diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-06-23 19:59:42 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-06-23 19:59:42 +0000 |
commit | 5983d1c480b589e97770a11237a47d93b2a0e804 (patch) | |
tree | f0adb3c8821b83625259e78c7432f88212ed4d87 /libavcodec/ra144.c | |
parent | cb51aef1ab82ea5d424646c83527daa88c6a0fb7 (diff) | |
download | ffmpeg-streaming-5983d1c480b589e97770a11237a47d93b2a0e804.zip ffmpeg-streaming-5983d1c480b589e97770a11237a47d93b2a0e804.tar.gz |
Simplify rotate_buffer()
Originally committed as revision 13914 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra144.c')
-rw-r--r-- | libavcodec/ra144.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index 7059c50..e6895ce 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -97,14 +97,13 @@ static void eval_coefs(const int *refl, int *coefs) /* rotate block */ static void rotate_block(const int16_t *source, int16_t *target, int offset) { - int i=0, k=0; source += BUFFERSIZE - offset; - while (i<BLOCKSIZE) { - target[i++] = source[k++]; - - if (k == offset) - k = 0; + if (offset > BLOCKSIZE) { + memcpy(target, source, BLOCKSIZE*sizeof(*target)); + } else { + memcpy(target, source, offset*sizeof(*target)); + memcpy(target + offset, source, (BLOCKSIZE - offset)*sizeof(*target)); } } |