aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegaudiodec.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2009-05-05 18:44:07 +0000
committerMåns Rullgård <mans@mansr.com>2009-05-05 18:44:07 +0000
commitadb206c238d3e9ad73c8b01f608fe92ae2bb33fe (patch)
treeb51c6b4948c0076272f0f70c4959a8d89e1b3f16 /libavcodec/mpegaudiodec.c
parent4ee6a5c161c22474e41a84bbe2f01ed08b3b9334 (diff)
downloadffmpeg-adb206c238d3e9ad73c8b01f608fe92ae2bb33fe.tar.gz
mpegaudio: use av_clip()
Originally committed as revision 18744 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r--libavcodec/mpegaudiodec.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index b4d469990c..4d1129fcaf 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -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)