Message ID | 20190526184035.134-1-jamrial@gmail.com |
---|---|
State | Accepted |
Commit | ff2a638c83161b2b5d15acca494436922b389d51 |
Headers | show |
On 26/05/2019 19:40, James Almer wrote: > Signed-off-by: James Almer <jamrial@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
On 6/2/2019 1:38 PM, Mark Thompson wrote: > On 26/05/2019 19:40, James Almer wrote: >> Signed-off-by: James Almer <jamrial@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 Pushed, thanks!
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
Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/cbs_h264.h | 6 ++++++ libavcodec/cbs_h2645.c | 1 + libavcodec/cbs_h264_syntax_template.c | 17 +++++++++++++++++ 3 files changed, 24 insertions(+)