aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-05-15 22:42:14 +0100
committerMark Thompson <sw@jkqxz.net>2017-09-12 22:29:31 +0100
commit6eb102a616364d06a4cc994339b72910b3547e5f (patch)
treebb43d9a574e95d8a51a5890da5326b4a3d3051de
parent1db03e952b4ee998f2a19c037f60d17dc90e8f6c (diff)
downloadffmpeg-6eb102a616364d06a4cc994339b72910b3547e5f.tar.gz
h264_sei: Add namespace prefix to all SEI values
This avoids confusion with equivalent H.265 SEI values when both are being used at the same time. (cherry picked from commit 6ea220cbeec8863e2006a03b73bed52db2b13ee7)
-rw-r--r--libavcodec/h264_parser.c26
-rw-r--r--libavcodec/h264_sei.c20
-rw-r--r--libavcodec/h264_sei.h43
-rw-r--r--libavcodec/h264_slice.c24
-rw-r--r--libavcodec/vaapi_encode_h264.c6
-rw-r--r--libavcodec/videotoolboxenc.c6
6 files changed, 63 insertions, 62 deletions
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 2564c6c6c3..dd0a965af0 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -473,23 +473,23 @@ static inline int parse_nal_units(AVCodecParserContext *s,
if (sps->pic_struct_present_flag && p->sei.picture_timing.present) {
switch (p->sei.picture_timing.pic_struct) {
- case SEI_PIC_STRUCT_TOP_FIELD:
- case SEI_PIC_STRUCT_BOTTOM_FIELD:
+ case H264_SEI_PIC_STRUCT_TOP_FIELD:
+ case H264_SEI_PIC_STRUCT_BOTTOM_FIELD:
s->repeat_pict = 0;
break;
- case SEI_PIC_STRUCT_FRAME:
- case SEI_PIC_STRUCT_TOP_BOTTOM:
- case SEI_PIC_STRUCT_BOTTOM_TOP:
+ case H264_SEI_PIC_STRUCT_FRAME:
+ case H264_SEI_PIC_STRUCT_TOP_BOTTOM:
+ case H264_SEI_PIC_STRUCT_BOTTOM_TOP:
s->repeat_pict = 1;
break;
- case SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
- case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
+ case H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
+ case H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
s->repeat_pict = 2;
break;
- case SEI_PIC_STRUCT_FRAME_DOUBLING:
+ case H264_SEI_PIC_STRUCT_FRAME_DOUBLING:
s->repeat_pict = 3;
break;
- case SEI_PIC_STRUCT_FRAME_TRIPLING:
+ case H264_SEI_PIC_STRUCT_FRAME_TRIPLING:
s->repeat_pict = 5;
break;
default:
@@ -504,12 +504,12 @@ static inline int parse_nal_units(AVCodecParserContext *s,
s->picture_structure = AV_PICTURE_STRUCTURE_FRAME;
if (sps->pic_struct_present_flag && p->sei.picture_timing.present) {
switch (p->sei.picture_timing.pic_struct) {
- case SEI_PIC_STRUCT_TOP_BOTTOM:
- case SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
+ case H264_SEI_PIC_STRUCT_TOP_BOTTOM:
+ case H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
s->field_order = AV_FIELD_TT;
break;
- case SEI_PIC_STRUCT_BOTTOM_TOP:
- case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
+ case H264_SEI_PIC_STRUCT_BOTTOM_TOP:
+ case H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
s->field_order = AV_FIELD_BB;
break;
default:
diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index 889bea2ee0..2afe48e2fe 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -81,7 +81,7 @@ static int decode_picture_timing(H264SEIPictureTiming *h, GetBitContext *gb,
h->pic_struct = get_bits(gb, 4);
h->ct_type = 0;
- if (h->pic_struct > SEI_PIC_STRUCT_FRAME_TRIPLING)
+ if (h->pic_struct > H264_SEI_PIC_STRUCT_FRAME_TRIPLING)
return AVERROR_INVALIDDATA;
num_clock_ts = sei_num_clock_ts_table[h->pic_struct];
@@ -421,31 +421,31 @@ int ff_h264_sei_decode(H264SEIContext *h, GetBitContext *gb,
next = get_bits_count(gb) + 8 * size;
switch (type) {
- case SEI_TYPE_PIC_TIMING: // Picture timing SEI
+ case H264_SEI_TYPE_PIC_TIMING: // Picture timing SEI
ret = decode_picture_timing(&h->picture_timing, gb, ps, logctx);
break;
- case SEI_TYPE_USER_DATA_REGISTERED:
+ case H264_SEI_TYPE_USER_DATA_REGISTERED:
ret = decode_registered_user_data(h, gb, logctx, size);
break;
- case SEI_TYPE_USER_DATA_UNREGISTERED:
+ case H264_SEI_TYPE_USER_DATA_UNREGISTERED:
ret = decode_unregistered_user_data(&h->unregistered, gb, logctx, size);
break;
- case SEI_TYPE_RECOVERY_POINT:
+ case H264_SEI_TYPE_RECOVERY_POINT:
ret = decode_recovery_point(&h->recovery_point, gb);
break;
- case SEI_TYPE_BUFFERING_PERIOD:
+ case H264_SEI_TYPE_BUFFERING_PERIOD:
ret = decode_buffering_period(&h->buffering_period, gb, ps, logctx);
break;
- case SEI_TYPE_FRAME_PACKING:
+ case H264_SEI_TYPE_FRAME_PACKING:
ret = decode_frame_packing_arrangement(&h->frame_packing, gb);
break;
- case SEI_TYPE_DISPLAY_ORIENTATION:
+ case H264_SEI_TYPE_DISPLAY_ORIENTATION:
ret = decode_display_orientation(&h->display_orientation, gb);
break;
- case SEI_TYPE_GREEN_METADATA:
+ case H264_SEI_TYPE_GREEN_METADATA:
ret = decode_green_metadata(&h->green_metadata, gb);
break;
- case SEI_TYPE_ALTERNATIVE_TRANSFER:
+ case H264_SEI_TYPE_ALTERNATIVE_TRANSFER:
ret = decode_alternative_transfer(&h->alternative_transfer, gb);
break;
default:
diff --git a/libavcodec/h264_sei.h b/libavcodec/h264_sei.h
index 5f5d895e89..8cad5ea997 100644
--- a/libavcodec/h264_sei.h
+++ b/libavcodec/h264_sei.h
@@ -25,31 +25,32 @@
* SEI message types
*/
typedef enum {
- SEI_TYPE_BUFFERING_PERIOD = 0, ///< buffering period (H.264, D.1.1)
- SEI_TYPE_PIC_TIMING = 1, ///< picture timing
- SEI_TYPE_USER_DATA_REGISTERED = 4, ///< registered user data as specified by Rec. ITU-T T.35
- SEI_TYPE_USER_DATA_UNREGISTERED = 5, ///< unregistered user data
- SEI_TYPE_RECOVERY_POINT = 6, ///< recovery point (frame # to decoder sync)
- SEI_TYPE_FRAME_PACKING = 45, ///< frame packing arrangement
- SEI_TYPE_DISPLAY_ORIENTATION = 47, ///< display orientation
- SEI_TYPE_GREEN_METADATA = 56, ///< GreenMPEG information
- SEI_TYPE_ALTERNATIVE_TRANSFER = 147, ///< alternative transfer
-} SEI_Type;
+ H264_SEI_TYPE_BUFFERING_PERIOD = 0, ///< buffering period (H.264, D.1.1)
+ H264_SEI_TYPE_PIC_TIMING = 1, ///< picture timing
+ H264_SEI_TYPE_FILLER_PAYLOAD = 3, ///< filler data
+ H264_SEI_TYPE_USER_DATA_REGISTERED = 4, ///< registered user data as specified by Rec. ITU-T T.35
+ H264_SEI_TYPE_USER_DATA_UNREGISTERED = 5, ///< unregistered user data
+ H264_SEI_TYPE_RECOVERY_POINT = 6, ///< recovery point (frame # to decoder sync)
+ H264_SEI_TYPE_FRAME_PACKING = 45, ///< frame packing arrangement
+ H264_SEI_TYPE_DISPLAY_ORIENTATION = 47, ///< display orientation
+ H264_SEI_TYPE_GREEN_METADATA = 56, ///< GreenMPEG information
+ H264_SEI_TYPE_ALTERNATIVE_TRANSFER = 147, ///< alternative transfer
+} H264_SEI_Type;
/**
* pic_struct in picture timing SEI message
*/
typedef enum {
- SEI_PIC_STRUCT_FRAME = 0, ///< 0: %frame
- SEI_PIC_STRUCT_TOP_FIELD = 1, ///< 1: top field
- SEI_PIC_STRUCT_BOTTOM_FIELD = 2, ///< 2: bottom field
- SEI_PIC_STRUCT_TOP_BOTTOM = 3, ///< 3: top field, bottom field, in that order
- SEI_PIC_STRUCT_BOTTOM_TOP = 4, ///< 4: bottom field, top field, in that order
- SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5, ///< 5: top field, bottom field, top field repeated, in that order
- SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, ///< 6: bottom field, top field, bottom field repeated, in that order
- SEI_PIC_STRUCT_FRAME_DOUBLING = 7, ///< 7: %frame doubling
- SEI_PIC_STRUCT_FRAME_TRIPLING = 8 ///< 8: %frame tripling
-} SEI_PicStructType;
+ H264_SEI_PIC_STRUCT_FRAME = 0, ///< 0: %frame
+ H264_SEI_PIC_STRUCT_TOP_FIELD = 1, ///< 1: top field
+ H264_SEI_PIC_STRUCT_BOTTOM_FIELD = 2, ///< 2: bottom field
+ H264_SEI_PIC_STRUCT_TOP_BOTTOM = 3, ///< 3: top field, bottom field, in that order
+ H264_SEI_PIC_STRUCT_BOTTOM_TOP = 4, ///< 4: bottom field, top field, in that order
+ H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5, ///< 5: top field, bottom field, top field repeated, in that order
+ H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, ///< 6: bottom field, top field, bottom field repeated, in that order
+ H264_SEI_PIC_STRUCT_FRAME_DOUBLING = 7, ///< 7: %frame doubling
+ H264_SEI_PIC_STRUCT_FRAME_TRIPLING = 8 ///< 8: %frame tripling
+} H264_SEI_PicStructType;
/**
* frame_packing_arrangement types
@@ -66,7 +67,7 @@ typedef enum {
typedef struct H264SEIPictureTiming {
int present;
- SEI_PicStructType pic_struct;
+ H264_SEI_PicStructType pic_struct;
/**
* Bit set of clock types for fields/frames in picture timing SEI message.
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index ebff7b33e3..2577edd8a6 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1150,37 +1150,37 @@ static int h264_export_frame_props(H264Context *h)
if (sps->pic_struct_present_flag && h->sei.picture_timing.present) {
H264SEIPictureTiming *pt = &h->sei.picture_timing;
switch (pt->pic_struct) {
- case SEI_PIC_STRUCT_FRAME:
+ case H264_SEI_PIC_STRUCT_FRAME:
break;
- case SEI_PIC_STRUCT_TOP_FIELD:
- case SEI_PIC_STRUCT_BOTTOM_FIELD:
+ case H264_SEI_PIC_STRUCT_TOP_FIELD:
+ case H264_SEI_PIC_STRUCT_BOTTOM_FIELD:
cur->f->interlaced_frame = 1;
break;
- case SEI_PIC_STRUCT_TOP_BOTTOM:
- case SEI_PIC_STRUCT_BOTTOM_TOP:
+ case H264_SEI_PIC_STRUCT_TOP_BOTTOM:
+ case H264_SEI_PIC_STRUCT_BOTTOM_TOP:
if (FIELD_OR_MBAFF_PICTURE(h))
cur->f->interlaced_frame = 1;
else
// try to flag soft telecine progressive
cur->f->interlaced_frame = h->prev_interlaced_frame;
break;
- case SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
- case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
+ case H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
+ case H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
/* Signal the possibility of telecined film externally
* (pic_struct 5,6). From these hints, let the applications
* decide if they apply deinterlacing. */
cur->f->repeat_pict = 1;
break;
- case SEI_PIC_STRUCT_FRAME_DOUBLING:
+ case H264_SEI_PIC_STRUCT_FRAME_DOUBLING:
cur->f->repeat_pict = 2;
break;
- case SEI_PIC_STRUCT_FRAME_TRIPLING:
+ case H264_SEI_PIC_STRUCT_FRAME_TRIPLING:
cur->f->repeat_pict = 4;
break;
}
if ((pt->ct_type & 3) &&
- pt->pic_struct <= SEI_PIC_STRUCT_BOTTOM_TOP)
+ pt->pic_struct <= H264_SEI_PIC_STRUCT_BOTTOM_TOP)
cur->f->interlaced_frame = (pt->ct_type & (1 << 1)) != 0;
} else {
/* Derive interlacing flag from used decoding process. */
@@ -1195,8 +1195,8 @@ static int h264_export_frame_props(H264Context *h)
if (sps->pic_struct_present_flag && h->sei.picture_timing.present) {
/* Use picture timing SEI information. Even if it is a
* information of a past frame, better than nothing. */
- if (h->sei.picture_timing.pic_struct == SEI_PIC_STRUCT_TOP_BOTTOM ||
- h->sei.picture_timing.pic_struct == SEI_PIC_STRUCT_TOP_BOTTOM_TOP)
+ if (h->sei.picture_timing.pic_struct == H264_SEI_PIC_STRUCT_TOP_BOTTOM ||
+ h->sei.picture_timing.pic_struct == H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP)
cur->f->top_field_first = 1;
else
cur->f->top_field_first = 0;
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 90c7f7e3cc..549867ef3f 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -644,18 +644,18 @@ static void vaapi_encode_h264_write_sei(PutBitContext *pbc,
for (payload_type = 0; payload_type < 64; payload_type++) {
switch (payload_type) {
- case SEI_TYPE_BUFFERING_PERIOD:
+ case H264_SEI_TYPE_BUFFERING_PERIOD:
if (!priv->send_timing_sei ||
pic->type != PICTURE_TYPE_IDR)
continue;
write_payload = &vaapi_encode_h264_write_buffering_period;
break;
- case SEI_TYPE_PIC_TIMING:
+ case H264_SEI_TYPE_PIC_TIMING:
if (!priv->send_timing_sei)
continue;
write_payload = &vaapi_encode_h264_write_pic_timing;
break;
- case SEI_TYPE_USER_DATA_UNREGISTERED:
+ case H264_SEI_TYPE_USER_DATA_UNREGISTERED:
if (pic->encode_order != 0)
continue;
write_payload = &vaapi_encode_h264_write_identifier;
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 22eaeb0a60..eba6cc672f 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -1599,7 +1599,7 @@ static int copy_replace_length_codes(
remaining_dst_size--;
wrote_bytes = write_sei(sei,
- SEI_TYPE_USER_DATA_REGISTERED,
+ H264_SEI_TYPE_USER_DATA_REGISTERED,
dst_data,
remaining_dst_size);
@@ -1655,7 +1655,7 @@ static int copy_replace_length_codes(
return status;
wrote_bytes = write_sei(sei,
- SEI_TYPE_USER_DATA_REGISTERED,
+ H264_SEI_TYPE_USER_DATA_REGISTERED,
new_sei,
remaining_dst_size - old_sei_length);
if (wrote_bytes < 0)
@@ -1751,7 +1751,7 @@ static int vtenc_cm_to_avpacket(
if (sei) {
size_t msg_size = get_sei_msg_bytes(sei,
- SEI_TYPE_USER_DATA_REGISTERED);
+ H264_SEI_TYPE_USER_DATA_REGISTERED);
sei_nalu_size = sizeof(start_code) + 1 + msg_size + 1;
}