[FFmpeg-cvslog] r13914 - trunk/libavcodec/ra144.c

vitor subversion
Mon Jun 23 21:59:42 CEST 2008


Author: vitor
Date: Mon Jun 23 21:59:42 2008
New Revision: 13914

Log:
Simplify rotate_buffer()

Modified:
   trunk/libavcodec/ra144.c

Modified: trunk/libavcodec/ra144.c
==============================================================================
--- trunk/libavcodec/ra144.c	(original)
+++ trunk/libavcodec/ra144.c	Mon Jun 23 21:59:42 2008
@@ -97,14 +97,13 @@ static void eval_coefs(const int *refl, 
 /* 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));
     }
 }
 




More information about the ffmpeg-cvslog mailing list