]> git.sesse.net Git - ffmpeg/commitdiff
Simplify if() in copy_and_dup()
authorVitor Sessak <vitor1001@gmail.com>
Mon, 8 Sep 2008 18:16:00 +0000 (18:16 +0000)
committerVitor Sessak <vitor1001@gmail.com>
Mon, 8 Sep 2008 18:16:00 +0000 (18:16 +0000)
Originally committed as revision 15268 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/ra144.c

index ed60a157ef24f247af1951ef7739e8980976404d..7646ada797bd647a32e242edb37869812301d098 100644 (file)
@@ -109,12 +109,9 @@ static void copy_and_dup(int16_t *target, const int16_t *source, int offset)
 {
     source += BUFFERSIZE - offset;
 
-    if (offset > BLOCKSIZE) {
-        memcpy(target, source, BLOCKSIZE*sizeof(*target));
-    } else {
-        memcpy(target, source, offset*sizeof(*target));
+    memcpy(target, source, FFMIN(BLOCKSIZE, offset)*sizeof(*target));
+    if (offset < BLOCKSIZE)
         memcpy(target + offset, source, (BLOCKSIZE - offset)*sizeof(*target));
-    }
 }
 
 /** inverse root mean square */