[Ffmpeg-devel] [PATCH] dead code elimination

Måns Rullgård mans
Mon Feb 26 01:46:38 CET 2007


Aurelien Jacobs <aurel at gnuage.org> writes:

> On Sat, 24 Feb 2007 18:35:48 +0100
> Michael Niedermayer <michaelni at gmx.at> wrote:
>
>> Hi
>> 
>> On Sat, Feb 24, 2007 at 02:05:24PM -0300, ramiro at lisha.ufsc.br wrote:
>> > Dead since r1029
>> 
>> rejected, resurrect and benchmark it rather
>
> I've just benchmarked it on amd64. For this, I've just disabled SIMD and
> used START/STOP_TIMER around idctRowCondDC().
> Results without FAST_64BIT:
>   567 dezicycles in fast64bits, 1048564 runs, 12 skips
> with #define FAST_64BIT:
>   516 dezicycles in fast64bits, 1048570 runs, 6 skips
> I've repeated the test with several videos and got similar results.
>
> So defining FAST_64BIT on amd64 (and probably other 64bits arch) is
> definitely a win.
> I guess I should commit attached patch ?
>
> Aurel
>
> Index: configure
> ===================================================================
> --- configure	(revision 8129)
> +++ configure	(working copy)
> @@ -600,6 +600,7 @@
>      dev_video_bktr_ioctl_bt848_h
>      dlfcn_h
>      dlopen
> +    fast_64bit
>      fast_cmov
>      freetype2
>      imlib2

OK.

> @@ -957,6 +958,7 @@
>      if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
>        if [ -z "`echo $CFLAGS | grep -- -m32`"  ]; then
>          arch="x86_64"
> +        enable fast_64bit
>        fi
>      fi
>    ;;

Not OK.  This should be set for all 64-bit CPUs we currently have
special settings for.  These include Alpha, PPC64, and Sparc64.  We
don't seem to have any specific checks for MIPS64, a patch to rectify
this would of course be welcome.

> Index: libavcodec/simple_idct.c
> ===================================================================
> --- libavcodec/simple_idct.c	(revision 8129)
> +++ libavcodec/simple_idct.c	(working copy)
> @@ -78,13 +78,13 @@
>  static inline void idctRowCondDC (DCTELEM * row)
>  {
>          int a0, a1, a2, a3, b0, b1, b2, b3;
> -#ifdef FAST_64BIT
> +#ifdef HAVE_FAST_64BIT
>          uint64_t temp;
>  #else
>          uint32_t temp;
>  #endif
>  
> -#ifdef FAST_64BIT
> +#ifdef HAVE_FAST_64BIT
>  #ifdef WORDS_BIGENDIAN
>  #define ROW0_MASK 0xffff000000000000LL
>  #else
> @@ -146,7 +146,7 @@
>          MUL16(b3, W7, row[1]);
>          MAC16(b3, -W5, row[3]);
>  
> -#ifdef FAST_64BIT
> +#ifdef HAVE_FAST_64BIT
>          temp = ((uint64_t*)row)[1];
>  #else
>          temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3];

OK.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list