[Ffmpeg-devel] Re: [RFC] mpeg2 422 encoding.

Baptiste COUDURIER baptiste.coudurier
Sun Apr 2 18:05:24 CEST 2006


Michael Niedermayer wrote:
> [...]
> these are wrong, the following is correct
> if (!s->chroma_y_shift) {
>     put_bits(&s->pb, mbPatTable[cbp>>2][1], mbPatTable[cbp>>2][0]);
>     put_bits(&s->pb, 2, cbp & 3);
> }else
>     put_bits(&s->pb, mbPatTable[cbp][1], mbPatTable[cbp][0]);
> also note that the whole 422 encoding support must not slow the much more
> common 420 down by a "meassureable" amount

Indeed, you always fix things up. It is now working great.
Here is the patch, if you see anything I have forgotten (probably many).

I did not add 444 support, does anybody need that anyway ? And since
speed is really important... If it becomes needed I will implement it.

According to specs, I think 422 interlaced dct coding needs to be
different from 420. Chroma should not be treated as frame :

>From ISO 13818-2 2000:
"In the case of chrominance blocks the structure depends upon the
chrominance format that is being used. In the case
of 4:2:2 and 4:4:4 formats (where there are two blocks in the vertical
dimension of the macroblock) the chrominance
blocks are treated in exactly the same manner as the luminance blocks.
However, in the 4:2:0 format the chrominance
blocks shall always be organised in frame structure for the purposes of
DCT coding. It should, however, be noted
that field based predictions may be made for these blocks which will, in
the general case, require that predictions for
8 ? 4 regions (after half-sample filtering) must be made."

Am I right ?

codec_score needs to be changed for trellis quant.

Is it acceptable to be applied ? I will add regression tests for 422
encoding. Regression tests for 420 are sucessful.

Second patch is to fix vis_mb_type on 422 content.

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mpeg2_422.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060402/ec794531/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mpeg2_422_vis_fix.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060402/ec794531/attachment.asc>

More information about the ffmpeg-devel mailing list