[FFmpeg-cvslog] r22079 - trunk/libavcodec/h264.h

michael subversion
Fri Feb 26 16:26:11 CET 2010


Author: michael
Date: Fri Feb 26 16:26:11 2010
New Revision: 22079

Log:
Only load the topleft mv/ref when the topright is unavailable.
8 cpu cycles faster.

Modified:
   trunk/libavcodec/h264.h

Modified: trunk/libavcodec/h264.h
==============================================================================
--- trunk/libavcodec/h264.h	Fri Feb 26 16:03:00 2010	(r22078)
+++ trunk/libavcodec/h264.h	Fri Feb 26 16:26:11 2010	(r22079)
@@ -1006,16 +1006,6 @@ static void fill_decode_caches(H264Conte
                 }
             }
 
-            if(USES_LIST(topleft_type, list)){
-                const int b_xy = h->mb2b_xy [topleft_xy] + 3 + h->b_stride + (h->topleft_partition & 2*h->b_stride);
-                const int b8_xy= 4*topleft_xy + 1 + (h->topleft_partition & 2);
-                AV_COPY32(h->mv_cache[list][scan8[0] - 1 - 1*8], s->current_picture.motion_val[list][b_xy]);
-                h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy];
-            }else{
-                AV_ZERO32(h->mv_cache[list][scan8[0] - 1 - 1*8]);
-                h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
-            }
-
             if(USES_LIST(topright_type, list)){
                 const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride;
                 AV_COPY32(h->mv_cache[list][scan8[0] + 4 - 1*8], s->current_picture.motion_val[list][b_xy]);
@@ -1024,6 +1014,17 @@ static void fill_decode_caches(H264Conte
                 AV_ZERO32(h->mv_cache [list][scan8[0] + 4 - 1*8]);
                 h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
             }
+            if(h->ref_cache[list][scan8[0] + 4 - 1*8] < 0){
+                if(USES_LIST(topleft_type, list)){
+                    const int b_xy = h->mb2b_xy [topleft_xy] + 3 + h->b_stride + (h->topleft_partition & 2*h->b_stride);
+                    const int b8_xy= 4*topleft_xy + 1 + (h->topleft_partition & 2);
+                    AV_COPY32(h->mv_cache[list][scan8[0] - 1 - 1*8], s->current_picture.motion_val[list][b_xy]);
+                    h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy];
+                }else{
+                    AV_ZERO32(h->mv_cache[list][scan8[0] - 1 - 1*8]);
+                    h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE;
+                }
+            }
 
             if((mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2)) && !FRAME_MBAFF)
                 continue;



More information about the ffmpeg-cvslog mailing list