[FFmpeg-devel] [PATCH] Electronic Arts MAD Decoder

Peter Ross pross
Mon Jun 8 04:06:53 CEST 2009


Updated patch enclosed. Thanks to Diego and Reimar for the review.

On Sun, Jun 07, 2009 at 11:53:38AM +0200, Reimar D?ffinger wrote:
> On Sun, Jun 07, 2009 at 04:24:59PM +1000, Peter Ross wrote:
> 
> except that I think your code is wrong and you should be using
> ref_linesize for the ref_y offset.

Well spotted.

> 
> > +        OPEN_READER(re, &s->gb);
> > +        /* now quantify & encode AC coefficients */
> > +        for(;;) {
> > +            UPDATE_CACHE(re, &s->gb);
> 
> I know a lot of codecs use it, but is using this extremely lowlevel API
> really the best way to do? Seems to me like it will result in a lot of
> buggy an badly maintainable code.

The bulk of this is plagarised from mpeg12.c. Whereas the previous EA TQI
codec used the MPEG-1 intra coefficient encoding method, for MAD the
authors have changed the coding for the escaped RL values.

So I have left this verbose low-level code in with a comment. Suggestions
on how to better reuse the code without bloat are welcome.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mad-decoder-r104.diff
Type: text/x-diff
Size: 13389 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090608/2c98c33b/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090608/2c98c33b/attachment.pgp>



More information about the ffmpeg-devel mailing list