1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

twinvq: K&R formatting cosmetics

This commit is contained in:
Diego Biurrun 2013-07-20 00:06:29 +02:00
parent 54ba52077c
commit 6c145ecf78
2 changed files with 477 additions and 438 deletions

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * 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/channel_layout.h"
#include "libavutil/float_dsp.h" #include "libavutil/float_dsp.h"
#include "avcodec.h" #include "avcodec.h"
@ -27,10 +30,6 @@
#include "internal.h" #include "internal.h"
#include "lsp.h" #include "lsp.h"
#include "sinewin.h" #include "sinewin.h"
#include <math.h>
#include <stdint.h>
#include "twinvq_data.h" #include "twinvq_data.h"
enum FrameType { 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) static inline float get_cos(int idx, int part, const float *cos_tab, int size)
{ {
return part ? -cos_tab[size - idx - 1] : return part ? -cos_tab[size - idx - 1]
cos_tab[ idx ]; : 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 step the size of a block "siiiibiiii"
* @param in the cosinus of the LSP data * @param in the cosinus of the LSP data
* @param part is 0 for 0...PI (positive cossinus values) and 1 for PI...2PI * @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 * @param size the size of the whole output
*/ */
static inline void eval_lpcenv_or_interp(TwinContext *tctx, 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, eval_lpc_spectrum(in,
get_cos(i - step / 2, part, cos_tab, size), get_cos(i - step / 2, part, cos_tab, size),
mtab->n_lsp); mtab->n_lsp);
interpolate(out + i - step + 1, out[i-step/2], out[i-step ], step/2 - 1); interpolate(out + i - step + 1, out[i - step / 2],
interpolate(out + i - step/2 + 1, out[i ], out[i-step/2], step/2 - 1); 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, 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) int size, int step)
{ {
eval_lpcenv_or_interp(tctx, ftype, lpc, buf, size / 2, step, 0); 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); 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; tab1 = cb1 + tmp1 * cb_len;
for (j = 0; j < length; j++) 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; pos += length;
} }
} }
static inline float mulawinv(float y, float clip, float mu) 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 * @endcode
* *
* @note if this function is replaced by just ROUNDED_DIV(a*b,400.), the stddev * @note if this function is replaced by just ROUNDED_DIV(a * b, 400.), the
* between the original file (before encoding with Yamaha encoder) and the * stddev between the original file (before encoding with Yamaha encoder) and
* decoded output increases, which leads one to believe that the encoder expects * the decoded output increases, which leads one to believe that the encoder
* exactly this broken calculation. * expects exactly this broken calculation.
*/ */
static int very_broken_op(int a, int b) 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 isampf = tctx->avctx->sample_rate / 1000;
int ibps = tctx->avctx->bit_rate / (1000 * tctx->avctx->channels); int ibps = tctx->avctx->bit_rate / (1000 * tctx->avctx->channels);
int min_period = ROUNDED_DIV(40 * 2 * mtab->size, isampf); 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; int period_range = max_period - min_period;
// This is actually the period multiplied by 400. It is just linearly coded // This is actually the period multiplied by 400. It is just linearly coded
// between its maximum and minimum value. // between its maximum and minimum value.
int period = min_period + 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; int width;
if (isampf == 22 && ibps == 32) { if (isampf == 22 && ibps == 32) {
// For some unknown reason, NTT decided to code this case differently... // 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 } 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); 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), mulawinv(step * 0.5 + step * get_bits(gb, GAIN_BITS),
AMP_MAX, MULAW_MU); AMP_MAX, MULAW_MU);
for (j = 0; j < sub; j++) { for (j = 0; j < sub; j++)
out[i * sub + j] = out[i * sub + j] =
val * mulawinv(sub_step * 0.5 + val * mulawinv(sub_step * 0.5 +
sub_step * get_bits(gb, SUB_GAIN_BITS), 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 * 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; j = 0;
for (i = 0; i < mtab->lsp_split; i++) { 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++) for (; j < chunk_end; j++)
lsp[j] = cb[lpc_idx1 * mtab->n_lsp + j] + lsp[j] = cb[lpc_idx1 * mtab->n_lsp + j] +
cb2[lpc_idx2[i] * 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, static void imdct_and_window(TwinContext *tctx, enum FrameType ftype, int wtype,
float *in, float *prev, int ch) 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 bsize = mtab->size / mtab->fmode[ftype].sub;
int size = mtab->size; int size = mtab->size;
float *buf1 = tctx->tmp_buf; float *buf1 = tctx->tmp_buf;
int j; int j, first_wsize, wsize; // Window size
int wsize; // Window size
float *out = tctx->curr_frame + 2 * ch * mtab->size; float *out = tctx->curr_frame + 2 * ch * mtab->size;
float *out2 = out; float *out2 = out;
float *prev_buf; 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[] = { int types_sizes[] = {
mtab->size / mtab->fmode[FT_LONG].sub, mtab->size / mtab->fmode[FT_LONG].sub,
mtab->size / mtab->fmode[FT_MEDIUM].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]]; 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); wsize / 2);
out2 += wsize; 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; 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) float **out)
{ {
const ModeTab *mtab = tctx->mtab; const ModeTab *mtab = tctx->mtab;
int size1, size2;
float *prev_buf = tctx->prev_frame + tctx->last_block_pos[0]; 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, imdct_and_window(tctx, ftype, wtype,
tctx->spectrum + i * mtab->size, tctx->spectrum + i * mtab->size,
prev_buf + 2 * i * mtab->size, prev_buf + 2 * i * mtab->size,
i); i);
}
if (!out) if (!out)
return; 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])); memcpy(&out[0][size1], tctx->curr_frame, size2 * sizeof(out[0][0]));
if (tctx->avctx->channels == 2) { if (tctx->avctx->channels == 2) {
memcpy(&out[1][0], &prev_buf[2*mtab->size], size1 * sizeof(out[1][0])); memcpy(&out[1][0], &prev_buf[2 * mtab->size],
memcpy(&out[1][size1], &tctx->curr_frame[2*mtab->size], size2 * sizeof(out[1][0])); 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); 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 (i = 0; i < fw_cb_len; i++)
for (j = 0; j < bark_n_coef; j++, idx++) { for (j = 0; j < bark_n_coef; j++, idx++) {
float tmp2 = float tmp2 = mtab->fmode[ftype].bark_cb[fw_cb_len * in[j] + i] *
mtab->fmode[ftype].bark_cb[fw_cb_len*in[j] + i] * (1./4096); (1. / 4096);
float st = use_hist ? float st = use_hist ? (1. - val) * tmp2 + val * hist[idx] + 1.
(1. - val) * tmp2 + val*hist[idx] + 1. : tmp2 + 1.; : tmp2 + 1.;
hist[idx] = tmp2; hist[idx] = tmp2;
if (st < -1.) st = 1.; if (st < -1.)
st = 1.;
memset_float(out, st * gain, mtab->fmode[ftype].bark_tab[idx]); memset_float(out, st * gain, mtab->fmode[ftype].bark_tab[idx]);
out += mtab->fmode[ftype].bark_tab[idx]; out += mtab->fmode[ftype].bark_tab[idx];
} }
} }
static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb, 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, dec_bark_env(tctx, bark1[i][j], bark_use_hist[i][j], i,
tctx->tmp_buf, gain[sub * i + j], ftype); 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); tctx->tmp_buf, block_size);
} }
if (ftype == FT_LONG) { 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 p_coef = get_bits(gb, tctx->mtab->ppc_period_bit);
int g_coef = get_bits(gb, tctx->mtab->pgain_bit); int g_coef = get_bits(gb, tctx->mtab->pgain_bit);
float v = 1. / 8192 * 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, decode_ppc(tctx, p_coef, ppc_shape + i * mtab->ppc_shape_len, v,
chunk); chunk);
@ -911,12 +917,12 @@ static av_cold int init_mdct_win(TwinContext *tctx)
tctx->cos_tabs[i][m / 4 - j] = tctx->cos_tabs[i][j]; 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_m));
ff_init_ff_sine_windows(av_log2(size_s / 2)); ff_init_ff_sine_windows(av_log2(size_s / 2));
ff_init_ff_sine_windows(av_log2(mtab->size)); ff_init_ff_sine_windows(av_log2(mtab->size));
return 0; return 0;
alloc_fail: alloc_fail:
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
@ -931,7 +937,6 @@ static void permutate_in_line(int16_t *tab, int num_vect, int num_blocks,
int block_size, int block_size,
const uint8_t line_len[2], int length_div, const uint8_t line_len[2], int length_div,
enum FrameType ftype) enum FrameType ftype)
{ {
int i, j; int i, j;
@ -973,6 +978,7 @@ static void transpose_perm(int16_t *out, int16_t *in, int num_vect,
{ {
int i, j; int i, j;
int cont = 0; int cont = 0;
for (i = 0; i < num_vect; i++) for (i = 0; i < num_vect; i++)
for (j = 0; j < line_len[i >= length_div]; j++) for (j = 0; j < line_len[i >= length_div]; j++)
out[cont++] = in[j * num_vect + i]; out[cont++] = in[j * num_vect + i];
@ -987,11 +993,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; 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; const ModeTab *mtab = tctx->mtab;
int size;
int16_t *tmp_perm = (int16_t *)tctx->tmp_buf; int16_t *tmp_perm = (int16_t *)tctx->tmp_buf;
if (ftype == FT_PPC) { if (ftype == FT_PPC) {
@ -1026,15 +1032,14 @@ static av_cold void init_bitstream_params(TwinContext *tctx)
int ppc_bits = n_ch * (mtab->pgain_bit + mtab->ppc_shape_bit + int ppc_bits = n_ch * (mtab->pgain_bit + mtab->ppc_shape_bit +
mtab->ppc_period_bit); mtab->ppc_period_bit);
int bsize_no_main_cb[3]; int bsize_no_main_cb[3], bse_bits[3], i;
int bse_bits[3];
int i;
enum FrameType frametype; enum FrameType frametype;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
// +1 for history usage switch // +1 for history usage switch
bse_bits[i] = n_ch * 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 + bsize_no_main_cb[2] = bse_bits[2] + lsp_bits_per_block + ppc_bits +
WINDOW_TYPE_BITS + n_ch * GAIN_BITS; WINDOW_TYPE_BITS + n_ch * GAIN_BITS;
@ -1046,8 +1051,7 @@ static av_cold void init_bitstream_params(TwinContext *tctx)
// The remaining bits are all used for the main spectrum coefficients // The remaining bits are all used for the main spectrum coefficients
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
int bit_size; int bit_size, vect_size;
int vect_size;
int rounded_up, rounded_down, num_rounded_down, num_rounded_up; int rounded_up, rounded_down, num_rounded_down, num_rounded_up;
if (i == 3) { if (i == 3) {
bit_size = n_ch * mtab->ppc_shape_bit; bit_size = n_ch * mtab->ppc_shape_bit;
@ -1059,17 +1063,19 @@ static av_cold void init_bitstream_params(TwinContext *tctx)
tctx->n_div[i] = (bit_size + 13) / 14; 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]; rounded_down = (bit_size) / tctx->n_div[i];
num_rounded_down = rounded_up * tctx->n_div[i] - bit_size; num_rounded_down = rounded_up * tctx->n_div[i] - bit_size;
num_rounded_up = tctx->n_div[i] - num_rounded_down; 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[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[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; 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]; rounded_down = (vect_size) / tctx->n_div[i];
num_rounded_down = rounded_up * tctx->n_div[i] - vect_size; num_rounded_down = rounded_up * tctx->n_div[i] - vect_size;
num_rounded_up = tctx->n_div[i] - num_rounded_down; num_rounded_up = tctx->n_div[i] - num_rounded_down;
@ -1092,7 +1098,6 @@ static av_cold int twin_decode_close(AVCodecContext *avctx)
av_free(tctx->cos_tabs[i]); av_free(tctx->cos_tabs[i]);
} }
av_free(tctx->curr_frame); av_free(tctx->curr_frame);
av_free(tctx->spectrum); av_free(tctx->spectrum);
av_free(tctx->prev_frame); av_free(tctx->prev_frame);
@ -1103,9 +1108,8 @@ static av_cold int twin_decode_close(AVCodecContext *avctx)
static av_cold int twin_decode_init(AVCodecContext *avctx) static av_cold int twin_decode_init(AVCodecContext *avctx)
{ {
int ret; int ret, isampf, ibps;
TwinContext *tctx = avctx->priv_data; TwinContext *tctx = avctx->priv_data;
int isampf, ibps;
tctx->avctx = avctx; tctx->avctx = avctx;
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
@ -1123,10 +1127,18 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
switch (isampf) { switch (isampf) {
case 44: avctx->sample_rate = 44100; break; case 44:
case 22: avctx->sample_rate = 22050; break; avctx->sample_rate = 44100;
case 11: avctx->sample_rate = 11025; break; break;
default: avctx->sample_rate = isampf * 1000; 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) { if (avctx->channels <= 0 || avctx->channels > CHANNELS_MAX) {
@ -1134,23 +1146,43 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
avctx->channels); avctx->channels);
return -1; return -1;
} }
avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO : avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO
AV_CH_LAYOUT_STEREO; : AV_CH_LAYOUT_STEREO;
ibps = avctx->bit_rate / (1000 * avctx->channels); ibps = avctx->bit_rate / (1000 * avctx->channels);
switch ((isampf << 8) + ibps) { switch ((isampf << 8) + ibps) {
case (8 <<8) + 8: tctx->mtab = &mode_08_08; break; case (8 << 8) + 8:
case (11<<8) + 8: tctx->mtab = &mode_11_08; break; tctx->mtab = &mode_08_08;
case (11<<8) + 10: tctx->mtab = &mode_11_10; break; break;
case (16<<8) + 16: tctx->mtab = &mode_16_16; break; case (11 << 8) + 8:
case (22<<8) + 20: tctx->mtab = &mode_22_20; break; tctx->mtab = &mode_11_08;
case (22<<8) + 24: tctx->mtab = &mode_22_24; break; break;
case (22<<8) + 32: tctx->mtab = &mode_22_32; break; case (11 << 8) + 10:
case (44<<8) + 40: tctx->mtab = &mode_44_40; break; tctx->mtab = &mode_11_10;
case (44<<8) + 48: tctx->mtab = &mode_44_48; break; 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: 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; return -1;
} }

View File

@ -127,7 +127,6 @@ static const uint16_t bark_tab_s44_128[] = {
1, 2, 1, 2, 3, 4, 6, 10, 23, 76 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 * 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] = { 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, 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, 1, 0, 0, 0, 0, 0, 0, 1,
{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 },
{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, 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,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, 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,1,0,0,0}, 0,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 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] = { static const uint8_t tab8[][5] = {
@ -11023,90 +11043,77 @@ static const uint8_t tab8[][5] = {
}; };
static const uint8_t tab9[][45] = { 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, 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, 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, 0, 0, 0, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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