[FFmpeg-devel] [Ffmpeg-devel] [PATCH] HD DVD subtitle decoding

Michael Niedermayer michaelni
Tue Jul 17 20:44:59 CEST 2007


Hi

On Tue, Jul 17, 2007 at 03:41:47PM +0100, Ian Caulfield wrote:
> On 17/07/07, Michael Niedermayer <michaelni at gmx.at> wrote:
> >
> >
> >> -static int get_nibble(const uint8_t *buf, int nibble_offset)
> >> +static int decode_run_2bit(GetBitContext *gb, int *color)
> >>  {
> >> -    return (buf[nibble_offset >> 1] >> ((1 - (nibble_offset & 1)) <<
> >2)) & 0xf;
> >> +    unsigned int v;
> >> +
> >> +    v = get_bits(gb, 4);
> >> +    if (v < 0x4) {
> >> +        v = (v << 4) | get_bits(gb, 4);
> >> +        if (v < 0x10) {
> >> +            v = (v << 4) | get_bits(gb, 4);
> >> +            if (v < 0x040) {
> >> +                v = (v << 4) | get_bits(gb, 4);
> >> +            }
> >> +        }
> >> +    }
> >
> >v=0;
> >for(t=1; v < t && t<=0x40; t<<=2)
> >    v= (v<<4) | get_bits(gb, 4);
> 
> 
> Nice, patch updated to use your version
> 
> 
> [...]
> >> -                /* set palette */
> >> +                /* set colormap */
> >>                  if ((buf_size - pos) < 2)
> >>                      goto fail;
> >> -                palette[3] = buf[pos] >> 4;
> >> -                palette[2] = buf[pos] & 0x0f;
> >> -                palette[1] = buf[pos + 1] >> 4;
> >> -                palette[0] = buf[pos + 1] & 0x0f;
> >> +                colormap[3] = buf[pos] >> 4;
> >> +                colormap[2] = buf[pos] & 0x0f;
> >> +                colormap[1] = buf[pos + 1] >> 4;
> >> +                colormap[0] = buf[pos + 1] & 0x0f;
> >>                  pos += 2;
> >
> >variable renamings are cosmetic and must be in a seperate patch from
> >functional changes
> 
> 
> OK, now split into three patches:
> 
> - colormap.patch: rename "palette" to "colormap" when it's referring to the
> mapping from a 2-bit encoded color to a 4-bit index into the DVD palette

ok


> - hd-dvdsub-newer.patch: add HD-DVD subpicture decoding

ok


> - cosmetic.patch: reindent two lines

ok


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070717/0013ba59/attachment.pgp>



More information about the ffmpeg-devel mailing list