diff -ur vlc-0.8.6e.orig/configure vlc-0.8.6e/configure
--- vlc-0.8.6e.orig/configure	2008-02-24 20:07:09.000000000 +0100
+++ vlc-0.8.6e/configure	2008-03-15 13:59:28.082407135 +0100
@@ -45043,12 +45043,12 @@
         pkg_cv_FFMPEG_CFLAGS="$FFMPEG_CFLAGS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libavcodec, libavformat\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libavcodec, libavformat") 2>&5
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libavcodec, libavformat, libswscale\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libavcodec, libavformat, libswscale") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_FFMPEG_CFLAGS=`$PKG_CONFIG --cflags "libavcodec, libavformat" 2>/dev/null`
+  pkg_cv_FFMPEG_CFLAGS=`$PKG_CONFIG --cflags "libavcodec, libavformat, libswscale" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -45061,12 +45061,12 @@
         pkg_cv_FFMPEG_LIBS="$FFMPEG_LIBS"
     else
         if test -n "$PKG_CONFIG" && \
-    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libavcodec, libavformat\"") >&5
-  ($PKG_CONFIG --exists --print-errors "libavcodec, libavformat") 2>&5
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libavcodec, libavformat, libswscale\"") >&5
+  ($PKG_CONFIG --exists --print-errors "libavcodec, libavformat, libswscale") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  pkg_cv_FFMPEG_LIBS=`$PKG_CONFIG --libs "libavcodec, libavformat" 2>/dev/null`
+  pkg_cv_FFMPEG_LIBS=`$PKG_CONFIG --libs "libavcodec, libavformat, libswscale" 2>/dev/null`
 else
   pkg_failed=yes
 fi
@@ -45085,9 +45085,9 @@
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        FFMPEG_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libavcodec, libavformat"`
+	        FFMPEG_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libavcodec, libavformat, libswscale"`
         else
-	        FFMPEG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libavcodec, libavformat"`
+	        FFMPEG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libavcodec, libavformat, libswscale"`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$FFMPEG_PKG_ERRORS" >&5
@@ -45746,7 +45746,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lavcodec $LDAVUTIL $LIBS"
+LIBS="-lavcodec -lswscale $LDAVUTIL $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -45808,7 +45808,7 @@
 
 
   for element in ffmpeg; do
-    eval "LDFLAGS_${element}="'"'"-lavcodec "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-lavcodec -lswscale "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -45907,7 +45907,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lavformat -lavcodec -lz $LDAVUTIL $LIBS"
+LIBS="-lavformat -lavcodec -lswscale -lz $LDAVUTIL $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -46628,7 +46628,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lavcodec $LDAVUTIL $LIBS"
+LIBS="-lavcodec -lswscale $LDAVUTIL $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -46690,7 +46690,7 @@
 
 
   for element in ffmpeg; do
-    eval "LDFLAGS_${element}="'"'"-lavcodec "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-lavcodec -lswscale "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -46789,7 +46789,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lavformat -lavcodec -lz $LDAVUTIL $LIBS"
+LIBS="-lavformat -lavcodec -lswscale -lz $LDAVUTIL $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -47586,7 +47586,7 @@
 
 
   for element in ffmpegaltivec; do
-    eval "LDFLAGS_${element}="'"'"-L${real_ffmpeg_tree}/libavcodec -lavcodecaltivec "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-L${real_ffmpeg_tree}/libavcodec -lavcodecaltivec -lswscale "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
diff -ur vlc-0.8.6e.orig/configure.ac vlc-0.8.6e/configure.ac
--- vlc-0.8.6e.orig/configure.ac	2008-02-24 20:01:55.000000000 +0100
+++ vlc-0.8.6e/configure.ac	2008-03-15 13:59:28.082407135 +0100
@@ -2694,7 +2694,7 @@
  else
 
 dnl Trying with pkg-config
-   PKG_CHECK_MODULES(FFMPEG,[libavcodec, libavformat],
+   PKG_CHECK_MODULES(FFMPEG,[libavcodec, libavformat, libswscale],
     [
      AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
      AC_CHECK_HEADERS(ffmpeg/avformat.h)
@@ -2736,7 +2736,7 @@
 
       AC_CHECK_LIB(avcodec, avcodec_init, [
         VLC_ADD_BUILTINS([ffmpeg])
-        VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
+        VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec -lswscale])
         if test "${enable_sout}" != "no"; then
             VLC_ADD_BUILTINS([stream_out_switcher])
         fi],
@@ -2749,7 +2749,7 @@
 	[$LDAVUTIL])
 
       AC_CHECK_LIB(avformat, av_open_input_stream, [
-        VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL])
+        VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lswscale -lz]) ], [], [-lavcodec -lswscale -lz $LDAVUTIL])
       LDFLAGS="${LDFLAGS_save}"
       CPPFLAGS="${CPPFLAGS_save}"
     ])
@@ -2785,13 +2785,13 @@
     dnl  Use a custom libffmpeg
     AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodecaltivec.a)
     VLC_ADD_BUILTINS([ffmpegaltivec])
-    VLC_ADD_LDFLAGS([ffmpegaltivec],[-L${real_ffmpeg_tree}/libavcodec -lavcodecaltivec])
+    VLC_ADD_LDFLAGS([ffmpegaltivec],[-L${real_ffmpeg_tree}/libavcodec -lavcodecaltivec -lswscale])
     VLC_ADD_CPPFLAGS([ffmpeg],[-DNO_ALTIVEC_IN_FFMPEG])
     VLC_ADD_CPPFLAGS([ffmpegaltivec],[-I${real_ffmpeg_tree}/libavcodec -I${real_ffmpeg_tree}/libavformat])
 
     if test -f "${real_ffmpeg_tree}/libavformat/libavformat.a"; then
       AC_DEFINE(HAVE_LIBAVFORMAT_TREE, 1, [Define if you have ffmpeg's libavformat.])
-      VLC_ADD_LDFLAGS([ffmpegaltivec],[-L${real_ffmpeg_tree}/libavformat -lavformataltivec -lz])
+      VLC_ADD_LDFLAGS([ffmpegaltivec],[-L${real_ffmpeg_tree}/libavformat -lavformataltivec -lswscale -lz])
       VLC_ADD_CPPFLAGS([ffmpegaltivec],[-I${real_ffmpeg_tree}/libavformat])
     fi
     VLC_ADD_LDFLAGS([stream_out_switcher],[-L${real_ffmpeg_tree}/libavcodec])
diff -ur vlc-0.8.6e.orig/modules/codec/ffmpeg/chroma.c vlc-0.8.6e/modules/codec/ffmpeg/chroma.c
--- vlc-0.8.6e.orig/modules/codec/ffmpeg/chroma.c	2007-11-21 23:23:29.000000000 +0100
+++ vlc-0.8.6e/modules/codec/ffmpeg/chroma.c	2008-03-15 13:59:28.082407135 +0100
@@ -35,6 +35,7 @@
 #endif
 
 #include "ffmpeg.h"
+#include <ffmpeg/swscale.h>
 
 void E_(InitLibavcodec) ( vlc_object_t *p_object );
 static void ChromaConversion( vout_thread_t *, picture_t *, picture_t * );
@@ -89,26 +90,27 @@
     p_vout->chroma.p_sys->i_src_ffmpeg_chroma = i_ffmpeg_chroma[0];
     p_vout->chroma.p_sys->i_dst_ffmpeg_chroma = i_ffmpeg_chroma[1];
 
-    if( ( p_vout->render.i_height != p_vout->output.i_height ||
-          p_vout->render.i_width != p_vout->output.i_width ) &&
-        ( p_vout->chroma.p_sys->i_dst_vlc_chroma == VLC_FOURCC('I','4','2','0')  ||
-          p_vout->chroma.p_sys->i_dst_vlc_chroma == VLC_FOURCC('Y','V','1','2') ))
-        
-    {
-        msg_Dbg( p_vout, "preparing to resample picture" );
-        p_vout->chroma.p_sys->p_rsc =
-            img_resample_init( p_vout->output.i_width, p_vout->output.i_height,
-                               p_vout->render.i_width, p_vout->render.i_height );
-        avpicture_alloc( &p_vout->chroma.p_sys->tmp_pic,
-                         p_vout->chroma.p_sys->i_dst_ffmpeg_chroma,
-                         p_vout->render.i_width, p_vout->render.i_height );
-    }
-    else
-    {
-        msg_Dbg( p_vout, "no resampling" );
-        p_vout->chroma.p_sys->p_rsc = NULL;
-    }
-
+   /* if( ( p_vout->render.i_height != p_vout->output.i_height ||
+    *      p_vout->render.i_width != p_vout->output.i_width ) &&
+    *    ( p_vout->chroma.p_sys->i_dst_vlc_chroma == VLC_FOURCC('I','4','2','0')  ||
+    *      p_vout->chroma.p_sys->i_dst_vlc_chroma == VLC_FOURCC('Y','V','1','2') ))
+    *
+    * {
+         *msg_Dbg( p_vout, "preparing to resample picture" );
+         * p_vout->chroma.p_sys->p_rsc =
+         *    img_resample_init( p_vout->output.i_width, p_vout->output.i_height,
+         *                       p_vout->render.i_width, p_vout->render.i_height );
+         *avpicture_alloc( &p_vout->chroma.p_sys->tmp_pic,
+         *                p_vout->chroma.p_sys->i_dst_ffmpeg_chroma,
+         *                p_vout->render.i_width, p_vout->render.i_height );
+    *}
+    *else
+    *{
+    *
+    *     msg_Dbg( p_vout, "no resampling" );
+    *     p_vout->chroma.p_sys->p_rsc = NULL;
+    *}
+    */
     /* libavcodec needs to be initialized for some chroma conversions */
     E_(InitLibavcodec)(p_this);
 
@@ -124,6 +126,7 @@
     AVPicture src_pic;
     AVPicture dest_pic;
     int i;
+    struct SwsContext *img_convert_ctx;
 
     /* Prepare the AVPictures for converion */
     for( i = 0; i < p_src->i_planes; i++ )
@@ -156,21 +159,33 @@
         if( p_vout->render.i_bmask == 0x00ff0000 )
             p_vout->chroma.p_sys->i_src_ffmpeg_chroma = PIX_FMT_BGR24;
 
-    if( p_vout->chroma.p_sys->p_rsc )
-    {
-        img_convert( &p_vout->chroma.p_sys->tmp_pic,
-                     p_vout->chroma.p_sys->i_dst_ffmpeg_chroma,
-                     &src_pic, p_vout->chroma.p_sys->i_src_ffmpeg_chroma,
-                     p_vout->render.i_width, p_vout->render.i_height );
-        img_resample( p_vout->chroma.p_sys->p_rsc, &dest_pic,
-                      &p_vout->chroma.p_sys->tmp_pic );
-    }
-    else
-    {
-        img_convert( &dest_pic, p_vout->chroma.p_sys->i_dst_ffmpeg_chroma,
-                     &src_pic, p_vout->chroma.p_sys->i_src_ffmpeg_chroma,
-                     p_vout->render.i_width, p_vout->render.i_height );
-    }
+/*   if( p_vout->chroma.p_sys->p_rsc )
+ *   {
+ *        img_convert( &p_vout->chroma.p_sys->tmp_pic,
+ *                     p_vout->chroma.p_sys->i_dst_ffmpeg_chroma,
+ *                     &src_pic, p_vout->chroma.p_sys->i_src_ffmpeg_chroma,
+ *                     p_vout->render.i_width, p_vout->render.i_height );
+ *        img_resample( p_vout->chroma.p_sys->p_rsc, &dest_pic,
+ *                      &p_vout->chroma.p_sys->tmp_pic );
+ *
+ *   }
+ *   else
+ *   {
+ *        img_convert( &dest_pic, p_vout->chroma.p_sys->i_dst_ffmpeg_chroma,
+ *                    &src_pic, p_vout->chroma.p_sys->i_src_ffmpeg_chroma,
+ *                    p_vout->render.i_width, p_vout->render.i_height );
+ */
+        img_convert_ctx =
+               sws_getContext(p_vout->render.i_width, p_vout->render.i_height,
+                          p_vout->chroma.p_sys->i_src_ffmpeg_chroma,
+                          p_vout->render.i_width, p_vout->render.i_height,
+                          p_vout->chroma.p_sys->i_dst_ffmpeg_chroma,
+                          SWS_BICUBIC, NULL, NULL, NULL);
+        sws_scale(img_convert_ctx, src_pic.data, src_pic.linesize,
+                  0, p_vout->render.i_height,
+                  dest_pic.data, dest_pic.linesize);
+        sws_freeContext( img_convert_ctx );
+ /*   } */
 }
 
 /*****************************************************************************
@@ -181,10 +196,11 @@
 void E_(CloseChroma)( vlc_object_t *p_this )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
-    if( p_vout->chroma.p_sys->p_rsc )
-    {
-        img_resample_close( p_vout->chroma.p_sys->p_rsc );
-        avpicture_free( &p_vout->chroma.p_sys->tmp_pic );
-    }
+    /*if( p_vout->chroma.p_sys->p_rsc )
+     *{
+     *   img_resample_close( p_vout->chroma.p_sys->p_rsc );
+     *   avpicture_free( &p_vout->chroma.p_sys->tmp_pic );
+     *}
+     */
     free( p_vout->chroma.p_sys );
 }
diff -ur vlc-0.8.6e.orig/modules/codec/ffmpeg/video.c vlc-0.8.6e/modules/codec/ffmpeg/video.c
--- vlc-0.8.6e.orig/modules/codec/ffmpeg/video.c	2007-11-21 23:23:29.000000000 +0100
+++ vlc-0.8.6e/modules/codec/ffmpeg/video.c	2008-03-15 13:59:28.082407135 +0100
@@ -37,6 +37,7 @@
 #endif
 
 #include "ffmpeg.h"
+#include <ffmpeg/swscale.h>
 
 /*****************************************************************************
  * decoder_sys_t : decoder descriptor
@@ -831,11 +832,22 @@
                 dest_pic.data[i] = p_pic->p[i].p_pixels;
                 dest_pic.linesize[i] = p_pic->p[i].i_pitch;
             }
-            img_convert( &dest_pic, PIX_FMT_YUV420P,
+            /*img_convert( &dest_pic, PIX_FMT_YUV420P,
                          (AVPicture *)p_ff_pic,
                          p_sys->p_context->pix_fmt,
                          p_sys->p_context->width,
-                         p_sys->p_context->height );
+                         p_sys->p_context->height );*/
+            struct SwsContext *img_convert_ctx = sws_getContext(
+                     p_sys->p_context->width, p_sys->p_context->height,
+                     p_sys->p_context->pix_fmt,
+                     p_sys->p_context->width, p_sys->p_context->height,
+                     PIX_FMT_YUV420P,
+                     SWS_BICUBIC, NULL, NULL, NULL);
+           sws_scale(img_convert_ctx,
+                     (AVPicture *)p_ff_pic->data, (AVPicture *)p_ff_pic->linesize,
+                     0, p_sys->p_context->height,
+                     dest_pic.data, dest_pic.linesize);
+            sws_freeContext(img_convert_ctx);
             break;
         default:
             msg_Err( p_dec, "don't know how to convert chroma %i",
diff -ur vlc-0.8.6e.orig/modules/codec/ffmpeg/video_filter.c vlc-0.8.6e/modules/codec/ffmpeg/video_filter.c
--- vlc-0.8.6e.orig/modules/codec/ffmpeg/video_filter.c	2008-02-24 20:01:53.000000000 +0100
+++ vlc-0.8.6e/modules/codec/ffmpeg/video_filter.c	2008-03-15 14:14:51.051889193 +0100
@@ -37,6 +37,7 @@
 #endif
 
 #include "ffmpeg.h"
+#include <ffmpeg/swscale.h>
 
 void E_(InitLibavcodec) ( vlc_object_t *p_object );
 static int CheckInit( filter_t *p_filter );
@@ -59,7 +60,8 @@
     int i_dst_ffmpeg_chroma;
 
     AVPicture tmp_pic;
-    ImgReSampleContext *p_rsc;
+    /*ImgReSampleContext *p_rsc;*/
+    struct SwsContext *img_convert_ctx;
 };
 
 
@@ -114,7 +116,7 @@
     }
 
     /* Misc init */
-    p_sys->p_rsc = NULL;
+    /*p_sys->p_rsc = NULL;*/
     p_sys->b_enable_croppadd = b_enable_croppadd;
     p_sys->i_src_ffmpeg_chroma =
         E_(GetFfmpegChroma)( p_filter->fmt_in.video.i_chroma );
@@ -123,6 +125,14 @@
     p_filter->pf_video_filter = Process;
     es_format_Init( &p_sys->fmt_in, 0, 0 );
     es_format_Init( &p_sys->fmt_out, 0, 0 );
+    p_sys->img_convert_ctx = sws_getContext(
+                               p_filter->fmt_out.video.i_width,
+                               p_filter->fmt_out.video.i_height,
+                               p_sys->i_dst_ffmpeg_chroma,
+                               p_filter->fmt_in.video.i_width,
+                               p_filter->fmt_in.video.i_height,
+                               p_sys->i_dst_ffmpeg_chroma,
+                               SWS_BICUBIC, NULL, NULL, NULL);
 
     /* Dummy alloc, will be reallocated in CheckInit */
     avpicture_alloc( &p_sys->tmp_pic, p_sys->i_src_ffmpeg_chroma,
@@ -131,8 +141,10 @@
 
     if( CheckInit( p_filter ) != VLC_SUCCESS )
     {	
-        if( p_sys->p_rsc ) img_resample_close( p_sys->p_rsc );
-        avpicture_free( &p_sys->tmp_pic );
+        /*if( p_sys->p_rsc ) img_resample_close( p_sys->p_rsc );
+        avpicture_free( &p_sys->tmp_pic );*/
+        if( p_sys->img_convert_ctx ) sws_freeContext( p_sys->img_convert_ctx );
+        p_sys->img_convert_ctx = NULL;
         free( p_sys );
         return VLC_EGENERIC;
     }
@@ -174,7 +186,8 @@
     filter_t *p_filter = (filter_t*)p_this;
     filter_sys_t *p_sys = p_filter->p_sys;
 
-    if( p_sys->p_rsc ) img_resample_close( p_sys->p_rsc );
+    /*if( p_sys->p_rsc ) img_resample_close( p_sys->p_rsc );*/
+    if( p_sys->img_convert_ctx ) sws_freeContext( p_sys->img_convert_ctx );
     avpicture_free( &p_sys->tmp_pic );
 
     free( p_sys );
@@ -217,8 +230,10 @@
 
     if ( b_change )
     {
-        if( p_sys->p_rsc ) img_resample_close( p_sys->p_rsc );
-        p_sys->p_rsc = 0;
+        /*if( p_sys->p_rsc ) img_resample_close( p_sys->p_rsc );
+        p_sys->p_rsc = 0;*/
+        if( p_sys->img_convert_ctx ) sws_freeContext( p_sys->img_convert_ctx );
+        p_sys->img_convert_ctx = NULL;
 
         p_sys->b_convert =
           p_filter->fmt_in.video.i_chroma != p_filter->fmt_out.video.i_chroma;
@@ -288,7 +303,7 @@
                                       - p_filter->fmt_out.video.i_x_offset;
             }
 
-#if LIBAVCODEC_BUILD >= 4708
+/*#if LIBAVCODEC_BUILD >= 4708
             p_sys->p_rsc = img_resample_full_init( 
                                p_filter->fmt_out.video.i_width,
                                p_filter->fmt_out.video.i_height,
@@ -306,18 +321,36 @@
                                p_filter->fmt_in.video.i_height,
                                i_croptop,i_cropbottom,
                                i_cropleft,i_cropright );
-#endif
+#endif*/
+            p_sys->img_convert_ctx = sws_getContext(
+                               p_filter->fmt_out.video.i_width - i_paddleft - i_paddright,
+                               p_filter->fmt_out.video.i_height - i_paddtop - i_paddbottom,
+                               p_sys->i_dst_ffmpeg_chroma,
+                               p_filter->fmt_in.video.i_width,
+                               p_filter->fmt_in.video.i_height,
+                               p_sys->i_dst_ffmpeg_chroma,
+                               SWS_BICUBIC, NULL, NULL, NULL);
             msg_Dbg( p_filter, "input: %ix%i -> %ix%i",
                 p_filter->fmt_out.video.i_width,
                 p_filter->fmt_out.video.i_height,
                 p_filter->fmt_in.video.i_width,
                 p_filter->fmt_in.video.i_height);
 
-            if( !p_sys->p_rsc )
+            /*if( !p_sys->p_rsc )*/
+            if( !p_sys->img_convert_ctx )
             {
                 msg_Err( p_filter, "img_resample_init failed" );
                 return VLC_EGENERIC;
             }
+        } else {
+            p_sys->img_convert_ctx = sws_getContext(
+                               p_filter->fmt_out.video.i_width,
+                               p_filter->fmt_out.video.i_height,
+                               p_sys->i_dst_ffmpeg_chroma,
+                               p_filter->fmt_in.video.i_width,
+                               p_filter->fmt_in.video.i_height,
+                               p_sys->i_dst_ffmpeg_chroma,
+                               SWS_BICUBIC, NULL, NULL, NULL);
         }
 
         avpicture_free( &p_sys->tmp_pic );
@@ -459,14 +492,15 @@
 
     p_src = &src_pic;
 
-    if( p_sys->b_resize && p_sys->p_rsc )
+   /* if( p_sys->b_resize && p_sys->p_rsc )*/
+    if( p_sys->b_resize && p_sys->img_convert_ctx )
     {
         p_dst = &dest_pic;
         if( p_sys->b_resize_first )
         {
             if( p_sys->b_convert ) p_dst = &p_sys->tmp_pic;
 
-#if LIBAVCODEC_BUILD >= 4708
+/*#if LIBAVCODEC_BUILD >= 4708
             img_resample( p_sys->p_rsc, p_dst, p_src );
 #else        
             if ( p_sys->b_enable_croppadd )
@@ -479,7 +513,12 @@
             {
                 img_resample( p_sys->p_rsc, p_dst, p_src );
             }
-#endif
+#endif*/
+            sws_scale(p_sys->img_convert_ctx, p_src->data, p_src->linesize,
+                  0, p_filter->fmt_out.video.i_height
+                                      - p_filter->fmt_out.video.i_visible_height
+                                      - p_filter->fmt_out.video.i_y_offset,
+                  p_dst->data, p_dst->linesize);
 
             if (p_sys->b_enable_croppadd)
             {
@@ -516,18 +555,22 @@
             p_fmt = &p_filter->fmt_in.video;
         }
 
-        img_convert( p_dst, p_sys->i_dst_ffmpeg_chroma,
+        /*img_convert( p_dst, p_sys->i_dst_ffmpeg_chroma,
                      p_src, p_sys->i_src_ffmpeg_chroma,
-                     p_fmt->i_width, p_fmt->i_height );
+                     p_fmt->i_width, p_fmt->i_height );*/
+        sws_scale(p_sys->img_convert_ctx, p_src->data, p_src->linesize,
+                  0, p_fmt->i_height,
+                  p_dst->data, p_dst->linesize);
 
         p_src = p_dst;
     }
 
-    if( p_sys->b_resize && !p_sys->b_resize_first && p_sys->p_rsc )
+    /*if( p_sys->b_resize && !p_sys->b_resize_first && p_sys->p_rsc )*/
+    if( p_sys->b_resize && !p_sys->b_resize_first && p_sys->img_convert_ctx )
     {
         p_dst = &dest_pic;
 
-#if LIBAVCODEC_BUILD >= 4708
+/*#if LIBAVCODEC_BUILD >= 4708
         img_resample( p_sys->p_rsc, p_dst, p_src );
 #else
         if ( p_sys->b_enable_croppadd )
@@ -540,7 +583,7 @@
         {
             img_resample( p_sys->p_rsc, p_dst, p_src );
         }
-#endif
+#endif*/
  
         if (p_sys->b_enable_croppadd)
         {
