• Ezequiel Garcia's avatar
    media: uapi: h264: Clean slice invariants syntax elements · d9358563
    Ezequiel Garcia authored
    The H.264 specification requires in section 7.4.3 "Slice header semantics",
    that the following values shall be the same in all slice headers:
    
      pic_parameter_set_id
      frame_num
      field_pic_flag
      bottom_field_flag
      idr_pic_id
      pic_order_cnt_lsb
      delta_pic_order_cnt_bottom
      delta_pic_order_cnt[ 0 ]
      delta_pic_order_cnt[ 1 ]
      sp_for_switch_flag
      slice_group_change_cycle
    
    These bitstream fields are part of the slice header, and therefore
    passed redundantly on each slice. The purpose of the redundancy
    is to make the codec fault-tolerant in network scenarios.
    
    This is of course not needed to be reflected in the V4L2 controls,
    given the bitstream has already been parsed by applications.
    Therefore, move the redundant fields to the per-frame decode
    parameters control (DECODE_PARAMS).
    
    Field 'pic_parameter_set_id' is simply removed in this case,
    because the PPS control must currently contain the active PPS.
    
    Syntax elements dec_ref_pic_marking() and those related
    to pic order count, remain invariant as well, and therefore,
    the fields dec_ref_pic_marking_bit_size and pic_order_cnt_bit_size
    are also common to all slices.
    Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
    Reviewed-by: default avatarNicolas Dufresne <nicolas.dufresne@collabora.com>
    Tested-by: default avatarJonas Karlman <jonas@kwiboo.se>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    d9358563
v4l2-ctrls.c 135 KB