[FFmpeg-devel] [PATCH] Escape 124 (RPL) decoder
Michael Niedermayer
michaelni
Fri Mar 28 13:03:33 CET 2008
On Thu, Mar 27, 2008 at 10:18:37PM -0700, Eli Friedman wrote:
> On Thu, Mar 27, 2008 at 8:49 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
[...]
> > [...]
> > > +static uint32_t rice_decode(GetBitContext* gb) {
> > > + uint32_t more_bits, value;
> > > +
> > > + more_bits = get_bits1(gb);
> > > + value = more_bits;
> > > + if (!more_bits)
> > > + return value;
> > > +
> > > + more_bits = get_bits(gb, 3);
> > > + value += more_bits;
> > > + if (more_bits != (1 << 3) - 1)
> > > + return value;
> > > +
> > > + more_bits = get_bits(gb, 7);
> > > + value += more_bits;
> > > + if (more_bits != (1 << 7) - 1)
> > > + return value;
> > > +
> > > + more_bits = get_bits(gb, 12);
> > > + value += more_bits;
> > > + return value;
> > > +}
> >
> > This can be simplified, also why is it called rice?
>
> The person who wrote up the bitstream description for this codec
> called it RICE_Decode; do you have a better suggestion?
vlc_decode(), not really the best name either but at least it is not outright
wrong.
>
> > Why this odd decode into these weird arrays and then copy into the frame
> > with the above function? IMHO decode one superblock and then copy that into
> > the frame.
>
> Would you prefer the code to insert the macroblocks as it generates them?
Yes, or to hava a single superblock be build and then copied. The idea
here is that a superlock does fit in the L1 cache, a frame does not.
>
> That'll mean I have to figure out how to keep around the previous
> frame... what's the preferred way to do that? Decode into a private
> buffer and memcpy the result into the returned frame?
Just keep the previous AVFrame in the context.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I wish the Xiph folks would stop pretending they've got something they
do not. Somehow I fear this will remain a wish. -- M?ns Rullg?rd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080328/c7a538ee/attachment.pgp>
More information about the ffmpeg-devel
mailing list