+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;
+}
+