[FFmpeg-devel] [PATCH] Huffyuv speed tweaks

Vitor Sessak vitor1001
Sat Aug 9 06:01:24 CEST 2008


Jason Garrett-Glaser wrote:
> $subj, faster decoding pixel prediction.
> 
> Dark Shikari
> 
> Index: libavcodec/huffyuv.c
> ===================================================================
> --- libavcodec/huffyuv.c	(revision 14661)
> +++ libavcodec/huffyuv.c	(working copy)
> @@ -131,17 +131,23 @@
>      return acc;
> @@ -155,9 +161,12 @@
>      lt= *left_top;
> 
>      for(i=0; i<w; i++){
> -        l= mid_pred(l, src1[i], (l + src1[i] - lt)&0xFF) + diff[i];
> -        lt= src1[i];
> -        dst[i]= l;
> +        l= mid_pred(l, *src1, (l + *src1 - lt)&0xFF) + *diff;
> +        lt= *src1;
> +        *dst= l;
> +        src1++;
> +        dst++;
> +        diff++;
>      }

When compiling add_median_predition() as a non-inline function with gcc 
4.2.3 this optimization gives in the same code as the original function. 
  Are you sure it is not still the case as an inline function?

(actually I'm interested on this because I have undone a few such 
optimizations in my ra_* cleanup)

-Vitor




More information about the ffmpeg-devel mailing list