[SCM] libav/experimental: Simplify if() in copy_and_dup()

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:29:47 UTC 2013


The following commit has been merged in the experimental branch:
commit b28bdce6889247cd2969a162c263c0def06d5072
Author: Vitor Sessak <vitor1001 at gmail.com>
Date:   Mon Sep 8 18:16:00 2008 +0000

    Simplify if() in copy_and_dup()
    
    Originally committed as revision 15268 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index ed60a15..7646ada 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -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 */

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list