Changeset e7e6e9df502ccb0a71c766047c626128d253b935

Show
Ignore:
Timestamp:
27/05/04 23:06:16 (5 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1085691976 +0000
git-parent:

[8f5a3ddc82407e46aea9d7288a9e3be918d7789a]

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

* modules/video_chroma/i422_yuy2.c: fixed the I422 MMX conversion routines. The fix also doubles the speed of the conversion :)

Files:

Legend:

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

    r82a6766 re7e6e9d  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000, 2001 VideoLAN 
    5  * $Id: i422_yuy2.c,v 1.5 2004/01/25 17:20:18 kuehne Exp
     5 * $Id
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    163163                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) );  
    164164 
    165             p_line += 8; p_y += 4; p_u += 2; p_v += 2; 
    166  
    167             __asm__( ".align 8" MMX_YUV422_YUYV 
    168                      : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) );  
    169  
    170             p_line += 8; p_y += 4; p_u += 2; p_v += 2; 
     165            p_line += 16; p_y += 8; p_u += 4; p_v += 4; 
    171166#endif 
    172167        } 
     
    200195                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) );  
    201196 
    202             p_line += 8; p_y += 4; p_u += 2; p_v += 2; 
    203  
    204             __asm__( ".align 8" MMX_YUV422_YVYU 
    205                      : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) );  
    206  
    207             p_line += 8; p_y += 4; p_u += 2; p_v += 2; 
     197            p_line += 16; p_y += 8; p_u += 4; p_v += 4; 
    208198#endif 
    209199        } 
     
    237227                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) );  
    238228 
    239             p_line += 8; p_y += 4; p_u += 2; p_v += 2; 
    240  
     229            p_line += 16; p_y += 8; p_u += 4; p_v += 4; 
     230#endif 
     231        } 
     232    } 
     233
     234 
     235/***************************************************************************** 
     236 * I422_IUYV: planar YUV 4:2:2 to interleaved packed IUYV 4:2:2 
     237 *****************************************************************************/ 
     238static void I422_IUYV( vout_thread_t *p_vout, picture_t *p_source, 
     239                                              picture_t *p_dest ) 
     240
     241    /* FIXME: TODO ! */ 
     242    msg_Err( p_vout, "I422_IUYV unimplemented, please harass <sam@zoy.org>" ); 
     243
     244 
     245/***************************************************************************** 
     246 * I422_cyuv: planar YUV 4:2:2 to upside-down packed UYVY 4:2:2 
     247 *****************************************************************************/ 
     248static void I422_cyuv( vout_thread_t *p_vout, picture_t *p_source, 
     249                                              picture_t *p_dest ) 
     250
     251    uint8_t *p_line = p_dest->p->p_pixels + p_dest->p->i_lines * p_dest->p->i_pitch; 
     252    uint8_t *p_y = p_source->Y_PIXELS; 
     253    uint8_t *p_u = p_source->U_PIXELS; 
     254    uint8_t *p_v = p_source->V_PIXELS; 
     255 
     256    int i_x, i_y; 
     257 
     258    for( i_y = p_vout->render.i_height ; i_y-- ; ) 
     259    { 
     260        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; ) 
     261        { 
     262            p_line -= 2 * p_dest->p->i_pitch; 
     263 
     264#if defined (MODULE_NAME_IS_i422_yuy2) 
     265            C_YUV422_UYVY( p_line, p_y, p_u, p_v ); 
     266            C_YUV422_UYVY( p_line, p_y, p_u, p_v ); 
     267            C_YUV422_UYVY( p_line, p_y, p_u, p_v ); 
     268            C_YUV422_UYVY( p_line, p_y, p_u, p_v ); 
     269#else 
    241270            __asm__( ".align 8" MMX_YUV422_UYVY 
    242271                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) );  
    243272 
    244             p_line += 8; p_y += 4; p_u += 2; p_v += 2; 
    245 #endif 
    246         } 
    247     } 
    248 
    249  
    250 /***************************************************************************** 
    251  * I422_IUYV: planar YUV 4:2:2 to interleaved packed IUYV 4:2:2 
    252  *****************************************************************************/ 
    253 static void I422_IUYV( vout_thread_t *p_vout, picture_t *p_source, 
    254                                               picture_t *p_dest ) 
    255 
    256     /* FIXME: TODO ! */ 
    257     msg_Err( p_vout, "I422_IUYV unimplemented, please harass <sam@zoy.org>" ); 
    258 
    259  
    260 /***************************************************************************** 
    261  * I422_cyuv: planar YUV 4:2:2 to upside-down packed UYVY 4:2:2 
    262  *****************************************************************************/ 
    263 static void I422_cyuv( vout_thread_t *p_vout, picture_t *p_source, 
    264                                               picture_t *p_dest ) 
    265 
    266     uint8_t *p_line = p_dest->p->p_pixels + p_dest->p->i_lines * p_dest->p->i_pitch; 
    267     uint8_t *p_y = p_source->Y_PIXELS; 
    268     uint8_t *p_u = p_source->U_PIXELS; 
    269     uint8_t *p_v = p_source->V_PIXELS; 
    270  
    271     int i_x, i_y; 
    272  
    273     for( i_y = p_vout->render.i_height ; i_y-- ; ) 
    274     { 
    275         for( i_x = p_vout->render.i_width / 8 ; i_x-- ; ) 
    276         { 
    277             p_line -= 2 * p_dest->p->i_pitch; 
    278  
    279 #if defined (MODULE_NAME_IS_i422_yuy2) 
    280             C_YUV422_UYVY( p_line, p_y, p_u, p_v ); 
    281             C_YUV422_UYVY( p_line, p_y, p_u, p_v ); 
    282             C_YUV422_UYVY( p_line, p_y, p_u, p_v ); 
    283             C_YUV422_UYVY( p_line, p_y, p_u, p_v ); 
    284 #else 
    285             __asm__( ".align 8" MMX_YUV422_UYVY 
    286                      : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) );  
    287  
    288             p_line += 8; p_y += 4; p_u += 2; p_v += 2; 
    289  
    290             __asm__( ".align 8" MMX_YUV422_UYVY 
    291                      : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) );  
    292  
    293             p_line += 8; p_y += 4; p_u += 2; p_v += 2; 
     273            p_line += 16; p_y += 8; p_u += 4; p_v += 4; 
    294274#endif 
    295275        }