[FFmpeg-cvslog] r14319 - trunk/libavcodec/h264.c

michael subversion
Mon Jul 21 03:41:57 CEST 2008


Author: michael
Date: Mon Jul 21 03:41:56 2008
New Revision: 14319

Log:
Simplify spatial direct ref selection with FFMIN3()


Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Mon Jul 21 03:41:56 2008
@@ -1001,11 +1001,7 @@ static inline void pred_direct_motion(H2
             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;
         }




More information about the ffmpeg-cvslog mailing list