Mercurial > libavcodec.hg
comparison vorbis_dec.c @ 7286:e267f2519248 libavcodec
float_to_int16_interleave: change src to an array of pointers instead of assuming it's contiguous.
this has no immediate effect, but will allow it to be used in more codecs.
author | lorenm |
---|---|
date | Wed, 16 Jul 2008 00:50:12 +0000 |
parents | 1fe3ae6a9491 |
children | a4ebced5d4a2 |
comparison
equal
deleted
inserted
replaced
7285:1fe3ae6a9491 | 7286:e267f2519248 |
---|---|
1551 void *data, int *data_size, | 1551 void *data, int *data_size, |
1552 const uint8_t *buf, int buf_size) | 1552 const uint8_t *buf, int buf_size) |
1553 { | 1553 { |
1554 vorbis_context *vc = avccontext->priv_data ; | 1554 vorbis_context *vc = avccontext->priv_data ; |
1555 GetBitContext *gb = &(vc->gb); | 1555 GetBitContext *gb = &(vc->gb); |
1556 const float *channel_ptrs[vc->audio_channels]; | |
1557 int i; | |
1556 | 1558 |
1557 int_fast16_t len; | 1559 int_fast16_t len; |
1558 | 1560 |
1559 if(!buf_size){ | 1561 if(!buf_size){ |
1560 return 0; | 1562 return 0; |
1577 return buf_size ; | 1579 return buf_size ; |
1578 } | 1580 } |
1579 | 1581 |
1580 AV_DEBUG("parsed %d bytes %d bits, returned %d samples (*ch*bits) \n", get_bits_count(gb)/8, get_bits_count(gb)%8, len); | 1582 AV_DEBUG("parsed %d bytes %d bits, returned %d samples (*ch*bits) \n", get_bits_count(gb)/8, get_bits_count(gb)%8, len); |
1581 | 1583 |
1582 vc->dsp.float_to_int16_interleave(data, vc->channel_residues, len, vc->audio_channels); | 1584 for(i=0; i<vc->audio_channels; i++) |
1585 channel_ptrs[i] = vc->channel_residues+i*len; | |
1586 vc->dsp.float_to_int16_interleave(data, channel_ptrs, len, vc->audio_channels); | |
1583 *data_size=len*2*vc->audio_channels; | 1587 *data_size=len*2*vc->audio_channels; |
1584 | 1588 |
1585 return buf_size ; | 1589 return buf_size ; |
1586 } | 1590 } |
1587 | 1591 |