[vlc-devel] commit: Removed dead code (deinterlace). (Laurent Aimar )

git version control git at videolan.org
Tue Mar 17 20:08:47 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Mar 15 21:16:47 2009 +0100| [f9cbf5e6071f1864d394987d4cda7dac8f8343c7] | committer: Laurent Aimar 

Removed dead code (deinterlace).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f9cbf5e6071f1864d394987d4cda7dac8f8343c7
---

 modules/video_filter/deinterlace.c |  323 ------------------------------------
 1 files changed, 0 insertions(+), 323 deletions(-)

diff --git a/modules/video_filter/deinterlace.c b/modules/video_filter/deinterlace.c
index d90dd80..6e2a110 100644
--- a/modules/video_filter/deinterlace.c
+++ b/modules/video_filter/deinterlace.c
@@ -1236,30 +1236,6 @@ static inline int XDeint8x8DetectMMXEXT( uint8_t *src, int i_src )
 }
 #endif
 
-/* XDeint8x8Frame: apply a small blend between field (1,6,1).
- * This won't destroy details, and help if there is a bit of interlacing.
- * (It helps with paning to avoid flickers)
- * (Use 8x9 pixels)
- */
-#if 0
-static inline void XDeint8x8FrameC( uint8_t *dst, int i_dst,
-                                    uint8_t *src, int i_src )
-{
-    int y, x;
-
-    /* Progressive */
-    for( y = 0; y < 8; y += 2 )
-    {
-        memcpy( dst, src, 8 );
-        dst += i_dst;
-
-        for( x = 0; x < 8; x++ )
-            dst[x] = (src[x] + 6*src[1*i_src+x] + src[2*i_src+x] + 4 ) >> 3;
-        dst += 1*i_dst;
-        src += 2*i_src;
-    }
-}
-#endif
 static inline void XDeint8x8MergeC( uint8_t *dst, int i_dst,
                                     uint8_t *src1, int i_src1,
                                     uint8_t *src2, int i_src2 )
@@ -1466,305 +1442,6 @@ static inline void XDeint8x8FieldMMXEXT( uint8_t *dst, int i_dst,
 }
 #endif
 
-#if 0
-static inline int XDeint8x8SsdC( uint8_t *pix1, int i_pix1,
-                                 uint8_t *pix2, int i_pix2 )
-{
-    int y, x;
-    int s = 0;
-
-    for( y = 0; y < 8; y++ )
-        for( x = 0; x < 8; x++ )
-            s += ssd( pix1[y*i_pix1+x] - pix2[y*i_pix2+x] );
-    return s;
-}
-
-#ifdef CAN_COMPILE_MMXEXT
-static inline int XDeint8x8SsdMMXEXT( uint8_t *pix1, int i_pix1,
-                                      uint8_t *pix2, int i_pix2 )
-{
-    int y;
-    int32_t s;
-
-    pxor_r2r( mm7, mm7 );
-    pxor_r2r( mm6, mm6 );
-
-    for( y = 0; y < 8; y++ )
-    {
-        movq_m2r( pix1[0], mm0 );
-        movq_m2r( pix2[0], mm1 );
-
-        movq_r2r( mm0, mm2 );
-        movq_r2r( mm1, mm3 );
-
-        punpcklbw_r2r( mm7, mm0 );
-        punpckhbw_r2r( mm7, mm2 );
-        punpcklbw_r2r( mm7, mm1 );
-        punpckhbw_r2r( mm7, mm3 );
-
-        psubw_r2r( mm1, mm0 );
-        psubw_r2r( mm3, mm2 );
-
-        pmaddwd_r2r( mm0, mm0 );
-        pmaddwd_r2r( mm2, mm2 );
-
-        paddd_r2r( mm2, mm0 );
-        paddd_r2r( mm0, mm6 );
-
-        pix1 += i_pix1;
-        pix2 += i_pix2;
-    }
-
-    movq_r2r( mm6, mm7 );
-    psrlq_i2r( 32, mm7 );
-    paddd_r2r( mm6, mm7 );
-    movd_r2m( mm7, s );
-
-    return s;
-}
-#endif
-#endif
-
-#if 0
-/* A little try with motion, but doesn't work better that pure intra (and slow) */
-#ifdef CAN_COMPILE_MMXEXT
-/* XDeintMC:
- *  Bilinear MC QPel
- *  TODO: mmx version (easier in sse2)
- */
-static inline void XDeintMC( uint8_t *dst, int i_dst,
-                             uint8_t *src, int i_src,
-                             int mvx, int mvy,
-                             int i_width, int i_height )
-{
-    const int d4x = mvx&0x03;
-    const int d4y = mvy&0x03;
-
-    const int cA = (4-d4x)*(4-d4y);
-    const int cB = d4x    *(4-d4y);
-    const int cC = (4-d4x)*d4y;
-    const int cD = d4x    *d4y;
-
-    int y, x;
-    uint8_t *srcp;
-
-
-    src  += (mvy >> 2) * i_src + (mvx >> 2);
-    srcp = &src[i_src];
-
-    for( y = 0; y < i_height; y++ )
-    {
-        for( x = 0; x < i_width; x++ )
-        {
-            dst[x] = ( cA*src[x]  + cB*src[x+1] +
-                       cC*srcp[x] + cD*srcp[x+1] + 8 ) >> 4;
-        }
-        dst  += i_dst;
-
-        src   = srcp;
-        srcp += i_src;
-    }
-}
-static int XDeint8x4SadMMXEXT( uint8_t *pix1, int i_pix1,
-                               uint8_t *pix2, int i_pix2 )
-{
-    int32_t s;
-
-    movq_m2r( pix1[0*i_pix1], mm0 );
-    movq_m2r( pix1[1*i_pix1], mm1 );
-
-    psadbw_m2r( pix2[0*i_pix2], mm0 );
-    psadbw_m2r( pix2[1*i_pix2], mm1 );
-
-    movq_m2r( pix1[2*i_pix1], mm2 );
-    movq_m2r( pix1[3*i_pix1], mm3 );
-    psadbw_m2r( pix2[2*i_pix2], mm2 );
-    psadbw_m2r( pix2[3*i_pix2], mm3 );
-
-    paddd_r2r( mm1, mm0 );
-    paddd_r2r( mm3, mm2 );
-    paddd_r2r( mm2, mm0 );
-    movd_r2m( mm0, s );
-
-    return s;
-}
-
-static inline int XDeint8x4TestQpel( uint8_t *src, int i_src,
-                                     uint8_t *ref, int i_stride,
-                                     int mx, int my,
-                                     int xmax, int ymax )
-{
-    uint8_t buffer[8*4];
-
-    if( abs(mx) >= 4*xmax || abs(my) >= 4*ymax )
-        return 255*255*255;
-
-    XDeintMC( buffer, 8, ref, i_stride, mx, my, 8, 4 );
-    return XDeint8x4SadMMXEXT( src, i_src, buffer, 8 );
-}
-static inline int XDeint8x4TestInt( uint8_t *src, int i_src,
-                                    uint8_t *ref, int i_stride,
-                                    int mx, int my,
-                                    int xmax, int ymax )
-{
-    if( abs(mx) >= xmax || abs(my) >= ymax )
-        return 255*255*255;
-
-    return XDeint8x4SadMMXEXT( src, i_src, &ref[my*i_stride+mx], i_stride );
-}
-
-static inline void XDeint8x8FieldMotion( uint8_t *dst, int i_dst,
-                                         uint8_t *src, int i_src,
-                                         int *mpx, int *mpy,
-                                         int xmax, int ymax )
-{
-    static const int dx[8] = { 0,  0, -1, 1, -1, -1,  1, 1 };
-    static const int dy[8] = {-1,  1,  0, 0, -1,  1, -1, 1 };
-    uint8_t *next = &src[i_src];
-    const int i_src2 = 2*i_src;
-    int mvx, mvy;
-    int mvs, s;
-    int i_step;
-
-    uint8_t *rec = &dst[i_dst];
-
-    /* We construct with intra method the missing field */
-    XDeint8x8FieldMMXEXT( dst, i_dst, src, i_src );
-
-    /* Now we will try to find a match with ME with the other field */
-
-    /* ME: A small/partial EPZS
-     * We search only for small MV (with high motion intra will be perfect */
-    if( xmax > 4 ) xmax = 4;
-    if( ymax > 4 ) ymax = 4;
-
-    /* Init with NULL Mv */
-    mvx = mvy = 0;
-    mvs = XDeint8x4SadMMXEXT( rec, i_src2, next, i_src2 );
-
-    /* Try predicted Mv */
-    if( (s=XDeint8x4TestInt( rec, i_src2, next, i_src2, *mpx, *mpy, xmax, ymax)) < mvs )
-    {
-        mvs = s;
-        mvx = *mpx;
-        mvy = *mpy;
-    }
-    /* Search interger pel (small mv) */
-    for( i_step = 0; i_step < 4; i_step++ )
-    {
-        int c = 4;
-        int s;
-        int i;
-
-        for( i = 0; i < 4; i++ )
-        {
-            s = XDeint8x4TestInt( rec, i_src2,
-                                  next, i_src2, mvx+dx[i], mvy+dy[i],
-                                  xmax, ymax );
-            if( s < mvs )
-            {
-                mvs = s;
-                c = i;
-            }
-        }
-        if( c == 4 )
-            break;
-
-        mvx += dx[c];
-        mvy += dy[c];
-    }
-    *mpx = mvx;
-    *mpy = mvy;
-
-    mvx <<= 2;
-    mvy <<= 2;
-
-    if( mvs > 4 && mvs < 256 )
-    {
-        /* Search Qpel */
-        /* XXX: for now only HPEL (too slow) */
-        for( i_step = 0; i_step < 4; i_step++ )
-        {
-            int c = 8;
-            int s;
-            int i;
-
-            for( i = 0; i < 8; i++ )
-            {
-                s = XDeint8x4TestQpel( rec, i_src2, next, i_src2,
-                                       mvx+dx[i], mvy+dy[i],
-                                       xmax, ymax );
-                if( s < mvs )
-                {
-                    mvs = s;
-                    c = i;
-                }
-            }
-            if( c == 8 )
-                break;
-
-            mvx += dx[c];
-            mvy += dy[c];
-        }
-    }
-
-    if( mvs < 128 )
-    {
-        uint8_t buffer[8*4];
-        XDeintMC( buffer, 8, next, i_src2, mvx, mvy, 8, 4 );
-        XDeint8x8MergeMMXEXT( dst, i_dst, src, 2*i_src, buffer, 8 );
-
-        //XDeint8x8Set( dst, i_dst, 0 );
-    }
-}
-#endif
-#endif
-
-#if 0
-/* Kernel interpolation (1,-5,20,20,-5,1)
- * Lose a bit more details+add aliasing than edge interpol but avoid
- * more artifacts
- */
-static inline uint8_t clip1( int a )
-{
-    if( a <= 0 )
-        return 0;
-    else if( a >= 255 )
-        return 255;
-    else
-        return a;
-}
-static inline void XDeint8x8Field( uint8_t *dst, int i_dst,
-                                   uint8_t *src, int i_src )
-{
-    int y, x;
-
-    /* Interlaced */
-    for( y = 0; y < 8; y += 2 )
-    {
-        const int i_src2 = i_src*2;
-
-        memcpy( dst, src, 8 );
-        dst += i_dst;
-
-        for( x = 0; x < 8; x++ )
-        {
-            int pix;
-
-            pix =   1*(src[-2*i_src2+x]+src[3*i_src2+x]) +
-                   -5*(src[-1*i_src2+x]+src[2*i_src2+x])
-                  +20*(src[ 0*i_src2+x]+src[1*i_src2+x]);
-
-            dst[x] = clip1( ( pix + 16 ) >> 5 );
-        }
-
-        dst += 1*i_dst;
-        src += 2*i_src;
-    }
-}
-
-#endif
-
 /* NxN arbitray size (and then only use pixel in the NxN block)
  */
 static inline int XDeintNxNDetect( uint8_t *src, int i_src,




More information about the vlc-devel mailing list