• Andreas Rheinhardt's avatar
    h264_mp4toannexb: Try to avoid four byte startcodes · 518bbe9e
    Andreas Rheinhardt authored
    According to the H.264 specifications, the only NAL units that need to
    have four byte startcodes in H.264 Annex B format are SPS/PPS units and
    units that start a new access unit. Before af7e953a, the first of these
    conditions wasn't upheld as already existing in-band parameter sets
    would not automatically be written with a four byte startcode, but only
    when they already were at the beginning of their input packets. But it
    made four byte startcodes be used too often as every unit that is written
    together with a parameter set that is inserted from extradata received a
    four byte startcode although a three byte start code would suffice
    unless the unit itself were a parameter set.
    
    FATE has been updated to reflect the changes. Although the patch leaves
    the extradata unchanged, the size of the extradata according to the FATE
    reports changes. This is due to a quirk in ff_h2645_packet_split which
    is used by extract_extradata: If the input is Annex B, the first zero of
    a four byte startcode is considered a part of the last unit (if any).
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    518bbe9e
h264_mp4toannexb_ticket5927 1.2 KB