Originally committed as revision 13167 to svn://svn.ffmpeg.org/ffmpeg/trunk
/* 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;
-
- while (target < end) {
- *(target++) = *(ptr3++);
-
- if (ptr3 == ptr2)
- ptr3 = ptr1;
+ int i=0, k=0;
+ const short *ptr1 = source + BUFFERSIZE - offset;
+
+ while (i<BLOCKSIZE) {
+ target[i++] = ptr1[k++];
+
+ if (k == offset)
+ k = 0;
}
}