summaryrefslogtreecommitdiff
path: root/libavcodec/h264_direct.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/h264_direct.c')
-rw-r--r--libavcodec/h264_direct.c6
1 files changed, 3 insertions, 3 deletions
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);
}
}