[FFmpeg-cvslog] hevc : add hevc profile

gcocherel git at videolan.org
Fri Nov 22 01:37:50 CET 2013


ffmpeg | branch: master | gcocherel <gildas.cocherel at laposte.net> | Thu Nov 21 11:29:05 2013 +0100| [fb7d70c1cd95529cbbbeeab5e9fa3b200ef2545c] | committer: Michael Niedermayer

hevc : add hevc profile

(cherry picked from commit 0c8dfd8ad6400b33da55a9f4d9aa8d3f5c9d209f)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/avcodec.h |    5 +++++
 libavcodec/hevc.c    |   12 ++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 68bb115..7e5aee2 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2814,6 +2814,11 @@ typedef struct AVCodecContext {
 #define FF_PROFILE_JPEG2000_DCINEMA_2K              3
 #define FF_PROFILE_JPEG2000_DCINEMA_4K              4
 
+
+#define FF_PROFILE_HEVC_MAIN                        1
+#define FF_PROFILE_HEVC_MAIN_10                     2
+#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE          3
+
     /**
      * level
      * - encoding: Set by user.
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 26b0c5f..add6a7c 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -374,6 +374,9 @@ static int hls_slice_header(HEVCContext *s)
         s->max_ra     = INT_MAX;
     }
 
+    s->avctx->profile = s->sps->ptl.general_PTL.profile_idc;
+    s->avctx->level   = s->sps->ptl.general_PTL.level_idc;
+
     sh->dependent_slice_segment_flag = 0;
     if (!sh->first_slice_in_pic_flag) {
         int slice_address_length;
@@ -2926,6 +2929,14 @@ static void hevc_decode_flush(AVCodecContext *avctx)
 
 #define OFFSET(x) offsetof(HEVCContext, x)
 #define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
+
+static const AVProfile profiles[] = {
+    { FF_PROFILE_HEVC_MAIN,                 "Main"              },
+    { FF_PROFILE_HEVC_MAIN_10,              "Main10"            },
+    { FF_PROFILE_HEVC_MAIN_STILL_PICTURE,   "MainStillPicture"  },
+    { FF_PROFILE_UNKNOWN },
+};
+
 static const AVOption options[] = {
     { "apply_defdispwin", "Apply default display window from VUI", OFFSET(apply_defdispwin),
         AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, PAR },
@@ -2956,4 +2967,5 @@ AVCodec ff_hevc_decoder = {
     .init_thread_copy      = hevc_init_thread_copy,
     .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
                              CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS,
+    .profiles              = NULL_IF_CONFIG_SMALL(profiles),
 };



More information about the ffmpeg-cvslog mailing list