[Ffmpeg-devel] Intel IPP

Tomas Christiansson tomas.christiansson
Tue Nov 15 15:09:35 CET 2005


not really sure, but here's a try

------------------------------------------------------------------------
----------
diff -u dsputil_mmx.c
--- libavcodec/i386/dsputil_mmx.c       28 Oct 2005 07:54:03 -0000
1.1.2.1
+++ libavcodec/i386/dsputil_mmx.c       15 Nov 2005 14:05:43 -0000
@@ -25,6 +25,10 @@
 #include "../mpegvideo.h"
 #include "mmx.h"

+#ifdef HAVE_IPP
+#include "ipp.h"
+#endif
+
 //#undef NDEBUG
 //#include <assert.h>

@@ -2561,6 +2565,28 @@
 }
 #endif

+#ifdef HAVE_IPP
+static void idct_ipp(DCTELEM *block)
+{
+   ippiDCT8x8Inv_Video_16s_C1I(block);
+}
+static void idct_ipp_put(uint8_t *dest, int line_size, DCTELEM *block)
+{
+     ippiDCT8x8Inv_Video_16s8u_C1R(block, dest, line_size);
+}
+static void idct_ipp_add(uint8_t *dest, int line_size, DCTELEM *block)
+{
+    ippiDCT8x8Inv_Video_16s_C1I(block);
+    add_pixels_clamped_mmx(block, dest, line_size);
+}
+
+static void clear_blocks_ipp(DCTELEM *block)
+{
+  ippsZero_16s(block, 6*64);
+}
+
+#endif
+
 void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
 {
     mm_flags = mm_support();
@@ -2644,6 +2670,13 @@
                     c->idct    = ff_idct_xvid_mmx;
                 }
 #endif
+
+#ifdef HAVE_IPP
+            }else if(idct_algo==FF_IDCT_IPP){
+                c->idct_put= idct_ipp_put;
+                c->idct_add= idct_ipp_add;
+                c->idct    = idct_ipp;
+#endif
             }
         }

@@ -2655,6 +2688,9 @@
         c->put_signed_pixels_clamped = put_signed_pixels_clamped_mmx;
         c->add_pixels_clamped = add_pixels_clamped_mmx;
         c->clear_blocks = clear_blocks_mmx;
+#ifdef HAVE_IPP
+        c->clear_blocks = clear_blocks_ipp;
+#endif //HAVE_IPP
 #ifdef CONFIG_ENCODERS
         c->pix_sum = pix_sum16_mmx;
 #endif //CONFIG_ENCODERS

------------------------------------------------------------------------
----------
diff -u configure
--- configure   28 Oct 2005 07:54:02 -0000      1.1.2.1
+++ configure   15 Nov 2005 14:05:43 -0000
@@ -85,6 +85,7 @@
 echo "  --disable-decoders       disables all decoders"
 echo "  --disable-muxers         disables all muxers"
 echo "  --disable-demuxers       disables all demuxers"
+echo "  --enable-ipp=PATH        enable ipp with include path=PATH"
 echo ""
 echo "NOTE: Object files are built at the place where configure is
launched."
 exit 1
@@ -240,6 +241,7 @@
 memalignhack="no"
 muxers="yes"
 demuxers="yes"
+ipp="no"

 # OS specific
 targetos=`uname -s`
@@ -578,6 +580,9 @@
   ;;
   --disable-demuxers) demuxers="no"
   ;;
+  --enable-ipp=*) CFLAGS="$CFLAGS -I${opt#--enable-ipp=}"
+    ipp="yes"
+  ;;
   *)
   echo "Unknown option \"$opt\"."
   echo "See $0 --help for available options."
@@ -1264,6 +1269,9 @@
 if test "$network" = "yes" ; then
 echo "IPv6 support         $ipv6"
 fi
+if test $ipp = "yes"; then
+echo "IPP enabled      $ipp"
+fi
 if test "$gpl" = "no" ; then
 echo "License: LGPL"
 else
@@ -1775,6 +1783,10 @@
     echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
     echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
 done
+
+if test "$ipp" = "yes" ; then
+  echo "#define HAVE_IPP 1" >> $TMPH
+fi

 diff $TMPH config.h >/dev/null 2>&1
 if test $? -ne 0 ; then
------------------------------------------------------------------------
----------

> -----Original Message-----
> From: ffmpeg-devel-bounces at mplayerhq.hu 
> [mailto:ffmpeg-devel-bounces at mplayerhq.hu] On Behalf Of 
> Guillaume Poirier
> Sent: den 15 november 2005 14:57
> To: FFMpeg development discussions and patches
> Subject: Re: [Ffmpeg-devel] Intel IPP
> 
> 
> Tomas Christiansson wrote:
> > Hi, 
> > 
> > Yes, we tried this (for MPEG2 decompression) last week using IPP 4.0
> > (Linux) and  managed to get an 8-9% speedup of the 
> decompression (gcc
> > 3.3.4). Hopefully we'll be able to get more speedup when we 
> move up to
> > IPP version 5.0. Below, you'll find patches (for
> > 'libavcodec/i386/dsputil_mmx.c' and 'configure') from our tests..
> 
> Could you please send a unified diff? (diff -u) ?
> 
> Guillaume
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/ffmpeg-devel
> 





More information about the ffmpeg-devel mailing list