[FFmpeg-cvslog] h264: drop needs_realloc

Anton Khirnov git at videolan.org
Wed Apr 29 11:37:08 CEST 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Mar 31 10:10:42 2015 +0200| [27b0e6ebfd47b0c11156c18b90fa8c571f0f60c3] | committer: Anton Khirnov

h264: drop needs_realloc

It is not needed anymore since switching to refcounted frames.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=27b0e6ebfd47b0c11156c18b90fa8c571f0f60c3
---

 libavcodec/h264.c         |    3 ---
 libavcodec/h264.h         |    1 -
 libavcodec/h264_picture.c |    1 -
 libavcodec/h264_slice.c   |    7 -------
 4 files changed, 12 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index ec8ac40..266b3ec 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -359,9 +359,6 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp)
         for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
             ff_h264_unref_picture(h, &h->DPB[i]);
         av_freep(&h->DPB);
-    } else if (h->DPB) {
-        for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
-            h->DPB[i].needs_realloc = 1;
     }
 
     h->cur_pic_ptr = NULL;
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 94fc029..fc2ee4b 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -292,7 +292,6 @@ typedef struct H264Picture {
     int mbaff;              ///< 1 -> MBAFF frame 0-> not MBAFF
     int field_picture;      ///< whether or not picture was encoded in separate fields
 
-    int needs_realloc;      ///< picture needs to be reallocated (eg due to a frame size change)
     int reference;
     int recovered;          ///< picture at IDR or recovery point + recovery count
 } H264Picture;
diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c
index 694ddb9..0263e6e 100644
--- a/libavcodec/h264_picture.c
+++ b/libavcodec/h264_picture.c
@@ -113,7 +113,6 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src)
     dst->long_ref      = src->long_ref;
     dst->mbaff         = src->mbaff;
     dst->field_picture = src->field_picture;
-    dst->needs_realloc = src->needs_realloc;
     dst->reference     = src->reference;
     dst->recovered     = src->recovered;
 
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 16d5878..d5c0a6f 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -273,8 +273,6 @@ static inline int pic_is_unused(H264Context *h, H264Picture *pic)
 {
     if (!pic->f.buf[0])
         return 1;
-    if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF))
-        return 1;
     return 0;
 }
 
@@ -289,11 +287,6 @@ static int find_unused_picture(H264Context *h)
     if (i == H264_MAX_PICTURE_COUNT)
         return AVERROR_INVALIDDATA;
 
-    if (h->DPB[i].needs_realloc) {
-        h->DPB[i].needs_realloc = 0;
-        ff_h264_unref_picture(h, &h->DPB[i]);
-    }
-
     return i;
 }
 



More information about the ffmpeg-cvslog mailing list