[FFmpeg-devel] [PATCH] h.264: derive pict_type from slice_type

Reinhard Nissl rnissl
Sun Nov 18 23:18:26 CET 2007


compared to the current implementation the attached version works like that:
- for the first slice, pict_type is set to slice_type as before, but
slice_type SI_TYPE and SP_TYPE are folded to I_TYPE and P_TYPE.
- for any further slice, pict_type is changed to the folded slice_type
when the latter uses more prediction (e. g. a B slice) than the current
pict_type (e. g. a I picture).
- slice_type is only derived for frame pictures or the first field of
field picture pairs. When the second field would be considered too, my
samples would almost never yield pict_type = I_TYPE as they most often
use I slices for the first field and P slices for the second field.

The patched version yields the following results for my samples (which
heavily switch between frame and field pictures) in the IDR and non-IDR

    IDR: I P B B B P B B B ...
non-IDR: I B B B P B B B ...

Although the final result seems to be correct when slice_type varies
within one field or frame, it is not ready when it is used in the call
to frame_start(), which happens for the first slice of a frame picture
or the first field picture. But in that case it works equally good to
the original code.

Dipl.-Inform. (FH) Reinhard Nissl
mailto:rnissl at gmx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h264-derive_pict_type.diff
Type: text/x-patch
Size: 1259 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071118/f529f971/attachment.bin>

More information about the ffmpeg-devel mailing list