1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-09 01:07:01 +02:00

Simplify rotate_buffer()

Originally committed as revision 13914 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Vitor Sessak 2008-06-23 19:59:42 +00:00
parent cb51aef1ab
commit 5983d1c480

View File

@ -97,14 +97,13 @@ static void eval_coefs(const int *refl, int *coefs)
/* rotate block */ /* rotate block */
static void rotate_block(const int16_t *source, int16_t *target, int offset) static void rotate_block(const int16_t *source, int16_t *target, int offset)
{ {
int i=0, k=0;
source += BUFFERSIZE - offset; source += BUFFERSIZE - offset;
while (i<BLOCKSIZE) { if (offset > BLOCKSIZE) {
target[i++] = source[k++]; memcpy(target, source, BLOCKSIZE*sizeof(*target));
} else {
if (k == offset) memcpy(target, source, offset*sizeof(*target));
k = 0; memcpy(target + offset, source, (BLOCKSIZE - offset)*sizeof(*target));
} }
} }