]> git.sesse.net Git - mlt/blobdiff - src/modules/avformat/filter_avdeinterlace.c
Work around for vid.stab chroma skew when using 4:2:2
[mlt] / src / modules / avformat / filter_avdeinterlace.c
index b75117453652b3e0427c7435b4452204f7773008..b4cf0eab78f3dfaf98d486be9da11e9115600538 100644 (file)
@@ -31,7 +31,7 @@
 #include "mmx.h"
 #else
 #define MAX_NEG_CROP 1024
-extern uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP];
+static uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP] = {0,};
 #endif
 
 #ifdef USE_MMX
@@ -81,10 +81,6 @@ extern uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP];
                     movd_r2m(mm1,dst[0]);
 #endif
 
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-#define PIX_FMT_YUYV422 PIX_FMT_YUV422
-#endif
-
 /* filter parameters: [-1 4 2 4 -1] // 8 */
 static inline void deinterlace_line(uint8_t *dst, 
                             const uint8_t *lum_m4, const uint8_t *lum_m3, 
@@ -346,6 +342,17 @@ static mlt_frame deinterlace_process( mlt_filter filter, mlt_frame frame )
 
 mlt_filter filter_avdeinterlace_init( void *arg )
 {
+#ifndef USE_MMX
+       if ( ff_cropTbl[MAX_NEG_CROP + 1] == 0 )
+       {
+               int i;
+               for(i=0;i<256;i++) ff_cropTbl[i + MAX_NEG_CROP] = i;
+               for(i=0;i<MAX_NEG_CROP;i++) {
+                       ff_cropTbl[i] = 0;
+                       ff_cropTbl[i + MAX_NEG_CROP + 256] = 255;
+               }
+       }
+#endif
        mlt_filter filter = mlt_filter_new( );
        if ( filter != NULL )
                filter->process = deinterlace_process;