diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-09-08 18:16:00 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-09-08 18:16:00 +0000 |
commit | b28bdce6889247cd2969a162c263c0def06d5072 (patch) | |
tree | c4a205fbcaac4eaaec731d6feed99e917c482e72 | |
parent | 8022a8ebc25966bf6708c33a886eeac115c28bdb (diff) | |
download | ffmpeg-b28bdce6889247cd2969a162c263c0def06d5072.tar.gz |
Simplify if() in copy_and_dup()
Originally committed as revision 15268 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/ra144.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index ed60a157ef..7646ada797 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 */ |