[FFmpeg-devel] [PATCH] H.264 Predictive Lossless (profile_idc 244) support
Jason Garrett-Glaser
darkshikari
Sat Aug 9 08:45:21 CEST 2008
This patch is quite ugly and clearly not ready to be committed, but I
am not entirely sure what the best way to factor it appropriately is,
so I'm submitting it here for review. I assume that some of the
functions I have implemented already exist somewhere else and can be
re-used. The if statement chain I set up is also clearly suboptimal;
its just an initial attempt, not meant to be pretty.
This patch adds support for High 4:4:4 Predictive profile (only for
the existing 4:2:0 colorspace, of course). The prediction is
lossless-only, with transform_bypass. This is rather tricky for a
number of reasons:
1. With pixel prediction, the intra prediction step comes *after* the
iDCT instead of before.
2. With pixel prediction, you're iDCTing into an *empty block* (since
pixel prediction comes after iDCT instead of before); normally, in
H.264, this never happens. As a result, the block has to be zeroed
beforehand, since the frame data is not zeroed by default.
3. The pixel prediction only occurs with horizontal and vertical
intra modes; no others. It occurs in i4x4, i8x8, and i16x16
partitions, both in luma and chroma accordingly. All other intra
modes are the same as before.
This patch is my initial attempt at this; it correctly decodes the
following reference clip as far as I can tell:
http://mirror05.x264.nl/Dark/force.php?file=./h264_predictive_lossless.h264
(this clip is an encode of the canonical "soccer.yuv" CIF clip)
Note that this reference clip is itself generated by a prototype build
of x264 that supports predictive lossless mode; I know of no other
encoder (or decoder!) that supports this mode correctly, including the
JM itself. CoreAVC and DivX have promised support, however. If
someone does know of any (en|de)coder that currently supports this
profile, please point me to it so I can further test both the encoder
and decoder version of this patch. I consider this somewhat important
because I intend to replace x264's current lossless mode (High 4:4:4,
which has been officially removed from the H.264 standard) with the
new predictive lossless mode as soon as is reasonable.
Dark Shikari
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h264_predictive_lossless.diff
Type: text/x-diff
Size: 9899 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080809/b82d9606/attachment.diff>
More information about the ffmpeg-devel
mailing list