aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cbs_h264_syntax_template.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2018-05-07 23:33:08 +0100
committerMark Thompson <sw@jkqxz.net>2018-05-10 23:54:01 +0100
commitd94dda742c8eab3141197270fb78063ed22442aa (patch)
tree7f42a384376ae69061a6bf0414b5ad8c69a95d80 /libavcodec/cbs_h264_syntax_template.c
parent9d375e114ac240ccff77d75724f6bc0e2210a1ba (diff)
downloadffmpeg-d94dda742c8eab3141197270fb78063ed22442aa.tar.gz
cbs_h264: Add support for pan-scan rectangle SEI messages
Diffstat (limited to 'libavcodec/cbs_h264_syntax_template.c')
-rw-r--r--libavcodec/cbs_h264_syntax_template.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
index b789207e33..fb1685e6e6 100644
--- a/libavcodec/cbs_h264_syntax_template.c
+++ b/libavcodec/cbs_h264_syntax_template.c
@@ -626,6 +626,30 @@ static int FUNC(sei_pic_timing)(CodedBitstreamContext *ctx, RWContext *rw,
return 0;
}
+static int FUNC(sei_pan_scan_rect)(CodedBitstreamContext *ctx, RWContext *rw,
+ H264RawSEIPanScanRect *current)
+{
+ int err, i;
+
+ ue(pan_scan_rect_id, 0, UINT32_MAX - 1);
+ flag(pan_scan_rect_cancel_flag);
+
+ if (!current->pan_scan_rect_cancel_flag) {
+ ue(pan_scan_cnt_minus1, 0, 2);
+
+ for (i = 0; i <= current->pan_scan_cnt_minus1; i++) {
+ ses(pan_scan_rect_left_offset[i], INT32_MIN + 1, INT32_MAX, 1, i);
+ ses(pan_scan_rect_right_offset[i], INT32_MIN + 1, INT32_MAX, 1, i);
+ ses(pan_scan_rect_top_offset[i], INT32_MIN + 1, INT32_MAX, 1, i);
+ ses(pan_scan_rect_bottom_offset[i], INT32_MIN + 1, INT32_MAX, 1, i);
+ }
+
+ ue(pan_scan_rect_repetition_period, 0, 16384);
+ }
+
+ return 0;
+}
+
static int FUNC(sei_user_data_registered)(CodedBitstreamContext *ctx, RWContext *rw,
H264RawSEIUserDataRegistered *current,
uint32_t *payload_size)
@@ -737,6 +761,10 @@ static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(sei_pic_timing)
(ctx, rw, &current->payload.pic_timing));
break;
+ case H264_SEI_TYPE_PAN_SCAN_RECT:
+ CHECK(FUNC(sei_pan_scan_rect)
+ (ctx, rw, &current->payload.pan_scan_rect));
+ break;
case H264_SEI_TYPE_FILLER_PAYLOAD:
{
for (i = 0; i < current->payload_size; i++)