|
|
|
@ -329,7 +329,8 @@ static const uint8_t wtype_to_wsize[] = { 0, 0, 2, 2, 2, 1, 0, 1, 1 }; |
|
|
|
|
static void imdct_and_window(TwinVQContext *tctx, enum TwinVQFrameType ftype, |
|
|
|
|
int wtype, float *in, float *prev, int ch) |
|
|
|
|
{ |
|
|
|
|
FFTContext *mdct = &tctx->mdct_ctx[ftype]; |
|
|
|
|
AVTXContext *tx = tctx->tx[ftype]; |
|
|
|
|
av_tx_fn tx_fn = tctx->tx_fn[ftype]; |
|
|
|
|
const TwinVQModeTab *mtab = tctx->mtab; |
|
|
|
|
int bsize = mtab->size / mtab->fmode[ftype].sub; |
|
|
|
|
int size = mtab->size; |
|
|
|
@ -358,7 +359,7 @@ static void imdct_and_window(TwinVQContext *tctx, enum TwinVQFrameType ftype, |
|
|
|
|
|
|
|
|
|
wsize = types_sizes[wtype_to_wsize[sub_wtype]]; |
|
|
|
|
|
|
|
|
|
mdct->imdct_half(mdct, buf1 + bsize * j, in + bsize * j); |
|
|
|
|
tx_fn(tx, buf1 + bsize * j, in + bsize * j, sizeof(float)); |
|
|
|
|
|
|
|
|
|
tctx->fdsp->vector_fmul_window(out2, prev_buf + (bsize - wsize) / 2, |
|
|
|
|
buf1 + bsize * j, |
|
|
|
@ -544,8 +545,9 @@ static av_cold int init_mdct_win(TwinVQContext *tctx) |
|
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++) { |
|
|
|
|
int bsize = tctx->mtab->size / tctx->mtab->fmode[i].sub; |
|
|
|
|
if ((ret = ff_mdct_init(&tctx->mdct_ctx[i], av_log2(bsize) + 1, 1, |
|
|
|
|
-sqrt(norm / bsize) / (1 << 15)))) |
|
|
|
|
const float scale = -sqrt(norm / bsize) / (1 << 15); |
|
|
|
|
if ((ret = av_tx_init(&tctx->tx[i], &tctx->tx_fn[i], AV_TX_FLOAT_MDCT, |
|
|
|
|
1, bsize, &scale, 0))) |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -746,7 +748,7 @@ av_cold int ff_twinvq_decode_close(AVCodecContext *avctx) |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++) { |
|
|
|
|
ff_mdct_end(&tctx->mdct_ctx[i]); |
|
|
|
|
av_tx_uninit(&tctx->tx[i]); |
|
|
|
|
av_freep(&tctx->cos_tabs[i]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|