[Ffmpeg-cvslog] r7996 - trunk/libavcodec/h264.c

michael subversion
Fri Feb 16 22:28:00 CET 2007


Author: michael
Date: Fri Feb 16 22:27:59 2007
New Revision: 7996

Modified:
   trunk/libavcodec/h264.c

Log:
factorize mv_cache and mvd_cache init


Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Fri Feb 16 22:27:59 2007
@@ -5299,21 +5299,19 @@
                         tprintf("final mv:%d %d\n", mx, my);
 
                         if(IS_SUB_8X8(sub_mb_type)){
-                            mv_cache[ 0 ][0]= mv_cache[ 1 ][0]=
+                            mv_cache[ 1 ][0]=
                             mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx;
-                            mv_cache[ 0 ][1]= mv_cache[ 1 ][1]=
+                            mv_cache[ 1 ][1]=
                             mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my;
                         }else if(IS_SUB_8X4(sub_mb_type)){
-                            mv_cache[ 0 ][0]= mv_cache[ 1 ][0]= mx;
-                            mv_cache[ 0 ][1]= mv_cache[ 1 ][1]= my;
+                            mv_cache[ 1 ][0]= mx;
+                            mv_cache[ 1 ][1]= my;
                         }else if(IS_SUB_4X8(sub_mb_type)){
-                            mv_cache[ 0 ][0]= mv_cache[ 8 ][0]= mx;
-                            mv_cache[ 0 ][1]= mv_cache[ 8 ][1]= my;
-                        }else{
-                            assert(IS_SUB_4X4(sub_mb_type));
-                            mv_cache[ 0 ][0]= mx;
-                            mv_cache[ 0 ][1]= my;
+                            mv_cache[ 8 ][0]= mx;
+                            mv_cache[ 8 ][1]= my;
                         }
+                        mv_cache[ 0 ][0]= mx;
+                        mv_cache[ 0 ][1]= my;
                     }
                 }else{
                     uint32_t *p= (uint32_t *)&h->mv_cache[list][ scan8[4*i] ][0];
@@ -6434,35 +6432,33 @@
                         tprintf("final mv:%d %d\n", mx, my);
 
                         if(IS_SUB_8X8(sub_mb_type)){
-                            mv_cache[ 0 ][0]= mv_cache[ 1 ][0]=
+                            mv_cache[ 1 ][0]=
                             mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx;
-                            mv_cache[ 0 ][1]= mv_cache[ 1 ][1]=
+                            mv_cache[ 1 ][1]=
                             mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my;
 
-                            mvd_cache[ 0 ][0]= mvd_cache[ 1 ][0]=
+                            mvd_cache[ 1 ][0]=
                             mvd_cache[ 8 ][0]= mvd_cache[ 9 ][0]= mx - mpx;
-                            mvd_cache[ 0 ][1]= mvd_cache[ 1 ][1]=
+                            mvd_cache[ 1 ][1]=
                             mvd_cache[ 8 ][1]= mvd_cache[ 9 ][1]= my - mpy;
                         }else if(IS_SUB_8X4(sub_mb_type)){
-                            mv_cache[ 0 ][0]= mv_cache[ 1 ][0]= mx;
-                            mv_cache[ 0 ][1]= mv_cache[ 1 ][1]= my;
+                            mv_cache[ 1 ][0]= mx;
+                            mv_cache[ 1 ][1]= my;
 
-                            mvd_cache[ 0 ][0]= mvd_cache[ 1 ][0]= mx- mpx;
-                            mvd_cache[ 0 ][1]= mvd_cache[ 1 ][1]= my - mpy;
+                            mvd_cache[ 1 ][0]= mx - mpx;
+                            mvd_cache[ 1 ][1]= my - mpy;
                         }else if(IS_SUB_4X8(sub_mb_type)){
-                            mv_cache[ 0 ][0]= mv_cache[ 8 ][0]= mx;
-                            mv_cache[ 0 ][1]= mv_cache[ 8 ][1]= my;
+                            mv_cache[ 8 ][0]= mx;
+                            mv_cache[ 8 ][1]= my;
 
-                            mvd_cache[ 0 ][0]= mvd_cache[ 8 ][0]= mx - mpx;
-                            mvd_cache[ 0 ][1]= mvd_cache[ 8 ][1]= my - mpy;
-                        }else{
-                            assert(IS_SUB_4X4(sub_mb_type));
-                            mv_cache[ 0 ][0]= mx;
-                            mv_cache[ 0 ][1]= my;
-
-                            mvd_cache[ 0 ][0]= mx - mpx;
-                            mvd_cache[ 0 ][1]= my - mpy;
+                            mvd_cache[ 8 ][0]= mx - mpx;
+                            mvd_cache[ 8 ][1]= my - mpy;
                         }
+                        mv_cache[ 0 ][0]= mx;
+                        mv_cache[ 0 ][1]= my;
+
+                        mvd_cache[ 0 ][0]= mx - mpx;
+                        mvd_cache[ 0 ][1]= my - mpy;
                     }
                 }else{
                     uint32_t *p= (uint32_t *)&h->mv_cache[list][ scan8[4*i] ][0];




More information about the ffmpeg-cvslog mailing list