aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cbs_h264_syntax_template.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-06-26 20:12:57 -0300
committerJames Almer <jamrial@gmail.com>2024-06-28 13:16:57 -0300
commit826f55d5b3dd3895caf5aeb4da5458cd2f80e192 (patch)
tree6fbf8a828fd0650fdd75da30692db5861e2b20b3 /libavcodec/cbs_h264_syntax_template.c
parent0cb733d276477185d2983005851e92c0bf9946e0 (diff)
downloadffmpeg-826f55d5b3dd3895caf5aeb4da5458cd2f80e192.tar.gz
avcodec/cbs_sei: add support for Frame Packing Arrangement SEI parsing
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/cbs_h264_syntax_template.c')
-rw-r--r--libavcodec/cbs_h264_syntax_template.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
index 4d2d303722..9d0386c24d 100644
--- a/libavcodec/cbs_h264_syntax_template.c
+++ b/libavcodec/cbs_h264_syntax_template.c
@@ -801,6 +801,40 @@ SEI_FUNC(film_grain_characteristics, (CodedBitstreamContext *ctx, RWContext *rw,
return 0;
}
+SEI_FUNC(sei_frame_packing_arrangement, (CodedBitstreamContext *ctx, RWContext *rw,
+ H264RawSEIFramePackingArrangement *current,
+ SEIMessageState *sei))
+{
+ int err;
+
+ HEADER("Frame Packing Arrangement");
+
+ ue(frame_packing_arrangement_id, 0, MAX_UINT_BITS(31));
+ flag(frame_packing_arrangement_cancel_flag);
+ if (!current->frame_packing_arrangement_cancel_flag) {
+ u(7, frame_packing_arrangement_type, 0, 7);
+ flag(quincunx_sampling_flag);
+ u(6, content_interpretation_type, 0, 2);
+ flag(spatial_flipping_flag);
+ flag(frame0_flipped_flag);
+ flag(field_views_flag);
+ flag(current_frame_is_frame0_flag);
+ flag(frame0_self_contained_flag);
+ flag(frame1_self_contained_flag);
+ if (!current->quincunx_sampling_flag && current->frame_packing_arrangement_type != 5) {
+ ub(4, frame0_grid_position_x);
+ ub(4, frame0_grid_position_y);
+ ub(4, frame1_grid_position_x);
+ ub(4, frame1_grid_position_y);
+ }
+ fixed(8, frame_packing_arrangement_reserved_byte, 0);
+ ue(frame_packing_arrangement_repetition_period, 0, 16384);
+ }
+ flag(frame_packing_arrangement_extension_flag);
+
+ return 0;
+}
+
SEI_FUNC(sei_display_orientation, (CodedBitstreamContext *ctx, RWContext *rw,
H264RawSEIDisplayOrientation *current,
SEIMessageState *sei))