Merge commit '6c145ecf785dc3d26ba3fed3ea9892cc80244625'
* commit '6c145ecf785dc3d26ba3fed3ea9892cc80244625': twinvq: K&R formatting cosmetics Conflicts: libavcodec/twinvq.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		
						commit
						e28fabb4cb
					
				@ -19,6 +19,9 @@
 | 
			
		||||
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
#include "libavutil/channel_layout.h"
 | 
			
		||||
#include "libavutil/float_dsp.h"
 | 
			
		||||
#include "avcodec.h"
 | 
			
		||||
@ -27,10 +30,6 @@
 | 
			
		||||
#include "internal.h"
 | 
			
		||||
#include "lsp.h"
 | 
			
		||||
#include "sinewin.h"
 | 
			
		||||
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
#include "twinvq_data.h"
 | 
			
		||||
 | 
			
		||||
enum FrameType {
 | 
			
		||||
@ -290,8 +289,8 @@ static void interpolate(float *out, float v1, float v2, int size)
 | 
			
		||||
 | 
			
		||||
static inline float get_cos(int idx, int part, const float *cos_tab, int size)
 | 
			
		||||
{
 | 
			
		||||
    return part ? -cos_tab[size - idx - 1] :
 | 
			
		||||
                   cos_tab[       idx    ];
 | 
			
		||||
    return part ? -cos_tab[size - idx - 1]
 | 
			
		||||
                :  cos_tab[idx];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@ -305,7 +304,7 @@ static inline float get_cos(int idx, int part, const float *cos_tab, int size)
 | 
			
		||||
 * @param step the size of a block "siiiibiiii"
 | 
			
		||||
 * @param in the cosinus of the LSP data
 | 
			
		||||
 * @param part is 0 for 0...PI (positive cossinus values) and 1 for PI...2PI
 | 
			
		||||
          (negative cossinus values)
 | 
			
		||||
 *        (negative cossinus values)
 | 
			
		||||
 * @param size the size of the whole output
 | 
			
		||||
 */
 | 
			
		||||
static inline void eval_lpcenv_or_interp(TwinContext *tctx,
 | 
			
		||||
@ -334,12 +333,15 @@ static inline void eval_lpcenv_or_interp(TwinContext *tctx,
 | 
			
		||||
                eval_lpc_spectrum(in,
 | 
			
		||||
                                  get_cos(i - step / 2, part, cos_tab, size),
 | 
			
		||||
                                  mtab->n_lsp);
 | 
			
		||||
            interpolate(out + i - step   + 1, out[i-step/2], out[i-step  ], step/2 - 1);
 | 
			
		||||
            interpolate(out + i - step/2 + 1, out[i       ], out[i-step/2], step/2 - 1);
 | 
			
		||||
            interpolate(out + i - step + 1, out[i - step / 2],
 | 
			
		||||
                        out[i - step], step / 2 - 1);
 | 
			
		||||
            interpolate(out + i - step / 2 + 1, out[i],
 | 
			
		||||
                        out[i - step / 2], step / 2 - 1);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    interpolate(out + size - 2*step + 1, out[size-step], out[size - 2*step], step - 1);
 | 
			
		||||
    interpolate(out + size - 2 * step + 1, out[size - step],
 | 
			
		||||
                out[size - 2 * step], step - 1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void eval_lpcenv_2parts(TwinContext *tctx, enum FrameType ftype,
 | 
			
		||||
@ -347,9 +349,11 @@ static void eval_lpcenv_2parts(TwinContext *tctx, enum FrameType ftype,
 | 
			
		||||
                               int size, int step)
 | 
			
		||||
{
 | 
			
		||||
    eval_lpcenv_or_interp(tctx, ftype, lpc, buf, size / 2, step, 0);
 | 
			
		||||
    eval_lpcenv_or_interp(tctx, ftype, lpc + size/2, buf, size/2, 2*step, 1);
 | 
			
		||||
    eval_lpcenv_or_interp(tctx, ftype, lpc + size / 2, buf, size / 2,
 | 
			
		||||
                          2 * step, 1);
 | 
			
		||||
 | 
			
		||||
    interpolate(lpc+size/2-step+1, lpc[size/2], lpc[size/2-step], step);
 | 
			
		||||
    interpolate(lpc + size / 2 - step + 1, lpc[size / 2],
 | 
			
		||||
                lpc[size / 2 - step], step);
 | 
			
		||||
 | 
			
		||||
    memset_float(lpc + size - 2 * step + 1, lpc[size - 2 * step], 2 * step - 1);
 | 
			
		||||
}
 | 
			
		||||
@ -396,11 +400,11 @@ static void dequant(TwinContext *tctx, GetBitContext *gb, float *out,
 | 
			
		||||
        tab1 = cb1 + tmp1 * cb_len;
 | 
			
		||||
 | 
			
		||||
        for (j = 0; j < length; j++)
 | 
			
		||||
            out[tctx->permut[ftype][pos+j]] = sign0*tab0[j] + sign1*tab1[j];
 | 
			
		||||
            out[tctx->permut[ftype][pos + j]] = sign0 * tab0[j] +
 | 
			
		||||
                                                sign1 * tab1[j];
 | 
			
		||||
 | 
			
		||||
        pos += length;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline float mulawinv(float y, float clip, float mu)
 | 
			
		||||
@ -424,10 +428,10 @@ static inline float mulawinv(float y, float clip, float mu)
 | 
			
		||||
 * }
 | 
			
		||||
 * @endcode
 | 
			
		||||
 *
 | 
			
		||||
 * @note if this function is replaced by just ROUNDED_DIV(a*b,400.), the stddev
 | 
			
		||||
 * between the original file (before encoding with Yamaha encoder) and the
 | 
			
		||||
 * decoded output increases, which leads one to believe that the encoder expects
 | 
			
		||||
 * exactly this broken calculation.
 | 
			
		||||
 * @note if this function is replaced by just ROUNDED_DIV(a * b, 400.), the
 | 
			
		||||
 * stddev between the original file (before encoding with Yamaha encoder) and
 | 
			
		||||
 * the decoded output increases, which leads one to believe that the encoder
 | 
			
		||||
 * expects exactly this broken calculation.
 | 
			
		||||
 */
 | 
			
		||||
static int very_broken_op(int a, int b)
 | 
			
		||||
{
 | 
			
		||||
@ -481,20 +485,22 @@ static void decode_ppc(TwinContext *tctx, int period_coef, const float *shape,
 | 
			
		||||
    int isampf          = tctx->avctx->sample_rate / 1000;
 | 
			
		||||
    int ibps            = tctx->avctx->bit_rate / (1000 * tctx->avctx->channels);
 | 
			
		||||
    int min_period      = ROUNDED_DIV(40 * 2 * mtab->size, isampf);
 | 
			
		||||
    int max_period = ROUNDED_DIV(6*40*2*mtab->size, isampf);
 | 
			
		||||
    int max_period      = ROUNDED_DIV(40 * 2 * mtab->size * 6, isampf);
 | 
			
		||||
    int period_range    = max_period - min_period;
 | 
			
		||||
 | 
			
		||||
    // This is actually the period multiplied by 400. It is just linearly coded
 | 
			
		||||
    // between its maximum and minimum value.
 | 
			
		||||
    int period = min_period +
 | 
			
		||||
        ROUNDED_DIV(period_coef*period_range, (1 << mtab->ppc_period_bit) - 1);
 | 
			
		||||
                 ROUNDED_DIV(period_coef * period_range,
 | 
			
		||||
                             (1 << mtab->ppc_period_bit) - 1);
 | 
			
		||||
    int width;
 | 
			
		||||
 | 
			
		||||
    if (isampf == 22 && ibps == 32) {
 | 
			
		||||
        // For some unknown reason, NTT decided to code this case differently...
 | 
			
		||||
        width = ROUNDED_DIV((period + 800)* mtab->peak_per2wid, 400*mtab->size);
 | 
			
		||||
        width = ROUNDED_DIV((period + 800) * mtab->peak_per2wid,
 | 
			
		||||
                            400 * mtab->size);
 | 
			
		||||
    } else
 | 
			
		||||
        width =             (period      )* mtab->peak_per2wid/(400*mtab->size);
 | 
			
		||||
        width = period * mtab->peak_per2wid / (400 * mtab->size);
 | 
			
		||||
 | 
			
		||||
    add_peak(period, width, shape, ppc_gain, speech, mtab->ppc_shape_len);
 | 
			
		||||
}
 | 
			
		||||
@ -519,7 +525,7 @@ static void dec_gain(TwinContext *tctx, GetBitContext *gb, enum FrameType ftype,
 | 
			
		||||
                        mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS),
 | 
			
		||||
                                 AMP_MAX, MULAW_MU);
 | 
			
		||||
 | 
			
		||||
            for (j = 0; j < sub; j++) {
 | 
			
		||||
            for (j = 0; j < sub; j++)
 | 
			
		||||
                out[i * sub + j] =
 | 
			
		||||
                    val * mulawinv(sub_step * 0.5 +
 | 
			
		||||
                                   sub_step * get_bits(gb, SUB_GAIN_BITS),
 | 
			
		||||
@ -527,7 +533,6 @@ static void dec_gain(TwinContext *tctx, GetBitContext *gb, enum FrameType ftype,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Rearrange the LSP coefficients so that they have a minimum distance of
 | 
			
		||||
@ -567,7 +572,8 @@ static void decode_lsp(TwinContext *tctx, int lpc_idx1, uint8_t *lpc_idx2,
 | 
			
		||||
 | 
			
		||||
    j = 0;
 | 
			
		||||
    for (i = 0; i < mtab->lsp_split; i++) {
 | 
			
		||||
        int chunk_end = ((i + 1)*mtab->n_lsp + funny_rounding[i])/mtab->lsp_split;
 | 
			
		||||
        int chunk_end = ((i + 1) * mtab->n_lsp + funny_rounding[i]) /
 | 
			
		||||
                        mtab->lsp_split;
 | 
			
		||||
        for (; j < chunk_end; j++)
 | 
			
		||||
            lsp[j] = cb[lpc_idx1     * mtab->n_lsp + j] +
 | 
			
		||||
                     cb2[lpc_idx2[i] * mtab->n_lsp + j];
 | 
			
		||||
@ -609,6 +615,8 @@ static void dec_lpc_spectrum_inv(TwinContext *tctx, float *lsp,
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const uint8_t wtype_to_wsize[] = { 0, 0, 2, 2, 2, 1, 0, 1, 1 };
 | 
			
		||||
 | 
			
		||||
static void imdct_and_window(TwinContext *tctx, enum FrameType ftype, int wtype,
 | 
			
		||||
                             float *in, float *prev, int ch)
 | 
			
		||||
{
 | 
			
		||||
@ -617,18 +625,14 @@ static void imdct_and_window(TwinContext *tctx, enum FrameType ftype, int wtype,
 | 
			
		||||
    int bsize           = mtab->size / mtab->fmode[ftype].sub;
 | 
			
		||||
    int size            = mtab->size;
 | 
			
		||||
    float *buf1         = tctx->tmp_buf;
 | 
			
		||||
    int j;
 | 
			
		||||
    int wsize; // Window size
 | 
			
		||||
    int j, first_wsize, wsize; // Window size
 | 
			
		||||
    float *out  = tctx->curr_frame + 2 * ch * mtab->size;
 | 
			
		||||
    float *out2 = out;
 | 
			
		||||
    float *prev_buf;
 | 
			
		||||
    int first_wsize;
 | 
			
		||||
 | 
			
		||||
    static const uint8_t wtype_to_wsize[]      = {0, 0, 2, 2, 2, 1, 0, 1, 1};
 | 
			
		||||
    int types_sizes[] = {
 | 
			
		||||
        mtab->size /  mtab->fmode[FT_LONG].sub,
 | 
			
		||||
        mtab->size /  mtab->fmode[FT_MEDIUM].sub,
 | 
			
		||||
        mtab->size / (2*mtab->fmode[FT_SHORT ].sub),
 | 
			
		||||
        mtab->size / (mtab->fmode[FT_SHORT].sub * 2),
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    wsize       = types_sizes[wtype_to_wsize[wtype]];
 | 
			
		||||
@ -653,7 +657,8 @@ static void imdct_and_window(TwinContext *tctx, enum FrameType ftype, int wtype,
 | 
			
		||||
                                      wsize / 2);
 | 
			
		||||
        out2 += wsize;
 | 
			
		||||
 | 
			
		||||
        memcpy(out2, buf1 + bsize*j + wsize/2, (bsize - wsize/2)*sizeof(float));
 | 
			
		||||
        memcpy(out2, buf1 + bsize * j + wsize / 2,
 | 
			
		||||
               (bsize - wsize / 2) * sizeof(float));
 | 
			
		||||
 | 
			
		||||
        out2 += ftype == FT_MEDIUM ? (bsize - wsize) / 2 : bsize - wsize;
 | 
			
		||||
 | 
			
		||||
@ -667,16 +672,14 @@ static void imdct_output(TwinContext *tctx, enum FrameType ftype, int wtype,
 | 
			
		||||
                         float **out)
 | 
			
		||||
{
 | 
			
		||||
    const ModeTab *mtab = tctx->mtab;
 | 
			
		||||
    int size1, size2;
 | 
			
		||||
    float *prev_buf     = tctx->prev_frame + tctx->last_block_pos[0];
 | 
			
		||||
    int i;
 | 
			
		||||
    int size1, size2, i;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < tctx->avctx->channels; i++) {
 | 
			
		||||
    for (i = 0; i < tctx->avctx->channels; i++)
 | 
			
		||||
        imdct_and_window(tctx, ftype, wtype,
 | 
			
		||||
                         tctx->spectrum + i * mtab->size,
 | 
			
		||||
                         prev_buf + 2 * i * mtab->size,
 | 
			
		||||
                         i);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!out)
 | 
			
		||||
        return;
 | 
			
		||||
@ -688,8 +691,10 @@ static void imdct_output(TwinContext *tctx, enum FrameType ftype, int wtype,
 | 
			
		||||
    memcpy(&out[0][size1], tctx->curr_frame, size2 * sizeof(out[0][0]));
 | 
			
		||||
 | 
			
		||||
    if (tctx->avctx->channels == 2) {
 | 
			
		||||
        memcpy(&out[1][0],     &prev_buf[2*mtab->size],         size1 * sizeof(out[1][0]));
 | 
			
		||||
        memcpy(&out[1][size1], &tctx->curr_frame[2*mtab->size], size2 * sizeof(out[1][0]));
 | 
			
		||||
        memcpy(&out[1][0], &prev_buf[2 * mtab->size],
 | 
			
		||||
               size1 * sizeof(out[1][0]));
 | 
			
		||||
        memcpy(&out[1][size1], &tctx->curr_frame[2 * mtab->size],
 | 
			
		||||
               size2 * sizeof(out[1][0]));
 | 
			
		||||
        tctx->fdsp.butterflies_float(out[0], out[1], mtab->size);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -707,18 +712,18 @@ static void dec_bark_env(TwinContext *tctx, const uint8_t *in, int use_hist,
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < fw_cb_len; i++)
 | 
			
		||||
        for (j = 0; j < bark_n_coef; j++, idx++) {
 | 
			
		||||
            float tmp2 =
 | 
			
		||||
                mtab->fmode[ftype].bark_cb[fw_cb_len*in[j] + i] * (1./4096);
 | 
			
		||||
            float st = use_hist ?
 | 
			
		||||
                (1. - val) * tmp2 + val*hist[idx] + 1. : tmp2 + 1.;
 | 
			
		||||
            float tmp2 = mtab->fmode[ftype].bark_cb[fw_cb_len * in[j] + i] *
 | 
			
		||||
                         (1. / 4096);
 | 
			
		||||
            float st   = use_hist ? (1. - val) * tmp2 + val * hist[idx] + 1.
 | 
			
		||||
                                  : tmp2 + 1.;
 | 
			
		||||
 | 
			
		||||
            hist[idx] = tmp2;
 | 
			
		||||
            if (st < -1.) st = 1.;
 | 
			
		||||
            if (st < -1.)
 | 
			
		||||
                st = 1.;
 | 
			
		||||
 | 
			
		||||
            memset_float(out, st * gain, mtab->fmode[ftype].bark_tab[idx]);
 | 
			
		||||
            out += mtab->fmode[ftype].bark_tab[idx];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb,
 | 
			
		||||
@ -778,9 +783,9 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb,
 | 
			
		||||
            dec_bark_env(tctx, bark1[i][j], bark_use_hist[i][j], i,
 | 
			
		||||
                         tctx->tmp_buf, gain[sub * i + j], ftype);
 | 
			
		||||
 | 
			
		||||
            tctx->fdsp.vector_fmul(chunk + block_size*j, chunk + block_size*j,
 | 
			
		||||
            tctx->fdsp.vector_fmul(chunk + block_size * j,
 | 
			
		||||
                                   chunk + block_size * j,
 | 
			
		||||
                                   tctx->tmp_buf, block_size);
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (ftype == FT_LONG) {
 | 
			
		||||
@ -788,7 +793,8 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb,
 | 
			
		||||
            int p_coef       = get_bits(gb, tctx->mtab->ppc_period_bit);
 | 
			
		||||
            int g_coef       = get_bits(gb, tctx->mtab->pgain_bit);
 | 
			
		||||
            float v          = 1. / 8192 *
 | 
			
		||||
                mulawinv(pgain_step*g_coef+ pgain_step/2, 25000., PGAIN_MU);
 | 
			
		||||
                               mulawinv(pgain_step * g_coef + pgain_step / 2,
 | 
			
		||||
                                        25000., PGAIN_MU);
 | 
			
		||||
 | 
			
		||||
            decode_ppc(tctx, p_coef, ppc_shape + i * mtab->ppc_shape_len, v,
 | 
			
		||||
                       chunk);
 | 
			
		||||
@ -909,12 +915,12 @@ static av_cold int init_mdct_win(TwinContext *tctx)
 | 
			
		||||
            tctx->cos_tabs[i][m / 4 - j] = tctx->cos_tabs[i][j];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    ff_init_ff_sine_windows(av_log2(size_m));
 | 
			
		||||
    ff_init_ff_sine_windows(av_log2(size_s / 2));
 | 
			
		||||
    ff_init_ff_sine_windows(av_log2(mtab->size));
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
 | 
			
		||||
alloc_fail:
 | 
			
		||||
    return AVERROR(ENOMEM);
 | 
			
		||||
}
 | 
			
		||||
@ -929,7 +935,6 @@ static void permutate_in_line(int16_t *tab, int num_vect, int num_blocks,
 | 
			
		||||
                              int block_size,
 | 
			
		||||
                              const uint8_t line_len[2], int length_div,
 | 
			
		||||
                              enum FrameType ftype)
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
    int i, j;
 | 
			
		||||
 | 
			
		||||
@ -971,6 +976,7 @@ static void transpose_perm(int16_t *out, int16_t *in, int num_vect,
 | 
			
		||||
{
 | 
			
		||||
    int i, j;
 | 
			
		||||
    int cont = 0;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < num_vect; i++)
 | 
			
		||||
        for (j = 0; j < line_len[i >= length_div]; j++)
 | 
			
		||||
            out[cont++] = in[j * num_vect + i];
 | 
			
		||||
@ -985,11 +991,11 @@ static void linear_perm(int16_t *out, int16_t *in, int n_blocks, int size)
 | 
			
		||||
        out[i] = block_size * (in[i] % n_blocks) + in[i] / n_blocks;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static av_cold void construct_perm_table(TwinContext *tctx,enum FrameType ftype)
 | 
			
		||||
static av_cold void construct_perm_table(TwinContext *tctx,
 | 
			
		||||
                                         enum FrameType ftype)
 | 
			
		||||
{
 | 
			
		||||
    int block_size;
 | 
			
		||||
    int block_size, size;
 | 
			
		||||
    const ModeTab *mtab = tctx->mtab;
 | 
			
		||||
    int size;
 | 
			
		||||
    int16_t *tmp_perm = (int16_t *)tctx->tmp_buf;
 | 
			
		||||
 | 
			
		||||
    if (ftype == FT_PPC) {
 | 
			
		||||
@ -1024,15 +1030,14 @@ static av_cold void init_bitstream_params(TwinContext *tctx)
 | 
			
		||||
    int ppc_bits = n_ch * (mtab->pgain_bit + mtab->ppc_shape_bit +
 | 
			
		||||
                           mtab->ppc_period_bit);
 | 
			
		||||
 | 
			
		||||
    int bsize_no_main_cb[3];
 | 
			
		||||
    int bse_bits[3];
 | 
			
		||||
    int i;
 | 
			
		||||
    int bsize_no_main_cb[3], bse_bits[3], i;
 | 
			
		||||
    enum FrameType frametype;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < 3; i++)
 | 
			
		||||
        // +1 for history usage switch
 | 
			
		||||
        bse_bits[i] = n_ch *
 | 
			
		||||
            (mtab->fmode[i].bark_n_coef * mtab->fmode[i].bark_n_bit + 1);
 | 
			
		||||
                      (mtab->fmode[i].bark_n_coef *
 | 
			
		||||
                       mtab->fmode[i].bark_n_bit + 1);
 | 
			
		||||
 | 
			
		||||
    bsize_no_main_cb[2] = bse_bits[2] + lsp_bits_per_block + ppc_bits +
 | 
			
		||||
                          WINDOW_TYPE_BITS + n_ch * GAIN_BITS;
 | 
			
		||||
@ -1044,8 +1049,7 @@ static av_cold void init_bitstream_params(TwinContext *tctx)
 | 
			
		||||
 | 
			
		||||
    // The remaining bits are all used for the main spectrum coefficients
 | 
			
		||||
    for (i = 0; i < 4; i++) {
 | 
			
		||||
        int bit_size;
 | 
			
		||||
        int vect_size;
 | 
			
		||||
        int bit_size, vect_size;
 | 
			
		||||
        int rounded_up, rounded_down, num_rounded_down, num_rounded_up;
 | 
			
		||||
        if (i == 3) {
 | 
			
		||||
            bit_size  = n_ch * mtab->ppc_shape_bit;
 | 
			
		||||
@ -1057,17 +1061,19 @@ static av_cold void init_bitstream_params(TwinContext *tctx)
 | 
			
		||||
 | 
			
		||||
        tctx->n_div[i] = (bit_size + 13) / 14;
 | 
			
		||||
 | 
			
		||||
        rounded_up   = (bit_size + tctx->n_div[i] - 1)/tctx->n_div[i];
 | 
			
		||||
        rounded_up                     = (bit_size + tctx->n_div[i] - 1) /
 | 
			
		||||
                                         tctx->n_div[i];
 | 
			
		||||
        rounded_down                   = (bit_size) / tctx->n_div[i];
 | 
			
		||||
        num_rounded_down               = rounded_up * tctx->n_div[i] - bit_size;
 | 
			
		||||
        num_rounded_up                 = tctx->n_div[i] - num_rounded_down;
 | 
			
		||||
        tctx->bits_main_spec[0][i][0]  = (rounded_up + 1)   / 2;
 | 
			
		||||
        tctx->bits_main_spec[1][i][0] = (rounded_up      )/2;
 | 
			
		||||
        tctx->bits_main_spec[1][i][0]  =  rounded_up        / 2;
 | 
			
		||||
        tctx->bits_main_spec[0][i][1]  = (rounded_down + 1) / 2;
 | 
			
		||||
        tctx->bits_main_spec[1][i][1] = (rounded_down    )/2;
 | 
			
		||||
        tctx->bits_main_spec[1][i][1]  =  rounded_down      / 2;
 | 
			
		||||
        tctx->bits_main_spec_change[i] = num_rounded_up;
 | 
			
		||||
 | 
			
		||||
        rounded_up   = (vect_size + tctx->n_div[i] - 1)/tctx->n_div[i];
 | 
			
		||||
        rounded_up             = (vect_size + tctx->n_div[i] - 1) /
 | 
			
		||||
                                 tctx->n_div[i];
 | 
			
		||||
        rounded_down           = (vect_size) / tctx->n_div[i];
 | 
			
		||||
        num_rounded_down       = rounded_up * tctx->n_div[i] - vect_size;
 | 
			
		||||
        num_rounded_up         = tctx->n_div[i] - num_rounded_down;
 | 
			
		||||
@ -1090,7 +1096,6 @@ static av_cold int twin_decode_close(AVCodecContext *avctx)
 | 
			
		||||
        av_free(tctx->cos_tabs[i]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    av_free(tctx->curr_frame);
 | 
			
		||||
    av_free(tctx->spectrum);
 | 
			
		||||
    av_free(tctx->prev_frame);
 | 
			
		||||
@ -1101,9 +1106,8 @@ static av_cold int twin_decode_close(AVCodecContext *avctx)
 | 
			
		||||
 | 
			
		||||
static av_cold int twin_decode_init(AVCodecContext *avctx)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    int ret, isampf, ibps;
 | 
			
		||||
    TwinContext *tctx = avctx->priv_data;
 | 
			
		||||
    int isampf, ibps;
 | 
			
		||||
 | 
			
		||||
    tctx->avctx       = avctx;
 | 
			
		||||
    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
 | 
			
		||||
@ -1121,10 +1125,18 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
 | 
			
		||||
        return AVERROR_INVALIDDATA;
 | 
			
		||||
    }
 | 
			
		||||
    switch (isampf) {
 | 
			
		||||
    case 44: avctx->sample_rate = 44100;         break;
 | 
			
		||||
    case 22: avctx->sample_rate = 22050;         break;
 | 
			
		||||
    case 11: avctx->sample_rate = 11025;         break;
 | 
			
		||||
    default: avctx->sample_rate = isampf * 1000; break;
 | 
			
		||||
    case 44:
 | 
			
		||||
        avctx->sample_rate = 44100;
 | 
			
		||||
        break;
 | 
			
		||||
    case 22:
 | 
			
		||||
        avctx->sample_rate = 22050;
 | 
			
		||||
        break;
 | 
			
		||||
    case 11:
 | 
			
		||||
        avctx->sample_rate = 11025;
 | 
			
		||||
        break;
 | 
			
		||||
    default:
 | 
			
		||||
        avctx->sample_rate = isampf * 1000;
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (avctx->channels <= 0 || avctx->channels > CHANNELS_MAX) {
 | 
			
		||||
@ -1132,8 +1144,8 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
 | 
			
		||||
               avctx->channels);
 | 
			
		||||
        return -1;
 | 
			
		||||
    }
 | 
			
		||||
    avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO :
 | 
			
		||||
                                                   AV_CH_LAYOUT_STEREO;
 | 
			
		||||
    avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO
 | 
			
		||||
                                                 : AV_CH_LAYOUT_STEREO;
 | 
			
		||||
 | 
			
		||||
    ibps = avctx->bit_rate / (1000 * avctx->channels);
 | 
			
		||||
 | 
			
		||||
@ -1143,17 +1155,37 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    switch ((isampf << 8) + ibps) {
 | 
			
		||||
    case (8 <<8) +  8: tctx->mtab = &mode_08_08; break;
 | 
			
		||||
    case (11<<8) +  8: tctx->mtab = &mode_11_08; break;
 | 
			
		||||
    case (11<<8) + 10: tctx->mtab = &mode_11_10; break;
 | 
			
		||||
    case (16<<8) + 16: tctx->mtab = &mode_16_16; break;
 | 
			
		||||
    case (22<<8) + 20: tctx->mtab = &mode_22_20; break;
 | 
			
		||||
    case (22<<8) + 24: tctx->mtab = &mode_22_24; break;
 | 
			
		||||
    case (22<<8) + 32: tctx->mtab = &mode_22_32; break;
 | 
			
		||||
    case (44<<8) + 40: tctx->mtab = &mode_44_40; break;
 | 
			
		||||
    case (44<<8) + 48: tctx->mtab = &mode_44_48; break;
 | 
			
		||||
    case (8 << 8) + 8:
 | 
			
		||||
        tctx->mtab = &mode_08_08;
 | 
			
		||||
        break;
 | 
			
		||||
    case (11 << 8) + 8:
 | 
			
		||||
        tctx->mtab = &mode_11_08;
 | 
			
		||||
        break;
 | 
			
		||||
    case (11 << 8) + 10:
 | 
			
		||||
        tctx->mtab = &mode_11_10;
 | 
			
		||||
        break;
 | 
			
		||||
    case (16 << 8) + 16:
 | 
			
		||||
        tctx->mtab = &mode_16_16;
 | 
			
		||||
        break;
 | 
			
		||||
    case (22 << 8) + 20:
 | 
			
		||||
        tctx->mtab = &mode_22_20;
 | 
			
		||||
        break;
 | 
			
		||||
    case (22 << 8) + 24:
 | 
			
		||||
        tctx->mtab = &mode_22_24;
 | 
			
		||||
        break;
 | 
			
		||||
    case (22 << 8) + 32:
 | 
			
		||||
        tctx->mtab = &mode_22_32;
 | 
			
		||||
        break;
 | 
			
		||||
    case (44 << 8) + 40:
 | 
			
		||||
        tctx->mtab = &mode_44_40;
 | 
			
		||||
        break;
 | 
			
		||||
    case (44 << 8) + 48:
 | 
			
		||||
        tctx->mtab = &mode_44_48;
 | 
			
		||||
        break;
 | 
			
		||||
    default:
 | 
			
		||||
        av_log(avctx, AV_LOG_ERROR, "This version does not support %d kHz - %d kbit/s/ch mode.\n", isampf, isampf);
 | 
			
		||||
        av_log(avctx, AV_LOG_ERROR,
 | 
			
		||||
               "This version does not support %d kHz - %d kbit/s/ch mode.\n",
 | 
			
		||||
               isampf, isampf);
 | 
			
		||||
        return -1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -127,7 +127,6 @@ 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
 | 
			
		||||
 *
 | 
			
		||||
@ -10991,19 +10990,40 @@ static const struct twinvq_data {
 | 
			
		||||
    },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
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}
 | 
			
		||||
    { 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] = {
 | 
			
		||||
@ -11023,90 +11043,77 @@ static const uint8_t tab8[][5] = {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
    }
 | 
			
		||||
    { 0, 0, 0, 0, 0, 0, 0, 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 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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,
 | 
			
		||||
    }
 | 
			
		||||
      1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const uint8_t tab12[][15] = {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user