Merge commit '31d2039cb42668ebcf08248bc48bbad44aa05f49'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 19 Feb 2015 19:39:04 +0000 (20:39 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 19 Feb 2015 19:39:04 +0000 (20:39 +0100)
* commit '31d2039cb42668ebcf08248bc48bbad44aa05f49':
  h264_parser: export video format and dimensions

Conflicts:
libavcodec/h264_parser.c
libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
doc/APIchanges
libavcodec/avcodec.h
libavcodec/h264_parser.c
libavcodec/parser.c
libavcodec/version.h

diff --cc doc/APIchanges
Simple merge
Simple merge
@@@ -324,9 -275,35 +324,38 @@@ static inline int parse_nal_units(AVCod
              h->sps       = *h->sps_buffers[h->pps.sps_id];
              h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
  
 +            if(h->sps.ref_frame_count <= 1 && h->pps.ref_count[0] <= 1 && s->pict_type == AV_PICTURE_TYPE_I)
 +                s->key_frame = 1;
 +
+             s->coded_width  = 16 * h->sps.mb_width;
+             s->coded_height = 16 * h->sps.mb_height;
+             s->width        = s->coded_width  - (h->sps.crop_right + h->sps.crop_left);
+             s->height       = s->coded_height - (h->sps.crop_top   + h->sps.crop_bottom);
+             if (s->width <= 0 || s->height <= 0) {
+                 s->width  = s->coded_width;
+                 s->height = s->coded_height;
+             }
+             switch (h->sps.bit_depth_luma) {
+             case 9:
+                 if (CHROMA444(h))      s->format = AV_PIX_FMT_YUV444P9;
+                 else if (CHROMA422(h)) s->format = AV_PIX_FMT_YUV422P9;
+                 else                   s->format = AV_PIX_FMT_YUV420P9;
+                 break;
+             case 10:
+                 if (CHROMA444(h))      s->format = AV_PIX_FMT_YUV444P10;
+                 else if (CHROMA422(h)) s->format = AV_PIX_FMT_YUV422P10;
+                 else                   s->format = AV_PIX_FMT_YUV420P10;
+                 break;
+             case 8:
+                 if (CHROMA444(h))      s->format = AV_PIX_FMT_YUV444P;
+                 else if (CHROMA422(h)) s->format = AV_PIX_FMT_YUV422P;
+                 else                   s->format = AV_PIX_FMT_YUV420P;
+                 break;
+             default:
+                 s->format = AV_PIX_FMT_NONE;
+             }
              avctx->profile = ff_h264_get_profile(&h->sps);
              avctx->level   = h->sps.level_idc;
  
@@@ -86,16 -89,12 +86,18 @@@ found
      s->dts_sync_point       = INT_MIN;
      s->dts_ref_dts_delta    = INT_MIN;
      s->pts_dts_delta        = INT_MIN;
+     s->format               = -1;
      return s;
 +
 +err_out:
 +    if (s)
 +        av_freep(&s->priv_data);
 +    av_free(s);
 +    return NULL;
  }
  
 -void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove)
 +void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove, int fuzzy)
  {
      int i;
  
@@@ -29,8 -29,8 +29,8 @@@
  #include "libavutil/version.h"
  
  #define LIBAVCODEC_VERSION_MAJOR 56
- #define LIBAVCODEC_VERSION_MINOR  22
 -#define LIBAVCODEC_VERSION_MINOR 13
 -#define LIBAVCODEC_VERSION_MICRO  0
++#define LIBAVCODEC_VERSION_MINOR  23
 +#define LIBAVCODEC_VERSION_MICRO 100
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                 LIBAVCODEC_VERSION_MINOR, \