[FFmpeg-cvslog] avcodec/cbs_h264: add support for Alternative Transfer Characteristics SEI message

James Almer git at videolan.org
Tue Jun 4 01:22:30 EEST 2019


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun May 26 15:40:35 2019 -0300| [ff2a638c83161b2b5d15acca494436922b389d51] | committer: James Almer

avcodec/cbs_h264: add support for Alternative Transfer Characteristics SEI message

Reviewed-by: Mark Thompson <sw at jkqxz.net>
Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/cbs_h264.h                 |  6 ++++++
 libavcodec/cbs_h2645.c                |  1 +
 libavcodec/cbs_h264_syntax_template.c | 17 +++++++++++++++++
 3 files changed, 24 insertions(+)

diff --git a/libavcodec/cbs_h264.h b/libavcodec/cbs_h264.h
index cc46eeb3b0..a31be298ba 100644
--- a/libavcodec/cbs_h264.h
+++ b/libavcodec/cbs_h264.h
@@ -314,6 +314,10 @@ typedef struct H264RawSEIMasteringDisplayColourVolume {
     uint32_t min_display_mastering_luminance;
 } H264RawSEIMasteringDisplayColourVolume;
 
+typedef struct H264RawSEIAlternativeTransferCharacteristics {
+    uint8_t preferred_transfer_characteristics;
+} H264RawSEIAlternativeTransferCharacteristics;
+
 typedef struct H264RawSEIPayload {
     uint32_t payload_type;
     uint32_t payload_size;
@@ -327,6 +331,8 @@ typedef struct H264RawSEIPayload {
         H264RawSEIRecoveryPoint recovery_point;
         H264RawSEIDisplayOrientation display_orientation;
         H264RawSEIMasteringDisplayColourVolume mastering_display_colour_volume;
+        H264RawSEIAlternativeTransferCharacteristics
+            alternative_transfer_characteristics;
         struct {
             uint8_t *data;
             size_t data_length;
diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index 319202fc48..0456937710 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -458,6 +458,7 @@ static void cbs_h264_free_sei_payload(H264RawSEIPayload *payload)
     case H264_SEI_TYPE_RECOVERY_POINT:
     case H264_SEI_TYPE_DISPLAY_ORIENTATION:
     case H264_SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME:
+    case H264_SEI_TYPE_ALTERNATIVE_TRANSFER:
         break;
     case H264_SEI_TYPE_USER_DATA_REGISTERED:
         av_buffer_unref(&payload->payload.user_data_registered.data_ref);
diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
index 95fc6d7194..cdacd79fc4 100644
--- a/libavcodec/cbs_h264_syntax_template.c
+++ b/libavcodec/cbs_h264_syntax_template.c
@@ -815,6 +815,19 @@ static int FUNC(sei_mastering_display_colour_volume)(CodedBitstreamContext *ctx,
     return 0;
 }
 
+static int FUNC(sei_alternative_transfer_characteristics)(CodedBitstreamContext *ctx,
+                                                          RWContext *rw,
+                                                          H264RawSEIAlternativeTransferCharacteristics *current)
+{
+    int err;
+
+    HEADER("Alternative Transfer Characteristics");
+
+    ub(8, preferred_transfer_characteristics);
+
+    return 0;
+}
+
 static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw,
                              H264RawSEIPayload *current)
 {
@@ -866,6 +879,10 @@ static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw,
         CHECK(FUNC(sei_mastering_display_colour_volume)
               (ctx, rw, &current->payload.mastering_display_colour_volume));
         break;
+    case H264_SEI_TYPE_ALTERNATIVE_TRANSFER:
+        CHECK(FUNC(sei_alternative_transfer_characteristics)
+              (ctx, rw, &current->payload.alternative_transfer_characteristics));
+        break;
     default:
         {
 #ifdef READ



More information about the ffmpeg-cvslog mailing list