Changeset b3e689d0e60cffe1d8c4406e2a280d8c0ba83c1a

Show
Ignore:
Timestamp:
26/01/04 17:54:56 (5 years ago)
Author:
Eric Petit <titer@videolan.org>
git-committer:
Eric Petit <titer@videolan.org> 1075136096 +0000
git-parent:

[d47b33f38a60ffe3a781e9b04d25ff9434b1f424]

git-author:
Eric Petit <titer@videolan.org> 1075136096 +0000
Message:

+ All: added Altivec-optimized i420 to yuy2 conversion. It isn't used

yet as Quicktime handles i420 pictures, but it will be when I've
cleaned the OpenGL output I'm working on (to be commited soon).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.ac

    r54693af rb3e689d  
    11dnl Autoconf settings for vlc 
    2 dnl $Id: configure.ac,v 1.159 2004/01/26 10:35:28 gbazin Exp $ 
     2dnl $Id: configure.ac,v 1.160 2004/01/26 16:54:56 titer Exp $ 
    33 
    44AC_INIT(vlc,0.7.1-cvs) 
     
    914914THREEDNOW_MODULES="memcpy3dn" 
    915915SSE_MODULES="" 
    916 ALTIVEC_MODULES="memcpyaltivec
     916ALTIVEC_MODULES="memcpyaltivec i420_yuy2_altivec
    917917#ALTIVEC_MODULES="${ALTIVEC_MODULES} idctaltivec motionaltivec" 
    918918 
     
    996996if test "${ac_cv_c_altivec}" != "no"; then 
    997997  AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.) 
    998   AX_ADD_CFLAGS([vlc idctaltivec motionaltivec memcpyaltivec deinterlace],[${ac_cv_c_altivec}]) 
     998  AX_ADD_CFLAGS([vlc idctaltivec motionaltivec memcpyaltivec deinterlace i420_yuy2_altivec],[${ac_cv_c_altivec}]) 
    999999  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}" 
    10001000fi 
  • modules/video_chroma/Modules.am

    rfe17002 rb3e689d  
    2424    $(NULL) 
    2525 
     26SOURCES_i420_yuy2_altivec = \ 
     27    i420_yuy2.c \ 
     28    i420_yuy2.h \ 
     29    $(NULL) 
     30 
    2631SOURCES_i422_yuy2 = \ 
    2732    i422_yuy2.c \ 
  • modules/video_chroma/i420_yuy2.c

    r82a6766 rb3e689d  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000, 2001 VideoLAN 
    5  * $Id: i420_yuy2.c,v 1.5 2004/01/25 17:20:18 kuehne Exp $ 
     5 * $Id: i420_yuy2.c,v 1.6 2004/01/26 16:54:56 titer Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    3737#if defined (MODULE_NAME_IS_i420_yuy2) 
    3838#    define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv,Y211" 
    39 #else 
     39#elif defined (MODULE_NAME_IS_i420_yuy2_mmx) 
    4040#    define DEST_FOURCC "YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,cyuv" 
     41#elif defined (MODULE_NAME_IS_i420_yuy2_altivec) 
     42#    define DEST_FOURCC "YUY2,YUNV" 
    4143#endif 
    4244 
     
    4749 
    4850static void I420_YUY2           ( vout_thread_t *, picture_t *, picture_t * ); 
     51#if !defined (MODULE_NAME_IS_i420_yuy2_altivec) 
    4952static void I420_YVYU           ( vout_thread_t *, picture_t *, picture_t * ); 
    5053static void I420_UYVY           ( vout_thread_t *, picture_t *, picture_t * ); 
    5154static void I420_IUYV           ( vout_thread_t *, picture_t *, picture_t * ); 
    5255static void I420_cyuv           ( vout_thread_t *, picture_t *, picture_t * ); 
     56#endif 
    5357#if defined (MODULE_NAME_IS_i420_yuy2) 
    5458static void I420_Y211           ( vout_thread_t *, picture_t *, picture_t * ); 
     
    7478    i_00ffw = 0x00ff00ff00ff00ffULL; 
    7579    i_80w   = 0x0000000080808080ULL; 
     80#elif defined (MODULE_NAME_IS_i420_yuy2_altivec) 
     81    set_description( 
     82            _("Altivec conversions from " SRC_FOURCC " to " DEST_FOURCC) ); 
     83    set_capability( "chroma", 100 ); 
     84    add_requirement( ALTIVEC ); 
    7685#endif 
    7786    set_callbacks( Activate, NULL ); 
     
    104113                    break; 
    105114 
     115#if !defined (MODULE_NAME_IS_i420_yuy2_altivec) 
    106116                case VLC_FOURCC('Y','V','Y','U'): 
    107117                    p_vout->chroma.pf_convert = I420_YVYU; 
     
    121131                    p_vout->chroma.pf_convert = I420_cyuv; 
    122132                    break; 
     133#endif 
    123134 
    124135#if defined (MODULE_NAME_IS_i420_yuy2) 
     
    160171                               - p_dest->p->i_visible_pitch; 
    161172 
     173#if defined (MODULE_NAME_IS_i420_yuy2_altivec) 
     174    vector unsigned char u_vec; 
     175    vector unsigned char v_vec; 
     176    vector unsigned char uv_vec; 
     177    vector unsigned char y_vec; 
     178    int high = 1; 
     179#endif 
     180 
    162181    for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) 
    163182    { 
     
    168187        p_y2 += p_source->p[Y_PLANE].i_pitch; 
    169188 
     189#if defined (MODULE_NAME_IS_i420_yuy2_altivec) 
     190        /* FIXME Thats only works for sizes multiple of 16 */ 
     191        for( i_x = p_vout->render.i_width / 16 ; i_x-- ; ) 
     192        { 
     193            if( high ) 
     194            { 
     195                u_vec = vec_ld( 0, p_u ); p_u += 16; 
     196                v_vec = vec_ld( 0, p_v ); p_v += 16; 
     197                uv_vec = vec_mergeh( u_vec, v_vec ); 
     198            } 
     199            else 
     200            { 
     201                uv_vec = vec_mergel( u_vec, v_vec ); 
     202            } 
     203            y_vec = vec_ld( 0, p_y1 ); p_y1 += 16; 
     204            vec_st( vec_mergeh( y_vec, uv_vec ), 0, p_line1 ); p_line1 += 16; 
     205            vec_st( vec_mergel( y_vec, uv_vec ), 0, p_line1 ); p_line1 += 16; 
     206            y_vec = vec_ld( 0, p_y2 ); p_y2 += 16; 
     207            vec_st( vec_mergeh( y_vec, uv_vec ), 0, p_line2 ); p_line2 += 16; 
     208            vec_st( vec_mergel( y_vec, uv_vec ), 0, p_line2 ); p_line2 += 16; 
     209            high = !high; 
     210        } 
     211#else 
    170212        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; ) 
    171213        { 
     
    179221#endif 
    180222        } 
     223#endif 
    181224 
    182225        p_y1 += i_source_margin; 
     
    190233 * I420_YVYU: planar YUV 4:2:0 to packed YVYU 4:2:2 
    191234 *****************************************************************************/ 
     235#if !defined (MODULE_NAME_IS_i420_yuy2_altivec) 
    192236static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, 
    193237                                              picture_t *p_dest ) 
     
    335379    } 
    336380} 
     381#endif // !defined (MODULE_NAME_IS_i420_yuy2_altivec) 
    337382 
    338383/*****************************************************************************