1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Simplify if() in copy_and_dup()

Originally committed as revision 15268 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Vitor Sessak 2008-09-08 18:16:00 +00:00
parent 8022a8ebc2
commit b28bdce688

View File

@ -109,13 +109,10 @@ 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 */
static int irms(const int16_t *data)