diff -urN DirectFB-1.1.1.orig/configure DirectFB-1.1.1/configure
--- DirectFB-1.1.1.orig/configure	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/configure	2007-12-18 11:36:10.000000000 +0000
@@ -27504,7 +27504,7 @@
 CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
 
 
-ac_config_files="$ac_config_files directfb-config directfb.pc directfb-internal.pc directfb.spec Makefile include/Makefile include/directfb_version.h lib/Makefile lib/direct/Makefile lib/direct/build.h lib/direct/direct.pc lib/fusion/Makefile lib/fusion/build.h lib/fusion/fusion.pc lib/fusion/shm/Makefile lib/voodoo/Makefile lib/voodoo/build.h lib/voodoo/voodoo.pc patches/Makefile proxy/Makefile proxy/dispatcher/Makefile proxy/requestor/Makefile rules/Makefile src/Makefile src/core/Makefile src/display/Makefile src/gfx/Makefile src/gfx/generic/Makefile src/input/Makefile src/media/Makefile src/misc/Makefile src/windows/Makefile systems/Makefile systems/devmem/Makefile systems/fbdev/Makefile systems/x11/Makefile systems/osx/Makefile systems/sdl/Makefile systems/vnc/Makefile wm/Makefile wm/default/Makefile wm/unique/Makefile wm/unique/classes/Makefile wm/unique/data/Makefile wm/unique/devices/Makefile gfxdrivers/Makefile gfxdrivers/ati128/Makefile gfxdrivers/cle266/Makefile gfxdrivers/cyber5k/Makefile gfxdrivers/davinci/Makefile gfxdrivers/i810/Makefile gfxdrivers/i830/Makefile gfxdrivers/mach64/Makefile gfxdrivers/matrox/Makefile gfxdrivers/neomagic/Makefile gfxdrivers/nsc/Makefile gfxdrivers/nsc/include/Makefile gfxdrivers/nvidia/Makefile gfxdrivers/omap/Makefile gfxdrivers/radeon/Makefile gfxdrivers/savage/Makefile gfxdrivers/sh7722/Makefile gfxdrivers/sis315/Makefile gfxdrivers/tdfx/Makefile gfxdrivers/unichrome/Makefile gfxdrivers/vmware/Makefile inputdrivers/Makefile inputdrivers/dbox2remote/Makefile inputdrivers/dreamboxremote/Makefile inputdrivers/dynapro/Makefile inputdrivers/elo/Makefile inputdrivers/gunze/Makefile inputdrivers/h3600_ts/Makefile inputdrivers/joystick/Makefile inputdrivers/keyboard/Makefile inputdrivers/linux_input/Makefile inputdrivers/lirc/Makefile inputdrivers/mutouch/Makefile inputdrivers/penmount/Makefile inputdrivers/ps2mouse/Makefile inputdrivers/serialmouse/Makefile inputdrivers/sonypi/Makefile inputdrivers/tslib/Makefile inputdrivers/ucb1x00_ts/Makefile inputdrivers/wm97xx_ts/Makefile interfaces/Makefile interfaces/IDirectFBFont/Makefile interfaces/IDirectFBImageProvider/Makefile interfaces/IDirectFBImageProvider/mpeg2/Makefile interfaces/IDirectFBVideoProvider/Makefile data/Makefile tests/Makefile tools/Makefile docs/Makefile docs/dfbg.1 docs/directfb-csource.1 docs/directfbrc.5 docs/html/Makefile"
+ac_config_files="$ac_config_files directfb-config directfb.pc directfb-internal.pc directfb.spec Makefile include/Makefile include/directfb_version.h lib/Makefile lib/direct/Makefile lib/direct/build.h lib/direct/direct.pc lib/fusion/Makefile lib/fusion/build.h lib/fusion/fusion.pc lib/fusion/shm/Makefile lib/voodoo/Makefile lib/voodoo/build.h lib/voodoo/voodoo.pc patches/Makefile proxy/Makefile proxy/dispatcher/Makefile proxy/requestor/Makefile rules/Makefile src/Makefile src/core/Makefile src/display/Makefile src/gfx/Makefile src/gfx/generic/Makefile src/input/Makefile src/media/Makefile src/misc/Makefile src/windows/Makefile systems/Makefile systems/devmem/Makefile systems/fbdev/Makefile systems/x11/Makefile systems/osx/Makefile systems/sdl/Makefile systems/vnc/Makefile wm/Makefile wm/default/Makefile wm/unique/Makefile wm/unique/classes/Makefile wm/unique/data/Makefile wm/unique/devices/Makefile gfxdrivers/Makefile gfxdrivers/ati128/Makefile gfxdrivers/cle266/Makefile gfxdrivers/cyber5k/Makefile gfxdrivers/davinci/Makefile gfxdrivers/i810/Makefile gfxdrivers/i830/Makefile gfxdrivers/mach64/Makefile gfxdrivers/matrox/Makefile gfxdrivers/neomagic/Makefile gfxdrivers/nsc/Makefile gfxdrivers/nsc/include/Makefile gfxdrivers/nvidia/Makefile gfxdrivers/omap/Makefile gfxdrivers/radeon/Makefile gfxdrivers/savage/Makefile gfxdrivers/sh7722/Makefile gfxdrivers/sis315/Makefile gfxdrivers/tdfx/Makefile gfxdrivers/unichrome/Makefile gfxdrivers/vmware/Makefile inputdrivers/Makefile inputdrivers/dbox2remote/Makefile inputdrivers/dreamboxremote/Makefile inputdrivers/dynapro/Makefile inputdrivers/elo/Makefile inputdrivers/gunze/Makefile inputdrivers/h3600_ts/Makefile inputdrivers/joystick/Makefile inputdrivers/keyboard/Makefile inputdrivers/linux_input/Makefile inputdrivers/lirc/Makefile inputdrivers/mutouch/Makefile inputdrivers/penmount/Makefile inputdrivers/ps2mouse/Makefile inputdrivers/serialmouse/Makefile inputdrivers/sonypi/Makefile inputdrivers/tslib/Makefile inputdrivers/ucb1x00_ts/Makefile inputdrivers/wm97xx_ts/Makefile interfaces/Makefile interfaces/IDirectFBFont/Makefile interfaces/IDirectFBImageProvider/Makefile interfaces/IDirectFBVideoProvider/Makefile data/Makefile tests/Makefile tools/Makefile docs/Makefile docs/dfbg.1 docs/directfb-csource.1 docs/directfbrc.5 docs/html/Makefile"
 
 ac_config_commands="$ac_config_commands default"
 
@@ -28644,7 +28644,6 @@
     "interfaces/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/Makefile" ;;
     "interfaces/IDirectFBFont/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/IDirectFBFont/Makefile" ;;
     "interfaces/IDirectFBImageProvider/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/IDirectFBImageProvider/Makefile" ;;
-    "interfaces/IDirectFBImageProvider/mpeg2/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/IDirectFBImageProvider/mpeg2/Makefile" ;;
     "interfaces/IDirectFBVideoProvider/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/IDirectFBVideoProvider/Makefile" ;;
     "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
@@ -29799,7 +29798,7 @@
 Building Image Provider Modules:
   GIF                       $enable_gif
   JPEG                      $JPEG
-  MPEG2 I-Frame             yes
+  MPEG2 I-Frame             no
   PNG                       $PNG
 
 Building Video Provider Modules:
@@ -29854,7 +29853,7 @@
 Building Image Provider Modules:
   GIF                       $enable_gif
   JPEG                      $JPEG
-  MPEG2 I-Frame             yes
+  MPEG2 I-Frame             no
   PNG                       $PNG
 
 Building Video Provider Modules:
diff -urN DirectFB-1.1.1.orig/configure.in DirectFB-1.1.1/configure.in
--- DirectFB-1.1.1.orig/configure.in	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/configure.in	2007-12-18 11:36:19.000000000 +0000
@@ -1574,7 +1574,6 @@
 interfaces/Makefile
 interfaces/IDirectFBFont/Makefile
 interfaces/IDirectFBImageProvider/Makefile
-interfaces/IDirectFBImageProvider/mpeg2/Makefile
 interfaces/IDirectFBVideoProvider/Makefile
 
 data/Makefile
@@ -1637,7 +1636,7 @@
 Building Image Provider Modules:
   GIF                       $enable_gif 
   JPEG                      $JPEG
-  MPEG2 I-Frame             yes
+  MPEG2 I-Frame             no
   PNG                       $PNG
 
 Building Video Provider Modules:
diff -urN DirectFB-1.1.1.orig/directfb-config.in DirectFB-1.1.1/directfb-config.in
--- DirectFB-1.1.1.orig/directfb-config.in	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/directfb-config.in	2007-12-18 11:35:08.000000000 +0000
@@ -172,9 +172,6 @@
             ;;
           gif)
             ;;
-          mpeg2)
-            echo_imageprovider="$echo_imageprovider -lm"
-            ;;
         esac
       done
 
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/idirectfbimageprovider_mpeg2.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/idirectfbimageprovider_mpeg2.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/idirectfbimageprovider_mpeg2.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/idirectfbimageprovider_mpeg2.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,361 +0,0 @@
-/*
-   (c) Copyright 2001-2007  The DirectFB Organization (directfb.org)
-   (c) Copyright 2000-2004  Convergence (integrated media) GmbH
-
-   All rights reserved.
-
-   Written by Denis Oliver Kropp <dok@directfb.org>,
-              Andreas Hundt <andi@fischlustig.de>,
-              Sven Neumann <neo@directfb.org>,
-              Ville Syrjälä <syrjala@sci.fi> and
-              Claudio Ciccani <klan@users.sf.net>.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.
-*/
-
-#include <config.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdarg.h>
-
-#include <directfb.h>
-
-#include <display/idirectfbsurface.h>
-
-#include <media/idirectfbimageprovider.h>
-
-#include <core/coredefs.h>
-#include <core/coretypes.h>
-
-#include <core/layers.h>
-#include <core/palette.h>
-#include <core/surface.h>
-
-#include <misc/gfx_util.h>
-#include <direct/interface.h>
-#include <direct/mem.h>
-#include <misc/util.h>
-
-#include "mpeg2/mpeg2dec.h"
-
-static DFBResult
-Probe( IDirectFBImageProvider_ProbeContext *ctx );
-
-static DFBResult
-Construct( IDirectFBImageProvider *thiz,
-           ... );
-
-#include <direct/interface_implementation.h>
-
-DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBImageProvider, MPEG2 )
-
-
-enum {
-     STAGE_ERROR = -1,
-     STAGE_START =  0,
-     STAGE_INFO,
-     STAGE_IMAGE,
-     STAGE_END
-};
-
-/*
- * private data struct of IDirectFBImageProvider_MPEG2
- */
-typedef struct {
-     int                  ref;      /* reference counter */
-     IDirectFBDataBuffer *buffer;
-
-     MPEG2_Decoder       *dec;
-
-     int                  stage;
-
-     int                  width;
-     int                  height;
-
-     u32                 *image;
-
-     CoreDFB             *core;
-} IDirectFBImageProvider_MPEG2_data;
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_AddRef  ( IDirectFBImageProvider *thiz );
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_Release ( IDirectFBImageProvider *thiz );
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_RenderTo( IDirectFBImageProvider *thiz,
-                                       IDirectFBSurface       *destination,
-                                       const DFBRectangle     *destination_rect );
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_SetRenderCallback( IDirectFBImageProvider *thiz,
-                                                DIRenderCallback        callback,
-                                                void                   *context );
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_GetSurfaceDescription( IDirectFBImageProvider *thiz,
-                                                    DFBSurfaceDescription  *dsc );
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_GetImageDescription( IDirectFBImageProvider *thiz,
-                                                  DFBImageDescription    *dsc );
-
-
-static int  mpeg2_read_func ( void *buf, int count, void *ctx );
-static void mpeg2_write_func( int x, int y, u32 argb, void *ctx );
-
-static DFBResult
-Probe( IDirectFBImageProvider_ProbeContext *ctx )
-{
-     unsigned char *sig = (unsigned char*) ctx->header;
-
-     if (sig[0] == 0x00 && sig[1] == 0x00 && sig[2] == 0x01 && sig[3] == 0xb3)
-          return DFB_OK;
-
-     return DFB_UNSUPPORTED;
-}
-
-static DFBResult
-Construct( IDirectFBImageProvider *thiz,
-           ... )
-{
-     DFBResult ret = DFB_FAILURE;
-     IDirectFBDataBuffer *buffer;
-     CoreDFB             *core;
-     va_list              tag;
-
-     DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBImageProvider_MPEG2)
-
-     va_start( tag, thiz );
-     buffer = va_arg( tag, IDirectFBDataBuffer * );
-     core = va_arg( tag, CoreDFB * );
-     va_end( tag );
-       
-     data->ref    = 1;
-     data->buffer = buffer;
-     data->core   = core;
-
-     /* Increase the data buffer reference counter. */
-     buffer->AddRef( buffer );
-
-     /* Initialize mpeg2 decoding. */
-     data->dec = MPEG2_Init( mpeg2_read_func, buffer, &data->width, &data->height );
-     if (!data->dec)
-          goto error;
-
-     data->stage = STAGE_INFO;
-
-     /* Allocate image data. */
-     data->image = D_MALLOC( data->width * data->height * 4 );
-     if (!data->image)
-          goto error;
-
-     data->stage = STAGE_IMAGE;
-
-     thiz->AddRef = IDirectFBImageProvider_MPEG2_AddRef;
-     thiz->Release = IDirectFBImageProvider_MPEG2_Release;
-     thiz->RenderTo = IDirectFBImageProvider_MPEG2_RenderTo;
-     thiz->SetRenderCallback = IDirectFBImageProvider_MPEG2_SetRenderCallback;
-     thiz->GetImageDescription = IDirectFBImageProvider_MPEG2_GetImageDescription;
-     thiz->GetSurfaceDescription =
-                              IDirectFBImageProvider_MPEG2_GetSurfaceDescription;
-
-     return DFB_OK;
-
-error:
-     if (data->dec)
-          MPEG2_Close(data->dec);
-
-     buffer->Release( buffer );
-
-     DIRECT_DEALLOCATE_INTERFACE(thiz);
-
-     return ret;
-}
-
-static void
-IDirectFBImageProvider_MPEG2_Destruct( IDirectFBImageProvider *thiz )
-{
-     IDirectFBImageProvider_MPEG2_data *data =
-                              (IDirectFBImageProvider_MPEG2_data*)thiz->priv;
-
-     MPEG2_Close(data->dec);
-
-     /* Decrease the data buffer reference counter. */
-     data->buffer->Release( data->buffer );
-
-     /* Deallocate image data. */
-     if (data->image)
-          D_FREE( data->image );
-
-     DIRECT_DEALLOCATE_INTERFACE( thiz );
-}
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_AddRef( IDirectFBImageProvider *thiz )
-{
-     DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_MPEG2)
-
-     data->ref++;
-
-     return DFB_OK;
-}
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_Release( IDirectFBImageProvider *thiz )
-{
-     DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_MPEG2)
-
-     if (--data->ref == 0)
-          IDirectFBImageProvider_MPEG2_Destruct( thiz );
-
-     return DFB_OK;
-}
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_RenderTo( IDirectFBImageProvider *thiz,
-                                       IDirectFBSurface       *destination,
-                                       const DFBRectangle     *dest_rect )
-{
-     DFBResult              ret;
-     IDirectFBSurface_data *dst_data;
-     CoreSurface           *dst_surface;
-     DFBRegion              clip;
-     DFBRectangle           rect;
-
-     DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_MPEG2)
-
-     dst_data = (IDirectFBSurface_data*) destination->priv;
-     if (!dst_data)
-          return DFB_DEAD;
-
-     dst_surface = dst_data->surface;
-     if (!dst_surface)
-          return DFB_DESTROYED;
-
-     dfb_region_from_rectangle( &clip, &dst_data->area.current );
-
-     if (dest_rect) {
-          if (dest_rect->w < 1 || dest_rect->h < 1)
-               return DFB_INVARG;
-          rect = *dest_rect;
-          rect.w += dst_data->area.wanted.w;
-          rect.h += dst_data->area.wanted.h;
-     }
-     else {
-          rect = dst_data->area.wanted;
-     }
-
-     switch (data->stage) {
-          case STAGE_END:
-               break;
-          case STAGE_IMAGE:
-               if (MPEG2_Decode( data->dec, mpeg2_write_func, data )) {
-                    data->stage = STAGE_ERROR;
-                    return DFB_FAILURE;
-               }
-               data->stage = STAGE_END;
-               break;
-          default:
-               return DFB_FAILURE;
-     }
-
-     /* actual rendering */
-     if (dfb_rectangle_region_intersects( &rect, &clip )) {
-          CoreSurfaceBufferLock lock;
-
-          ret = dfb_surface_lock_buffer( dst_surface, CSBR_BACK, CSAF_CPU_WRITE, &lock );
-          if (ret)
-               return ret;
-
-          dfb_scale_linear_32( data->image, data->width, data->height,
-                               lock.addr, lock.pitch, &rect, dst_surface, &clip );
-
-          dfb_surface_unlock_buffer( dst_surface, &lock );
-     }
-
-     return DFB_OK;
-}
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_SetRenderCallback( IDirectFBImageProvider *thiz,
-                                                DIRenderCallback        callback,
-                                                void                   *context )
-{
-     return DFB_UNIMPLEMENTED;
-}
-
-/* Loading routines */
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_GetSurfaceDescription( IDirectFBImageProvider *thiz,
-                                                    DFBSurfaceDescription *dsc )
-{
-     DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_MPEG2)
-
-     dsc->flags       = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
-     dsc->width       = data->width;
-     dsc->height      = data->height;
-     dsc->pixelformat = dfb_primary_layer_pixelformat();
-
-     return DFB_OK;
-}
-
-static DFBResult
-IDirectFBImageProvider_MPEG2_GetImageDescription( IDirectFBImageProvider *thiz,
-                                                  DFBImageDescription    *dsc )
-{
-     DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_MPEG2)
-
-     if (!dsc)
-          return DFB_INVARG;
-
-     dsc->caps = DICAPS_NONE;
-
-     return DFB_OK;
-}
-
-/******************************************************************************/
-
-static int
-mpeg2_read_func( void *buf, int count, void *ctx )
-{
-     unsigned int         len;
-     DFBResult            ret;
-     IDirectFBDataBuffer *buffer = (IDirectFBDataBuffer*) ctx;
-
-     buffer->WaitForData( buffer, 1 );
-
-     ret = buffer->GetData( buffer, count, buf, &len );
-     if (ret)
-          return 0;
-
-     return len;
-}
-
-static void
-mpeg2_write_func( int x, int y, u32 argb, void *ctx )
-{
-     IDirectFBImageProvider_MPEG2_data *data =
-                                       (IDirectFBImageProvider_MPEG2_data*) ctx;
-
-     data->image[ data->width * y + x ] = argb;
-}
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/Makefile.am DirectFB-1.1.1/interfaces/IDirectFBImageProvider/Makefile.am
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/Makefile.am	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/Makefile.am	2007-12-18 11:33:48.000000000 +0000
@@ -1,6 +1,6 @@
 ## Makefile.am for DirectFB/interfaces/IDirectFBImageProvider
 
-SUBDIRS = mpeg2
+SUBDIRS = 
 
 idirectfbimageproviderdir = $(MODULEDIR)/interfaces/IDirectFBImageProvider
 
@@ -33,7 +33,6 @@
 
 idirectfbimageprovider_LTLIBRARIES = \
 	libidirectfbimageprovider_dfiff.la	\
-	libidirectfbimageprovider_mpeg2.la	\
 	$(GIF_PROVIDER_LTLIB)			\
 	$(JPEG_PROVIDER_LTLIB)			\
 	$(PNG_PROVIDER_LTLIB)
@@ -52,16 +51,6 @@
 
 libidirectfbimageprovider_png_la_LDFLAGS = -avoid-version -module
 
-
-libidirectfbimageprovider_mpeg2_la_SOURCES = idirectfbimageprovider_mpeg2.c
-
-libidirectfbimageprovider_mpeg2_la_LIBADD = \
-	$(top_builddir)/src/libdirectfb.la \
-	mpeg2/libmpeg2decode.la
-
-libidirectfbimageprovider_mpeg2_la_LDFLAGS = -avoid-version -module
-
-
 libidirectfbimageprovider_dfiff_la_SOURCES = idirectfbimageprovider_dfiff.c
 
 libidirectfbimageprovider_dfiff_la_LIBADD = \
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/Makefile.in DirectFB-1.1.1/interfaces/IDirectFBImageProvider/Makefile.in
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/Makefile.in	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/Makefile.in	2007-12-18 11:36:32.000000000 +0000
@@ -92,19 +92,6 @@
 	$(libidirectfbimageprovider_jpeg_la_LDFLAGS) $(LDFLAGS) -o $@
 @JPEG_PROVIDER_TRUE@am_libidirectfbimageprovider_jpeg_la_rpath =  \
 @JPEG_PROVIDER_TRUE@	-rpath $(idirectfbimageproviderdir)
-libidirectfbimageprovider_mpeg2_la_DEPENDENCIES =  \
-	$(top_builddir)/src/libdirectfb.la mpeg2/libmpeg2decode.la
-am_libidirectfbimageprovider_mpeg2_la_OBJECTS =  \
-	idirectfbimageprovider_mpeg2.lo
-libidirectfbimageprovider_mpeg2_la_OBJECTS =  \
-	$(am_libidirectfbimageprovider_mpeg2_la_OBJECTS)
-libidirectfbimageprovider_mpeg2_la_LINK = $(LIBTOOL) --tag=CC \
-	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
-	$(AM_CFLAGS) $(CFLAGS) \
-	$(libidirectfbimageprovider_mpeg2_la_LDFLAGS) $(LDFLAGS) -o $@
-libidirectfbimageprovider_png_la_DEPENDENCIES =  \
-	$(top_builddir)/lib/direct/libdirect.la \
-	$(top_builddir)/src/libdirectfb.la $(am__DEPENDENCIES_1)
 am_libidirectfbimageprovider_png_la_OBJECTS =  \
 	idirectfbimageprovider_png.lo
 libidirectfbimageprovider_png_la_OBJECTS =  \
@@ -130,12 +117,10 @@
 SOURCES = $(libidirectfbimageprovider_dfiff_la_SOURCES) \
 	$(libidirectfbimageprovider_gif_la_SOURCES) \
 	$(libidirectfbimageprovider_jpeg_la_SOURCES) \
-	$(libidirectfbimageprovider_mpeg2_la_SOURCES) \
 	$(libidirectfbimageprovider_png_la_SOURCES)
 DIST_SOURCES = $(libidirectfbimageprovider_dfiff_la_SOURCES) \
 	$(libidirectfbimageprovider_gif_la_SOURCES) \
 	$(libidirectfbimageprovider_jpeg_la_SOURCES) \
-	$(libidirectfbimageprovider_mpeg2_la_SOURCES) \
 	$(libidirectfbimageprovider_png_la_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
@@ -332,7 +317,7 @@
 target_vendor = @target_vendor@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = mpeg2
+SUBDIRS = 
 idirectfbimageproviderdir = $(MODULEDIR)/interfaces/IDirectFBImageProvider
 @GIF_PROVIDER_FALSE@GIF_PROVIDER_LTLIB = 
 @GIF_PROVIDER_TRUE@GIF_PROVIDER_LTLIB = libidirectfbimageprovider_gif.la
@@ -349,7 +334,6 @@
 AM_CPPFLAGS = -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\"
 idirectfbimageprovider_LTLIBRARIES = \
 	libidirectfbimageprovider_dfiff.la	\
-	libidirectfbimageprovider_mpeg2.la	\
 	$(GIF_PROVIDER_LTLIB)			\
 	$(JPEG_PROVIDER_LTLIB)			\
 	$(PNG_PROVIDER_LTLIB)
@@ -362,12 +346,6 @@
 	$(LIBPNG)
 
 libidirectfbimageprovider_png_la_LDFLAGS = -avoid-version -module
-libidirectfbimageprovider_mpeg2_la_SOURCES = idirectfbimageprovider_mpeg2.c
-libidirectfbimageprovider_mpeg2_la_LIBADD = \
-	$(top_builddir)/src/libdirectfb.la \
-	mpeg2/libmpeg2decode.la
-
-libidirectfbimageprovider_mpeg2_la_LDFLAGS = -avoid-version -module
 libidirectfbimageprovider_dfiff_la_SOURCES = idirectfbimageprovider_dfiff.c
 libidirectfbimageprovider_dfiff_la_LIBADD = \
 	$(top_builddir)/src/libdirectfb.la
@@ -452,8 +430,6 @@
 	$(libidirectfbimageprovider_gif_la_LINK) $(am_libidirectfbimageprovider_gif_la_rpath) $(libidirectfbimageprovider_gif_la_OBJECTS) $(libidirectfbimageprovider_gif_la_LIBADD) $(LIBS)
 libidirectfbimageprovider_jpeg.la: $(libidirectfbimageprovider_jpeg_la_OBJECTS) $(libidirectfbimageprovider_jpeg_la_DEPENDENCIES) 
 	$(libidirectfbimageprovider_jpeg_la_LINK) $(am_libidirectfbimageprovider_jpeg_la_rpath) $(libidirectfbimageprovider_jpeg_la_OBJECTS) $(libidirectfbimageprovider_jpeg_la_LIBADD) $(LIBS)
-libidirectfbimageprovider_mpeg2.la: $(libidirectfbimageprovider_mpeg2_la_OBJECTS) $(libidirectfbimageprovider_mpeg2_la_DEPENDENCIES) 
-	$(libidirectfbimageprovider_mpeg2_la_LINK) -rpath $(idirectfbimageproviderdir) $(libidirectfbimageprovider_mpeg2_la_OBJECTS) $(libidirectfbimageprovider_mpeg2_la_LIBADD) $(LIBS)
 libidirectfbimageprovider_png.la: $(libidirectfbimageprovider_png_la_OBJECTS) $(libidirectfbimageprovider_png_la_DEPENDENCIES) 
 	$(libidirectfbimageprovider_png_la_LINK) $(am_libidirectfbimageprovider_png_la_rpath) $(libidirectfbimageprovider_png_la_OBJECTS) $(libidirectfbimageprovider_png_la_LIBADD) $(LIBS)
 
@@ -466,7 +442,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_dfiff.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_gif.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_jpeg.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_mpeg2.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_png.Plo@am__quote@
 
 .c.o:
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getbits.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getbits.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getbits.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getbits.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,147 +0,0 @@
-/* getbits.c, bit level routines                                            */
-
-/*
- * All modifications (mpeg2decode -> mpeg2play) are
- * Copyright (C) 1996, Stefan Eckart. All Rights Reserved.
- */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "global.h"
-
-/* initialize buffer, call once before first getbits or showbits */
-
-void
-MPEG2_Initialize_Buffer(MPEG2_Decoder *dec)
-{
-     dec->Incnt = 0;
-     dec->Rdptr = dec->Rdbfr + 2048;
-     dec->Rdmax = dec->Rdptr;
-
-     dec->Bfr = 0;
-
-     MPEG2_Flush_Buffer(dec, 0); /* fills valid data into bfr */
-}
-
-void
-MPEG2_Fill_Buffer(MPEG2_Decoder *dec)
-{
-     int Buffer_Level;
-
-     Buffer_Level = dec->mpeg2_read (dec->Rdbfr, 2048, dec->mpeg2_read_ctx);
-     dec->Rdptr = dec->Rdbfr;
-
-     /* end of the bitstream file */
-     if (Buffer_Level < 2048) {
-          /* just to be safe */
-          if (Buffer_Level < 0)
-               Buffer_Level = 0;
-
-          /* pad until the next to the next 32-bit word boundary */
-          while (Buffer_Level & 3)
-               dec->Rdbfr[Buffer_Level++] = 0;
-
-          /* pad the buffer with sequence end codes */
-          while (Buffer_Level < 2048) {
-               dec->Rdbfr[Buffer_Level++] = SEQUENCE_END_CODE>>24;
-               dec->Rdbfr[Buffer_Level++] = SEQUENCE_END_CODE>>16;
-               dec->Rdbfr[Buffer_Level++] = SEQUENCE_END_CODE>>8;
-               dec->Rdbfr[Buffer_Level++] = SEQUENCE_END_CODE&0xff;
-          }
-     }
-}
-
-
-/* return next n bits (right adjusted) without advancing */
-
-unsigned int
-MPEG2_Show_Bits(MPEG2_Decoder *dec, int N)
-{
-     return dec->Bfr >> (32-N);
-}
-
-
-/* return next bit (could be made faster than MPEG2_Get_Bits(1)) */
-
-unsigned int
-MPEG2_Get_Bits1(MPEG2_Decoder *dec)
-{
-     return MPEG2_Get_Bits(dec, 1);
-}
-
-
-/* advance by n bits */
-
-void
-MPEG2_Flush_Buffer(MPEG2_Decoder *dec, int N)
-{
-     int Incnt;
-
-     dec->Bfr <<= N;
-
-     Incnt = dec->Incnt -= N;
-
-     if (Incnt <= 24) {
-          if (dec->Rdptr < dec->Rdbfr+2044) {
-               do {
-                    dec->Bfr |= *dec->Rdptr++ << (24 - Incnt);
-                    Incnt += 8;
-               }
-               while (Incnt <= 24);
-          }
-          else {
-               do {
-                    if (dec->Rdptr >= dec->Rdbfr+2048)
-                         MPEG2_Fill_Buffer(dec);
-                    dec->Bfr |= *dec->Rdptr++ << (24 - Incnt);
-                    Incnt += 8;
-               }
-               while (Incnt <= 24);
-          }
-          dec->Incnt = Incnt;
-     }
-}
-
-
-/* return next n bits (right adjusted) */
-
-unsigned int
-MPEG2_Get_Bits(MPEG2_Decoder *dec, int N)
-{
-     unsigned int Val;
-
-     Val = MPEG2_Show_Bits(dec, N);
-     MPEG2_Flush_Buffer(dec, N);
-
-     return Val;
-}
-
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getblk.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getblk.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getblk.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getblk.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,431 +0,0 @@
-/* getblk.c, DCT block decoding                                             */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-
-#include "global.h"
-
-
-/* defined in getvlc.h */
-typedef struct {
-     char run, level, len;
-} DCTtab;
-
-extern const DCTtab DCTtabfirst[],DCTtabnext[],DCTtab0[],DCTtab1[];
-extern const DCTtab DCTtab2[],DCTtab3[],DCTtab4[],DCTtab5[],DCTtab6[];
-extern const DCTtab DCTtab0a[],DCTtab1a[];
-
-
-/* decode one intra coded MPEG-1 block */
-
-void
-MPEG2_Decode_MPEG1_Intra_Block(MPEG2_Decoder *dec, int comp, int dc_dct_pred[])
-{
-     int val, i, j, sign;
-     unsigned int code;
-     const DCTtab *tab;
-     short *bp;
-
-     bp = dec->block[comp];
-
-     /* ISO/IEC 11172-2 section 2.4.3.7: Block layer. */
-     /* decode DC coefficients */
-     if (comp<4)
-          bp[0] = (dc_dct_pred[0]+=MPEG2_Get_Luma_DC_dct_diff(dec)) << 3;
-     else if (comp==4)
-          bp[0] = (dc_dct_pred[1]+=MPEG2_Get_Chroma_DC_dct_diff(dec)) << 3;
-     else
-          bp[0] = (dc_dct_pred[2]+=MPEG2_Get_Chroma_DC_dct_diff(dec)) << 3;
-
-     if (dec->Fault_Flag)
-          return;
-
-     /* D-pictures do not contain AC coefficients */
-     if (dec->picture_coding_type == D_TYPE)
-          return;
-
-     /* decode AC coefficients */
-     for (i=1; ; i++) {
-          code = MPEG2_Show_Bits(dec, 16);
-          if (code>=16384)
-               tab = &DCTtabnext[(code>>12)-4];
-          else if (code>=1024)
-               tab = &DCTtab0[(code>>8)-4];
-          else if (code>=512)
-               tab = &DCTtab1[(code>>6)-8];
-          else if (code>=256)
-               tab = &DCTtab2[(code>>4)-16];
-          else if (code>=128)
-               tab = &DCTtab3[(code>>3)-16];
-          else if (code>=64)
-               tab = &DCTtab4[(code>>2)-16];
-          else if (code>=32)
-               tab = &DCTtab5[(code>>1)-16];
-          else if (code>=16)
-               tab = &DCTtab6[code-16];
-          else {
-               if (!MPEG2_Quiet_Flag)
-                    printf("invalid Huffman code in MPEG2_Decode_MPEG1_Intra_Block()\n");
-               dec->Fault_Flag = 1;
-               return;
-          }
-
-          MPEG2_Flush_Buffer(dec, tab->len);
-
-          if (tab->run==64) /* end_of_block */
-               return;
-
-          if (tab->run==65) { /* escape */
-               i+= MPEG2_Get_Bits(dec, 6);
-
-               val = MPEG2_Get_Bits(dec, 8);
-               if (val==0)
-                    val = MPEG2_Get_Bits(dec, 8);
-               else if (val==128)
-                    val = MPEG2_Get_Bits(dec, 8) - 256;
-               else if (val>128)
-                    val -= 256;
-
-               if ((sign = (val<0)))
-                    val = -val;
-          }
-          else {
-               i+= tab->run;
-               val = tab->level;
-               sign = MPEG2_Get_Bits(dec, 1);
-          }
-
-          if (i>=64) {
-               if (!MPEG2_Quiet_Flag)
-                    fprintf(stderr,"DCT coeff index (i) out of bounds (intra)\n");
-               dec->Fault_Flag = 1;
-               return;
-          }
-
-          j = MPEG2_scan[ZIG_ZAG][i];
-          val = (val*dec->quantizer_scale*dec->intra_quantizer_matrix[j]) >> 3;
-
-          /* mismatch control ('oddification') */
-          if (val!=0) /* should always be true, but it's not guaranteed */
-               val = (val-1) | 1; /* equivalent to: if ((val&1)==0) val = val - 1; */
-
-          /* saturation */
-          if (!sign)
-               bp[j] = (val>2047) ?  2047 :  val; /* positive */
-          else
-               bp[j] = (val>2048) ? -2048 : -val; /* negative */
-     }
-}
-
-
-/* decode one non-intra coded MPEG-1 block */
-
-void
-MPEG2_Decode_MPEG1_Non_Intra_Block(MPEG2_Decoder *dec, int comp)
-{
-     int val, i, j, sign;
-     unsigned int code;
-     const DCTtab *tab;
-     short *bp;
-
-     bp = dec->block[comp];
-
-     /* decode AC coefficients */
-     for (i=0; ; i++) {
-          code = MPEG2_Show_Bits(dec, 16);
-          if (code>=16384) {
-               if (i==0)
-                    tab = &DCTtabfirst[(code>>12)-4];
-               else
-                    tab = &DCTtabnext[(code>>12)-4];
-          }
-          else if (code>=1024)
-               tab = &DCTtab0[(code>>8)-4];
-          else if (code>=512)
-               tab = &DCTtab1[(code>>6)-8];
-          else if (code>=256)
-               tab = &DCTtab2[(code>>4)-16];
-          else if (code>=128)
-               tab = &DCTtab3[(code>>3)-16];
-          else if (code>=64)
-               tab = &DCTtab4[(code>>2)-16];
-          else if (code>=32)
-               tab = &DCTtab5[(code>>1)-16];
-          else if (code>=16)
-               tab = &DCTtab6[code-16];
-          else {
-               if (!MPEG2_Quiet_Flag)
-                    printf("invalid Huffman code in MPEG2_Decode_MPEG1_Non_Intra_Block()\n");
-               dec->Fault_Flag = 1;
-               return;
-          }
-
-          MPEG2_Flush_Buffer(dec, tab->len);
-
-          if (tab->run==64) /* end_of_block */
-               return;
-
-          if (tab->run==65) { /* escape */
-               i+= MPEG2_Get_Bits(dec, 6);
-
-               val = MPEG2_Get_Bits(dec, 8);
-               if (val==0)
-                    val = MPEG2_Get_Bits(dec, 8);
-               else if (val==128)
-                    val = MPEG2_Get_Bits(dec, 8) - 256;
-               else if (val>128)
-                    val -= 256;
-
-               if ((sign = (val<0)))
-                    val = -val;
-          }
-          else {
-               i+= tab->run;
-               val = tab->level;
-               sign = MPEG2_Get_Bits(dec, 1);
-          }
-
-          if (i>=64) {
-               if (!MPEG2_Quiet_Flag)
-                    fprintf(stderr,"DCT coeff index (i) out of bounds (inter)\n");
-               dec->Fault_Flag = 1;
-               return;
-          }
-
-          j = MPEG2_scan[ZIG_ZAG][i];
-          val = (((val<<1)+1)*dec->quantizer_scale*dec->non_intra_quantizer_matrix[j]) >> 4;
-
-          /* mismatch control ('oddification') */
-          if (val!=0) /* should always be true, but it's not guaranteed */
-               val = (val-1) | 1; /* equivalent to: if ((val&1)==0) val = val - 1; */
-
-          /* saturation */
-          if (!sign)
-               bp[j] = (val>2047) ?  2047 :  val; /* positive */
-          else
-               bp[j] = (val>2048) ? -2048 : -val; /* negative */
-     }
-}
-
-
-/* decode one intra coded MPEG-2 block */
-
-void
-MPEG2_Decode_MPEG2_Intra_Block(MPEG2_Decoder *dec, int comp, int dc_dct_pred[])
-{
-     int val, i, j, sign, nc, cc, run;
-     unsigned int code;
-     const DCTtab *tab;
-     short *bp;
-     int *qmat;
-
-     bp = dec->block[comp];
-
-     cc = (comp<4) ? 0 : (comp&1)+1;
-
-     qmat = (comp<4 || dec->chroma_format==CHROMA420)
-            ? dec->intra_quantizer_matrix
-            : dec->chroma_intra_quantizer_matrix;
-
-     /* ISO/IEC 13818-2 section 7.2.1: decode DC coefficients */
-     if (cc==0)
-          val = (dc_dct_pred[0]+= MPEG2_Get_Luma_DC_dct_diff(dec));
-     else if (cc==1)
-          val = (dc_dct_pred[1]+= MPEG2_Get_Chroma_DC_dct_diff(dec));
-     else
-          val = (dc_dct_pred[2]+= MPEG2_Get_Chroma_DC_dct_diff(dec));
-
-     if (dec->Fault_Flag)
-          return;
-
-     bp[0] = val << (3-dec->intra_dc_precision);
-
-     nc=0;
-
-     /* decode AC coefficients */
-     for (i=1; ; i++) {
-          code = MPEG2_Show_Bits(dec, 16);
-          if (code>=16384 && !dec->intra_vlc_format)
-               tab = &DCTtabnext[(code>>12)-4];
-          else if (code>=1024) {
-               if (dec->intra_vlc_format)
-                    tab = &DCTtab0a[(code>>8)-4];
-               else
-                    tab = &DCTtab0[(code>>8)-4];
-          }
-          else if (code>=512) {
-               if (dec->intra_vlc_format)
-                    tab = &DCTtab1a[(code>>6)-8];
-               else
-                    tab = &DCTtab1[(code>>6)-8];
-          }
-          else if (code>=256)
-               tab = &DCTtab2[(code>>4)-16];
-          else if (code>=128)
-               tab = &DCTtab3[(code>>3)-16];
-          else if (code>=64)
-               tab = &DCTtab4[(code>>2)-16];
-          else if (code>=32)
-               tab = &DCTtab5[(code>>1)-16];
-          else if (code>=16)
-               tab = &DCTtab6[code-16];
-          else {
-               if (!MPEG2_Quiet_Flag)
-                    printf("invalid Huffman code in MPEG2_Decode_MPEG2_Intra_Block()\n");
-               dec->Fault_Flag = 1;
-               return;
-          }
-
-          MPEG2_Flush_Buffer(dec, tab->len);
-
-          if (tab->run==64) { /* end_of_block */
-               return;
-          }
-
-          if (tab->run==65) { /* escape */
-               i+= run = MPEG2_Get_Bits(dec, 6);
-
-               val = MPEG2_Get_Bits(dec, 12);
-               if ((val&2047)==0) {
-                    if (!MPEG2_Quiet_Flag)
-                         printf("invalid escape in MPEG2_Decode_MPEG2_Intra_Block()\n");
-                    dec->Fault_Flag = 1;
-                    return;
-               }
-               if ((sign = (val>=2048)))
-                    val = 4096 - val;
-          }
-          else {
-               i+= run = tab->run;
-               val = tab->level;
-               sign = MPEG2_Get_Bits(dec, 1);
-          }
-
-          if (i>=64) {
-               if (!MPEG2_Quiet_Flag)
-                    fprintf(stderr,"DCT coeff index (i) out of bounds (intra2)\n");
-               dec->Fault_Flag = 1;
-               return;
-          }
-
-          j = MPEG2_scan[dec->alternate_scan][i];
-          val = (val * dec->quantizer_scale * qmat[j]) >> 4;
-          bp[j] = sign ? -val : val;
-          nc++;
-     }
-}
-
-
-/* decode one non-intra coded MPEG-2 block */
-
-void
-MPEG2_Decode_MPEG2_Non_Intra_Block(MPEG2_Decoder *dec, int comp)
-{
-     int val, i, j, sign, nc, run;
-     unsigned int code;
-     const DCTtab *tab;
-     short *bp;
-     int *qmat;
-
-     bp = dec->block[comp];
-
-     qmat = (comp<4 || dec->chroma_format==CHROMA420)
-            ? dec->non_intra_quantizer_matrix
-            : dec->chroma_non_intra_quantizer_matrix;
-
-     nc = 0;
-
-     /* decode AC coefficients */
-     for (i=0; ; i++) {
-          code = MPEG2_Show_Bits(dec, 16);
-          if (code>=16384) {
-               if (i==0)
-                    tab = &DCTtabfirst[(code>>12)-4];
-               else
-                    tab = &DCTtabnext[(code>>12)-4];
-          }
-          else if (code>=1024)
-               tab = &DCTtab0[(code>>8)-4];
-          else if (code>=512)
-               tab = &DCTtab1[(code>>6)-8];
-          else if (code>=256)
-               tab = &DCTtab2[(code>>4)-16];
-          else if (code>=128)
-               tab = &DCTtab3[(code>>3)-16];
-          else if (code>=64)
-               tab = &DCTtab4[(code>>2)-16];
-          else if (code>=32)
-               tab = &DCTtab5[(code>>1)-16];
-          else if (code>=16)
-               tab = &DCTtab6[code-16];
-          else {
-               if (!MPEG2_Quiet_Flag)
-                    printf("invalid Huffman code in MPEG2_Decode_MPEG2_Non_Intra_Block()\n");
-               dec->Fault_Flag = 1;
-               return;
-          }
-
-          MPEG2_Flush_Buffer(dec, tab->len);
-
-          if (tab->run==64) { /* end_of_block */
-               return;
-          }
-
-          if (tab->run==65) { /* escape */
-               i+= run = MPEG2_Get_Bits(dec, 6);
-
-               val = MPEG2_Get_Bits(dec, 12);
-               if ((val&2047)==0) {
-                    if (!MPEG2_Quiet_Flag)
-                         printf("invalid escape in MPEG2_Decode_MPEG2_Intra_Block()\n");
-                    dec->Fault_Flag = 1;
-                    return;
-               }
-               if ((sign = (val>=2048)))
-                    val = 4096 - val;
-          }
-          else {
-               i+= run = tab->run;
-               val = tab->level;
-               sign = MPEG2_Get_Bits(dec, 1);
-          }
-
-          if (i>=64) {
-               if (!MPEG2_Quiet_Flag)
-                    fprintf(stderr,"DCT coeff index (i) out of bounds (inter2)\n");
-               dec->Fault_Flag = 1;
-               return;
-          }
-
-          j = MPEG2_scan[dec->alternate_scan][i];
-          val = (((val<<1)+1) * dec->quantizer_scale * qmat[j]) >> 5;
-          bp[j] = sign ? -val : val;
-          nc++;
-     }
-}
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/gethdr.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/gethdr.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/gethdr.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/gethdr.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,639 +0,0 @@
-/* gethdr.c, header decoding                                                */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-
-#include "global.h"
-
-
-/* private prototypes */
-static void sequence_header (MPEG2_Decoder *dec);
-static void group_of_pictures_header (MPEG2_Decoder *dec);
-static void picture_header (MPEG2_Decoder *dec);
-static void extension_and_user_data (MPEG2_Decoder *dec);
-static void sequence_extension (MPEG2_Decoder *dec);
-static void sequence_display_extension (MPEG2_Decoder *dec);
-static void quant_matrix_extension (MPEG2_Decoder *dec);
-static void sequence_scalable_extension (MPEG2_Decoder *dec);
-static void picture_display_extension (MPEG2_Decoder *dec);
-static void picture_coding_extension (MPEG2_Decoder *dec);
-static void picture_spatial_scalable_extension (MPEG2_Decoder *dec);
-static void picture_temporal_scalable_extension (MPEG2_Decoder *dec);
-static int  extra_bit_information (MPEG2_Decoder *dec);
-static void copyright_extension (MPEG2_Decoder *dec);
-static void user_data (MPEG2_Decoder *dec);
-static void user_data (MPEG2_Decoder *dec);
-
-
-
-
-#define RESERVED    -1 
-static const double frame_rate_Table[16] =
-{
-     0.0,
-     ((23.0*1000.0)/1001.0),
-     24.0,
-     25.0,
-     ((30.0*1000.0)/1001.0),
-     30.0,
-     50.0,
-     ((60.0*1000.0)/1001.0),
-     60.0,
-
-     RESERVED,
-     RESERVED,
-     RESERVED,
-     RESERVED,
-     RESERVED,
-     RESERVED,
-     RESERVED
-};
-
-/* default intra quantization matrix */
-static const unsigned char default_intra_quantizer_matrix[64] = {
-     8, 16, 19, 22, 26, 27, 29, 34,
-     16, 16, 22, 24, 27, 29, 34, 37,
-     19, 22, 26, 27, 29, 34, 34, 38,
-     22, 22, 26, 27, 29, 34, 37, 40,
-     22, 26, 27, 29, 32, 35, 40, 48,
-     26, 27, 29, 32, 35, 40, 48, 58,
-     26, 27, 29, 34, 38, 46, 56, 69,
-     27, 29, 35, 38, 46, 56, 69, 83
-};
-
-
-/*
- * decode headers from one input stream
- * until an End of Sequence or picture start code
- * is found
- */
-int
-MPEG2_Get_Hdr(MPEG2_Decoder *dec)
-{
-     unsigned int code;
-
-     for (;;) {
-          /* look for MPEG2_next_start_code */
-          MPEG2_next_start_code(dec);
-          code = MPEG2_Get_Bits32(dec);
-
-          switch (code) {
-               case SEQUENCE_HEADER_CODE:
-                    sequence_header(dec);
-                    break;
-               case GROUP_START_CODE:
-                    group_of_pictures_header(dec);
-                    break;
-               case PICTURE_START_CODE:
-                    picture_header(dec);
-                    return 1;
-                    break;
-               case SEQUENCE_END_CODE:
-                    return 0;
-                    break;
-               default:
-                    if (!MPEG2_Quiet_Flag)
-                         fprintf(stderr,"Unexpected MPEG2_next_start_code %08x (ignored)\n",code);
-                    break;
-          }
-     }
-}
-
-
-/* align to start of next MPEG2_next_start_code */
-
-void
-MPEG2_next_start_code(MPEG2_Decoder *dec)
-{
-     /* byte align */
-     MPEG2_Flush_Buffer(dec, dec->Incnt&7);
-     while (MPEG2_Show_Bits(dec, 24)!=0x01L)
-          MPEG2_Flush_Buffer(dec, 8);
-}
-
-
-/* decode sequence header */
-
-static void
-sequence_header(MPEG2_Decoder *dec)
-{
-     int i;
-     int pos;
-
-     pos = dec->Bitcnt;
-     dec->horizontal_size             = MPEG2_Get_Bits(dec, 12);
-     dec->vertical_size               = MPEG2_Get_Bits(dec, 12);
-     dec->aspect_ratio_information    = MPEG2_Get_Bits(dec, 4);
-     dec->frame_rate_code             = MPEG2_Get_Bits(dec, 4);
-     dec->bit_rate_value              = MPEG2_Get_Bits(dec, 18);
-     MPEG2_marker_bit(dec, "sequence_header()");
-     dec->vbv_buffer_size             = MPEG2_Get_Bits(dec, 10);
-     dec->constrained_parameters_flag = MPEG2_Get_Bits(dec, 1);
-
-     if ((dec->load_intra_quantizer_matrix = MPEG2_Get_Bits(dec, 1))) {
-          for (i=0; i<64; i++)
-               dec->intra_quantizer_matrix[MPEG2_scan[ZIG_ZAG][i]] = MPEG2_Get_Bits(dec, 8);
-     }
-     else {
-          for (i=0; i<64; i++)
-               dec->intra_quantizer_matrix[i] = default_intra_quantizer_matrix[i];
-     }
-
-     if ((dec->load_non_intra_quantizer_matrix = MPEG2_Get_Bits(dec, 1))) {
-          for (i=0; i<64; i++)
-               dec->non_intra_quantizer_matrix[MPEG2_scan[ZIG_ZAG][i]] = MPEG2_Get_Bits(dec, 8);
-     }
-     else {
-          for (i=0; i<64; i++)
-               dec->non_intra_quantizer_matrix[i] = 16;
-     }
-
-     /* copy luminance to chrominance matrices */
-     for (i=0; i<64; i++) {
-          dec->chroma_intra_quantizer_matrix[i] =
-          dec->intra_quantizer_matrix[i];
-
-          dec->chroma_non_intra_quantizer_matrix[i] =
-          dec->non_intra_quantizer_matrix[i];
-     }
-
-     extension_and_user_data(dec);
-}
-
-
-
-/* decode group of pictures header */
-/* ISO/IEC 13818-2 section 6.2.2.6 */
-static void
-group_of_pictures_header(MPEG2_Decoder *dec)
-{
-     int pos;
-
-     pos = dec->Bitcnt;
-     dec->drop_flag   = MPEG2_Get_Bits(dec, 1);
-     dec->hour        = MPEG2_Get_Bits(dec, 5);
-     dec->minute      = MPEG2_Get_Bits(dec, 6);
-     MPEG2_marker_bit(dec, "group_of_pictures_header()");
-     dec->sec         = MPEG2_Get_Bits(dec, 6);
-     dec->frame       = MPEG2_Get_Bits(dec, 6);
-     dec->closed_gop  = MPEG2_Get_Bits(dec, 1);
-     dec->broken_link = MPEG2_Get_Bits(dec, 1);
-
-     extension_and_user_data(dec);
-}
-
-
-/* decode picture header */
-
-/* ISO/IEC 13818-2 section 6.2.3 */
-static void
-picture_header(MPEG2_Decoder *dec)
-{
-     int pos;
-     int Extra_Information_Byte_Count;
-
-     pos = dec->Bitcnt;
-     dec->temporal_reference  = MPEG2_Get_Bits(dec, 10);
-     dec->picture_coding_type = MPEG2_Get_Bits(dec, 3);
-     dec->vbv_delay           = MPEG2_Get_Bits(dec, 16);
-
-     if (dec->picture_coding_type==P_TYPE || dec->picture_coding_type==B_TYPE) {
-          dec->full_pel_forward_vector = MPEG2_Get_Bits(dec, 1);
-          dec->forward_f_code = MPEG2_Get_Bits(dec, 3);
-     }
-     if (dec->picture_coding_type==B_TYPE) {
-          dec->full_pel_backward_vector = MPEG2_Get_Bits(dec, 1);
-          dec->backward_f_code = MPEG2_Get_Bits(dec, 3);
-     }
-
-     Extra_Information_Byte_Count = extra_bit_information(dec);
-
-     extension_and_user_data(dec);
-}
-
-/* decode slice header */
-
-/* ISO/IEC 13818-2 section 6.2.4 */
-int
-MPEG2_slice_header(MPEG2_Decoder *dec)
-{
-     int slice_vertical_position_extension;
-     int quantizer_scale_code;
-     int pos;
-     int slice_picture_id_enable = 0;
-     int slice_picture_id = 0;
-     int extra_information_slice = 0;
-
-     pos = dec->Bitcnt;
-
-     slice_vertical_position_extension =
-     (dec->MPEG2_Flag && dec->vertical_size>2800) ? MPEG2_Get_Bits(dec, 3) : 0;
-
-     quantizer_scale_code = MPEG2_Get_Bits(dec, 5);
-     dec->quantizer_scale =
-     dec->MPEG2_Flag ? (dec->q_scale_type ? MPEG2_Non_Linear_quantizer_scale[quantizer_scale_code] : quantizer_scale_code<<1) : quantizer_scale_code;
-
-     /* slice_id introduced in March 1995 as part of the video corridendum
-        (after the IS was drafted in November 1994) */
-     if (MPEG2_Get_Bits(dec, 1)) {
-          dec->intra_slice = MPEG2_Get_Bits(dec, 1);
-
-          slice_picture_id_enable = MPEG2_Get_Bits(dec, 1);
-          slice_picture_id = MPEG2_Get_Bits(dec, 6);
-
-          extra_information_slice = extra_bit_information(dec);
-     }
-     else
-          dec->intra_slice = 0;
-
-
-     return slice_vertical_position_extension;
-}
-
-
-/* decode extension and user data */
-/* ISO/IEC 13818-2 section 6.2.2.2 */
-static void
-extension_and_user_data(MPEG2_Decoder *dec)
-{
-     int code,ext_ID;
-
-     MPEG2_next_start_code(dec);
-
-     while ((code = MPEG2_Show_Bits(dec, 32))==EXTENSION_START_CODE || code==USER_DATA_START_CODE) {
-          if (code==EXTENSION_START_CODE) {
-               MPEG2_Flush_Buffer32(dec);
-               ext_ID = MPEG2_Get_Bits(dec, 4);
-               switch (ext_ID) {
-                    case SEQUENCE_EXTENSION_ID:
-                         sequence_extension(dec);
-                         break;
-                    case SEQUENCE_DISPLAY_EXTENSION_ID:
-                         sequence_display_extension(dec);
-                         break;
-                    case QUANT_MATRIX_EXTENSION_ID:
-                         quant_matrix_extension(dec);
-                         break;
-                    case SEQUENCE_SCALABLE_EXTENSION_ID:
-                         sequence_scalable_extension(dec);
-                         break;
-                    case PICTURE_DISPLAY_EXTENSION_ID:
-                         picture_display_extension(dec);
-                         break;
-                    case PICTURE_CODING_EXTENSION_ID:
-                         picture_coding_extension(dec);
-                         break;
-                    case PICTURE_SPATIAL_SCALABLE_EXTENSION_ID:
-                         picture_spatial_scalable_extension(dec);
-                         break;
-                    case PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID:
-                         picture_temporal_scalable_extension(dec);
-                         break;
-                    case COPYRIGHT_EXTENSION_ID:
-                         copyright_extension(dec);
-                         break;
-                    default:
-                         fprintf(stderr,"reserved extension start code ID %d\n",ext_ID);
-                         break;
-               }
-               MPEG2_next_start_code(dec);
-          }
-          else {
-               MPEG2_Flush_Buffer32(dec);
-               user_data(dec);
-          }
-     }
-}
-
-
-/* decode sequence extension */
-
-/* ISO/IEC 13818-2 section 6.2.2.3 */
-static void
-sequence_extension(MPEG2_Decoder *dec)
-{
-     int horizontal_size_extension;
-     int vertical_size_extension;
-     int bit_rate_extension;
-     int vbv_buffer_size_extension;
-
-     /* derive bit position for trace */
-     dec->MPEG2_Flag = 1;
-
-     dec->profile_and_level_indication = MPEG2_Get_Bits(dec, 8);
-     dec->progressive_sequence         = MPEG2_Get_Bits(dec, 1);
-     dec->chroma_format                = MPEG2_Get_Bits(dec, 2);
-     horizontal_size_extension    = MPEG2_Get_Bits(dec, 2);
-     vertical_size_extension      = MPEG2_Get_Bits(dec, 2);
-     bit_rate_extension           = MPEG2_Get_Bits(dec, 12);
-     MPEG2_marker_bit(dec, "sequence_extension");
-     vbv_buffer_size_extension    = MPEG2_Get_Bits(dec, 8);
-     dec->low_delay                    = MPEG2_Get_Bits(dec, 1);
-     dec->frame_rate_extension_n       = MPEG2_Get_Bits(dec, 2);
-     dec->frame_rate_extension_d       = MPEG2_Get_Bits(dec, 5);
-
-     dec->frame_rate = frame_rate_Table[dec->frame_rate_code] *
-                  ((dec->frame_rate_extension_n+1)/(dec->frame_rate_extension_d+1));
-
-     /* special case for 422 profile & level must be made */
-     if ((dec->profile_and_level_indication>>7) & 1) {  /* escape bit of profile_and_level_indication set */
-
-          /* 4:2:2 Profile @ Main Level */
-          if ((dec->profile_and_level_indication&15)==5) {
-               dec->profile = PROFILE_422;
-               dec->level   = MAIN_LEVEL;  
-          }
-     }
-     else {
-          dec->profile = dec->profile_and_level_indication >> 4;  /* Profile is upper nibble */
-          dec->level   = dec->profile_and_level_indication & 0xF;  /* Level is lower nibble */
-     }
-
-
-     dec->horizontal_size = (horizontal_size_extension<<12) | (dec->horizontal_size&0x0fff);
-     dec->vertical_size = (vertical_size_extension<<12) | (dec->vertical_size&0x0fff);
-
-
-     /* ISO/IEC 13818-2 does not define bit_rate_value to be composed of
-      * both the original bit_rate_value parsed in sequence_header() and
-      * the optional bit_rate_extension in sequence_extension_header(). 
-      * However, we use it for bitstream verification purposes. 
-      */
-
-     dec->bit_rate_value += (bit_rate_extension << 18);
-     dec->bit_rate = ((double) dec->bit_rate_value) * 400.0;
-     dec->vbv_buffer_size += (vbv_buffer_size_extension << 10);
-}
-
-
-/* decode sequence display extension */
-
-static void
-sequence_display_extension(MPEG2_Decoder *dec)
-{
-     int pos;
-
-     pos = dec->Bitcnt;
-     dec->video_format      = MPEG2_Get_Bits(dec, 3);
-     dec->color_description = MPEG2_Get_Bits(dec, 1);
-
-     if (dec->color_description) {
-          dec->color_primaries          = MPEG2_Get_Bits(dec, 8);
-          dec->transfer_characteristics = MPEG2_Get_Bits(dec, 8);
-          dec->matrix_coefficients      = MPEG2_Get_Bits(dec, 8);
-     }
-
-     dec->display_horizontal_size = MPEG2_Get_Bits(dec, 14);
-     MPEG2_marker_bit(dec, "sequence_display_extension");
-     dec->display_vertical_size   = MPEG2_Get_Bits(dec, 14);
-
-}
-
-
-/* decode quant matrix entension */
-/* ISO/IEC 13818-2 section 6.2.3.2 */
-static void
-quant_matrix_extension(MPEG2_Decoder *dec)
-{
-     int i;
-     int pos;
-
-     pos = dec->Bitcnt;
-
-     if ((dec->load_intra_quantizer_matrix = MPEG2_Get_Bits(dec, 1))) {
-          for (i=0; i<64; i++) {
-               dec->chroma_intra_quantizer_matrix[MPEG2_scan[ZIG_ZAG][i]]
-               = dec->intra_quantizer_matrix[MPEG2_scan[ZIG_ZAG][i]]
-                 = MPEG2_Get_Bits(dec, 8);
-          }
-     }
-
-     if ((dec->load_non_intra_quantizer_matrix = MPEG2_Get_Bits(dec, 1))) {
-          for (i=0; i<64; i++) {
-               dec->chroma_non_intra_quantizer_matrix[MPEG2_scan[ZIG_ZAG][i]]
-               = dec->non_intra_quantizer_matrix[MPEG2_scan[ZIG_ZAG][i]]
-                 = MPEG2_Get_Bits(dec, 8);
-          }
-     }
-
-     if ((dec->load_chroma_intra_quantizer_matrix = MPEG2_Get_Bits(dec, 1))) {
-          for (i=0; i<64; i++)
-               dec->chroma_intra_quantizer_matrix[MPEG2_scan[ZIG_ZAG][i]] = MPEG2_Get_Bits(dec, 8);
-     }
-
-     if ((dec->load_chroma_non_intra_quantizer_matrix = MPEG2_Get_Bits(dec, 1))) {
-          for (i=0; i<64; i++)
-               dec->chroma_non_intra_quantizer_matrix[MPEG2_scan[ZIG_ZAG][i]] = MPEG2_Get_Bits(dec, 8);
-     }
-}
-
-
-/* decode sequence scalable extension */
-/* ISO/IEC 13818-2   section 6.2.2.5 */
-static void
-sequence_scalable_extension(MPEG2_Decoder *dec)
-{
-     MPEG2_Error(dec, "scalability not implemented\n");
-}
-
-
-/* decode picture display extension */
-/* ISO/IEC 13818-2 section 6.2.3.3. */
-static void
-picture_display_extension(MPEG2_Decoder *dec)
-{
-     int i;
-     int number_of_frame_center_offsets;
-     int pos;
-
-     pos = dec->Bitcnt;
-     /* based on ISO/IEC 13818-2 section 6.3.12 
-       (November 1994) Picture display extensions */
-
-     /* derive number_of_frame_center_offsets */
-     if (dec->progressive_sequence) {
-          if (dec->repeat_first_field) {
-               if (dec->top_field_first)
-                    number_of_frame_center_offsets = 3;
-               else
-                    number_of_frame_center_offsets = 2;
-          }
-          else {
-               number_of_frame_center_offsets = 1;
-          }
-     }
-     else {
-          if (dec->picture_structure!=FRAME_PICTURE) {
-               number_of_frame_center_offsets = 1;
-          }
-          else {
-               if (dec->repeat_first_field)
-                    number_of_frame_center_offsets = 3;
-               else
-                    number_of_frame_center_offsets = 2;
-          }
-     }
-
-
-     /* now parse */
-     for (i=0; i<number_of_frame_center_offsets; i++) {
-          dec->frame_center_horizontal_offset[i] = MPEG2_Get_Bits(dec, 16);
-          MPEG2_marker_bit(dec, "picture_display_extension, first marker bit");
-
-          dec->frame_center_vertical_offset[i]   = MPEG2_Get_Bits(dec, 16);
-          MPEG2_marker_bit(dec, "picture_display_extension, second marker bit");
-     }
-}
-
-
-/* decode picture coding extension */
-static void
-picture_coding_extension(MPEG2_Decoder *dec)
-{
-     int pos;
-
-     pos = dec->Bitcnt;
-
-     dec->f_code[0][0] = MPEG2_Get_Bits(dec, 4);
-     dec->f_code[0][1] = MPEG2_Get_Bits(dec, 4);
-     dec->f_code[1][0] = MPEG2_Get_Bits(dec, 4);
-     dec->f_code[1][1] = MPEG2_Get_Bits(dec, 4);
-
-     dec->intra_dc_precision         = MPEG2_Get_Bits(dec, 2);
-     dec->picture_structure          = MPEG2_Get_Bits(dec, 2);
-     dec->top_field_first            = MPEG2_Get_Bits(dec, 1);
-     dec->frame_pred_frame_dct       = MPEG2_Get_Bits(dec, 1);
-     dec->concealment_motion_vectors = MPEG2_Get_Bits(dec, 1);
-     dec->q_scale_type               = MPEG2_Get_Bits(dec, 1);
-     dec->intra_vlc_format           = MPEG2_Get_Bits(dec, 1);
-     dec->alternate_scan             = MPEG2_Get_Bits(dec, 1);
-     dec->repeat_first_field         = MPEG2_Get_Bits(dec, 1);
-     dec->chroma_420_type            = MPEG2_Get_Bits(dec, 1);
-     dec->progressive_frame          = MPEG2_Get_Bits(dec, 1);
-     dec->composite_display_flag     = MPEG2_Get_Bits(dec, 1);
-
-     if (dec->composite_display_flag) {
-          dec->v_axis            = MPEG2_Get_Bits(dec, 1);
-          dec->field_sequence    = MPEG2_Get_Bits(dec, 3);
-          dec->sub_carrier       = MPEG2_Get_Bits(dec, 1);
-          dec->burst_amplitude   = MPEG2_Get_Bits(dec, 7);
-          dec->sub_carrier_phase = MPEG2_Get_Bits(dec, 8);
-     }
-}
-
-
-/* decode picture spatial scalable extension */
-/* ISO/IEC 13818-2 section 6.2.3.5. */
-static void
-picture_spatial_scalable_extension(MPEG2_Decoder *dec)
-{
-     MPEG2_Error(dec, "picture spatial scalable extension not supported\n");
-}
-
-
-/* decode picture temporal scalable extension
- *
- * not implemented
- */
-/* ISO/IEC 13818-2 section 6.2.3.4. */
-static void
-picture_temporal_scalable_extension(MPEG2_Decoder *dec)
-{
-     MPEG2_Error(dec, "temporal scalability not supported\n");
-}
-
-
-/* decode extra bit information */
-/* ISO/IEC 13818-2 section 6.2.3.4. */
-static int
-extra_bit_information(MPEG2_Decoder *dec)
-{
-     int Byte_Count = 0;
-
-     while (MPEG2_Get_Bits1(dec)) {
-          MPEG2_Flush_Buffer(dec, 8);
-          Byte_Count++;
-     }
-
-     return(Byte_Count);
-}
-
-
-
-/* ISO/IEC 13818-2 section 5.3 */
-/* Purpose: this function is mainly designed to aid in bitstream conformance
-   testing.  A simple MPEG2_Flush_Buffer(1) would do */
-void
-MPEG2_marker_bit(MPEG2_Decoder *dec, char *text)
-{
-     int marker;
-
-     marker = MPEG2_Get_Bits(dec, 1);
-}
-
-
-/* ISO/IEC 13818-2  sections 6.3.4.1 and 6.2.2.2.2 */
-static void
-user_data(MPEG2_Decoder *dec)
-{
-     /* skip ahead to the next start code */
-     MPEG2_next_start_code(dec);
-}
-
-
-
-/* Copyright extension */
-/* ISO/IEC 13818-2 section 6.2.3.6. */
-/* (header added in November, 1994 to the IS document) */
-
-
-static void
-copyright_extension(MPEG2_Decoder *dec)
-{
-     int pos;
-     int reserved_data;
-
-     pos = dec->Bitcnt;
-
-
-     dec->copyright_flag =       MPEG2_Get_Bits(dec, 1); 
-     dec->copyright_identifier = MPEG2_Get_Bits(dec, 8);
-     dec->original_or_copy =     MPEG2_Get_Bits(dec, 1);
-
-     /* reserved */
-     reserved_data = MPEG2_Get_Bits(dec, 7);
-
-     MPEG2_marker_bit(dec, "copyright_extension(), first marker bit");
-     dec->copyright_number_1 =   MPEG2_Get_Bits(dec, 20);
-     MPEG2_marker_bit(dec, "copyright_extension(), second marker bit");
-     dec->copyright_number_2 =   MPEG2_Get_Bits(dec, 22);
-     MPEG2_marker_bit(dec, "copyright_extension(), third marker bit");
-     dec->copyright_number_3 =   MPEG2_Get_Bits(dec, 22);
-}
-
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getpic.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getpic.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getpic.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getpic.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,793 +0,0 @@
-/* getpic.c, picture decoding                                               */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-
-#include "global.h"
-
-/* private prototypes*/
-static void picture_data (MPEG2_Decoder *dec, int framenum);
-static void macroblock_modes (MPEG2_Decoder *dec, int *pmacroblock_type, int *pstwtype,
-                              int *pstwclass, int *pmotion_type, int *pmotion_vector_count, int *pmv_format, int *pdmv,
-                              int *pmvscale, int *pdct_type);
-static void Clear_Block (MPEG2_Decoder *dec, int comp);
-static void Add_Block (MPEG2_Decoder *dec, int comp, int bx, int by,
-                       int dct_type, int addflag);
-static void Update_Picture_Buffers (MPEG2_Decoder *dec);
-static void frame_reorder (MPEG2_Decoder *dec, int bitstream_framenum, 
-                           int sequence_framenum);
-
-static void motion_compensation (MPEG2_Decoder *dec, int MBA, int macroblock_type, 
-                                 int motion_type, int PMV[2][2][2], int motion_vertical_field_select[2][2], 
-                                 int dmvector[2], int stwtype, int dct_type);
-
-static void skipped_macroblock (MPEG2_Decoder *dec, int dc_dct_pred[3], 
-                                int PMV[2][2][2], int *motion_type, int motion_vertical_field_select[2][2],
-                                int *stwtype, int *macroblock_type);
-
-static int slice (MPEG2_Decoder *dec, int framenum, int MBAmax);
-
-static int start_of_slice (MPEG2_Decoder *dec, int MBAmax, int *MBA,
-                           int *MBAinc, int dc_dct_pred[3], int PMV[2][2][2]);
-
-static int decode_macroblock (MPEG2_Decoder *dec, int *macroblock_type, 
-                              int *stwtype, int *stwclass, int *motion_type, int *dct_type,
-                              int PMV[2][2][2], int dc_dct_pred[3], 
-                              int motion_vertical_field_select[2][2], int dmvector[2]);
-
-
-/* decode one frame or field picture */
-void
-MPEG2_Decode_Picture(MPEG2_Decoder *dec,
-                     int bitstream_framenum, int sequence_framenum)
-{
-
-     if (dec->picture_structure==FRAME_PICTURE && dec->Second_Field) {
-          /* recover from illegal number of field pictures */
-          printf("odd number of field pictures\n");
-          dec->Second_Field = 0;
-     }
-
-     /* IMPLEMENTATION: update picture buffer pointers */
-     Update_Picture_Buffers(dec);
-
-     /* decode picture data ISO/IEC 13818-2 section 6.2.3.7 */
-     picture_data(dec, bitstream_framenum);
-
-     /* write or display current or previously decoded reference frame */
-     /* ISO/IEC 13818-2 section 6.1.1.11: Frame reordering */
-     frame_reorder(dec, bitstream_framenum, sequence_framenum);
-
-     if (dec->picture_structure!=FRAME_PICTURE)
-          dec->Second_Field = !dec->Second_Field;
-}
-
-
-/* decode all macroblocks of the current picture */
-/* stages described in ISO/IEC 13818-2 section 7 */
-static void
-picture_data(MPEG2_Decoder *dec, int framenum)
-{
-     int MBAmax;
-     int ret;
-
-     /* number of macroblocks per picture */
-     MBAmax = dec->mb_width*dec->mb_height;
-
-     if (dec->picture_structure!=FRAME_PICTURE)
-          MBAmax>>=1; /* field picture has half as mnay macroblocks as frame */
-
-     for (;;) {
-          if ((ret=slice(dec, framenum, MBAmax))<0)
-               return;
-     }
-
-}
-
-
-
-/* decode all macroblocks of the current picture */
-/* ISO/IEC 13818-2 section 6.3.16 */
-static int
-slice(MPEG2_Decoder *dec, int framenum, int MBAmax)
-{
-     int MBA; 
-     int MBAinc, macroblock_type = 0, motion_type = 0, dct_type = 0;
-     int dc_dct_pred[3];
-     int PMV[2][2][2], motion_vertical_field_select[2][2];
-     int dmvector[2];
-     int stwtype = 0, stwclass = 0;
-     int ret;
-
-     MBA = 0; /* macroblock address */
-     MBAinc = 0;
-
-     if ((ret=start_of_slice(dec, MBAmax, &MBA, &MBAinc, dc_dct_pred, PMV))!=1)
-          return(ret);
-
-     dec->Fault_Flag=0;
-
-     for (;;) {
-
-          /* this is how we properly exit out of picture */
-          if (MBA>=MBAmax)
-               return(-1); /* all macroblocks decoded */
-
-          if (MBAinc==0) {
-               if (!MPEG2_Show_Bits(dec, 23) || dec->Fault_Flag) { /* MPEG2_next_start_code or fault */
-                    resync: /* if dec->Fault_Flag: resynchronize to next MPEG2_next_start_code */
-                    dec->Fault_Flag = 0;
-                    return(0);     /* trigger: go to next slice */
-               }
-               else { /* neither MPEG2_next_start_code nor dec->Fault_Flag */
-                    /* decode macroblock address increment */
-                    MBAinc = MPEG2_Get_macroblock_address_increment(dec);
-
-                    if (dec->Fault_Flag) goto resync;
-               }
-          }
-
-          if (MBA>=MBAmax) {
-               /* MBAinc points beyond picture dimensions */
-               if (!MPEG2_Quiet_Flag)
-                    printf("Too many macroblocks in picture\n");
-               return(-1);
-          }
-
-          if (MBAinc==1) { /* not skipped */
-               ret = decode_macroblock(dec, &macroblock_type, &stwtype, &stwclass,
-                                       &motion_type, &dct_type, PMV, dc_dct_pred, 
-                                       motion_vertical_field_select, dmvector);
-
-               if (ret==-1)
-                    return(-1);
-
-               if (ret==0)
-                    goto resync;
-
-          }
-          else { /* MBAinc!=1: skipped macroblock */
-               /* ISO/IEC 13818-2 section 7.6.6 */
-               skipped_macroblock(dec, dc_dct_pred, PMV, &motion_type, 
-                                  motion_vertical_field_select, &stwtype, &macroblock_type);
-          }
-
-          /* ISO/IEC 13818-2 section 7.6 */
-          motion_compensation(dec, MBA, macroblock_type, motion_type, PMV, 
-                              motion_vertical_field_select, dmvector, stwtype, dct_type);
-
-
-          /* advance to next macroblock */
-          MBA++;
-          MBAinc--;
-
-          if (MBA>=MBAmax)
-               return(-1); /* all macroblocks decoded */
-     }
-}
-
-
-/* ISO/IEC 13818-2 section 6.3.17.1: Macroblock modes */
-static void
-macroblock_modes(MPEG2_Decoder *dec, int *pmacroblock_type, int *pstwtype, int *pstwclass,
-                 int *pmotion_type,int *pmotion_vector_count,int *pmv_format,int *pdmv,int *pmvscale,int *pdct_type)
-{
-     int macroblock_type;
-     int stwtype, stwclass;
-     int motion_type = 0;
-     int motion_vector_count, mv_format, dmv, mvscale;
-     int dct_type;
-     static unsigned char stwclass_table[9]
-     = {0, 1, 2, 1, 1, 2, 3, 3, 4};
-
-     /* get macroblock_type */
-     macroblock_type = MPEG2_Get_macroblock_type(dec);
-
-     if (dec->Fault_Flag) return;
-
-     /* get spatial_temporal_weight_code */
-     if (macroblock_type & MB_WEIGHT) {
-          stwtype = 4;
-     }
-     else
-          stwtype = (macroblock_type & MB_CLASS4) ? 8 : 0;
-
-     /* SCALABILITY: derive spatial_temporal_weight_class (Table 7-18) */
-     stwclass = stwclass_table[stwtype];
-
-     /* get frame/field motion type */
-     if (macroblock_type & (MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD)) {
-          if (dec->picture_structure==FRAME_PICTURE) { /* frame_motion_type */
-               motion_type = dec->frame_pred_frame_dct ? MC_FRAME : MPEG2_Get_Bits(dec, 2);
-          }
-          else { /* field_motion_type */
-               motion_type = MPEG2_Get_Bits(dec, 2);
-          }
-     }
-     else if ((macroblock_type & MACROBLOCK_INTRA) && dec->concealment_motion_vectors) {
-          /* concealment motion vectors */
-          motion_type = (dec->picture_structure==FRAME_PICTURE) ? MC_FRAME : MC_FIELD;
-     }
-#if 0
-     else {
-          printf("maroblock_modes(): unknown macroblock type\n");
-          motion_type = -1;
-     }
-#endif
-
-     /* derive motion_vector_count, mv_format and dmv, (table 6-17, 6-18) */
-     if (dec->picture_structure==FRAME_PICTURE) {
-          motion_vector_count = (motion_type==MC_FIELD && stwclass<2) ? 2 : 1;
-          mv_format = (motion_type==MC_FRAME) ? MV_FRAME : MV_FIELD;
-     }
-     else {
-          motion_vector_count = (motion_type==MC_16X8) ? 2 : 1;
-          mv_format = MV_FIELD;
-     }
-
-     dmv = (motion_type==MC_DMV); /* dual prime */
-
-     /* field mv predictions in frame pictures have to be scaled
-      * ISO/IEC 13818-2 section 7.6.3.1 Decoding the motion vectors
-      * IMPLEMENTATION: mvscale is derived for later use in MPEG2_motion_vectors()
-      * it displaces the stage:
-      *
-      *    if((mv_format=="field")&&(t==1)&&(picture_structure=="Frame picture"))
-      *      prediction = PMV[r][s][t] DIV 2;
-      */
-
-     mvscale = ((mv_format==MV_FIELD) && (dec->picture_structure==FRAME_PICTURE));
-
-     /* get dct_type (frame DCT / field DCT) */
-     dct_type = (dec->picture_structure==FRAME_PICTURE)
-                && (!dec->frame_pred_frame_dct)
-                && (macroblock_type & (MACROBLOCK_PATTERN|MACROBLOCK_INTRA))
-                ? MPEG2_Get_Bits(dec, 1)
-                : 0;
-
-     /* return values */
-     *pmacroblock_type = macroblock_type;
-     *pstwtype = stwtype;
-     *pstwclass = stwclass;
-     *pmotion_type = motion_type;
-     *pmotion_vector_count = motion_vector_count;
-     *pmv_format = mv_format;
-     *pdmv = dmv;
-     *pmvscale = mvscale;
-     *pdct_type = dct_type;
-}
-
-
-/* move/add 8x8-Block from block[comp] to backward_reference_frame */
-/* copy reconstructed 8x8 block from block[comp] to current_frame[]
- * ISO/IEC 13818-2 section 7.6.8: Adding prediction and coefficient data
- * This stage also embodies some of the operations implied by:
- *   - ISO/IEC 13818-2 section 7.6.7: Combining predictions
- *   - ISO/IEC 13818-2 section 6.1.3: Macroblock
-*/
-static void
-Add_Block(MPEG2_Decoder *dec, int comp,int bx,int by,int dct_type,int addflag)
-{
-     int cc,i, j, iincr;
-     unsigned char *rfp;
-     short *bp;
-
-
-     /* derive color component index */
-     /* equivalent to ISO/IEC 13818-2 Table 7-1 */
-     cc = (comp<4) ? 0 : (comp&1)+1; /* color component index */
-
-     if (cc==0) {
-          /* luminance */
-
-          if (dec->picture_structure==FRAME_PICTURE)
-               if (dct_type) {
-                    /* field DCT coding */
-                    rfp = dec->current_frame[0]
-                          + dec->Coded_Picture_Width*(by+((comp&2)>>1)) + bx + ((comp&1)<<3);
-                    iincr = (dec->Coded_Picture_Width<<1) - 8;
-               }
-               else {
-                    /* frame DCT coding */
-                    rfp = dec->current_frame[0]
-                          + dec->Coded_Picture_Width*(by+((comp&2)<<2)) + bx + ((comp&1)<<3);
-                    iincr = dec->Coded_Picture_Width - 8;
-               }
-          else {
-               /* field picture */
-               rfp = dec->current_frame[0]
-                     + (dec->Coded_Picture_Width<<1)*(by+((comp&2)<<2)) + bx + ((comp&1)<<3);
-               iincr = (dec->Coded_Picture_Width<<1) - 8;
-          }
-     }
-     else {
-          /* chrominance */
-
-          /* scale coordinates */
-          if (dec->chroma_format!=CHROMA444)
-               bx >>= 1;
-          if (dec->chroma_format==CHROMA420)
-               by >>= 1;
-          if (dec->picture_structure==FRAME_PICTURE) {
-               if (dct_type && (dec->chroma_format!=CHROMA420)) {
-                    /* field DCT coding */
-                    rfp = dec->current_frame[cc]
-                          + dec->Chroma_Width*(by+((comp&2)>>1)) + bx + (comp&8);
-                    iincr = (dec->Chroma_Width<<1) - 8;
-               }
-               else {
-                    /* frame DCT coding */
-                    rfp = dec->current_frame[cc]
-                          + dec->Chroma_Width*(by+((comp&2)<<2)) + bx + (comp&8);
-                    iincr = dec->Chroma_Width - 8;
-               }
-          }
-          else {
-               /* field picture */
-               rfp = dec->current_frame[cc]
-                     + (dec->Chroma_Width<<1)*(by+((comp&2)<<2)) + bx + (comp&8);
-               iincr = (dec->Chroma_Width<<1) - 8;
-          }
-     }
-
-     bp = dec->block[comp];
-
-     if (addflag) {
-          for (i=0; i<8; i++) {
-               for (j=0; j<8; j++) {
-                    *rfp = dec->Clip[*bp++ + *rfp];
-                    rfp++;
-               }
-
-               rfp+= iincr;
-          }
-     }
-     else {
-          for (i=0; i<8; i++) {
-               for (j=0; j<8; j++)
-                    *rfp++ = dec->Clip[*bp++ + 128];
-
-               rfp+= iincr;
-          }
-     }
-}
-
-
-/* IMPLEMENTATION: set scratch pad macroblock to zero */
-static void
-Clear_Block(MPEG2_Decoder *dec, int comp)
-{
-     short *Block_Ptr;
-     int i;
-
-     Block_Ptr = dec->block[comp];
-
-     for (i=0; i<64; i++)
-          *Block_Ptr++ = 0;
-}
-
-
-/* reuse old picture buffers as soon as they are no longer needed 
-   based on life-time axioms of MPEG */
-static void
-Update_Picture_Buffers(MPEG2_Decoder *dec)
-{                           
-     int cc;              /* color component index */
-     unsigned char *tmp;  /* temporary swap pointer */
-
-     for (cc=0; cc<3; cc++) {
-          /* B pictures do not need to be save for future reference */
-          if (dec->picture_coding_type==B_TYPE) {
-               dec->current_frame[cc] = dec->auxframe[cc];
-          }
-          else {
-               /* only update at the beginning of the coded frame */
-               if (!dec->Second_Field) {
-                    tmp = dec->forward_reference_frame[cc];
-
-                    /* the previously decoded reference frame is stored
-                       coincident with the location where the backward 
-                       reference frame is stored (backwards prediction is not
-                       needed in P pictures) */
-                    dec->forward_reference_frame[cc] = dec->backward_reference_frame[cc];
-
-                    /* update pointer for potential future B pictures */
-                    dec->backward_reference_frame[cc] = tmp;
-               }
-
-               /* can erase over old backward reference frame since it is not used
-                  in a P picture, and since any subsequent B pictures will use the 
-                  previously decoded I or P frame as the backward_reference_frame */
-               dec->current_frame[cc] = dec->backward_reference_frame[cc];
-          }
-
-          /* IMPLEMENTATION:
-             one-time folding of a line offset into the pointer which stores the
-             memory address of the current frame saves offsets and conditional 
-             branches throughout the remainder of the picture processing loop */
-          if (dec->picture_structure==BOTTOM_FIELD)
-               dec->current_frame[cc]+= (cc==0) ? dec->Coded_Picture_Width : dec->Chroma_Width;
-     }
-}
-
-
-/* store last frame */
-
-void
-MPEG2_Output_Last_Frame_of_Sequence(MPEG2_Decoder *dec, int Framenum)
-{
-     if (dec->Second_Field)
-          printf("last frame incomplete, not stored\n");
-     else
-          MPEG2_Write_Frame(dec, dec->backward_reference_frame,Framenum-1);
-}
-
-
-
-static void
-frame_reorder(MPEG2_Decoder *dec, int Bitstream_Framenum, int Sequence_Framenum)
-{
-     /* tracking variables to insure proper output in spatial scalability */
-     static int Oldref_progressive_frame, Newref_progressive_frame;
-
-     if (Sequence_Framenum!=0) {
-          if (dec->picture_structure==FRAME_PICTURE || dec->Second_Field) {
-               if (dec->picture_coding_type==B_TYPE)
-                    MPEG2_Write_Frame(dec, dec->auxframe,Bitstream_Framenum-1);
-               else {
-                    Newref_progressive_frame = dec->progressive_frame;
-                    dec->progressive_frame = Oldref_progressive_frame;
-
-                    MPEG2_Write_Frame(dec, dec->forward_reference_frame,Bitstream_Framenum-1);
-
-                    Oldref_progressive_frame = dec->progressive_frame = Newref_progressive_frame;
-               }
-          }
-     }
-     else
-          Oldref_progressive_frame = dec->progressive_frame;
-}
-
-
-/* ISO/IEC 13818-2 section 7.6 */
-static void
-motion_compensation(MPEG2_Decoder *dec,
-int MBA,
-int macroblock_type,
-int motion_type,
-int PMV[2][2][2],
-int motion_vertical_field_select[2][2],
-int dmvector[2],
-int stwtype,
-int dct_type)
-{
-     int bx, by;
-     int comp;
-
-     /* derive current macroblock position within picture */
-     /* ISO/IEC 13818-2 section 6.3.1.6 and 6.3.1.7 */
-     bx = 16*(MBA%dec->mb_width);
-     by = 16*(MBA/dec->mb_width);
-
-     /* motion compensation */
-     if (!(macroblock_type & MACROBLOCK_INTRA))
-          MPEG2_form_predictions(dec, bx,by,macroblock_type,motion_type,PMV,
-                                 motion_vertical_field_select,dmvector,stwtype);
-
-     /* copy or add block data into picture */
-     for (comp=0; comp<dec->block_count; comp++) {
-          /* ISO/IEC 13818-2 section Annex A: inverse DCT */
-          if (MPEG2_Reference_IDCT_Flag)
-               MPEG2_Reference_IDCT(dec, dec->block[comp]);
-          else
-               MPEG2_Fast_IDCT(dec, dec->block[comp]);
-
-          /* ISO/IEC 13818-2 section 7.6.8: Adding prediction and coefficient data */
-          Add_Block(dec, comp,bx,by,dct_type,(macroblock_type & MACROBLOCK_INTRA)==0);
-     }
-}
-
-/* ISO/IEC 13818-2 section 7.6.6 */
-static void skipped_macroblock(MPEG2_Decoder *dec,
-int dc_dct_pred[3],
-int PMV[2][2][2],
-int *motion_type,
-int motion_vertical_field_select[2][2],
-int *stwtype,
-int *macroblock_type)
-{
-     int comp;
-
-     for (comp=0; comp<dec->block_count; comp++)
-          Clear_Block(dec, comp);
-
-     /* reset intra_dc predictors */
-     /* ISO/IEC 13818-2 section 7.2.1: DC coefficients in intra blocks */
-     dc_dct_pred[0]=dc_dct_pred[1]=dc_dct_pred[2]=0;
-
-     /* reset motion vector predictors */
-     /* ISO/IEC 13818-2 section 7.6.3.4: Resetting motion vector predictors */
-     if (dec->picture_coding_type==P_TYPE)
-          PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
-
-     /* derive motion_type */
-     if (dec->picture_structure==FRAME_PICTURE)
-          *motion_type = MC_FRAME;
-     else {
-          *motion_type = MC_FIELD;
-
-          /* predict from field of same parity */
-          /* ISO/IEC 13818-2 section 7.6.6.1 and 7.6.6.3: P field picture and B field
-             picture */
-          motion_vertical_field_select[0][0]=motion_vertical_field_select[0][1] = 
-                                             (dec->picture_structure==BOTTOM_FIELD);
-     }
-
-     /* skipped I are spatial-only predicted, */
-     /* skipped P and B are temporal-only predicted */
-     /* ISO/IEC 13818-2 section 7.7.6: Skipped macroblocks */
-     *stwtype = (dec->picture_coding_type==I_TYPE) ? 8 : 0;
-
-     /* IMPLEMENTATION: clear MACROBLOCK_INTRA */
-     *macroblock_type&= ~MACROBLOCK_INTRA;
-
-}
-
-/* return==-1 means go to next picture */
-/* the expression "start of slice" is used throughout the normative
-   body of the MPEG specification */
-static int
-start_of_slice(MPEG2_Decoder *dec,
-int MBAmax,
-int *MBA,
-int *MBAinc,
-int dc_dct_pred[3],
-int PMV[2][2][2])
-{
-     unsigned int code;
-     int slice_vert_pos_ext;
-
-     dec->Fault_Flag = 0;
-
-     MPEG2_next_start_code(dec);
-     code = MPEG2_Show_Bits(dec, 32);
-
-     if (code<SLICE_START_CODE_MIN || code>SLICE_START_CODE_MAX) {
-          /* only slice headers are allowed in picture_data */
-          if (!MPEG2_Quiet_Flag)
-               printf("start_of_slice(): Premature end of picture\n");
-
-          return(-1);  /* trigger: go to next picture */
-     }
-
-     MPEG2_Flush_Buffer32(dec); 
-
-     /* decode slice header (may change quantizer_scale) */
-     slice_vert_pos_ext = MPEG2_slice_header(dec);
-
-     /* decode macroblock address increment */
-     *MBAinc = MPEG2_Get_macroblock_address_increment(dec);
-
-     if (dec->Fault_Flag) {
-          printf("start_of_slice(): MBAinc unsuccessful\n");
-          return(0);   /* trigger: go to next slice */
-     }
-
-     /* set current location */
-     /* NOTE: the arithmetic used to derive macroblock_address below is
-      *       equivalent to ISO/IEC 13818-2 section 6.3.17: Macroblock
-      */
-     *MBA = ((slice_vert_pos_ext<<7) + (code&255) - 1)*dec->mb_width + *MBAinc - 1;
-     *MBAinc = 1; /* first macroblock in slice: not skipped */
-
-     /* reset all DC coefficient and motion vector predictors */
-     /* reset all DC coefficient and motion vector predictors */
-     /* ISO/IEC 13818-2 section 7.2.1: DC coefficients in intra blocks */
-     dc_dct_pred[0]=dc_dct_pred[1]=dc_dct_pred[2]=0;
-
-     /* ISO/IEC 13818-2 section 7.6.3.4: Resetting motion vector predictors */
-     PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
-     PMV[0][1][0]=PMV[0][1][1]=PMV[1][1][0]=PMV[1][1][1]=0;
-
-     /* successfull: trigger decode macroblocks in slice */
-     return(1);
-}
-
-
-/* ISO/IEC 13818-2 sections 7.2 through 7.5 */
-static int decode_macroblock(MPEG2_Decoder *dec,
-int *macroblock_type,
-int *stwtype,
-int *stwclass,
-int *motion_type,
-int *dct_type,
-int PMV[2][2][2],
-int dc_dct_pred[3],
-int motion_vertical_field_select[2][2],
-int dmvector[2])
-{
-     /* locals */
-     int quantizer_scale_code; 
-     int comp;
-
-     int motion_vector_count = 0;
-     int mv_format = 0;
-     int dmv = 0;
-     int mvscale = 0;
-     int coded_block_pattern;
-
-     /* ISO/IEC 13818-2 section 6.3.17.1: Macroblock modes */
-     macroblock_modes(dec, macroblock_type, stwtype, stwclass,
-                      motion_type, &motion_vector_count, &mv_format, &dmv, &mvscale,
-                      dct_type);
-
-     if (dec->Fault_Flag) return(0);  /* trigger: go to next slice */
-
-     if (*macroblock_type & MACROBLOCK_QUANT) {
-          quantizer_scale_code = MPEG2_Get_Bits(dec, 5);
-
-          /* ISO/IEC 13818-2 section 7.4.2.2: Quantizer scale factor */
-          if (dec->MPEG2_Flag)
-               dec->quantizer_scale =
-               dec->q_scale_type ? MPEG2_Non_Linear_quantizer_scale[quantizer_scale_code] 
-               : (quantizer_scale_code << 1);
-          else
-               dec->quantizer_scale = quantizer_scale_code;
-     }
-
-     /* motion vectors */
-
-
-     /* ISO/IEC 13818-2 section 6.3.17.2: Motion vectors */
-
-     /* decode forward motion vectors */
-     if ((*macroblock_type & MACROBLOCK_MOTION_FORWARD) 
-         || ((*macroblock_type & MACROBLOCK_INTRA) 
-             && dec->concealment_motion_vectors)) {
-          if (dec->MPEG2_Flag)
-               MPEG2_motion_vectors(dec, PMV,dmvector,motion_vertical_field_select,
-                                    0,motion_vector_count,mv_format,dec->f_code[0][0]-1,dec->f_code[0][1]-1,
-                                    dmv,mvscale);
-          else
-               MPEG2_motion_vector(dec, PMV[0][0],dmvector,
-                                   dec->forward_f_code-1,dec->forward_f_code-1,0,0,dec->full_pel_forward_vector);
-     }
-
-     if (dec->Fault_Flag) return(0);  /* trigger: go to next slice */
-
-     /* decode backward motion vectors */
-     if (*macroblock_type & MACROBLOCK_MOTION_BACKWARD) {
-          if (dec->MPEG2_Flag)
-               MPEG2_motion_vectors(dec, PMV,dmvector,motion_vertical_field_select,
-                                    1,motion_vector_count,mv_format,dec->f_code[1][0]-1,dec->f_code[1][1]-1,0,
-                                    mvscale);
-          else
-               MPEG2_motion_vector(dec, PMV[0][1],dmvector,
-                                   dec->backward_f_code-1,dec->backward_f_code-1,0,0,dec->full_pel_backward_vector);
-     }
-
-     if (dec->Fault_Flag) return(0);  /* trigger: go to next slice */
-
-     if ((*macroblock_type & MACROBLOCK_INTRA) && dec->concealment_motion_vectors)
-          MPEG2_Flush_Buffer(dec, 1); /* remove MPEG2_marker_bit */
-
-     /* macroblock_pattern */
-     /* ISO/IEC 13818-2 section 6.3.17.4: Coded block pattern */
-     if (*macroblock_type & MACROBLOCK_PATTERN) {
-          coded_block_pattern = MPEG2_Get_coded_block_pattern(dec);
-
-          if (dec->chroma_format==CHROMA422) {
-               /* coded_block_pattern_1 */
-               coded_block_pattern = (coded_block_pattern<<2) | MPEG2_Get_Bits(dec, 2); 
-
-          }
-          else if (dec->chroma_format==CHROMA444) {
-               /* coded_block_pattern_2 */
-               coded_block_pattern = (coded_block_pattern<<6) | MPEG2_Get_Bits(dec, 6); 
-          }
-     }
-     else
-          coded_block_pattern = (*macroblock_type & MACROBLOCK_INTRA) ? 
-                                (1<<dec->block_count)-1 : 0;
-
-     if (dec->Fault_Flag) return(0);  /* trigger: go to next slice */
-
-     /* decode blocks */
-     for (comp=0; comp<dec->block_count; comp++) {
-          Clear_Block(dec, comp);
-
-          if (coded_block_pattern & (1<<(dec->block_count-1-comp))) {
-               if (*macroblock_type & MACROBLOCK_INTRA) {
-                    if (dec->MPEG2_Flag)
-                         MPEG2_Decode_MPEG2_Intra_Block(dec, comp,dc_dct_pred);
-                    else
-                         MPEG2_Decode_MPEG1_Intra_Block(dec, comp,dc_dct_pred);
-               }
-               else {
-                    if (dec->MPEG2_Flag)
-                         MPEG2_Decode_MPEG2_Non_Intra_Block(dec, comp);
-                    else
-                         MPEG2_Decode_MPEG1_Non_Intra_Block(dec, comp);
-               }
-
-               if (dec->Fault_Flag) return(0);  /* trigger: go to next slice */
-          }
-     }
-
-     if (dec->picture_coding_type==D_TYPE) {
-          /* remove end_of_macroblock (always 1, prevents startcode emulation) */
-          /* ISO/IEC 11172-2 section 2.4.2.7 and 2.4.3.6 */
-          MPEG2_marker_bit(dec, "D picture end_of_macroblock bit");
-     }
-
-     /* reset intra_dc predictors */
-     /* ISO/IEC 13818-2 section 7.2.1: DC coefficients in intra blocks */
-     if (!(*macroblock_type & MACROBLOCK_INTRA))
-          dc_dct_pred[0]=dc_dct_pred[1]=dc_dct_pred[2]=0;
-
-     /* reset motion vector predictors */
-     if ((*macroblock_type & MACROBLOCK_INTRA) && !dec->concealment_motion_vectors) {
-          /* intra mb without concealment motion vectors */
-          /* ISO/IEC 13818-2 section 7.6.3.4: Resetting motion vector predictors */
-          PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
-          PMV[0][1][0]=PMV[0][1][1]=PMV[1][1][0]=PMV[1][1][1]=0;
-     }
-
-     /* special "No_MC" macroblock_type case */
-     /* ISO/IEC 13818-2 section 7.6.3.5: Prediction in P pictures */
-     if ((dec->picture_coding_type==P_TYPE) 
-         && !(*macroblock_type & (MACROBLOCK_MOTION_FORWARD|MACROBLOCK_INTRA))) {
-          /* non-intra mb without forward mv in a P picture */
-          /* ISO/IEC 13818-2 section 7.6.3.4: Resetting motion vector predictors */
-          PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
-
-          /* derive motion_type */
-          /* ISO/IEC 13818-2 section 6.3.17.1: Macroblock modes, frame_motion_type */
-          if (dec->picture_structure==FRAME_PICTURE)
-               *motion_type = MC_FRAME;
-          else {
-               *motion_type = MC_FIELD;
-               /* predict from field of same parity */
-               motion_vertical_field_select[0][0] = (dec->picture_structure==BOTTOM_FIELD);
-          }
-     }
-
-     if (*stwclass==4) {
-          /* purely spatially predicted macroblock */
-          /* ISO/IEC 13818-2 section 7.7.5.1: Resetting motion vector predictions */
-          PMV[0][0][0]=PMV[0][0][1]=PMV[1][0][0]=PMV[1][0][1]=0;
-          PMV[0][1][0]=PMV[0][1][1]=PMV[1][1][0]=PMV[1][1][1]=0;
-     }
-
-     /* successfully decoded macroblock */
-     return(1);
-
-} /* decode_macroblock */
-
-
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getvlc.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getvlc.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getvlc.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getvlc.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,338 +0,0 @@
-/* getvlc.c, variable length decoding                                       */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-
-#include "global.h"
-#include "getvlc.h"
-
-/* private prototypes */
-/* generic picture macroblock type processing functions */
-static int Get_I_macroblock_type (MPEG2_Decoder *dec);
-static int Get_P_macroblock_type (MPEG2_Decoder *dec);
-static int Get_B_macroblock_type (MPEG2_Decoder *dec);
-static int Get_D_macroblock_type (MPEG2_Decoder *dec);
-
-
-int
-MPEG2_Get_macroblock_type(MPEG2_Decoder *dec)
-{
-     int macroblock_type = 0;
-
-     switch (dec->picture_coding_type) {
-          case I_TYPE:
-               macroblock_type = Get_I_macroblock_type(dec);
-               break;
-          case P_TYPE:
-               macroblock_type = Get_P_macroblock_type(dec);
-               break;
-          case B_TYPE:
-               macroblock_type = Get_B_macroblock_type(dec);
-               break;
-          case D_TYPE:
-               macroblock_type = Get_D_macroblock_type(dec);
-               break;
-          default:
-               printf("MPEG2_Get_macroblock_type(): unrecognized picture coding type\n");
-               break;
-     }
-
-     return macroblock_type;
-}
-
-static int
-Get_I_macroblock_type(MPEG2_Decoder *dec)
-{
-     if (MPEG2_Get_Bits1(dec)) {
-          return 1;
-     }
-
-     if (!MPEG2_Get_Bits1(dec)) {
-          if (!MPEG2_Quiet_Flag)
-               printf("Invalid macroblock_type code\n");
-          dec->Fault_Flag = 1;
-     }
-
-     return 17;
-}
-
-static int
-Get_P_macroblock_type(MPEG2_Decoder *dec)
-{
-     int code;
-
-     if ((code = MPEG2_Show_Bits(dec, 6))>=8) {
-          code >>= 3;
-          MPEG2_Flush_Buffer(dec, PMBtab0[code].len);
-          return PMBtab0[code].val;
-     }
-
-     if (code==0) {
-          if (!MPEG2_Quiet_Flag)
-               printf("Invalid macroblock_type code\n");
-          dec->Fault_Flag = 1;
-          return 0;
-     }
-
-     MPEG2_Flush_Buffer(dec, PMBtab1[code].len);
-
-     return PMBtab1[code].val;
-}
-
-static int
-Get_B_macroblock_type(MPEG2_Decoder *dec)
-{
-     int code;
-
-     if ((code = MPEG2_Show_Bits(dec, 6))>=8) {
-          code >>= 2;
-          MPEG2_Flush_Buffer(dec, BMBtab0[code].len);
-
-          return BMBtab0[code].val;
-     }
-
-     if (code==0) {
-          if (!MPEG2_Quiet_Flag)
-               printf("Invalid macroblock_type code\n");
-          dec->Fault_Flag = 1;
-          return 0;
-     }
-
-     MPEG2_Flush_Buffer(dec, BMBtab1[code].len);
-
-     return BMBtab1[code].val;
-}
-
-static int
-Get_D_macroblock_type(MPEG2_Decoder *dec)
-{
-     if (!MPEG2_Get_Bits1(dec)) {
-          if (!MPEG2_Quiet_Flag)
-               printf("Invalid macroblock_type code\n");
-          dec->Fault_Flag=1;
-     }
-
-     return 1;
-}
-
-int
-MPEG2_Get_motion_code(MPEG2_Decoder *dec)
-{
-     int code;
-
-     if (MPEG2_Get_Bits1(dec)) {
-          return 0;
-     }
-
-     if ((code = MPEG2_Show_Bits(dec, 9))>=64) {
-          code >>= 6;
-          MPEG2_Flush_Buffer(dec, MVtab0[code].len);
-
-          return MPEG2_Get_Bits1(dec)?-MVtab0[code].val:MVtab0[code].val;
-     }
-
-     if (code>=24) {
-          code >>= 3;
-          MPEG2_Flush_Buffer(dec, MVtab1[code].len);
-
-          return MPEG2_Get_Bits1(dec)?-MVtab1[code].val:MVtab1[code].val;
-     }
-
-     if ((code-=12)<0) {
-          if (!MPEG2_Quiet_Flag)
-/* HACK */
-               printf("Invalid MPEG2_motion_vector code (MBA %d, pic %d)\n", dec->global_MBA, dec->global_pic);
-          dec->Fault_Flag=1;
-          return 0;
-     }
-
-     MPEG2_Flush_Buffer(dec, MVtab2[code].len);
-
-     return MPEG2_Get_Bits1(dec) ? -MVtab2[code].val : MVtab2[code].val;
-}
-
-/* get differential motion vector (for dual prime prediction) */
-int
-MPEG2_Get_dmvector(MPEG2_Decoder *dec)
-{
-     if (MPEG2_Get_Bits(dec, 1)) {
-          return MPEG2_Get_Bits(dec, 1) ? -1 : 1;
-     }
-     else {
-          return 0;
-     }
-}
-
-int
-MPEG2_Get_coded_block_pattern(MPEG2_Decoder *dec)
-{
-     int code;
-
-     if ((code = MPEG2_Show_Bits(dec, 9))>=128) {
-          code >>= 4;
-          MPEG2_Flush_Buffer(dec, CBPtab0[code].len);
-
-          return CBPtab0[code].val;
-     }
-
-     if (code>=8) {
-          code >>= 1;
-          MPEG2_Flush_Buffer(dec, CBPtab1[code].len);
-
-          return CBPtab1[code].val;
-     }
-
-     if (code<1) {
-          if (!MPEG2_Quiet_Flag)
-               printf("Invalid coded_block_pattern code\n");
-          dec->Fault_Flag = 1;
-          return 0;
-     }
-
-     MPEG2_Flush_Buffer(dec, CBPtab2[code].len);
-
-     return CBPtab2[code].val;
-}
-
-int
-MPEG2_Get_macroblock_address_increment(MPEG2_Decoder *dec)
-{
-     int code, val;
-
-     val = 0;
-
-     while ((code = MPEG2_Show_Bits(dec, 11))<24) {
-          if (code!=15) { /* if not macroblock_stuffing */
-               if (code==8) { /* if macroblock_escape */
-                    val+= 33;
-               }
-               else {
-                    if (!MPEG2_Quiet_Flag)
-                         printf("Invalid macroblock_address_increment code\n");
-
-                    dec->Fault_Flag = 1;
-                    return 1;
-               }
-          }
-
-          MPEG2_Flush_Buffer(dec, 11);
-     }
-
-     /* macroblock_address_increment == 1 */
-     /* ('1' is in the MSB position of the lookahead) */
-     if (code>=1024) {
-          MPEG2_Flush_Buffer(dec, 1);
-          return val + 1;
-     }
-
-     /* codes 00010 ... 011xx */
-     if (code>=128) {
-          /* remove leading zeros */
-          code >>= 6;
-          MPEG2_Flush_Buffer(dec, MBAtab1[code].len);
-
-
-          return val + MBAtab1[code].val;
-     }
-
-     /* codes 00000011000 ... 0000111xxxx */
-     code-= 24; /* remove common base */
-     MPEG2_Flush_Buffer(dec, MBAtab2[code].len);
-
-     return val + MBAtab2[code].val;
-}
-
-/* combined MPEG-1 and MPEG-2 stage. parse VLC and 
-   perform dct_diff arithmetic.
-
-   MPEG-1:  ISO/IEC 11172-2 section
-   MPEG-2:  ISO/IEC 13818-2 section 7.2.1 
-   
-   Note: the arithmetic here is presented more elegantly than
-   the spec, yet the results, dct_diff, are the same.
-*/
-
-int
-MPEG2_Get_Luma_DC_dct_diff(MPEG2_Decoder *dec)
-{
-     int code, size, dct_diff;
-
-     /* decode length */
-     code = MPEG2_Show_Bits(dec, 5);
-
-     if (code<31) {
-          size = DClumtab0[code].val;
-          MPEG2_Flush_Buffer(dec, DClumtab0[code].len);
-     }
-     else {
-          code = MPEG2_Show_Bits(dec, 9) - 0x1f0;
-          size = DClumtab1[code].val;
-          MPEG2_Flush_Buffer(dec, DClumtab1[code].len);
-     }
-
-     if (size==0)
-          dct_diff = 0;
-     else {
-          dct_diff = MPEG2_Get_Bits(dec, size);
-          if ((dct_diff & (1<<(size-1)))==0)
-               dct_diff-= (1<<size) - 1;
-     }
-
-     return dct_diff;
-}
-
-
-int
-MPEG2_Get_Chroma_DC_dct_diff(MPEG2_Decoder *dec)
-{
-     int code, size, dct_diff;
-
-     /* decode length */
-     code = MPEG2_Show_Bits(dec, 5);
-
-     if (code<31) {
-          size = DCchromtab0[code].val;
-          MPEG2_Flush_Buffer(dec, DCchromtab0[code].len);
-     }
-     else {
-          code = MPEG2_Show_Bits(dec, 10) - 0x3e0;
-          size = DCchromtab1[code].val;
-          MPEG2_Flush_Buffer(dec, DCchromtab1[code].len);
-     }
-
-     if (size==0)
-          dct_diff = 0;
-     else {
-          dct_diff = MPEG2_Get_Bits(dec, size);
-          if ((dct_diff & (1<<(size-1)))==0)
-               dct_diff-= (1<<size) - 1;
-     }
-
-     return dct_diff;
-}
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getvlc.h DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getvlc.h
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/getvlc.h	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/getvlc.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,380 +0,0 @@
-/* getvlc.h, variable length code tables                                    */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-/* NOTE: #define constants such as MACROBLOCK_QUANT are upper case 
-   as per C programming convention. However, the MPEG document 
-   (ISO/IEC 13818-2) lists them in all lower case (e.g. Annex B) */
-
-/* NOTE: the VLC tables are in a flash format---a transformation
-   of the tables in Annex B to a form more convenient towards 
-   parallel (more than one-bit-at-a-time) decoding */
-
-typedef struct {
-  char val, len;
-} VLCtab;
-
-typedef struct {
-  char run, level, len;
-} DCTtab;
-
-/* Table B-3, macroblock_type in P-pictures, codes 001..1xx */
-static const VLCtab PMBtab0[8] = {
-  {ERROR,0},
-  {MACROBLOCK_MOTION_FORWARD,3},
-  {MACROBLOCK_PATTERN,2}, {MACROBLOCK_PATTERN,2},
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,1}, 
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,1},
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,1}, 
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,1}
-};
-
-/* Table B-3, macroblock_type in P-pictures, codes 000001..00011x */
-static const VLCtab PMBtab1[8] = {
-  {ERROR,0},
-  {MACROBLOCK_QUANT|MACROBLOCK_INTRA,6},
-  {MACROBLOCK_QUANT|MACROBLOCK_PATTERN,5}, {MACROBLOCK_QUANT|MACROBLOCK_PATTERN,5},
-  {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,5}, {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,5},
-  {MACROBLOCK_INTRA,5}, {MACROBLOCK_INTRA,5}
-};
-
-/* Table B-4, macroblock_type in B-pictures, codes 0010..11xx */
-static const VLCtab BMBtab0[16] = {
-  {ERROR,0}, 
-  {ERROR,0},
-  {MACROBLOCK_MOTION_FORWARD,4},
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,4},
-  {MACROBLOCK_MOTION_BACKWARD,3}, 
-  {MACROBLOCK_MOTION_BACKWARD,3},
-  {MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,3}, 
-  {MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,3},
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2}, 
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2}, 
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD,2},
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2},
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2},
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2},
-  {MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,2}
-};
-
-/* Table B-4, macroblock_type in B-pictures, codes 000001..00011x */
-static const VLCtab BMBtab1[8] = {
-  {ERROR,0},
-  {MACROBLOCK_QUANT|MACROBLOCK_INTRA,6},
-  {MACROBLOCK_QUANT|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,6},
-  {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_PATTERN,6},
-  {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,5},
-  {MACROBLOCK_QUANT|MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD|MACROBLOCK_PATTERN,5},
-  {MACROBLOCK_INTRA,5}, 
-  {MACROBLOCK_INTRA,5}
-};
-
-/* Table B-10, motion_code, codes 0001 ... 01xx */
-static const VLCtab MVtab0[8] =
-{ {ERROR,0}, {3,3}, {2,2}, {2,2}, {1,1}, {1,1}, {1,1}, {1,1}
-};
-
-/* Table B-10, motion_code, codes 0000011 ... 000011x */
-static const VLCtab MVtab1[8] =
-{ {ERROR,0}, {ERROR,0}, {ERROR,0}, {7,6}, {6,6}, {5,6}, {4,5}, {4,5}
-};
-
-/* Table B-10, motion_code, codes 0000001100 ... 000001011x */
-static const VLCtab MVtab2[12] =
-{ {16,9}, {15,9}, {14,9}, {13,9},
-  {12,9}, {11,9}, {10,8}, {10,8},
-  {9,8},  {9,8},  {8,8},  {8,8}
-};
-
-/* Table B-9, coded_block_pattern, codes 01000 ... 111xx */
-static const VLCtab CBPtab0[32] =
-{ {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
-  {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
-  {62,5}, {2,5},  {61,5}, {1,5},  {56,5}, {52,5}, {44,5}, {28,5},
-  {40,5}, {20,5}, {48,5}, {12,5}, {32,4}, {32,4}, {16,4}, {16,4},
-  {8,4},  {8,4},  {4,4},  {4,4},  {60,3}, {60,3}, {60,3}, {60,3}
-};
-
-/* Table B-9, coded_block_pattern, codes 00000100 ... 001111xx */
-static const VLCtab CBPtab1[64] =
-{ {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
-  {58,8}, {54,8}, {46,8}, {30,8},
-  {57,8}, {53,8}, {45,8}, {29,8}, {38,8}, {26,8}, {37,8}, {25,8},
-  {43,8}, {23,8}, {51,8}, {15,8}, {42,8}, {22,8}, {50,8}, {14,8},
-  {41,8}, {21,8}, {49,8}, {13,8}, {35,8}, {19,8}, {11,8}, {7,8},
-  {34,7}, {34,7}, {18,7}, {18,7}, {10,7}, {10,7}, {6,7},  {6,7},
-  {33,7}, {33,7}, {17,7}, {17,7}, {9,7},  {9,7},  {5,7},  {5,7},
-  {63,6}, {63,6}, {63,6}, {63,6}, {3,6},  {3,6},  {3,6},  {3,6},
-  {36,6}, {36,6}, {36,6}, {36,6}, {24,6}, {24,6}, {24,6}, {24,6}
-};
-
-/* Table B-9, coded_block_pattern, codes 000000001 ... 000000111 */
-static const VLCtab CBPtab2[8] =
-{ {ERROR,0}, {0,9}, {39,9}, {27,9}, {59,9}, {55,9}, {47,9}, {31,9}
-};
-
-/* Table B-1, macroblock_address_increment, codes 00010 ... 011xx */
-static const VLCtab MBAtab1[16] =
-{ {ERROR,0}, {ERROR,0}, {7,5}, {6,5}, {5,4}, {5,4}, {4,4}, {4,4},
-  {3,3}, {3,3}, {3,3}, {3,3}, {2,3}, {2,3}, {2,3}, {2,3}
-};
-
-/* Table B-1, macroblock_address_increment, codes 00000011000 ... 0000111xxxx */
-static const VLCtab MBAtab2[104] =
-{
-  {33,11}, {32,11}, {31,11}, {30,11}, {29,11}, {28,11}, {27,11}, {26,11},
-  {25,11}, {24,11}, {23,11}, {22,11}, {21,10}, {21,10}, {20,10}, {20,10},
-  {19,10}, {19,10}, {18,10}, {18,10}, {17,10}, {17,10}, {16,10}, {16,10},
-  {15,8},  {15,8},  {15,8},  {15,8},  {15,8},  {15,8},  {15,8},  {15,8},
-  {14,8},  {14,8},  {14,8},  {14,8},  {14,8},  {14,8},  {14,8},  {14,8},
-  {13,8},  {13,8},  {13,8},  {13,8},  {13,8},  {13,8},  {13,8},  {13,8},
-  {12,8},  {12,8},  {12,8},  {12,8},  {12,8},  {12,8},  {12,8},  {12,8},
-  {11,8},  {11,8},  {11,8},  {11,8},  {11,8},  {11,8},  {11,8},  {11,8},
-  {10,8},  {10,8},  {10,8},  {10,8},  {10,8},  {10,8},  {10,8},  {10,8},
-  {9,7},   {9,7},   {9,7},   {9,7},   {9,7},   {9,7},   {9,7},   {9,7},
-  {9,7},   {9,7},   {9,7},   {9,7},   {9,7},   {9,7},   {9,7},   {9,7},
-  {8,7},   {8,7},   {8,7},   {8,7},   {8,7},   {8,7},   {8,7},   {8,7},
-  {8,7},   {8,7},   {8,7},   {8,7},   {8,7},   {8,7},   {8,7},   {8,7}
-};
-
-/* Table B-12, dct_dc_size_luminance, codes 00xxx ... 11110 */
-static const VLCtab DClumtab0[32] =
-{ {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
-  {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
-  {0, 3}, {0, 3}, {0, 3}, {0, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3},
-  {4, 3}, {4, 3}, {4, 3}, {4, 3}, {5, 4}, {5, 4}, {6, 5}, {ERROR, 0}
-};
-
-/* Table B-12, dct_dc_size_luminance, codes 111110xxx ... 111111111 */
-static const VLCtab DClumtab1[16] =
-{ {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6},
-  {8, 7}, {8, 7}, {8, 7}, {8, 7}, {9, 8}, {9, 8}, {10,9}, {11,9}
-};
-
-/* Table B-13, dct_dc_size_chrominance, codes 00xxx ... 11110 */
-static const VLCtab DCchromtab0[32] =
-{ {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2},
-  {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
-  {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
-  {3, 3}, {3, 3}, {3, 3}, {3, 3}, {4, 4}, {4, 4}, {5, 5}, {ERROR, 0}
-};
-
-/* Table B-13, dct_dc_size_chrominance, codes 111110xxxx ... 1111111111 */
-static const VLCtab DCchromtab1[32] =
-{ {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6},
-  {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6},
-  {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7},
-  {8, 8}, {8, 8}, {8, 8}, {8, 8}, {9, 9}, {9, 9}, {10,10}, {11,10}
-};
-
-/* Table B-14, DCT coefficients table zero,
- * codes 0100 ... 1xxx (used for first (DC) coefficient)
- */
-const DCTtab DCTtabfirst[12] =
-{
-  {0,2,4}, {2,1,4}, {1,1,3}, {1,1,3},
-  {0,1,1}, {0,1,1}, {0,1,1}, {0,1,1},
-  {0,1,1}, {0,1,1}, {0,1,1}, {0,1,1}
-};
-
-/* Table B-14, DCT coefficients table zero,
- * codes 0100 ... 1xxx (used for all other coefficients)
- */
-const DCTtab DCTtabnext[12] =
-{
-  {0,2,4},  {2,1,4},  {1,1,3},  {1,1,3},
-  {64,0,2}, {64,0,2}, {64,0,2}, {64,0,2}, /* EOB */
-  {0,1,2},  {0,1,2},  {0,1,2},  {0,1,2}
-};
-
-/* Table B-14, DCT coefficients table zero,
- * codes 000001xx ... 00111xxx
- */
-const DCTtab DCTtab0[60] =
-{
-  {65,0,6}, {65,0,6}, {65,0,6}, {65,0,6}, /* Escape */
-  {2,2,7}, {2,2,7}, {9,1,7}, {9,1,7},
-  {0,4,7}, {0,4,7}, {8,1,7}, {8,1,7},
-  {7,1,6}, {7,1,6}, {7,1,6}, {7,1,6},
-  {6,1,6}, {6,1,6}, {6,1,6}, {6,1,6},
-  {1,2,6}, {1,2,6}, {1,2,6}, {1,2,6},
-  {5,1,6}, {5,1,6}, {5,1,6}, {5,1,6},
-  {13,1,8}, {0,6,8}, {12,1,8}, {11,1,8},
-  {3,2,8}, {1,3,8}, {0,5,8}, {10,1,8},
-  {0,3,5}, {0,3,5}, {0,3,5}, {0,3,5},
-  {0,3,5}, {0,3,5}, {0,3,5}, {0,3,5},
-  {4,1,5}, {4,1,5}, {4,1,5}, {4,1,5},
-  {4,1,5}, {4,1,5}, {4,1,5}, {4,1,5},
-  {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
-  {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5}
-};
-
-/* Table B-15, DCT coefficients table one,
- * codes 000001xx ... 11111111
-*/
-const DCTtab DCTtab0a[252] =
-{
-  {65,0,6}, {65,0,6}, {65,0,6}, {65,0,6}, /* Escape */
-  {7,1,7}, {7,1,7}, {8,1,7}, {8,1,7},
-  {6,1,7}, {6,1,7}, {2,2,7}, {2,2,7},
-  {0,7,6}, {0,7,6}, {0,7,6}, {0,7,6},
-  {0,6,6}, {0,6,6}, {0,6,6}, {0,6,6},
-  {4,1,6}, {4,1,6}, {4,1,6}, {4,1,6},
-  {5,1,6}, {5,1,6}, {5,1,6}, {5,1,6},
-  {1,5,8}, {11,1,8}, {0,11,8}, {0,10,8},
-  {13,1,8}, {12,1,8}, {3,2,8}, {1,4,8},
-  {2,1,5}, {2,1,5}, {2,1,5}, {2,1,5},
-  {2,1,5}, {2,1,5}, {2,1,5}, {2,1,5},
-  {1,2,5}, {1,2,5}, {1,2,5}, {1,2,5},
-  {1,2,5}, {1,2,5}, {1,2,5}, {1,2,5},
-  {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
-  {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
-  {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
-  {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
-  {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
-  {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
-  {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
-  {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
-  {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
-  {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
-  {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4}, /* EOB */
-  {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
-  {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
-  {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
-  {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
-  {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
-  {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
-  {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
-  {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
-  {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
-  {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
-  {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
-  {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
-  {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
-  {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
-  {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
-  {0,4,5}, {0,4,5}, {0,4,5}, {0,4,5},
-  {0,4,5}, {0,4,5}, {0,4,5}, {0,4,5},
-  {0,5,5}, {0,5,5}, {0,5,5}, {0,5,5},
-  {0,5,5}, {0,5,5}, {0,5,5}, {0,5,5},
-  {9,1,7}, {9,1,7}, {1,3,7}, {1,3,7},
-  {10,1,7}, {10,1,7}, {0,8,7}, {0,8,7},
-  {0,9,7}, {0,9,7}, {0,12,8}, {0,13,8},
-  {2,3,8}, {4,2,8}, {0,14,8}, {0,15,8}
-};
-
-/* Table B-14, DCT coefficients table zero,
- * codes 0000001000 ... 0000001111
- */
-const DCTtab DCTtab1[8] =
-{
-  {16,1,10}, {5,2,10}, {0,7,10}, {2,3,10},
-  {1,4,10}, {15,1,10}, {14,1,10}, {4,2,10}
-};
-
-/* Table B-15, DCT coefficients table one,
- * codes 000000100x ... 000000111x
- */
-const DCTtab DCTtab1a[8] =
-{
-  {5,2,9}, {5,2,9}, {14,1,9}, {14,1,9},
-  {2,4,10}, {16,1,10}, {15,1,9}, {15,1,9}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 000000010000 ... 000000011111
- */
-const DCTtab DCTtab2[16] =
-{
-  {0,11,12}, {8,2,12}, {4,3,12}, {0,10,12},
-  {2,4,12}, {7,2,12}, {21,1,12}, {20,1,12},
-  {0,9,12}, {19,1,12}, {18,1,12}, {1,5,12},
-  {3,3,12}, {0,8,12}, {6,2,12}, {17,1,12}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 0000000010000 ... 0000000011111
- */
-const DCTtab DCTtab3[16] =
-{
-  {10,2,13}, {9,2,13}, {5,3,13}, {3,4,13},
-  {2,5,13}, {1,7,13}, {1,6,13}, {0,15,13},
-  {0,14,13}, {0,13,13}, {0,12,13}, {26,1,13},
-  {25,1,13}, {24,1,13}, {23,1,13}, {22,1,13}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 00000000010000 ... 00000000011111
- */
-const DCTtab DCTtab4[16] =
-{
-  {0,31,14}, {0,30,14}, {0,29,14}, {0,28,14},
-  {0,27,14}, {0,26,14}, {0,25,14}, {0,24,14},
-  {0,23,14}, {0,22,14}, {0,21,14}, {0,20,14},
-  {0,19,14}, {0,18,14}, {0,17,14}, {0,16,14}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 000000000010000 ... 000000000011111
- */
-const DCTtab DCTtab5[16] =
-{
-  {0,40,15}, {0,39,15}, {0,38,15}, {0,37,15},
-  {0,36,15}, {0,35,15}, {0,34,15}, {0,33,15},
-  {0,32,15}, {1,14,15}, {1,13,15}, {1,12,15},
-  {1,11,15}, {1,10,15}, {1,9,15}, {1,8,15}
-};
-
-/* Table B-14/15, DCT coefficients table zero / one,
- * codes 0000000000010000 ... 0000000000011111
- */
-const DCTtab DCTtab6[16] =
-{
-  {1,18,16}, {1,17,16}, {1,16,16}, {1,15,16},
-  {6,3,16}, {16,2,16}, {15,2,16}, {14,2,16},
-  {13,2,16}, {12,2,16}, {11,2,16}, {31,1,16},
-  {30,1,16}, {29,1,16}, {28,1,16}, {27,1,16}
-};
-
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/global.h DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/global.h
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/global.h	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/global.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,115 +0,0 @@
-/* global.h, global variables                                               */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include "mpeg2dec.h"
-
-
-/* prototypes of global functions */
-
-/* MPEG2_Get_Bits.c */
-void MPEG2_Initialize_Buffer (MPEG2_Decoder *dec);
-void MPEG2_Fill_Buffer (MPEG2_Decoder *dec);
-unsigned int MPEG2_Show_Bits (MPEG2_Decoder *dec, int n);
-unsigned int MPEG2_Get_Bits1 (MPEG2_Decoder *dec);
-void MPEG2_Flush_Buffer (MPEG2_Decoder *dec, int n);
-unsigned int MPEG2_Get_Bits (MPEG2_Decoder *dec, int n);
-
-/* systems.c */
-void MPEG2_Flush_Buffer32 (MPEG2_Decoder *dec);
-unsigned int MPEG2_Get_Bits32 (MPEG2_Decoder *dec);
-
-/* getblk.c */
-void MPEG2_Decode_MPEG1_Intra_Block (MPEG2_Decoder *dec,
-                                     int comp, int dc_dct_pred[]);
-void MPEG2_Decode_MPEG1_Non_Intra_Block (MPEG2_Decoder *dec, int comp);
-void MPEG2_Decode_MPEG2_Intra_Block (MPEG2_Decoder *dec,
-                                     int comp, int dc_dct_pred[]);
-void MPEG2_Decode_MPEG2_Non_Intra_Block (MPEG2_Decoder *dec, int comp);
-
-/* gethdr.c */
-int MPEG2_Get_Hdr (MPEG2_Decoder *dec);
-void MPEG2_next_start_code (MPEG2_Decoder *dec);
-int MPEG2_slice_header (MPEG2_Decoder *dec);
-void MPEG2_marker_bit (MPEG2_Decoder *dec, char *text);
-
-/* getpic.c */
-void MPEG2_Decode_Picture (MPEG2_Decoder *dec,
-                           int bitstream_framenum, int sequence_framenum);
-void MPEG2_Output_Last_Frame_of_Sequence (MPEG2_Decoder *dec, int framenum);
-
-/* getvlc.c */
-int MPEG2_Get_macroblock_type (MPEG2_Decoder *dec);
-int MPEG2_Get_motion_code (MPEG2_Decoder *dec);
-int MPEG2_Get_dmvector (MPEG2_Decoder *dec);
-int MPEG2_Get_coded_block_pattern (MPEG2_Decoder *dec);
-int MPEG2_Get_macroblock_address_increment (MPEG2_Decoder *dec);
-int MPEG2_Get_Luma_DC_dct_diff (MPEG2_Decoder *dec);
-int MPEG2_Get_Chroma_DC_dct_diff (MPEG2_Decoder *dec);
-
-/* idct.c */
-void MPEG2_Fast_IDCT (MPEG2_Decoder *dec, short *block);
-void MPEG2_Initialize_Fast_IDCT (MPEG2_Decoder *dec);
-
-/* MPEG2_Reference_IDCT.c */
-void MPEG2_Initialize_Reference_IDCT (MPEG2_Decoder *dec);
-void MPEG2_Reference_IDCT (MPEG2_Decoder *dec, short *block);
-
-/* motion.c */
-void MPEG2_motion_vectors (MPEG2_Decoder *dec, int PMV[2][2][2], int dmvector[2],
-                           int motion_vertical_field_select[2][2], int s, int motion_vector_count, 
-                           int mv_format, int h_r_size, int v_r_size, int dmv, int mvscale);
-void MPEG2_motion_vector (MPEG2_Decoder *dec, int *PMV, int *dmvector,
-                          int h_r_size, int v_r_size, int dmv, int mvscale, int full_pel_vector);
-void MPEG2_Dual_Prime_Arithmetic (MPEG2_Decoder *dec, int DMV[][2], int *dmvector, int mvx, int mvy);
-
-/* mpeg2dec.c */
-void MPEG2_Error (MPEG2_Decoder *dec, char *text);
-void MPEG2_Warning (MPEG2_Decoder *dec, char *text);
-
-/* recon.c */
-void MPEG2_form_predictions (MPEG2_Decoder *dec, int bx, int by, int macroblock_type, 
-                             int motion_type, int PMV[2][2][2], int motion_vertical_field_select[2][2], 
-                             int dmvector[2], int stwtype);
-
-/* store.c */
-void MPEG2_Write_Frame (MPEG2_Decoder *dec, unsigned char *src[], int frame);
-
-/* global variables */
-
-/* zig-zag and alternate MPEG2_scan patterns */
-extern const unsigned char MPEG2_scan[2][64];
-
-/* non-linear quantization coefficient table */
-extern const unsigned char MPEG2_Non_Linear_quantizer_scale[32];
-
-
-/* decoder operation control flags */
-extern int MPEG2_Quiet_Flag;
-extern int MPEG2_Reference_IDCT_Flag;
-
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/idct.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/idct.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/idct.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/idct.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,204 +0,0 @@
-/* idct.c, inverse fast discrete cosine transform                           */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-/**********************************************************/
-/* inverse two dimensional DCT, Chen-Wang algorithm       */
-/* (cf. IEEE ASSP-32, pp. 803-816, Aug. 1984)             */
-/* 32-bit integer arithmetic (8 bit coefficients)         */
-/* 11 mults, 29 adds per DCT                              */
-/*                                      sE, 18.8.91       */
-/**********************************************************/
-/* coefficients extended to 12 bit for IEEE1180-1990      */
-/* compliance                           sE,  2.1.94       */
-/**********************************************************/
-
-/* this code assumes >> to be a two's-complement arithmetic */
-/* right shift: (-2)>>1 == -1 , (-3)>>1 == -2               */
-
-#define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */
-#define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */
-#define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */
-#define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */
-#define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */
-#define W7 565  /* 2048*sqrt(2)*cos(7*pi/16) */
-
-#include "global.h"
-
-/* private data */
-static short iclip[1024]; /* clipping table */
-static short *iclp;
-
-/* private prototypes */
-static void idctrow (short *blk);
-static void idctcol (short *blk);
-
-/* row (horizontal) IDCT
- *
- *           7                       pi         1
- * dst[k] = sum c[l] * src[l] * cos( -- * ( k + - ) * l )
- *          l=0                      8          2
- *
- * where: c[0]    = 128
- *        c[1..7] = 128*sqrt(2)
- */
-
-static void idctrow(blk)
-short *blk;
-{
-     int x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
-     /* shortcut */
-     if (!((x1 = blk[4]<<11) | (x2 = blk[6]) | (x3 = blk[2]) |
-           (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) {
-          blk[0]=blk[1]=blk[2]=blk[3]=blk[4]=blk[5]=blk[6]=blk[7]=blk[0]<<3;
-          return;
-     }
-
-     x0 = (blk[0]<<11) + 128; /* for proper rounding in the fourth stage */
-
-     /* first stage */
-     x8 = W7*(x4+x5);
-     x4 = x8 + (W1-W7)*x4;
-     x5 = x8 - (W1+W7)*x5;
-     x8 = W3*(x6+x7);
-     x6 = x8 - (W3-W5)*x6;
-     x7 = x8 - (W3+W5)*x7;
-
-     /* second stage */
-     x8 = x0 + x1;
-     x0 -= x1;
-     x1 = W6*(x3+x2);
-     x2 = x1 - (W2+W6)*x2;
-     x3 = x1 + (W2-W6)*x3;
-     x1 = x4 + x6;
-     x4 -= x6;
-     x6 = x5 + x7;
-     x5 -= x7;
-
-     /* third stage */
-     x7 = x8 + x3;
-     x8 -= x3;
-     x3 = x0 + x2;
-     x0 -= x2;
-     x2 = (181*(x4+x5)+128)>>8;
-     x4 = (181*(x4-x5)+128)>>8;
-
-     /* fourth stage */
-     blk[0] = (x7+x1)>>8;
-     blk[1] = (x3+x2)>>8;
-     blk[2] = (x0+x4)>>8;
-     blk[3] = (x8+x6)>>8;
-     blk[4] = (x8-x6)>>8;
-     blk[5] = (x0-x4)>>8;
-     blk[6] = (x3-x2)>>8;
-     blk[7] = (x7-x1)>>8;
-}
-
-/* column (vertical) IDCT
- *
- *             7                         pi         1
- * dst[8*k] = sum c[l] * src[8*l] * cos( -- * ( k + - ) * l )
- *            l=0                        8          2
- *
- * where: c[0]    = 1/1024
- *        c[1..7] = (1/1024)*sqrt(2)
- */
-static void idctcol(blk)
-short *blk;
-{
-     int x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
-     /* shortcut */
-     if (!((x1 = (blk[8*4]<<8)) | (x2 = blk[8*6]) | (x3 = blk[8*2]) |
-           (x4 = blk[8*1]) | (x5 = blk[8*7]) | (x6 = blk[8*5]) | (x7 = blk[8*3]))) {
-          blk[8*0]=blk[8*1]=blk[8*2]=blk[8*3]=blk[8*4]=blk[8*5]=blk[8*6]=blk[8*7]=
-                                                                         iclp[(blk[8*0]+32)>>6];
-          return;
-     }
-
-     x0 = (blk[8*0]<<8) + 8192;
-
-     /* first stage */
-     x8 = W7*(x4+x5) + 4;
-     x4 = (x8+(W1-W7)*x4)>>3;
-     x5 = (x8-(W1+W7)*x5)>>3;
-     x8 = W3*(x6+x7) + 4;
-     x6 = (x8-(W3-W5)*x6)>>3;
-     x7 = (x8-(W3+W5)*x7)>>3;
-
-     /* second stage */
-     x8 = x0 + x1;
-     x0 -= x1;
-     x1 = W6*(x3+x2) + 4;
-     x2 = (x1-(W2+W6)*x2)>>3;
-     x3 = (x1+(W2-W6)*x3)>>3;
-     x1 = x4 + x6;
-     x4 -= x6;
-     x6 = x5 + x7;
-     x5 -= x7;
-
-     /* third stage */
-     x7 = x8 + x3;
-     x8 -= x3;
-     x3 = x0 + x2;
-     x0 -= x2;
-     x2 = (181*(x4+x5)+128)>>8;
-     x4 = (181*(x4-x5)+128)>>8;
-
-     /* fourth stage */
-     blk[8*0] = iclp[(x7+x1)>>14];
-     blk[8*1] = iclp[(x3+x2)>>14];
-     blk[8*2] = iclp[(x0+x4)>>14];
-     blk[8*3] = iclp[(x8+x6)>>14];
-     blk[8*4] = iclp[(x8-x6)>>14];
-     blk[8*5] = iclp[(x0-x4)>>14];
-     blk[8*6] = iclp[(x3-x2)>>14];
-     blk[8*7] = iclp[(x7-x1)>>14];
-}
-
-/* two dimensional inverse discrete cosine transform */
-void MPEG2_Fast_IDCT(MPEG2_Decoder *dec, short *block)
-{
-     int i;
-
-     for (i=0; i<8; i++)
-          idctrow(block+8*i);
-
-     for (i=0; i<8; i++)
-          idctcol(block+i);
-}
-
-void MPEG2_Initialize_Fast_IDCT(MPEG2_Decoder *dec)
-{
-     int i;
-
-     iclp = iclip+512;
-     for (i= -512; i<512; i++)
-          iclp[i] = (i<-256) ? -256 : ((i>255) ? 255 : i);
-}
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/idctref.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/idctref.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/idctref.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/idctref.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,100 +0,0 @@
-/* MPEG2_Reference_IDCT.c, Inverse Discrete Fourier Transform, double precision          */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-/*  Perform IEEE 1180 reference (64-bit floating point, separable 8x1
- *  direct matrix multiply) Inverse Discrete Cosine Transform
-*/
-
-
-/* Here we use math.h to generate constants.  Compiler results may
-   vary a little */
-
-#include <math.h>
-
-#ifndef PI
-# ifdef M_PI
-#  define PI M_PI
-# else
-#  define PI 3.14159265358979323846
-# endif
-#endif
-
-#include "global.h"
-
-/* private data */
-
-/* cosine transform matrix for 8x1 IDCT */
-static double c[8][8];
-
-/* initialize DCT coefficient matrix */
-
-void MPEG2_Initialize_Reference_IDCT(MPEG2_Decoder *dec)
-{
-     int freq, time;
-     double scale;
-
-     for (freq=0; freq < 8; freq++) {
-          scale = (freq == 0) ? sqrt(0.125) : 0.5;
-          for (time=0; time<8; time++)
-               c[freq][time] = scale*cos((PI/8.0)*freq*(time + 0.5));
-     }
-}
-
-/* perform IDCT matrix multiply for 8x8 coefficient block */
-
-void MPEG2_Reference_IDCT(MPEG2_Decoder *dec, short *block)
-{
-     int i, j, k, v;
-     double partial_product;
-     double tmp[64];
-
-     for (i=0; i<8; i++)
-          for (j=0; j<8; j++) {
-               partial_product = 0.0;
-
-               for (k=0; k<8; k++)
-                    partial_product+= c[k][j]*block[8*i+k];
-
-               tmp[8*i+j] = partial_product;
-          }
-
-     /* Transpose operation is integrated into address mapping by switching 
-        loop order of i and j */
-
-     for (j=0; j<8; j++)
-          for (i=0; i<8; i++) {
-               partial_product = 0.0;
-
-               for (k=0; k<8; k++)
-                    partial_product+= c[k][i]*tmp[8*k+j];
-
-               v = (int) floor(partial_product+0.5);
-               block[8*i+j] = (v<-256) ? -256 : ((v>255) ? 255 : v);
-          }
-}
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/Makefile.am DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/Makefile.am
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/Makefile.am	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/Makefile.am	1970-01-01 01:00:00.000000000 +0100
@@ -1,30 +0,0 @@
-## Makefile.am for DirectFB/interfaces/IDirectFBImageProvider/mpeg2
-
-INCLUDES = \
-	-I$(top_srcdir)/include \
-	-I$(top_builddir)/lib	\
-	-I$(top_srcdir)/lib	\
-	-I$(top_srcdir)/src
-
-noinst_LTLIBRARIES = libmpeg2decode.la
-
-libmpeg2decode_la_SOURCES = \
-	getbits.c		\
-	getblk.c		\
-	gethdr.c		\
-	getpic.c		\
-	getvlc.c		\
-	getvlc.h		\
-	global.h		\
-	idct.c			\
-	idctref.c		\
-	motion.c		\
-	mpeg2dec.c		\
-	mpeg2dec.h		\
-	recon.c			\
-	store.c			\
-	systems.c
-
-libmpeg2decode_la_LIBADD = -lm
-
-libmpeg2decode_la_LDFLAGS = -avoid-version -module
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/Makefile.in DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/Makefile.in
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/Makefile.in	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/Makefile.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,547 +0,0 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = interfaces/IDirectFBImageProvider/mpeg2
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
-	$(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libmpeg2decode_la_DEPENDENCIES =
-am_libmpeg2decode_la_OBJECTS = getbits.lo getblk.lo gethdr.lo \
-	getpic.lo getvlc.lo idct.lo idctref.lo motion.lo mpeg2dec.lo \
-	recon.lo store.lo systems.lo
-libmpeg2decode_la_OBJECTS = $(am_libmpeg2decode_la_OBJECTS)
-libmpeg2decode_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(libmpeg2decode_la_LDFLAGS) $(LDFLAGS) -o $@
-DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libmpeg2decode_la_SOURCES)
-DIST_SOURCES = $(libmpeg2decode_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-ASFLAGS = @ASFLAGS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATADIR = @DATADIR@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
-DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
-DFB_LDFLAGS = @DFB_LDFLAGS@
-DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
-DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
-DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
-DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
-DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
-DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
-DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
-DIRECTFB_VERSION = @DIRECTFB_VERSION@
-DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
-DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
-DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
-DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
-DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
-DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
-DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
-DYNLIB = @DYNLIB@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
-FREETYPE_CONFIG = @FREETYPE_CONFIG@
-FREETYPE_LIBS = @FREETYPE_LIBS@
-FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
-FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
-FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
-FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
-GIF_PROVIDER = @GIF_PROVIDER@
-GREP = @GREP@
-HAVE_LINUX = @HAVE_LINUX@
-INCLUDEDIR = @INCLUDEDIR@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
-JPEG_PROVIDER = @JPEG_PROVIDER@
-LDFLAGS = @LDFLAGS@
-LIBJPEG = @LIBJPEG@
-LIBOBJS = @LIBOBJS@
-LIBPNG = @LIBPNG@
-LIBPNG_CONFIG = @LIBPNG_CONFIG@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_BINARY = @LT_BINARY@
-LT_CURRENT = @LT_CURRENT@
-LT_RELEASE = @LT_RELEASE@
-LT_REVISION = @LT_REVISION@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MAN2HTML = @MAN2HTML@
-MKDIR_P = @MKDIR_P@
-MODULEDIR = @MODULEDIR@
-MODULEDIRNAME = @MODULEDIRNAME@
-OBJEXT = @OBJEXT@
-OSX_LIBS = @OSX_LIBS@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-PKG_CONFIG = @PKG_CONFIG@
-PNG_PROVIDER = @PNG_PROVIDER@
-RANLIB = @RANLIB@
-RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
-SDL_CFLAGS = @SDL_CFLAGS@
-SDL_CONFIG = @SDL_CONFIG@
-SDL_LIBS = @SDL_LIBS@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SOPATH = @SOPATH@
-STRIP = @STRIP@
-SYSCONFDIR = @SYSCONFDIR@
-SYSFS_LIBS = @SYSFS_LIBS@
-THREADFLAGS = @THREADFLAGS@
-THREADLIB = @THREADLIB@
-TSLIB_CFLAGS = @TSLIB_CFLAGS@
-TSLIB_LIBS = @TSLIB_LIBS@
-VERSION = @VERSION@
-VNC_CFLAGS = @VNC_CFLAGS@
-VNC_CONFIG = @VNC_CONFIG@
-VNC_LIBS = @VNC_LIBS@
-X11_CFLAGS = @X11_CFLAGS@
-X11_LIBS = @X11_LIBS@
-ZLIB_LIBS = @ZLIB_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-INCLUDES = \
-	-I$(top_srcdir)/include \
-	-I$(top_builddir)/lib	\
-	-I$(top_srcdir)/lib	\
-	-I$(top_srcdir)/src
-
-noinst_LTLIBRARIES = libmpeg2decode.la
-libmpeg2decode_la_SOURCES = \
-	getbits.c		\
-	getblk.c		\
-	gethdr.c		\
-	getpic.c		\
-	getvlc.c		\
-	getvlc.h		\
-	global.h		\
-	idct.c			\
-	idctref.c		\
-	motion.c		\
-	mpeg2dec.c		\
-	mpeg2dec.h		\
-	recon.c			\
-	store.c			\
-	systems.c
-
-libmpeg2decode_la_LIBADD = -lm
-libmpeg2decode_la_LDFLAGS = -avoid-version -module
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  interfaces/IDirectFBImageProvider/mpeg2/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  interfaces/IDirectFBImageProvider/mpeg2/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-clean-noinstLTLIBRARIES:
-	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libmpeg2decode.la: $(libmpeg2decode_la_OBJECTS) $(libmpeg2decode_la_DEPENDENCIES) 
-	$(libmpeg2decode_la_LINK)  $(libmpeg2decode_la_OBJECTS) $(libmpeg2decode_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getbits.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getblk.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gethdr.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpic.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getvlc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idct.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idctref.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motion.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpeg2dec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recon.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/store.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/systems.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
-	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
-	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-info: install-info-am
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-ps: install-ps-am
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-noinstLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags uninstall uninstall-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/motion.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/motion.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/motion.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/motion.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,178 +0,0 @@
-/* motion.c, motion vector decoding                                         */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-
-#include "global.h"
-
-/* private prototypes */
-static void decode_motion_vector (MPEG2_Decoder *dec, int *pred, int r_size, int motion_code,
-                                  int motion_residualesidual, int full_pel_vector);
-
-/* ISO/IEC 13818-2 sections 6.2.5.2, 6.3.17.2, and 7.6.3: Motion vectors */
-void
-MPEG2_motion_vectors(MPEG2_Decoder *dec,
-                     int PMV[2][2][2],
-                     int dmvector[2],
-                     int motion_vertical_field_select[2][2],
-                     int s, int motion_vector_count, int mv_format, int h_r_size, int v_r_size, int dmv, int mvscale)
-{
-     if (motion_vector_count==1) {
-          if (mv_format==MV_FIELD && !dmv) {
-               motion_vertical_field_select[1][s] = motion_vertical_field_select[0][s] = MPEG2_Get_Bits(dec, 1);
-          }
-
-          MPEG2_motion_vector(dec, PMV[0][s],dmvector,h_r_size,v_r_size,dmv,mvscale,0);
-
-          /* update other motion vector predictors */
-          PMV[1][s][0] = PMV[0][s][0];
-          PMV[1][s][1] = PMV[0][s][1];
-     }
-     else {
-          motion_vertical_field_select[0][s] = MPEG2_Get_Bits(dec, 1);
-          MPEG2_motion_vector(dec, PMV[0][s],dmvector,h_r_size,v_r_size,dmv,mvscale,0);
-
-          motion_vertical_field_select[1][s] = MPEG2_Get_Bits(dec, 1);
-          MPEG2_motion_vector(dec, PMV[1][s],dmvector,h_r_size,v_r_size,dmv,mvscale,0);
-     }
-}
-
-/* get and decode motion vector and differential motion vector 
-   for one prediction */
-void
-MPEG2_motion_vector(MPEG2_Decoder *dec,
-                    int *PMV,
-                    int *dmvector,
-                    int h_r_size,
-                    int v_r_size,
-                    int dmv, /* MPEG-2 only: get differential motion vectors */
-                    int mvscale, /* MPEG-2 only: field vector in frame pic */
-                    int full_pel_vector) /* MPEG-1 only */
-{
-     int motion_code, motion_residual;
-
-     /* horizontal component */
-     /* ISO/IEC 13818-2 Table B-10 */
-     motion_code = MPEG2_Get_motion_code(dec);
-
-     motion_residual = (h_r_size!=0 && motion_code!=0) ? MPEG2_Get_Bits(dec, h_r_size) : 0;
-
-
-     decode_motion_vector(dec, &PMV[0],h_r_size,motion_code,motion_residual,full_pel_vector);
-
-     if (dmv)
-          dmvector[0] = MPEG2_Get_dmvector(dec);
-
-
-     /* vertical component */
-     motion_code     = MPEG2_Get_motion_code(dec);
-     motion_residual = (v_r_size!=0 && motion_code!=0) ? MPEG2_Get_Bits(dec, v_r_size) : 0;
-
-     if (mvscale)
-          PMV[1] >>= 1; /* DIV 2 */
-
-     decode_motion_vector(dec, &PMV[1],v_r_size,motion_code,motion_residual,full_pel_vector);
-
-     if (mvscale)
-          PMV[1] <<= 1;
-
-     if (dmv)
-          dmvector[1] = MPEG2_Get_dmvector(dec);
-}
-
-/* calculate motion vector component */
-/* ISO/IEC 13818-2 section 7.6.3.1: Decoding the motion vectors */
-/* Note: the arithmetic here is more elegant than that which is shown 
-   in 7.6.3.1.  The end results (PMV[][][]) should, however, be the same.  */
-
-static void
-decode_motion_vector(MPEG2_Decoder *dec,
-                     int *pred,
-                     int r_size, int motion_code, int motion_residual,
-                     int full_pel_vector) /* MPEG-1 (ISO/IEC 11172-1) support */
-{
-     int lim, vec;
-
-     lim = 16<<r_size;
-     vec = full_pel_vector ? (*pred >> 1) : (*pred);
-
-     if (motion_code>0) {
-          vec+= ((motion_code-1)<<r_size) + motion_residual + 1;
-          if (vec>=lim)
-               vec-= lim + lim;
-     }
-     else if (motion_code<0) {
-          vec-= ((-motion_code-1)<<r_size) + motion_residual + 1;
-          if (vec<-lim)
-               vec+= lim + lim;
-     }
-     *pred = full_pel_vector ? (vec<<1) : vec;
-}
-
-
-/* ISO/IEC 13818-2 section 7.6.3.6: Dual prime additional arithmetic */
-void
-MPEG2_Dual_Prime_Arithmetic(MPEG2_Decoder *dec,
-                            int DMV[][2],
-                            int *dmvector, /* differential motion vector */
-                            int mvx, int mvy)  /* decoded mv components (always in field format) */
-{
-     if (dec->picture_structure==FRAME_PICTURE) {
-          if (dec->top_field_first) {
-               /* vector for prediction of top field from bottom field */
-               DMV[0][0] = ((mvx  +(mvx>0))>>1) + dmvector[0];
-               DMV[0][1] = ((mvy  +(mvy>0))>>1) + dmvector[1] - 1;
-
-               /* vector for prediction of bottom field from top field */
-               DMV[1][0] = ((3*mvx+(mvx>0))>>1) + dmvector[0];
-               DMV[1][1] = ((3*mvy+(mvy>0))>>1) + dmvector[1] + 1;
-          }
-          else {
-               /* vector for prediction of top field from bottom field */
-               DMV[0][0] = ((3*mvx+(mvx>0))>>1) + dmvector[0];
-               DMV[0][1] = ((3*mvy+(mvy>0))>>1) + dmvector[1] - 1;
-
-               /* vector for prediction of bottom field from top field */
-               DMV[1][0] = ((mvx  +(mvx>0))>>1) + dmvector[0];
-               DMV[1][1] = ((mvy  +(mvy>0))>>1) + dmvector[1] + 1;
-          }
-     }
-     else {
-          /* vector for prediction from field of opposite 'parity' */
-          DMV[0][0] = ((mvx+(mvx>0))>>1) + dmvector[0];
-          DMV[0][1] = ((mvy+(mvy>0))>>1) + dmvector[1];
-
-          /* correct for vertical field shift */
-          if (dec->picture_structure==TOP_FIELD)
-               DMV[0][1]--;
-          else
-               DMV[0][1]++;
-     }
-}
-
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/mpeg2dec.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/mpeg2dec.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/mpeg2dec.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/mpeg2dec.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,263 +0,0 @@
-
-/* mpeg2dec.c, main(), initialization, option processing                    */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <fcntl.h>
-
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "global.h"
-
-/* private prototypes */
-static int  video_sequence (MPEG2_Decoder *dec, int *framenum);
-static void Initialize_Sequence (MPEG2_Decoder *dec);
-static void Initialize_Decoder (MPEG2_Decoder *dec);
-static void Deinitialize_Sequence (MPEG2_Decoder *dec);
-
-/* decoder operation control flags */
-int MPEG2_Quiet_Flag = 0;
-int MPEG2_Reference_IDCT_Flag = 0;
-
-/* zig-zag and alternate MPEG2_scan patterns */
-const unsigned char MPEG2_scan[2][64] = {
-     { /* Zig-Zag MPEG2_scan pattern  */
-          0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,
-          12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,
-          35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,
-          58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63
-     },
-     { /* Alternate MPEG2_scan pattern */
-          0,8,16,24,1,9,2,10,17,25,32,40,48,56,57,49,
-          41,33,26,18,3,11,4,12,19,27,34,42,50,58,35,43,
-          51,59,20,28,5,13,6,14,21,29,36,44,52,60,37,45,
-          53,61,22,30,7,15,23,31,38,46,54,62,39,47,55,63
-     }
-};
-
-/* non-linear quantization coefficient table */
-const unsigned char MPEG2_Non_Linear_quantizer_scale[32] = {
-     0, 1, 2, 3, 4, 5, 6, 7,
-     8,10,12,14,16,18,20,22,
-     24,28,32,36,40,44,48,52,
-     56,64,72,80,88,96,104,112
-};
-
-MPEG2_Decoder *
-MPEG2_Init (MPEG2_Read mpeg2_read, void *read_ctx, int *width, int *height)
-{
-     MPEG2_Decoder *dec;
-
-     dec = calloc( 1, sizeof(MPEG2_Decoder) );
-     if (!dec)
-          return NULL;
-
-     dec->mpeg2_read = mpeg2_read;
-     dec->mpeg2_read_ctx = read_ctx;
-
-     MPEG2_Initialize_Buffer(dec);
-
-     Initialize_Decoder(dec);
-
-     if (MPEG2_Get_Hdr(dec) != 1) {
-          free(dec);
-          return NULL;
-     }
-
-     if (width)
-          *width = dec->horizontal_size;
-
-     if (height)
-          *height = dec->vertical_size;
-
-     return dec;
-}
-
-int
-MPEG2_Decode(MPEG2_Decoder *dec, MPEG2_Write mpeg2_write, void *write_ctx)
-{
-     int Bitstream_Framenum = 0;
-
-     dec->mpeg2_write = mpeg2_write;
-     dec->mpeg2_write_ctx = write_ctx;
-
-     return video_sequence(dec, &Bitstream_Framenum);
-}
-
-void
-MPEG2_Close(MPEG2_Decoder *dec)
-{
-}
-
-
-
-/* IMPLEMENTAION specific rouintes */
-static void
-Initialize_Decoder(MPEG2_Decoder *dec)
-{
-     int i;
-
-     dec->Clip = dec->_Clip + 384;
-
-     for (i=-384; i<640; i++)
-          dec->Clip[i] = (i<0) ? 0 : ((i>255) ? 255 : i);
-
-     /* IDCT */
-     if (MPEG2_Reference_IDCT_Flag)
-          MPEG2_Initialize_Reference_IDCT(dec);
-     else
-          MPEG2_Initialize_Fast_IDCT(dec);
-
-}
-
-/* mostly IMPLEMENTAION specific rouintes */
-static void
-Initialize_Sequence(MPEG2_Decoder *dec)
-{
-     int cc, size;
-     static int Table_6_20[3] = {6,8,12};
-
-     /* force MPEG-1 parameters for proper decoder behavior */
-     /* see ISO/IEC 13818-2 section D.9.14 */
-     if (!dec->MPEG2_Flag) {
-          dec->progressive_sequence = 1;
-          dec->progressive_frame = 1;
-          dec->picture_structure = FRAME_PICTURE;
-          dec->frame_pred_frame_dct = 1;
-          dec->chroma_format = CHROMA420;
-          dec->matrix_coefficients = 5;
-     }
-
-     /* round to nearest multiple of coded macroblocks */
-     /* ISO/IEC 13818-2 section 6.3.3 sequence_header() */
-     dec->mb_width = (dec->horizontal_size+15)/16;
-     dec->mb_height = (dec->MPEG2_Flag && !dec->progressive_sequence) ? 2*((dec->vertical_size+31)/32)
-                      : (dec->vertical_size+15)/16;
-
-     dec->Coded_Picture_Width = 16*dec->mb_width;
-     dec->Coded_Picture_Height = 16*dec->mb_height;
-
-     /* ISO/IEC 13818-2 sections 6.1.1.8, 6.1.1.9, and 6.1.1.10 */
-     dec->Chroma_Width = (dec->chroma_format==CHROMA444) ? dec->Coded_Picture_Width
-                         : dec->Coded_Picture_Width>>1;
-     dec->Chroma_Height = (dec->chroma_format!=CHROMA420) ? dec->Coded_Picture_Height
-                          : dec->Coded_Picture_Height>>1;
-
-     /* derived based on Table 6-20 in ISO/IEC 13818-2 section 6.3.17 */
-     dec->block_count = Table_6_20[dec->chroma_format-1];
-
-     for (cc=0; cc<3; cc++) {
-          if (cc==0)
-               size = dec->Coded_Picture_Width*dec->Coded_Picture_Height;
-          else
-               size = dec->Chroma_Width*dec->Chroma_Height;
-
-          if (!(dec->backward_reference_frame[cc] = (unsigned char *)malloc(size)))
-               MPEG2_Error(dec, "backward_reference_frame[] malloc failed\n");
-
-          if (!(dec->forward_reference_frame[cc] = (unsigned char *)malloc(size)))
-               MPEG2_Error(dec, "forward_reference_frame[] malloc failed\n");
-
-          if (!(dec->auxframe[cc] = (unsigned char *)malloc(size)))
-               MPEG2_Error(dec, "auxframe[] malloc failed\n");
-     }
-}
-
-void
-MPEG2_Error(MPEG2_Decoder *dec, char *text)
-{
-     fprintf(stderr,text);
-     //  exit(1);
-}
-
-static void
-Deinitialize_Sequence(MPEG2_Decoder *dec)
-{
-     int i;
-
-     /* clear flags */
-     dec->MPEG2_Flag=0;
-
-     for (i=0;i<3;i++) {
-          free(dec->backward_reference_frame[i]);
-          free(dec->forward_reference_frame[i]);
-          free(dec->auxframe[i]);
-     }
-}
-
-
-static int
-video_sequence(MPEG2_Decoder *dec, int *Bitstream_Framenumber)
-{
-     int Bitstream_Framenum;
-     int Sequence_Framenum;
-     int Return_Value = 0;
-
-     Bitstream_Framenum = *Bitstream_Framenumber;
-     Sequence_Framenum=0;
-
-     Initialize_Sequence(dec);
-
-     /* decode picture whose header has already been parsed in 
-        Decode_Bitstream() */
-
-
-     MPEG2_Decode_Picture(dec, Bitstream_Framenum, Sequence_Framenum);
-
-     /* update picture numbers */
-     if (!dec->Second_Field) {
-          Bitstream_Framenum++;
-          Sequence_Framenum++;
-     }
-
-     /* loop through the rest of the pictures in the sequence */
-/*     while ((Return_Value=MPEG2_Get_Hdr(dec))) {
-          MPEG2_Decode_Picture(dec, Bitstream_Framenum, Sequence_Framenum);
-
-          if (!dec->Second_Field) {
-               Bitstream_Framenum++;
-               Sequence_Framenum++;
-          }
-     }*/
-
-     /* put last frame */
-     if (Sequence_Framenum!=0) {
-          MPEG2_Output_Last_Frame_of_Sequence(dec, Bitstream_Framenum);
-     }
-
-     Deinitialize_Sequence(dec);
-
-     *Bitstream_Framenumber = Bitstream_Framenum;
-
-     return(Return_Value);
-}
-
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/mpeg2dec.h DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/mpeg2dec.h
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/mpeg2dec.h	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/mpeg2dec.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,294 +0,0 @@
-/* mpeg2dec.h, MPEG specific defines                                        */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <dfb_types.h>
-
-typedef int  (*MPEG2_Read)(void *buf, int count, void *ctx);
-typedef void (*MPEG2_Write)(int x, int y, u32 argb, void *ctx);
-
-typedef struct {
-     int Fault_Flag;
-
-     /* buffers for multiuse purposes */
-     char Error_Text[256];
-     unsigned char _Clip[1024];
-     unsigned char *Clip;
-
-     /* pointers to generic picture buffers */
-     unsigned char *backward_reference_frame[3];
-     unsigned char *forward_reference_frame[3];
-
-     unsigned char *auxframe[3];
-     unsigned char *current_frame[3];
-
-
-     /* non-normative variables derived from normative elements */
-     int Coded_Picture_Width;
-     int Coded_Picture_Height;
-     int Chroma_Width;
-     int Chroma_Height;
-     int block_count;
-     int Second_Field;
-     int profile, level;
-
-     /* normative derived variables (as per ISO/IEC 13818-2) */
-     int horizontal_size;
-     int vertical_size;
-     int mb_width;
-     int mb_height;
-     double bit_rate;
-     double frame_rate;
-
-
-     /* headers */
-
-     /* ISO/IEC 13818-2 section 6.2.2.1:  sequence_header() */
-     int aspect_ratio_information;
-     int frame_rate_code;
-     int bit_rate_value;
-     int vbv_buffer_size;
-     int constrained_parameters_flag;
-
-     /* ISO/IEC 13818-2 section 6.2.2.3:  sequence_extension() */
-     int profile_and_level_indication;
-     int progressive_sequence;
-     int chroma_format;
-     int low_delay;
-     int frame_rate_extension_n;
-     int frame_rate_extension_d;
-
-     /* ISO/IEC 13818-2 section 6.2.2.4:  sequence_display_extension() */
-     int video_format;
-     int color_description;
-     int color_primaries;
-     int transfer_characteristics;
-     int matrix_coefficients;
-     int display_horizontal_size;
-     int display_vertical_size;
-
-     /* ISO/IEC 13818-2 section 6.2.3: picture_header() */
-     int temporal_reference;
-     int picture_coding_type;
-     int vbv_delay;
-     int full_pel_forward_vector;
-     int forward_f_code;
-     int full_pel_backward_vector;
-     int backward_f_code;
-
-     /* ISO/IEC 13818-2 section 6.2.3.1: picture_coding_extension() header */
-     int f_code[2][2];
-     int intra_dc_precision;
-     int picture_structure;
-     int top_field_first;
-     int frame_pred_frame_dct;
-     int concealment_motion_vectors;
-     int intra_vlc_format;
-     int repeat_first_field;
-     int chroma_420_type;
-     int progressive_frame;
-     int composite_display_flag;
-     int v_axis;
-     int field_sequence;
-     int sub_carrier;
-     int burst_amplitude;
-     int sub_carrier_phase;
-
-     /* ISO/IEC 13818-2 section 6.2.3.3: picture_display_extension() header */
-     int frame_center_horizontal_offset[3];
-     int frame_center_vertical_offset[3];
-
-     /* ISO/IEC 13818-2 section 6.2.3.6: copyright_extension() header */
-     int copyright_flag;
-     int copyright_identifier;
-     int original_or_copy;
-     int copyright_number_1;
-     int copyright_number_2;
-     int copyright_number_3;
-
-     /* ISO/IEC 13818-2 section 6.2.2.6: group_of_pictures_header()  */
-     int drop_flag;
-     int hour;
-     int minute;
-     int sec;
-     int frame;
-     int closed_gop;
-     int broken_link;
-
-     /* bit input */
-     MPEG2_Read   mpeg2_read;
-     void        *mpeg2_read_ctx;
-
-     MPEG2_Write  mpeg2_write;
-     void        *mpeg2_write_ctx;
-
-     unsigned char Rdbfr[2048];
-     unsigned char *Rdptr;
-     unsigned char Inbfr[16];
-
-     /* from mpeg2play */
-     unsigned int Bfr;
-     unsigned char *Rdmax;
-     int Incnt;
-     int Bitcnt;
-
-     /* sequence header and quant_matrix_extension() */
-     int intra_quantizer_matrix[64];
-     int non_intra_quantizer_matrix[64];
-     int chroma_intra_quantizer_matrix[64];
-     int chroma_non_intra_quantizer_matrix[64];
-
-     int load_intra_quantizer_matrix;
-     int load_non_intra_quantizer_matrix;
-     int load_chroma_intra_quantizer_matrix;
-     int load_chroma_non_intra_quantizer_matrix;
-
-     int MPEG2_Flag;
-
-     /* picture coding extension */
-     int q_scale_type;
-     int alternate_scan;
-
-     /* slice/macroblock */
-     int priority_breakpoint;
-     int quantizer_scale;
-     int intra_slice;
-     short block[12][64];
-
-     int global_MBA;
-     int global_pic;
-     int True_Framenum;
-
-} MPEG2_Decoder;
-
-
-MPEG2_Decoder *MPEG2_Init(MPEG2_Read mpeg2_read, void *read_ctx, int *width, int *height);
-int  MPEG2_Decode(MPEG2_Decoder *dec, MPEG2_Write mpeg2_write, void *write_ctx);
-void MPEG2_Close(MPEG2_Decoder *dec);
-
-
-#define ERROR (-1)
-
-#define PICTURE_START_CODE      0x100
-#define SLICE_START_CODE_MIN    0x101
-#define SLICE_START_CODE_MAX    0x1AF
-#define USER_DATA_START_CODE    0x1B2
-#define SEQUENCE_HEADER_CODE    0x1B3
-#define SEQUENCE_ERROR_CODE     0x1B4
-#define EXTENSION_START_CODE    0x1B5
-#define SEQUENCE_END_CODE       0x1B7
-#define GROUP_START_CODE        0x1B8
-#define SYSTEM_START_CODE_MIN   0x1B9
-#define SYSTEM_START_CODE_MAX   0x1FF
-
-#define ISO_END_CODE            0x1B9
-#define PACK_START_CODE         0x1BA
-#define SYSTEM_START_CODE       0x1BB
-
-#define VIDEO_ELEMENTARY_STREAM 0x1e0
-
-/* scalable_mode */
-#define SC_NONE 0
-#define SC_DP   1
-#define SC_SPAT 2
-#define SC_SNR  3
-#define SC_TEMP 4
-
-/* picture coding type */
-#define I_TYPE 1
-#define P_TYPE 2
-#define B_TYPE 3
-#define D_TYPE 4
-
-/* picture structure */
-#define TOP_FIELD     1
-#define BOTTOM_FIELD  2
-#define FRAME_PICTURE 3
-
-/* macroblock type */
-#define MACROBLOCK_INTRA                        1
-#define MACROBLOCK_PATTERN                      2
-#define MACROBLOCK_MOTION_BACKWARD              4
-#define MACROBLOCK_MOTION_FORWARD               8
-#define MACROBLOCK_QUANT                        16
-#define SPATIAL_TEMPORAL_WEIGHT_CODE_FLAG       32
-#define PERMITTED_SPATIAL_TEMPORAL_WEIGHT_CLASS 64
-
-
-/* motion_type */
-#define MC_FIELD 1
-#define MC_FRAME 2
-#define MC_16X8  2
-#define MC_DMV   3
-
-/* mv_format */
-#define MV_FIELD 0
-#define MV_FRAME 1
-
-/* chroma_format */
-#define CHROMA420 1
-#define CHROMA422 2
-#define CHROMA444 3
-
-/* extension start code IDs */
-
-#define SEQUENCE_EXTENSION_ID                    1
-#define SEQUENCE_DISPLAY_EXTENSION_ID            2
-#define QUANT_MATRIX_EXTENSION_ID                3
-#define COPYRIGHT_EXTENSION_ID                   4
-#define SEQUENCE_SCALABLE_EXTENSION_ID           5
-#define PICTURE_DISPLAY_EXTENSION_ID             7
-#define PICTURE_CODING_EXTENSION_ID              8
-#define PICTURE_SPATIAL_SCALABLE_EXTENSION_ID    9
-#define PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID  10
-
-#define ZIG_ZAG                                  0
-
-#define PROFILE_422                             (128+5)
-#define MAIN_LEVEL                              8
-
-/* Layers: used by Verbose_Flag, Verifier_Flag, Stats_Flag, and Trace_Flag */
-#define NO_LAYER                                0
-#define SEQUENCE_LAYER                          1
-#define PICTURE_LAYER                           2
-#define SLICE_LAYER                             3
-#define MACROBLOCK_LAYER                        4
-#define BLOCK_LAYER                             5
-#define EVENT_LAYER                             6
-#define ALL_LAYERS                              7
-
-
-
-#define FILENAME_LENGTH                       256
-
-
-
-
-#define MB_WEIGHT                  32
-#define MB_CLASS4                  64
-
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/recon.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/recon.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/recon.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/recon.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,420 +0,0 @@
-/* Predict.c, motion compensation routines                                    */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-
-#include "global.h"
-
-/* private prototypes */
-static void form_prediction (MPEG2_Decoder *dec, unsigned char *src[], int sfield,
-                             unsigned char *dst[], int dfield,
-                             int lx, int lx2, int w, int h, int x, int y, int dx, int dy,
-                             int average_flag);
-
-static void form_component_prediction (MPEG2_Decoder *dec, unsigned char *src, unsigned char *dst,
-                                       int lx, int lx2, int w, int h, int x, int y, int dx, int dy, int average_flag);
-
-void
-MPEG2_form_predictions(MPEG2_Decoder *dec,
-                       int bx, int by,
-                       int macroblock_type,
-                       int motion_type,
-                       int PMV[2][2][2], int motion_vertical_field_select[2][2], int dmvector[2],
-                       int stwtype)
-{
-     int currentfield;
-     unsigned char **predframe;
-     int DMV[2][2];
-     int stwtop, stwbot;
-
-     stwtop = stwtype%3; /* 0:temporal, 1:(spat+temp)/2, 2:spatial */
-     stwbot = stwtype/3;
-
-     if ((macroblock_type & MACROBLOCK_MOTION_FORWARD) 
-         || (dec->picture_coding_type==P_TYPE)) {
-          if (dec->picture_structure==FRAME_PICTURE) {
-               if ((motion_type==MC_FRAME) 
-                   || !(macroblock_type & MACROBLOCK_MOTION_FORWARD)) {
-                    /* frame-based prediction (broken into top and bottom halves
-                         for spatial scalability prediction purposes) */
-                    if (stwtop<2)
-                         form_prediction(dec, dec->forward_reference_frame,0,dec->current_frame,0,
-                                         dec->Coded_Picture_Width,dec->Coded_Picture_Width<<1,16,8,bx,by,
-                                         PMV[0][0][0],PMV[0][0][1],stwtop);
-
-                    if (stwbot<2)
-                         form_prediction(dec, dec->forward_reference_frame,1,dec->current_frame,1,
-                                         dec->Coded_Picture_Width,dec->Coded_Picture_Width<<1,16,8,bx,by,
-                                         PMV[0][0][0],PMV[0][0][1],stwbot);
-               }
-               else if (motion_type==MC_FIELD) { /* field-based prediction */
-                    /* top field prediction */
-                    if (stwtop<2)
-                         form_prediction(dec, dec->forward_reference_frame,motion_vertical_field_select[0][0],
-                                         dec->current_frame,0,dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,
-                                         bx,by>>1,PMV[0][0][0],PMV[0][0][1]>>1,stwtop);
-
-                    /* bottom field prediction */
-                    if (stwbot<2)
-                         form_prediction(dec, dec->forward_reference_frame,motion_vertical_field_select[1][0],
-                                         dec->current_frame,1,dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,
-                                         bx,by>>1,PMV[1][0][0],PMV[1][0][1]>>1,stwbot);
-               }
-               else if (motion_type==MC_DMV) { /* dual prime prediction */
-                    /* calculate derived motion vectors */
-                    MPEG2_Dual_Prime_Arithmetic(dec, DMV,dmvector,PMV[0][0][0],PMV[0][0][1]>>1);
-
-                    if (stwtop<2) {
-                         /* predict top field from top field */
-                         form_prediction(dec, dec->forward_reference_frame,0,dec->current_frame,0,
-                                         dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,bx,by>>1,
-                                         PMV[0][0][0],PMV[0][0][1]>>1,0);
-
-                         /* predict and add to top field from bottom field */
-                         form_prediction(dec, dec->forward_reference_frame,1,dec->current_frame,0,
-                                         dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,bx,by>>1,
-                                         DMV[0][0],DMV[0][1],1);
-                    }
-
-                    if (stwbot<2) {
-                         /* predict bottom field from bottom field */
-                         form_prediction(dec, dec->forward_reference_frame,1,dec->current_frame,1,
-                                         dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,bx,by>>1,
-                                         PMV[0][0][0],PMV[0][0][1]>>1,0);
-
-                         /* predict and add to bottom field from top field */
-                         form_prediction(dec, dec->forward_reference_frame,0,dec->current_frame,1,
-                                         dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,bx,by>>1,
-                                         DMV[1][0],DMV[1][1],1);
-                    }
-               }
-               else
-                    /* invalid motion_type */
-                    printf("invalid motion_type\n");
-          }
-          else { /* TOP_FIELD or BOTTOM_FIELD */
-               /* field picture */
-               currentfield = (dec->picture_structure==BOTTOM_FIELD);
-
-               /* determine which frame to use for prediction */
-               if ((dec->picture_coding_type==P_TYPE) && dec->Second_Field
-                   && (currentfield!=motion_vertical_field_select[0][0]))
-                    predframe = dec->backward_reference_frame; /* same frame */
-               else
-                    predframe = dec->forward_reference_frame; /* previous frame */
-
-               if ((motion_type==MC_FIELD)
-                   || !(macroblock_type & MACROBLOCK_MOTION_FORWARD)) {
-                    /* field-based prediction */
-                    if (stwtop<2)
-                         form_prediction(dec, predframe,motion_vertical_field_select[0][0],dec->current_frame,0,
-                                         dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,16,bx,by,
-                                         PMV[0][0][0],PMV[0][0][1],stwtop);
-               }
-               else if (motion_type==MC_16X8) {
-                    if (stwtop<2) {
-                         form_prediction(dec, predframe,motion_vertical_field_select[0][0],dec->current_frame,0,
-                                         dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,bx,by,
-                                         PMV[0][0][0],PMV[0][0][1],stwtop);
-
-                         /* determine which frame to use for lower half prediction */
-                         if ((dec->picture_coding_type==P_TYPE) && dec->Second_Field
-                             && (currentfield!=motion_vertical_field_select[1][0]))
-                              predframe = dec->backward_reference_frame; /* same frame */
-                         else
-                              predframe = dec->forward_reference_frame; /* previous frame */
-
-                         form_prediction(dec, predframe,motion_vertical_field_select[1][0],dec->current_frame,0,
-                                         dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,bx,by+8,
-                                         PMV[1][0][0],PMV[1][0][1],stwtop);
-                    }
-               }
-               else if (motion_type==MC_DMV) { /* dual prime prediction */
-                    if (dec->Second_Field)
-                         predframe = dec->backward_reference_frame; /* same frame */
-                    else
-                         predframe = dec->forward_reference_frame; /* previous frame */
-
-                    /* calculate derived motion vectors */
-                    MPEG2_Dual_Prime_Arithmetic(dec, DMV,dmvector,PMV[0][0][0],PMV[0][0][1]);
-
-                    /* predict from field of same parity */
-                    form_prediction(dec, dec->forward_reference_frame,currentfield,dec->current_frame,0,
-                                    dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,16,bx,by,
-                                    PMV[0][0][0],PMV[0][0][1],0);
-
-                    /* predict from field of opposite parity */
-                    form_prediction(dec, predframe,!currentfield,dec->current_frame,0,
-                                    dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,16,bx,by,
-                                    DMV[0][0],DMV[0][1],1);
-               }
-               else
-                    /* invalid motion_type */
-                    printf("invalid motion_type\n");
-          }
-          stwtop = stwbot = 1;
-     }
-
-     if (macroblock_type & MACROBLOCK_MOTION_BACKWARD) {
-          if (dec->picture_structure==FRAME_PICTURE) {
-               if (motion_type==MC_FRAME) {
-                    /* frame-based prediction */
-                    if (stwtop<2)
-                         form_prediction(dec, dec->backward_reference_frame,0,dec->current_frame,0,
-                                         dec->Coded_Picture_Width,dec->Coded_Picture_Width<<1,16,8,bx,by,
-                                         PMV[0][1][0],PMV[0][1][1],stwtop);
-
-                    if (stwbot<2)
-                         form_prediction(dec, dec->backward_reference_frame,1,dec->current_frame,1,
-                                         dec->Coded_Picture_Width,dec->Coded_Picture_Width<<1,16,8,bx,by,
-                                         PMV[0][1][0],PMV[0][1][1],stwbot);
-               }
-               else { /* field-based prediction */
-                    /* top field prediction */
-                    if (stwtop<2)
-                         form_prediction(dec, dec->backward_reference_frame,motion_vertical_field_select[0][1],
-                                         dec->current_frame,0,dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,
-                                         bx,by>>1,PMV[0][1][0],PMV[0][1][1]>>1,stwtop);
-
-                    /* bottom field prediction */
-                    if (stwbot<2)
-                         form_prediction(dec, dec->backward_reference_frame,motion_vertical_field_select[1][1],
-                                         dec->current_frame,1,dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,
-                                         bx,by>>1,PMV[1][1][0],PMV[1][1][1]>>1,stwbot);
-               }
-          }
-          else { /* TOP_FIELD or BOTTOM_FIELD */
-               /* field picture */
-               if (motion_type==MC_FIELD) {
-                    /* field-based prediction */
-                    form_prediction(dec, dec->backward_reference_frame,motion_vertical_field_select[0][1],
-                                    dec->current_frame,0,dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,16,
-                                    bx,by,PMV[0][1][0],PMV[0][1][1],stwtop);
-               }
-               else if (motion_type==MC_16X8) {
-                    form_prediction(dec, dec->backward_reference_frame,motion_vertical_field_select[0][1],
-                                    dec->current_frame,0,dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,
-                                    bx,by,PMV[0][1][0],PMV[0][1][1],stwtop);
-
-                    form_prediction(dec, dec->backward_reference_frame,motion_vertical_field_select[1][1],
-                                    dec->current_frame,0,dec->Coded_Picture_Width<<1,dec->Coded_Picture_Width<<1,16,8,
-                                    bx,by+8,PMV[1][1][0],PMV[1][1][1],stwtop);
-               }
-               else
-                    /* invalid motion_type */
-                    printf("invalid motion_type\n");
-          }
-     }
-}
-
-static void
-form_prediction(MPEG2_Decoder *dec,
-                unsigned char *src[], /* prediction source buffer */
-                int sfield,           /* prediction source field number (0 or 1) */
-                unsigned char *dst[], /* prediction destination buffer */
-                int dfield,           /* prediction destination field number (0 or 1)*/
-                int lx,int lx2,       /* line strides */
-                int w,int h,          /* prediction block/sub-block width, height */
-                int x,int y,          /* pixel co-ordinates of top-left sample in current MB */
-                int dx, int dy,       /* horizontal, vertical prediction address */
-                int average_flag)     /* add prediction error to prediction ? */
-{
-     /* Y */
-     form_component_prediction(dec, src[0]+(sfield?lx2>>1:0),dst[0]+(dfield?lx2>>1:0),
-                               lx,lx2,w,h,x,y,dx,dy,average_flag);
-
-     if (dec->chroma_format!=CHROMA444) {
-          lx>>=1; lx2>>=1; w>>=1; x>>=1; dx/=2;
-     }
-
-     if (dec->chroma_format==CHROMA420) {
-          h>>=1; y>>=1; dy/=2;
-     }
-
-     /* Cb */
-     form_component_prediction(dec, src[1]+(sfield?lx2>>1:0),dst[1]+(dfield?lx2>>1:0),
-                               lx,lx2,w,h,x,y,dx,dy,average_flag);
-
-     /* Cr */
-     form_component_prediction(dec, src[2]+(sfield?lx2>>1:0),dst[2]+(dfield?lx2>>1:0),
-                               lx,lx2,w,h,x,y,dx,dy,average_flag);
-}
-
-/* ISO/IEC 13818-2 section 7.6.4: Forming predictions */
-/* NOTE: the arithmetic below produces numerically equivalent results
- *  to 7.6.4, yet is more elegant. It differs in the following ways:
- *
- *   1. the vectors (dx, dy) are based on cartesian frame 
- *      coordiantes along a half-pel grid (always positive numbers)
- *      In contrast, vector[r][s][t] are differential (with positive and 
- *      negative values). As a result, deriving the integer vectors 
- *      (int_vec[t]) from dx, dy is accomplished by a simple right shift.
- *
- *   2. Half pel flags (xh, yh) are equivalent to the LSB (Least
- *      Significant Bit) of the half-pel coordinates (dx,dy).
- * 
- *
- *  NOTE: the work of combining predictions (ISO/IEC 13818-2 section 7.6.7)
- *  is distributed among several other stages.  This is accomplished by 
- *  folding line offsets into the source and destination (src,dst)
- *  addresses (note the call arguments to form_prediction(dec, ) in Predict()),
- *  line stride variables lx and lx2, the block dimension variables (w,h), 
- *  average_flag, and by the very order in which Predict() is called.  
- *  This implementation design (implicitly different than the spec) 
- *  was chosen for its elegance.
-*/
-
-static void
-form_component_prediction(MPEG2_Decoder *dec,
-                          unsigned char *src,
-                          unsigned char *dst,
-                          int lx,          /* raster line increment */ 
-                          int lx2,
-                          int w,int h,
-                          int x,int y,
-                          int dx, int dy,
-                          int average_flag)      /* flag that signals bi-directional or Dual-Prime 
-                                                    averaging (7.6.7.1 and 7.6.7.4). if average_flag==1,
-                                                    a previously formed prediction has been stored in 
-                                                    pel_pred[] */
-{
-     int xint;      /* horizontal integer sample vector: analogous to int_vec[0] */
-     int yint;      /* vertical integer sample vectors: analogous to int_vec[1] */
-     int xh;        /* horizontal half sample flag: analogous to half_flag[0]  */
-     int yh;        /* vertical half sample flag: analogous to half_flag[1]  */
-     int i, j, v;
-     unsigned char *s;    /* source pointer: analogous to pel_ref[][]   */
-     unsigned char *d;    /* destination pointer:  analogous to pel_pred[][]  */
-
-     /* half pel scaling for integer vectors */
-     xint = dx>>1;
-     yint = dy>>1;
-
-     /* derive half pel flags */
-     xh = dx & 1;
-     yh = dy & 1;
-
-     /* compute the linear address of pel_ref[][] and pel_pred[][] 
-        based on cartesian/raster cordinates provided */
-     s = src + lx*(y+yint) + x + xint;
-     d = dst + lx*y + x;
-
-     if (!xh && !yh) { /* no horizontal nor vertical half-pel */
-          if (average_flag) {
-               for (j=0; j<h; j++) {
-                    for (i=0; i<w; i++) {
-                         v = d[i]+s[i];
-                         d[i] = (v+(v>=0?1:0))>>1;
-                    }
-
-                    s+= lx2;
-                    d+= lx2;
-               }
-          }
-          else {
-               for (j=0; j<h; j++) {
-                    for (i=0; i<w; i++) {
-                         d[i] = s[i];
-                    }
-
-                    s+= lx2;
-                    d+= lx2;
-               }
-          }
-     }
-     else if (!xh && yh) { /* no horizontal but vertical half-pel */
-          if (average_flag) {
-               for (j=0; j<h; j++) {
-                    for (i=0; i<w; i++) {
-                         v = d[i] + ((unsigned int)(s[i]+s[i+lx]+1)>>1);
-                         d[i]=(v+(v>=0?1:0))>>1;
-                    }
-
-                    s+= lx2;
-                    d+= lx2;
-               }
-          }
-          else {
-               for (j=0; j<h; j++) {
-                    for (i=0; i<w; i++) {
-                         d[i] = (unsigned int)(s[i]+s[i+lx]+1)>>1;
-                    }
-
-                    s+= lx2;
-                    d+= lx2;
-               }
-          }
-     }
-     else if (xh && !yh) { /* horizontal but no vertical half-pel */
-          if (average_flag) {
-               for (j=0; j<h; j++) {
-                    for (i=0; i<w; i++) {
-                         v = d[i] + ((unsigned int)(s[i]+s[i+1]+1)>>1);
-                         d[i] = (v+(v>=0?1:0))>>1;
-                    }
-
-                    s+= lx2;
-                    d+= lx2;
-               }
-          }
-          else {
-               for (j=0; j<h; j++) {
-                    for (i=0; i<w; i++) {
-                         d[i] = (unsigned int)(s[i]+s[i+1]+1)>>1;
-                    }
-
-                    s+= lx2;
-                    d+= lx2;
-               }
-          }
-     }
-     else { /* if (xh && yh) horizontal and vertical half-pel */
-          if (average_flag) {
-               for (j=0; j<h; j++) {
-                    for (i=0; i<w; i++) {
-                         v = d[i] + ((unsigned int)(s[i]+s[i+1]+s[i+lx]+s[i+lx+1]+2)>>2);
-                         d[i] = (v+(v>=0?1:0))>>1;
-                    }
-
-                    s+= lx2;
-                    d+= lx2;
-               }
-          }
-          else {
-               for (j=0; j<h; j++) {
-                    for (i=0; i<w; i++) {
-                         d[i] = (unsigned int)(s[i]+s[i+1]+s[i+lx]+s[i+lx+1]+2)>>2;
-                    }
-
-                    s+= lx2;
-                    d+= lx2;
-               }
-          }
-     }
-}
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/store.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/store.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/store.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/store.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,334 +0,0 @@
-/* store.c, picture output routines                                         */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <direct/mem.h>
-
-#include "global.h"
-
-/* private prototypes */
-static void store_argb (MPEG2_Decoder *dec, unsigned char *src[],
-                        int offset, int incr, int height);
-
-static void conv422to444 (MPEG2_Decoder *dec, unsigned char *src, unsigned char *dst);
-static void conv420to422 (MPEG2_Decoder *dec, unsigned char *src, unsigned char *dst);
-
-/* color space conversion coefficients
- * for YCbCr -> RGB mapping
- *
- * entries are {crv,cbu,cgu,cgv}
- *
- * crv=(255/224)*65536*(1-cr)/0.5
- * cbu=(255/224)*65536*(1-cb)/0.5
- * cgu=(255/224)*65536*(cb/cg)*(1-cb)/0.5
- * cgv=(255/224)*65536*(cr/cg)*(1-cr)/0.5
- *
- * where Y=cr*R+cg*G+cb*B (cr+cg+cb=1)
- */
-
-/* ISO/IEC 13818-2 section 6.3.6 sequence_display_extension() */
-
-static const int Inverse_Table_6_9[8][4] = {
-     {117504, 138453, 13954, 34903}, /* no sequence_display_extension */
-     {117504, 138453, 13954, 34903}, /* ITU-R Rec. 709 (1990) */
-     {104597, 132201, 25675, 53279}, /* unspecified */
-     {104597, 132201, 25675, 53279}, /* reserved */
-     {104448, 132798, 24759, 53109}, /* FCC */
-     {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */
-     {104597, 132201, 25675, 53279}, /* SMPTE 170M */
-     {117579, 136230, 16907, 35559}  /* SMPTE 240M (1987) */
-};
-
-
-/*
- * store a picture as either one frame or two fields
- */
-void MPEG2_Write_Frame(MPEG2_Decoder *dec, unsigned char *src[], int frame)
-{
-     store_argb (dec, src, 0, dec->Coded_Picture_Width, dec->vertical_size);
-}
-
-/*
- * store as ARGB
- */
-static void store_argb(MPEG2_Decoder *dec,
-unsigned char *src[],
-int offset, int incr, int height)
-{
-     int i, j;
-     int y, u, v, r, g, b;
-     int crv, cbu, cgu, cgv;
-     unsigned char *py, *pu, *pv;
-     unsigned char *u422 = NULL, *v422 = NULL, *u444 = NULL, *v444 = NULL;
-
-     if (dec->chroma_format==CHROMA444) {
-          u444 = src[1];
-          v444 = src[2];
-     }
-     else {
-          if (dec->chroma_format==CHROMA420) {
-               if (!(u422 = (unsigned char *)D_MALLOC((dec->Coded_Picture_Width>>1)
-                                                      *dec->Coded_Picture_Height)))
-                    MPEG2_Error(dec, "malloc failed");
-               if (!(v422 = (unsigned char *)D_MALLOC((dec->Coded_Picture_Width>>1)
-                                                      *dec->Coded_Picture_Height)))
-                    MPEG2_Error(dec, "malloc failed");
-          }
-
-          if (!(u444 = (unsigned char *)D_MALLOC(dec->Coded_Picture_Width
-                                                 *dec->Coded_Picture_Height)))
-               MPEG2_Error(dec, "malloc failed");
-
-          if (!(v444 = (unsigned char *)D_MALLOC(dec->Coded_Picture_Width
-                                                 *dec->Coded_Picture_Height)))
-               MPEG2_Error(dec, "malloc failed");
-
-          if (dec->chroma_format==CHROMA420) {
-               conv420to422(dec, src[1],u422);
-               conv420to422(dec, src[2],v422);
-               conv422to444(dec, u422,u444);
-               conv422to444(dec, v422,v444);
-          }
-          else {
-               conv422to444(dec, src[1],u444);
-               conv422to444(dec, src[2],v444);
-          }
-     }
-
-     /* matrix coefficients */
-     crv = Inverse_Table_6_9[dec->matrix_coefficients][0];
-     cbu = Inverse_Table_6_9[dec->matrix_coefficients][1];
-     cgu = Inverse_Table_6_9[dec->matrix_coefficients][2];
-     cgv = Inverse_Table_6_9[dec->matrix_coefficients][3];
-
-     for (i=0; i<height; i++) {
-          py = src[0] + offset + incr*i;
-          pu = u444 + offset + incr*i;
-          pv = v444 + offset + incr*i;
-
-          for (j=0; j<dec->horizontal_size; j++) {
-               u = *pu++ - 128;
-               v = *pv++ - 128;
-               y = 76309 * (*py++ - 16); /* (255/219)*65536 */
-               r = dec->Clip[(y + crv*v + 32768)>>16];
-               g = dec->Clip[(y - cgu*u - cgv*v + 32768)>>16];
-               b = dec->Clip[(y + cbu*u + 32786)>>16];
-
-               dec->mpeg2_write (j, i,
-                                 0xff000000 | (r << 16) | (g << 8) | b,
-                                 dec->mpeg2_write_ctx);
-          }
-     }
-
-     if (dec->chroma_format!=CHROMA444) {
-          if (u422)
-               D_FREE( u422 );
-
-          if (v422)
-               D_FREE( v422 );
-
-          if (u444)
-               D_FREE( u444 );
-
-          if (v444)
-               D_FREE( v444 );
-     }
-}
-
-/* horizontal 1:2 interpolation filter */
-static void conv422to444(MPEG2_Decoder *dec, unsigned char *src, unsigned char *dst)
-{
-     int i, i2, w, j, im3, im2, im1, ip1, ip2, ip3;
-
-     w = dec->Coded_Picture_Width>>1;
-
-     if (dec->MPEG2_Flag) {
-          for (j=0; j<dec->Coded_Picture_Height; j++) {
-               for (i=0; i<w; i++) {
-                    i2 = i<<1;
-                    im2 = (i<2) ? 0 : i-2;
-                    im1 = (i<1) ? 0 : i-1;
-                    ip1 = (i<w-1) ? i+1 : w-1;
-                    ip2 = (i<w-2) ? i+2 : w-1;
-                    ip3 = (i<w-3) ? i+3 : w-1;
-
-                    /* FIR filter coefficients (*256): 21 0 -52 0 159 256 159 0 -52 0 21 */
-                    /* even samples (0 0 256 0 0) */
-                    dst[i2] = src[i];
-
-                    /* odd samples (21 -52 159 159 -52 21) */
-                    dst[i2+1] = dec->Clip[(int)(21*(src[im2]+src[ip3])
-                                                 -52*(src[im1]+src[ip2])
-                                                 +159*(src[i]+src[ip1])+128)>>8];
-               }
-               src+= w;
-               dst+= dec->Coded_Picture_Width;
-          }
-     }
-     else {
-          for (j=0; j<dec->Coded_Picture_Height; j++) {
-               for (i=0; i<w; i++) {
-
-                    i2 = i<<1;
-                    im3 = (i<3) ? 0 : i-3;
-                    im2 = (i<2) ? 0 : i-2;
-                    im1 = (i<1) ? 0 : i-1;
-                    ip1 = (i<w-1) ? i+1 : w-1;
-                    ip2 = (i<w-2) ? i+2 : w-1;
-                    ip3 = (i<w-3) ? i+3 : w-1;
-
-                    /* FIR filter coefficients (*256): 5 -21 70 228 -37 11 */
-                    dst[i2] =   dec->Clip[(int)(  5*src[im3]
-                                                   -21*src[im2]
-                                                   +70*src[im1]
-                                                   +228*src[i]
-                                                   -37*src[ip1]
-                                                   +11*src[ip2]+128)>>8];
-
-                    dst[i2+1] = dec->Clip[(int)(  5*src[ip3]
-                                                   -21*src[ip2]
-                                                   +70*src[ip1]
-                                                   +228*src[i]
-                                                   -37*src[im1]
-                                                   +11*src[im2]+128)>>8];
-               }
-               src+= w;
-               dst+= dec->Coded_Picture_Width;
-          }
-     }
-}
-
-/* vertical 1:2 interpolation filter */
-static void conv420to422(MPEG2_Decoder *dec, unsigned char *src, unsigned char *dst)
-{
-     int w, h, i, j, j2;
-     int jm6, jm5, jm4, jm3, jm2, jm1, jp1, jp2, jp3, jp4, jp5, jp6, jp7;
-
-     w = dec->Coded_Picture_Width>>1;
-     h = dec->Coded_Picture_Height>>1;
-
-     if (dec->progressive_frame) {
-          /* intra frame */
-          for (i=0; i<w; i++) {
-               for (j=0; j<h; j++) {
-                    j2 = j<<1;
-                    jm3 = (j<3) ? 0 : j-3;
-                    jm2 = (j<2) ? 0 : j-2;
-                    jm1 = (j<1) ? 0 : j-1;
-                    jp1 = (j<h-1) ? j+1 : h-1;
-                    jp2 = (j<h-2) ? j+2 : h-1;
-                    jp3 = (j<h-3) ? j+3 : h-1;
-
-                    /* FIR filter coefficients (*256): 5 -21 70 228 -37 11 */
-                    /* New FIR filter coefficients (*256): 3 -16 67 227 -32 7 */
-                    dst[w*j2] =     dec->Clip[(int)(  3*src[w*jm3]
-                                                       -16*src[w*jm2]
-                                                       +67*src[w*jm1]
-                                                       +227*src[w*j]
-                                                       -32*src[w*jp1]
-                                                       +7*src[w*jp2]+128)>>8];
-
-                    dst[w*(j2+1)] = dec->Clip[(int)(  3*src[w*jp3]
-                                                       -16*src[w*jp2]
-                                                       +67*src[w*jp1]
-                                                       +227*src[w*j]
-                                                       -32*src[w*jm1]
-                                                       +7*src[w*jm2]+128)>>8];
-               }
-               src++;
-               dst++;
-          }
-     }
-     else {
-          /* intra field */
-          for (i=0; i<w; i++) {
-               for (j=0; j<h; j+=2) {
-                    j2 = j<<1;
-
-                    /* top field */
-                    jm6 = (j<6) ? 0 : j-6;
-                    jm4 = (j<4) ? 0 : j-4;
-                    jm2 = (j<2) ? 0 : j-2;
-                    jp2 = (j<h-2) ? j+2 : h-2;
-                    jp4 = (j<h-4) ? j+4 : h-2;
-                    jp6 = (j<h-6) ? j+6 : h-2;
-
-                    /* Polyphase FIR filter coefficients (*256): 2 -10 35 242 -18 5 */
-                    /* New polyphase FIR filter coefficients (*256): 1 -7 30 248 -21 5 */
-                    dst[w*j2] = dec->Clip[(int)(  1*src[w*jm6]
-                                                   -7*src[w*jm4]
-                                                   +30*src[w*jm2]
-                                                   +248*src[w*j]
-                                                   -21*src[w*jp2]
-                                                   +5*src[w*jp4]+128)>>8];
-
-                    /* Polyphase FIR filter coefficients (*256): 11 -38 192 113 -30 8 */
-                    /* New polyphase FIR filter coefficients (*256):7 -35 194 110 -24 4 */
-                    dst[w*(j2+2)] = dec->Clip[(int)( 7*src[w*jm4]
-                                                      -35*src[w*jm2]
-                                                      +194*src[w*j]
-                                                      +110*src[w*jp2]
-                                                      -24*src[w*jp4]
-                                                      +4*src[w*jp6]+128)>>8];
-
-                    /* bottom field */
-                    jm5 = (j<5) ? 1 : j-5;
-                    jm3 = (j<3) ? 1 : j-3;
-                    jm1 = (j<1) ? 1 : j-1;
-                    jp1 = (j<h-1) ? j+1 : h-1;
-                    jp3 = (j<h-3) ? j+3 : h-1;
-                    jp5 = (j<h-5) ? j+5 : h-1;
-                    jp7 = (j<h-7) ? j+7 : h-1;
-
-                    /* Polyphase FIR filter coefficients (*256): 11 -38 192 113 -30 8 */
-                    /* New polyphase FIR filter coefficients (*256):7 -35 194 110 -24 4 */
-                    dst[w*(j2+1)] = dec->Clip[(int)( 7*src[w*jp5]
-                                                      -35*src[w*jp3]
-                                                      +194*src[w*jp1]
-                                                      +110*src[w*jm1]
-                                                      -24*src[w*jm3]
-                                                      +4*src[w*jm5]+128)>>8];
-
-                    dst[w*(j2+3)] = dec->Clip[(int)(  1*src[w*jp7]
-                                                       -7*src[w*jp5]
-                                                       +30*src[w*jp3]
-                                                       +248*src[w*jp1]
-                                                       -21*src[w*jm1]
-                                                       +5*src[w*jm3]+128)>>8];
-               }
-               src++;
-               dst++;
-          }
-     }
-}
diff -urN DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/systems.c DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/systems.c
--- DirectFB-1.1.1.orig/interfaces/IDirectFBImageProvider/mpeg2/systems.c	2007-12-18 11:29:16.000000000 +0000
+++ DirectFB-1.1.1/interfaces/IDirectFBImageProvider/mpeg2/systems.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,68 +0,0 @@
-/* systems.c, systems-specific routines                                 */
-
-/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
-
-/*
- * Disclaimer of Warranty
- *
- * These software programs are available to the user without any license fee or
- * royalty on an "as is" basis.  The MPEG Software Simulation Group disclaims
- * any and all warranties, whether express, implied, or statuary, including any
- * implied warranties or merchantability or of fitness for a particular
- * purpose.  In no event shall the copyright-holder be liable for any
- * incidental, punitive, or consequential damages of any kind whatsoever
- * arising from the use of these programs.
- *
- * This disclaimer of warranty extends to the user of these programs and user's
- * customers, employees, agents, transferees, successors, and assigns.
- *
- * The MPEG Software Simulation Group does not represent or warrant that the
- * programs furnished hereunder are free of infringement of any third-party
- * patents.
- *
- * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
- * are subject to royalty fees to patent holders.  Many of these patents are
- * general enough such that they are unavoidable regardless of implementation
- * design.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "global.h"
-
-/* initialize buffer, call once before first getbits or showbits */
-
-void
-MPEG2_Flush_Buffer32(MPEG2_Decoder *dec)
-{
-  int Incnt;
-
-  dec->Bfr = 0;
-
-  Incnt = dec->Incnt;
-  Incnt -= 32;
-
-  while (Incnt <= 24)
-    {
-      if (dec->Rdptr >= dec->Rdbfr+2048)
-        MPEG2_Fill_Buffer(dec);
-      dec->Bfr |= *dec->Rdptr++ << (24 - Incnt);
-      Incnt += 8;
-    }
-
-  dec->Incnt = Incnt;
-}
-
-
-unsigned int
-MPEG2_Get_Bits32(MPEG2_Decoder *dec)
-{
-  unsigned int l;
-
-  l = MPEG2_Show_Bits(dec, 32);
-  MPEG2_Flush_Buffer32(dec);
-
-  return l;
-}
