From patchwork Sun May 26 18:40:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 13301 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 94A3B44868A for ; Sun, 26 May 2019 21:41:00 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 71763689CE9; Sun, 26 May 2019 21:41:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D8882680629 for ; Sun, 26 May 2019 21:40:53 +0300 (EEST) Received: by mail-qk1-f177.google.com with SMTP id l128so2102718qke.2 for ; Sun, 26 May 2019 11:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=lJHza1JhOI+jOwIgkiOWwiSczjhIHhgIRg6u+0ufvYE=; b=d2/hakksia6bxEbVsoOH0dingIw9OQQ7ymTCqYcTC+6/7960NK+A3pdMvkqBJ4/AMC mlQ755VGAZ2mWKaSBXbFRXSgTXycJvCjwtwLhSZi8OXIBManmGdVVPLkryKBK/GFdmRZ Wwou4A/QYCqqCGWhKUzsghaZUaBZWiXZTYb1iVhBiOg4ZiBBZ/Zu1DzsIXzS/sYd/Rka ZMnyR9yrP4Dx4QPexSl9ZCdX4vEYHdo9Abf4ZStGKcYFQLirOJ5IgFGiSsuGO4Xvuiyb 7l7XLRwFWw78caPsZxYhQtQSxMBy3JWv0eNPZYG4AvrBjyhu1dNAYCJtg4S2THbi7Gf4 c5xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=lJHza1JhOI+jOwIgkiOWwiSczjhIHhgIRg6u+0ufvYE=; b=ZeUBkv599xftVjp5NZ2zfwH7mO0heywKRj+/sdxvAJIk1LwUGYS6Og58nvX9iAuKSY 42wQ7e/dTXDa3Iib3OYwMY91bpCzXHR31yu013XRhM1uleeCkTb8gW8fmisLzkUynGMl F7sbWjHFZJoXD8cXZdEooo80hDjMW3UfzLvABkH8x0eHWcW6i/rqLPbMad4HuJDCxBLv mZIppF1xcwFufQufYrn3MSwdLG83GIk6LKfuCdUx4ICzNr5ldfWx6vhOo/W7AE54CHTL Uj5e4vuBqLu+SdUav14zdZx6IR0gW+URiCiGgu6ldrwizgODtuGbIsvoY4Wct+T/K2yS elUg== X-Gm-Message-State: APjAAAUck4Hg40IzUxBZ6wwX/zaQz4ffKKdWXz4afA9sbOJBslUpq3jU Dv7hfBnKpEjnz2Oz3LYkv7bVhZX5 X-Google-Smtp-Source: APXvYqw2VNmJ4B2ix3mS3OEUkkZCPxwT47laO4IrRpqtHgB+E/gfBY5SyZrJxhhiv1/usKjMoDD5WQ== X-Received: by 2002:ac8:895:: with SMTP id v21mr6019855qth.248.1558896052310; Sun, 26 May 2019 11:40:52 -0700 (PDT) Received: from localhost.localdomain ([191.83.221.100]) by smtp.gmail.com with ESMTPSA id z12sm2092840qkl.66.2019.05.26.11.40.51 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 26 May 2019 11:40:51 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 26 May 2019 15:40:35 -0300 Message-Id: <20190526184035.134-1-jamrial@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/cbs_h264: add support for Alternative Transfer Characteristics SEI message X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: James Almer --- 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