summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-07-21 01:41:56 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-07-21 01:41:56 +0000
commit29d05ebc7a24e7d0a736c43cc7906e65b2929798 (patch)
tree80601b098e41ded519f2124c7b4ddbb00057d2e4 /libavcodec/h264.c
parent86255db9b991210aa0a0a46780ed81d858f4dc7d (diff)
Simplify spatial direct ref selection with FFMIN3()
Originally committed as revision 14319 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 4d3d32b0e2..7fa1b07473 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1001,11 +1001,7 @@ static inline void pred_direct_motion(H264Context * const h, int *mb_type){
int refc = h->ref_cache[list][scan8[0] - 8 + 4];
if(refc == -2)
refc = h->ref_cache[list][scan8[0] - 8 - 1];
- ref[list] = refa;
- if(ref[list] < 0 || (refb < ref[list] && refb >= 0))
- ref[list] = refb;
- if(ref[list] < 0 || (refc < ref[list] && refc >= 0))
- ref[list] = refc;
+ ref[list] = FFMIN3((unsigned)refa, (unsigned)refb, (unsigned)refc);
if(ref[list] < 0)
ref[list] = -1;
}