Commit adb206c2 authored by Måns Rullgård's avatar Måns Rullgård

mpegaudio: use av_clip()

Originally committed as revision 18744 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 4ee6a5c1
......@@ -752,11 +752,7 @@ static inline int round_sample(int *sum)
int sum1;
sum1 = (*sum) >> OUT_SHIFT;
*sum &= (1<<OUT_SHIFT)-1;
if (sum1 < OUT_MIN)
sum1 = OUT_MIN;
else if (sum1 > OUT_MAX)
sum1 = OUT_MAX;
return sum1;
return av_clip(sum1, OUT_MIN, OUT_MAX);
}
/* signed 16x16 -> 32 multiply add accumulate */
......@@ -774,11 +770,7 @@ static inline int round_sample(int64_t *sum)
int sum1;
sum1 = (int)((*sum) >> OUT_SHIFT);
*sum &= (1<<OUT_SHIFT)-1;
if (sum1 < OUT_MIN)
sum1 = OUT_MIN;
else if (sum1 > OUT_MAX)
sum1 = OUT_MAX;
return sum1;
return av_clip(sum1, OUT_MIN, OUT_MAX);
}
# define MULS(ra, rb) MUL64(ra, rb)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment