@@ -1106,19 +1106,21 @@ static int FUNC(slice_header)(CodedBitstreamContext *ctx, RWContext *rw,
if (pps->bottom_field_pic_order_in_frame_present_flag &&
!current->field_pic_flag)
se(delta_pic_order_cnt_bottom, INT32_MIN + 1, INT32_MAX);
+ else
+ infer(delta_pic_order_cnt_bottom, 0);
+ } else
+ infer(delta_pic_order_cnt_bottom, 0);
- } else if (sps->pic_order_cnt_type == 1) {
- if (!sps->delta_pic_order_always_zero_flag) {
- se(delta_pic_order_cnt[0], INT32_MIN + 1, INT32_MAX);
- if (pps->bottom_field_pic_order_in_frame_present_flag &&
- !current->field_pic_flag)
- se(delta_pic_order_cnt[1], INT32_MIN + 1, INT32_MAX);
- else
- infer(delta_pic_order_cnt[1], 0);
- } else {
- infer(delta_pic_order_cnt[0], 0);
+ if (sps->pic_order_cnt_type == 1 && !sps->delta_pic_order_always_zero_flag) {
+ se(delta_pic_order_cnt[0], INT32_MIN + 1, INT32_MAX);
+ if (pps->bottom_field_pic_order_in_frame_present_flag &&
+ !current->field_pic_flag)
+ se(delta_pic_order_cnt[1], INT32_MIN + 1, INT32_MAX);
+ else
infer(delta_pic_order_cnt[1], 0);
- }
+ } else {
+ infer(delta_pic_order_cnt[0], 0);
+ infer(delta_pic_order_cnt[1], 0);
}
if (pps->redundant_pic_cnt_present_flag)
Also change the syntax for some checks, to more closely follow the spec. Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/cbs_h264_syntax_template.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)