Mercurial > libavcodec.hg
diff ra144.c @ 6810:17cfc415325d libavcodec
Simplify rotate_block()
author | vitor |
---|---|
date | Thu, 15 May 2008 18:42:05 +0000 |
parents | b09783068768 |
children | 6a85ed5b605a |
line wrap: on
line diff
--- a/ra144.c Thu May 15 18:41:04 2008 +0000 +++ b/ra144.c Thu May 15 18:42:05 2008 +0000 @@ -141,19 +141,14 @@ /* rotate block */ static void rotate_block(const short *source, short *target, int offset) { - short *end; - const short *ptr1; - const short *ptr2; - const short *ptr3; - ptr2 = source + BUFFERSIZE; - ptr3 = ptr1 = ptr2 - offset; - end = target + BLOCKSIZE; + int i=0, k=0; + const short *ptr1 = source + BUFFERSIZE - offset; - while (target < end) { - *(target++) = *(ptr3++); + while (i<BLOCKSIZE) { + target[i++] = ptr1[k++]; - if (ptr3 == ptr2) - ptr3 = ptr1; + if (k == offset) + k = 0; } }