[FFmpeg-devel] a64 encoder

Diego Biurrun diego
Mon Jan 19 17:07:50 CET 2009


On Mon, Jan 19, 2009 at 04:42:38PM +0100, Bitbreaker/METALVOTZE wrote:
>> is your code better then our elbg ? if so replace elbg.c/h by it
>> if its worse you should use elbg.c/h (possibly with adaptions in elbg to
>> handle the small number of colors)
>
> elbg code is used now, as it is way faster at similar quality. So code  
> size shrank again, and i am happy to present the third iteration :-)
>
> --- libavcodec/a64ecmcharset.h	(Revision 0)
> +++ libavcodec/a64ecmcharset.h	(Revision 0)
> @@ -0,0 +1,297 @@
> +
> +#ifndef A64ECMCHARSET_INCLUDED
> +#define A64ECMCHARSET_INCLUDED

This is not our style of multiple inclusion guard.

> +#endif

Please add a comment here.

> --- libavcodec/a64multi.c	(Revision 0)
> +++ libavcodec/a64multi.c	(Revision 0)
> @@ -0,0 +1,248 @@
> +
> +static void bgr_to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest, int maxsteps)

That's a loooong line.

> +    for(blocky=0;blocky<height && blocky<C64YRES;blocky+=8) {
> +        for(blockx=0;blockx<width && blockx<C64XRES;blockx+=8) {
> +            for(y=0;y<8 && blocky+y<C64YRES; y++) {
> +                for(x=0;x<8 && blockx+x<C64XRES;x+=2) {
> +                    switch(avctx->pix_fmt) {
> +                        case PIX_FMT_BGR24:
> +                            luma=p->data[0][(blockx+x+(blocky+y)*width)*3+2]*0.11+
> +                                 p->data[0][(blockx+x+(blocky+y)*width)*3+1]*0.59+
> +                                 p->data[0][(blockx+x+(blocky+y)*width)*3+0]*0.30;

K&R style is preferred.

Diego




More information about the ffmpeg-devel mailing list