From 9abc80f1ed673141326341e26a05c3e1f78576d0 Mon Sep 17 00:00:00 2001 From: Peter Meerwald Date: Fri, 20 Feb 2015 01:35:35 +0100 Subject: libavcodec: Make use of av_clip functions Signed-off-by: Peter Meerwald Signed-off-by: Luca Barbato --- libavcodec/h264_direct.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavcodec/h264_direct.c') diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c index f98389868d..855526ed03 100644 --- a/libavcodec/h264_direct.c +++ b/libavcodec/h264_direct.c @@ -37,13 +37,13 @@ static int get_scale_factor(H264Context *const h, int poc, int poc1, int i) { int poc0 = h->ref_list[0][i].poc; - int td = av_clip(poc1 - poc0, -128, 127); + int td = av_clip_int8(poc1 - poc0); if (td == 0 || h->ref_list[0][i].long_ref) { return 256; } else { - int tb = av_clip(poc - poc0, -128, 127); + int tb = av_clip_int8(poc - poc0); int tx = (16384 + (FFABS(td) >> 1)) / td; - return av_clip((tb * tx + 32) >> 6, -1024, 1023); + return av_clip_intp2((tb * tx + 32) >> 6, 10); } } -- cgit v1.2.3