# HG changeset patch # User vitor # Date 1221679597 0 # Node ID 29010c2697da27ea2e8b02fd0aaaef3336f43af4 # Parent d6664b47e13fc1da4e8098e7aea8e3f4d7446261 Use SAMPLE_FMT_FLT instead of doing the float->int conversion in the decoder. This changes the output very little and any difference should be inaudible. diff -r d6664b47e13f -r 29010c2697da ra288.c --- a/ra288.c Wed Sep 17 06:13:07 2008 +0000 +++ b/ra288.c Wed Sep 17 19:26:37 2008 +0000 @@ -48,7 +48,7 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx) { - avctx->sample_fmt = SAMPLE_FMT_S16; + avctx->sample_fmt = SAMPLE_FMT_FLT; return 0; } @@ -189,7 +189,7 @@ int *data_size, const uint8_t * buf, int buf_size) { - int16_t *out = data; + float *out = data; int i, j; RA288Context *ractx = avctx->priv_data; GetBitContext gb; @@ -201,7 +201,7 @@ return 0; } - if (*data_size < 32*5*2) + if (*data_size < 32*5*4) return -1; init_get_bits(&gb, buf, avctx->block_align * 8); @@ -213,7 +213,7 @@ decode(ractx, gain, cb_coef); for (j=0; j < 5; j++) - *(out++) = 8 * ractx->sp_hist[70 + 36 + j]; + *(out++) = (1/4096.) * ractx->sp_hist[70 + 36 + j]; if ((i & 7) == 3) backward_filter(ractx);