From ba625dd8a12b8f440af7f50c833e5c1005d67c85 Mon Sep 17 00:00:00 2001 From: James Almer Date: Tue, 21 Apr 2015 22:28:21 -0300 Subject: avcodec: use av_mod_uintp2() where useful Reviewed-by: Michael Niedermayer Signed-off-by: James Almer --- libavcodec/h264_refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/h264_refs.c') diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index c424b9e3a2..0b2008ac3d 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -772,7 +772,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count) for (i = 0; ishort_ref_count; i++) { pic = h->short_ref[i]; if (pic->invalid_gap) { - int d = (h->cur_pic_ptr->frame_num - pic->frame_num) & ((1 << h->sps.log2_max_frame_num)-1); + int d = av_mod_uintp2(h->cur_pic_ptr->frame_num - pic->frame_num, h->sps.log2_max_frame_num); if (d > h->sps.ref_frame_count) remove_short(h, pic->frame_num, 0); } -- cgit v1.2.3