# HG changeset patch # User lorenm # Date 1216169412 0 # Node ID e267f2519248f4871510185bb324b63c801849cc # Parent 1fe3ae6a9491a369dc0f715bdd156e1b63ffc092 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. diff -r 1fe3ae6a9491 -r e267f2519248 dsputil.c --- a/dsputil.c Tue Jul 15 23:04:28 2008 +0000 +++ b/dsputil.c Wed Jul 16 00:50:12 2008 +0000 @@ -3962,17 +3962,17 @@ dst[i] = float_to_int16_one(src+i); } -void ff_float_to_int16_interleave_c(int16_t *dst, const float *src, long len, int channels){ +void ff_float_to_int16_interleave_c(int16_t *dst, const float **src, long len, int channels){ int i,j,c; if(channels==2){ for(i=0; i2)\ float_to_int16_interleave2_##cpu(dst, src, len, channels);\ else{\ - float *src1;\ + const float *src0 = src[0];\ + const float *src1 = src[1];\ asm volatile(\ "shl $2, %0 \n"\ "add %0, %1 \n"\ "add %0, %2 \n"\ - "lea (%2,%0), %3 \n"\ + "add %0, %3 \n"\ "neg %0 \n"\ body\ - :"+r"(len), "+r"(dst), "+r"(src), "=r"(src1)\ + :"+r"(len), "+r"(dst), "+r"(src0), "+r"(src1)\ );\ }\ } diff -r 1fe3ae6a9491 -r e267f2519248 vorbis_dec.c --- a/vorbis_dec.c Tue Jul 15 23:04:28 2008 +0000 +++ b/vorbis_dec.c Wed Jul 16 00:50:12 2008 +0000 @@ -1553,6 +1553,8 @@ { vorbis_context *vc = avccontext->priv_data ; GetBitContext *gb = &(vc->gb); + const float *channel_ptrs[vc->audio_channels]; + int i; int_fast16_t len; @@ -1579,7 +1581,9 @@ AV_DEBUG("parsed %d bytes %d bits, returned %d samples (*ch*bits) \n", get_bits_count(gb)/8, get_bits_count(gb)%8, len); - vc->dsp.float_to_int16_interleave(data, vc->channel_residues, len, vc->audio_channels); + for(i=0; iaudio_channels; i++) + channel_ptrs[i] = vc->channel_residues+i*len; + vc->dsp.float_to_int16_interleave(data, channel_ptrs, len, vc->audio_channels); *data_size=len*2*vc->audio_channels; return buf_size ;