[FFmpeg-devel] [PATCH] avcodec/cbs_h264: add support for Alternative Transfer Characteristics SEI message
Mark Thompson
sw at jkqxz.net
Sun Jun 2 19:38:00 EEST 2019
On 26/05/2019 19:40, James Almer wrote:
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> 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, ¤t->payload.mastering_display_colour_volume));
> break;
> + case H264_SEI_TYPE_ALTERNATIVE_TRANSFER:
> + CHECK(FUNC(sei_alternative_transfer_characteristics)
> + (ctx, rw, ¤t->payload.alternative_transfer_characteristics));
> + break;
> default:
> {
> #ifdef READ
>
LGTM.
Thanks,
- Mark
More information about the ffmpeg-devel
mailing list