Changeset 4904140690f8630d53466a35914f0a37aa5154a4

Show
Ignore:
Timestamp:
08/30/04 03:24:08 (4 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1093829048 +0000
git-parent:

[60349e21f45e7da3341c13d28e4b36ba0913dfd1]

git-author:
Gildas Bazin <gbazin@videolan.org> 1093829048 +0000
Message:

* modules/video_chroma/i420_rgb16.c: take care of width != pitch as well.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/video_chroma/i420_rgb16.c

    r41a8349 r4904140  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000 VideoLAN 
    5  * $Id: i420_rgb16.c,v 1.5 2003/08/29 18:58:05 fenrir Exp
     5 * $Id
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    8383    int *       p_offset; 
    8484 
     85    const int i_source_margin = p_src->p[0].i_pitch 
     86                                 - p_src->p[0].i_visible_pitch; 
     87    const int i_source_margin_c = p_src->p[1].i_pitch 
     88                                 - p_src->p[1].i_visible_pitch; 
     89 
    8590    /* The dithering matrices */ 
    8691    int dither10[4] = {  0x0,  0x8,  0x2,  0xa }; 
     
    173178        SCALE_WIDTH; 
    174179        SCALE_HEIGHT( 420, 2 ); 
     180 
     181        p_y += i_source_margin; 
     182        if( i_y % 2 ) 
     183        { 
     184            p_u += i_source_margin_c; 
     185            p_v += i_source_margin_c; 
     186        } 
    175187    } 
    176188} 
     
    220232    int *       p_offset; 
    221233 
     234    const int i_source_margin = p_src->p[0].i_pitch 
     235                                 - p_src->p[0].i_visible_pitch; 
     236    const int i_source_margin_c = p_src->p[1].i_pitch 
     237                                 - p_src->p[1].i_visible_pitch; 
     238 
    222239    i_right_margin = p_dest->p->i_pitch - p_dest->p->i_visible_pitch; 
    223240 
     
    343360        SCALE_WIDTH; 
    344361        SCALE_HEIGHT( 420, 2 ); 
     362 
     363        p_y += i_source_margin; 
     364        if( i_y % 2 ) 
     365        { 
     366            p_u += i_source_margin_c; 
     367            p_v += i_source_margin_c; 
     368        } 
    345369    } 
    346370} 
     
    389413    int *       p_offset; 
    390414 
     415    const int i_source_margin = p_src->p[0].i_pitch 
     416                                 - p_src->p[0].i_visible_pitch; 
     417    const int i_source_margin_c = p_src->p[1].i_pitch 
     418                                 - p_src->p[1].i_visible_pitch; 
     419 
    391420    i_right_margin = p_dest->p->i_pitch - p_dest->p->i_visible_pitch; 
    392421 
     
    472501        SCALE_WIDTH; 
    473502        SCALE_HEIGHT( 420, 4 ); 
     503 
     504        p_y += i_source_margin; 
     505        if( i_y % 2 ) 
     506        { 
     507            p_u += i_source_margin_c; 
     508            p_v += i_source_margin_c; 
     509        } 
    474510    } 
    475511}