diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2010-01-28 14:29:53 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2010-01-28 14:29:53 +0000 |
commit | 52ed8d0efeb5627ffdd64f44b97d1c8965f33cf1 (patch) | |
tree | b491cf8805bd9ec378477b1ce44ed5b7e7066c55 | |
parent | 4ae406856f5cebe02f2c9ce85719c392bbc2d9bb (diff) | |
download | ffmpeg-52ed8d0efeb5627ffdd64f44b97d1c8965f33cf1.tar.gz |
Simplify. See "[PATCH] simplify ff_set_fixed_vector()" thread on mailinglist.
Originally committed as revision 21510 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/acelp_vectors.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/acelp_vectors.c b/libavcodec/acelp_vectors.c index 0b478b787b..c9a6f40839 100644 --- a/libavcodec/acelp_vectors.c +++ b/libavcodec/acelp_vectors.c @@ -245,14 +245,12 @@ void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size) for (i=0; i < in->n; i++) { int x = in->x[i]; float y = in->y[i] * scale; - out[x] += y; - x += in->pitch_lag; - while (x < size) { - y *= in->pitch_fac; + do { out[x] += y; + y *= in->pitch_fac; x += in->pitch_lag; - } + } while (x < size); } } @@ -262,12 +260,10 @@ void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size) for (i=0; i < in->n; i++) { int x = in->x[i]; - out[x] = 0.0; - x += in->pitch_lag; - while (x < size) { + do { out[x] = 0.0; x += in->pitch_lag; - } + } while (x < size); } } |