[FFmpeg-cvslog] avcodec: Add output_picture_number to AVCodecParserContext

Yusuke Nakamura git at videolan.org
Sat Aug 3 10:53:31 CEST 2013


ffmpeg | branch: master | Yusuke Nakamura <muken.the.vfrmaniac at gmail.com> | Fri Aug  2 18:16:48 2013 +0900| [a8b19271c3b40ac3c3dc769fe248887acf14ba5a] | committer: Diego Biurrun

avcodec: Add output_picture_number to AVCodecParserContext

Set output_picture_number in H.264 parser.

Signed-off-by: Diego Biurrun <diego at biurrun.de>

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

 doc/APIchanges           |    3 +++
 libavcodec/avcodec.h     |    8 ++++++++
 libavcodec/h264.c        |    3 +--
 libavcodec/h264_parser.c |    2 +-
 libavcodec/version.h     |    2 +-
 5 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index cdfcc09..cb477d8 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil:     2012-10-22
 
 API changes, most recent first:
 
+2013-08-xx - xxxxxxx - lavc 55.11.0 - avcodec.h
+  Add output_picture_number to AVCodecParserContext.
+
 2013-06-xx - xxxxxxx - lavc 55.10.0 - avcodec.h
   Add MPEG-2 AAC profiles
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index bd9a80c..a84c013 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3563,6 +3563,14 @@ typedef struct AVCodecParserContext {
      * AV_PICTURE_STRUCTURE_TOP_FIELD.
      */
     enum AVPictureStructure picture_structure;
+
+    /**
+     * Picture number incremented in presentation or output order.
+     * This field may be reinitialized at the first picture of a new sequence.
+     *
+     * For example, this corresponds to H.264 PicOrderCnt.
+     */
+    int output_picture_number;
 } AVCodecParserContext;
 
 typedef struct AVCodecParser {
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 2dccb87..c958941 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2717,8 +2717,7 @@ int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc)
         pic_field_poc[0] = field_poc[0];
     if (h->picture_structure != PICT_TOP_FIELD)
         pic_field_poc[1] = field_poc[1];
-    if (pic_poc)
-        *pic_poc = FFMIN(pic_field_poc[0], pic_field_poc[1]);
+    *pic_poc = FFMIN(pic_field_poc[0], pic_field_poc[1]);
 
     return 0;
 }
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 36829ec..2ed155c 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -240,7 +240,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
                     h->delta_poc[1] = get_se_golomb(&h->gb);
             }
 
-            ff_init_poc(h, field_poc, NULL);
+            ff_init_poc(h, field_poc, &s->output_picture_number);
 
             if (h->sps.pic_struct_present_flag) {
                 switch (h->sei_pic_struct) {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 7c82519..575fa26 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -27,7 +27,7 @@
  */
 
 #define LIBAVCODEC_VERSION_MAJOR 55
-#define LIBAVCODEC_VERSION_MINOR 10
+#define LIBAVCODEC_VERSION_MINOR 11
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list