[SCM] libav/experimental: Removing yet another weird field pic special case, now related to SHORT2LONG MMCOs.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:26:03 UTC 2013


The following commit has been merged in the experimental branch:
commit 472c9a58a8a70ed2db304aa143737b91f5962969
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Fri Jul 25 13:40:13 2008 +0000

    Removing yet another weird field pic special case,
    now related to SHORT2LONG MMCOs.
    
    Originally committed as revision 14394 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 10ec839..8a74edd 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3453,34 +3453,32 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
         if(s->avctx->debug&FF_DEBUG_MMCO)
             av_log(h->s.avctx, AV_LOG_DEBUG, "mmco:%d %d %d\n", h->mmco[i].opcode, h->mmco[i].short_pic_num, h->mmco[i].long_arg);
 
+        if(   mmco[i].opcode == MMCO_SHORT2UNUSED
+           || mmco[i].opcode == MMCO_SHORT2LONG){
+            frame_num = pic_num_extract(h, mmco[i].short_pic_num, &structure);
+            pic = find_short(h, frame_num, &j);
+            if(!pic){
+                av_log(h->s.avctx, AV_LOG_ERROR, "mmco: unref short failure\n");
+                continue;
+            }
+        }
+
         switch(mmco[i].opcode){
         case MMCO_SHORT2UNUSED:
             if(s->avctx->debug&FF_DEBUG_MMCO)
                 av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: unref short %d count %d\n", h->mmco[i].short_pic_num, h->short_ref_count);
-            frame_num = pic_num_extract(h, mmco[i].short_pic_num, &structure);
-            pic = find_short(h, frame_num, &j);
-            if (pic) {
                 if (unreference_pic(h, pic, structure ^ PICT_FRAME))
                     remove_short_at_index(h, j);
-            } else if(s->avctx->debug&FF_DEBUG_MMCO)
-                av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: unref short failure\n");
             break;
         case MMCO_SHORT2LONG:
-            if (FIELD_PICTURE && mmco[i].long_arg < h->long_ref_count &&
-                    h->long_ref[mmco[i].long_arg]->frame_num ==
-                                              mmco[i].short_pic_num / 2) {
-                /* do nothing, we've already moved this field pair. */
-            } else {
-                int frame_num = mmco[i].short_pic_num >> FIELD_PICTURE;
-
-                remove_long(h, mmco[i].long_arg, 0);
+                if (h->long_ref[mmco[i].long_arg] != pic)
+                    remove_long(h, mmco[i].long_arg, 0);
 
                 h->long_ref[ mmco[i].long_arg ]= remove_short(h, frame_num);
                 if (h->long_ref[ mmco[i].long_arg ]){
                     h->long_ref[ mmco[i].long_arg ]->long_ref=1;
                     h->long_ref_count++;
                 }
-            }
             break;
         case MMCO_LONG2UNUSED:
             j = pic_num_extract(h, mmco[i].long_arg, &structure);

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list