Changeset 37741cf811763f13a752a742431c6af2976863fa

Show
Ignore:
Timestamp:
11/10/02 23:17:29 (6 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 1034371049 +0000
git-parent:

[c93f613b1461ccedfa39c4d4dad0699a66783bb3]

git-author:
Sam Hocevar <sam@videolan.org> 1034371049 +0000
Message:
  • ./plugins/filter/deinterlace.c: fixed the green bottom line in the
    linear deinterlace mode, thanks to Marian Durkovic <md@bts.sk>.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/video_filter/deinterlace/deinterlace.c

    rb69c9ce r37741cf  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000, 2001 VideoLAN 
    5  * $Id: deinterlace.c,v 1.2 2002/08/26 09:12:46 sam Exp $ 
     5 * $Id: deinterlace.c,v 1.3 2002/10/11 21:17:29 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    451451        u8 *p_in, *p_out_end, *p_out; 
    452452 
    453         p_in = p_pic->p[i_plane].p_pixels 
    454                    + i_field * p_pic->p[i_plane].i_pitch; 
    455  
     453        p_in = p_pic->p[i_plane].p_pixels; 
    456454        p_out = p_outpic->p[i_plane].p_pixels; 
    457455        p_out_end = p_out + p_outpic->p[i_plane].i_pitch 
    458456                             * p_outpic->p[i_plane].i_lines; 
    459457 
    460         if( i_field == 0 ) 
     458        /* For BOTTOM field we need to add the first line */ 
     459        if( i_field == 1 ) 
    461460        { 
    462461            p_vout->p_vlc->pf_memcpy( p_out, p_in, 
    463462                                      p_pic->p[i_plane].i_pitch ); 
     463            p_in += p_pic->p[i_plane].i_pitch; 
     464            p_out += p_pic->p[i_plane].i_pitch; 
     465        } 
     466 
     467        p_out_end -= 2 * p_outpic->p[i_plane].i_pitch; 
     468 
     469        for( ; p_out < p_out_end ; ) 
     470        { 
     471            p_vout->p_vlc->pf_memcpy( p_out, p_in, 
     472                                      p_pic->p[i_plane].i_pitch ); 
     473 
     474            p_out += p_pic->p[i_plane].i_pitch; 
     475 
     476            Merge( p_out, p_in, p_in + 2 * p_pic->p[i_plane].i_pitch, 
     477                   p_pic->p[i_plane].i_pitch ); 
     478 
    464479            p_in += 2 * p_pic->p[i_plane].i_pitch; 
    465480            p_out += p_pic->p[i_plane].i_pitch; 
    466481        } 
    467482 
    468         p_out_end -= p_outpic->p[i_plane].i_pitch; 
    469  
    470         for( ; p_out < p_out_end ; ) 
    471         { 
     483        p_vout->p_vlc->pf_memcpy( p_out, p_in, 
     484                                  p_pic->p[i_plane].i_pitch ); 
     485 
     486        /* For TOP field we need to add the last line */ 
     487        if( i_field == 0 ) 
     488        { 
     489            p_in += p_pic->p[i_plane].i_pitch; 
     490            p_out += p_pic->p[i_plane].i_pitch; 
    472491            p_vout->p_vlc->pf_memcpy( p_out, p_in, 
    473492                                      p_pic->p[i_plane].i_pitch ); 
    474  
    475             p_out += p_pic->p[i_plane].i_pitch; 
    476  
    477             Merge( p_out, p_in, p_in + 2 * p_pic->p[i_plane].i_pitch, 
    478                    p_pic->p[i_plane].i_pitch ); 
    479  
    480             p_in += 2 * p_pic->p[i_plane].i_pitch; 
    481             p_out += p_pic->p[i_plane].i_pitch; 
    482         } 
    483  
    484 #if 0 
    485         if( i_field == 0 ) 
    486         { 
    487             p_in -= 2 * p_pic->p[i_plane].i_pitch; 
    488             p_vout->p_vlc->pf_memcpy( p_out, p_in, 
    489                                       p_pic->p[i_plane].i_pitch ); 
    490         } 
    491 #endif 
     493        } 
    492494    } 
    493495}