[FFmpeg-devel] BFI video decoder

Sisir Koppaka sisir.koppaka
Fri Apr 18 00:09:05 CEST 2008


Updated patch attached.

On Fri, Apr 18, 2008 at 3:30 AM, Michael Niedermayer <michaelni at gmx.at>
wrote:

> On Fri, Apr 18, 2008 at 03:25:59AM +0530, Sisir Koppaka wrote:
> > Updated patch attached
> >
> > On Fri, Apr 18, 2008 at 3:12 AM, Michael Niedermayer <michaelni at gmx.at>
> [...]
> > >
> > > [...]
> > > > +    uint8_t *src, *dst_offset, *frame_end = bfi->dst + avctx->width
> *
> > > avctx->height, colour1, colour2;
> > > [...]
> > > > +        unsigned int byte = *buf++, code = byte >> 6, length = byte
> &
> > > ~0xC0, offset;
> > >
> > > These would be more readable if they where not on a single line.
> > >
> > Done
> [...]
> > +    /* Set frame parameters and palette, if necessary */
> > +    if (!avctx->frame_number) {
> > +        bfi->frame.pict_type = FF_I_TYPE;
> > +        bfi->frame.key_frame = 1;
> > +        /* Setting the palette */
> > +        if(avctx->extradata_size>768) {
> > +            av_log(NULL, AV_LOG_ERROR, "Palette is too large.\n");
> > +            return -1;
> > +        }
> > +        pal = (uint32_t *) bfi->frame.data[1];
> > +        for (i = 0; i < avctx->extradata_size / 3; i++) {
> > +            int shift = 16;
> > +            *pal = 0;
> > +            for (j = 0; j < 3; j++, shift -= 8)
> > +                *pal +=
> > +                    ((avctx->extradata[i * 3 + j] << 2) |
> > +                    (avctx->extradata[i * 3 + j] >> 4)) << shift;
> > +            pal++;
> > +        }
> > +        bfi->frame.palette_has_changed = 1;
> > +    } else {
> > +        bfi->frame.pict_type = FF_P_TYPE;
> > +        bfi->frame.key_frame = 0;
> > +    }
> > +
> > +    buf += 4; //Unpacked size, not required.
> > +
>
> trailing whitespace
>
Removed

>
>
> > +    while (dst != frame_end) {
> > +        static const uint8_t lentab[4]={0,2,0,1};
> > +        unsigned int byte = *buf++, offset;
>
> > +        unsigned int code = byte >> 6, length = byte & ~0xC0;
>
> that would be more readable on 2 lines
>
Split the line

>
>
> > +
> > +        /* Get length and offset(if required) */
> > +        if (length == 0) {
> > +            if (code == 1) {
> > +                length = bytestream_get_byte(&buf);
> > +                offset = bytestream_get_le16(&buf);
> > +            } else {
> > +                length = bytestream_get_le16(&buf);
>
> > +                if (code == 2 && length == 0) {
> > +                    break;
> > +                }
>
> superflous {}
>
Removed


-----------------
Sisir Koppaka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfi_video_decoder_02.patch
Type: text/x-diff
Size: 7489 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080418/fcd956d6/attachment.patch>



More information about the ffmpeg-devel mailing list