changeset 11086:d4222f5b6dea libavcodec

Fix colocated map.
author michael
date Sun, 07 Feb 2010 01:18:00 +0000
parents 27b5a2bd1dfe
children 1b8e11679883
files h264_direct.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/h264_direct.c	Sun Feb 07 01:17:13 2010 +0000
+++ b/h264_direct.c	Sun Feb 07 01:18:00 2010 +0000
@@ -71,7 +71,7 @@
     Picture * const ref1 = &h->ref_list[1][0];
     int j, old_ref, rfield;
     int start= mbafi ? 16                      : 0;
-    int end  = mbafi ? 16+2*h->ref_count[list] : h->ref_count[list];
+    int end  = mbafi ? 16+2*h->ref_count[0]    : h->ref_count[0];
     int interl= mbafi || s->picture_structure != PICT_FRAME;
 
     /* bogus; fills in for missing frames */
@@ -87,10 +87,10 @@
                 poc= (poc&~3) + rfield + 1;
 
             for(j=start; j<end; j++){
-                if(4*h->ref_list[list][j].frame_num + (h->ref_list[list][j].reference&3) == poc){
+                if(4*h->ref_list[0][j].frame_num + (h->ref_list[0][j].reference&3) == poc){
                     int cur_ref= mbafi ? (j-16)^field : j;
                     map[list][2*old_ref + (rfield^field) + 16] = cur_ref;
-                    if(rfield == field)
+                    if(rfield == field || !interl)
                         map[list][old_ref] = cur_ref;
                     break;
                 }