Commit 27cc14d4 authored by mru's avatar mru

mpegaudio: use av_clip()

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18744 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3cca3c3b
...@@ -752,11 +752,7 @@ static inline int round_sample(int *sum) ...@@ -752,11 +752,7 @@ static inline int round_sample(int *sum)
int sum1; int sum1;
sum1 = (*sum) >> OUT_SHIFT; sum1 = (*sum) >> OUT_SHIFT;
*sum &= (1<<OUT_SHIFT)-1; *sum &= (1<<OUT_SHIFT)-1;
if (sum1 < OUT_MIN) return av_clip(sum1, OUT_MIN, OUT_MAX);
sum1 = OUT_MIN;
else if (sum1 > OUT_MAX)
sum1 = OUT_MAX;
return sum1;
} }
/* signed 16x16 -> 32 multiply add accumulate */ /* signed 16x16 -> 32 multiply add accumulate */
...@@ -774,11 +770,7 @@ static inline int round_sample(int64_t *sum) ...@@ -774,11 +770,7 @@ static inline int round_sample(int64_t *sum)
int sum1; int sum1;
sum1 = (int)((*sum) >> OUT_SHIFT); sum1 = (int)((*sum) >> OUT_SHIFT);
*sum &= (1<<OUT_SHIFT)-1; *sum &= (1<<OUT_SHIFT)-1;
if (sum1 < OUT_MIN) return av_clip(sum1, OUT_MIN, OUT_MAX);
sum1 = OUT_MIN;
else if (sum1 > OUT_MAX)
sum1 = OUT_MAX;
return sum1;
} }
# define MULS(ra, rb) MUL64(ra, rb) # 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