[FFmpeg-devel] [Patch] QT RLE encoder, bis

Alexis Ballier alexis.ballier
Tue Jun 26 23:49:26 CEST 2007


Hi,

> [...]
> > +/**
> > + * Computes the best RLE sequence for a line
> > + */
> > +static void qtrle_dump_line(QtrleEncContext *s, AVFrame *p, int line, uint8_t **buf)
>
> encode_line() or something else without "dump" seems to be a better name
> dump reminds me of dumping the thing as a hex values to stderr


renamed to qtrle_encode_line


> > +        total_skip_cost = (s->length_table[i+skipcount] + 2);
>
> superflous ()
>

*cough* those () were really useless and stupid :)


> > +            total_bulk_cost = s->length_table[i+1] + temp_cost;
> > +            bulkcount  = 1;
> > +
> > +            for(j=2;j<=limit;j++){
> > +                temp_cost += s->pixel_size;
> > +                if(s->length_table[i+j] + temp_cost < total_bulk_cost){
> > +                    /* We have found a better bulk copy ... */
> > +                    total_bulk_cost = s->length_table[i+j] + temp_cost;
> > +                    bulkcount = j;
> > +                }
> > +            }
>
> the loop could begin with j=1 and total_bulk_cost could be set to INT_MAX
> that would avoid the bulkcount  = 1


that's better & cleaner indeed


> > +    bytestream_put_be32(&buf, 0);                     // CHUNK SIZE, patched later
> > +
>
> trailing whitespace is forbidden in svn

Hmmm I thought I had been careful about this, probably not that much,
fixed anyway


Regards,

Alexis.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtrle_encoder_try3.patch
Type: text/x-patch
Size: 13928 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070626/e3639a1d/attachment.bin>



More information about the ffmpeg-devel mailing list