Changeset 52d7937c89ef32288f99b79dcefd91dd48ae691a

Show
Ignore:
Timestamp:
07/31/00 01:42:12 (8 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 965000532 +0000
git-parent:

[e13aed00cf01eefa9285cb030486ee0118ea0425]

git-author:
Sam Hocevar <sam@videolan.org> 965000532 +0000
Message:

. rajout de l'option -Winline
. fix de certaines fonctions qui devraient �tre inlin�es
. gain de place dans la YUVMMX

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r4af2fd1 r52d7937  
     1[] 
     20.1.99f : 
     3 
     4  * plugin detection now works 
     5  * "gvlc", "fbvlc", "ggivlc" aliases now work 
     6  * fixed functions that weren't properly inlined 
     7  * removed bloat from the MMX YUV plugin 
     8 
    19Thu Jul 20 15:14:06 CEST 2000 
    2100.1.99e : 
  • INSTALL

    r57e189e r52d7937  
    88 
    99   ./configure --prefix=/usr --enable-mmx --enable-gnome 
     10 
     11For a full compilation, you may try : 
     12 
     13   ./configure --prefix=/usr --enable-mmx --enable-gnome --enable-fb \ 
     14           --enable-glide --enable-ggi --enable-mga --enable-esd 
    1015 
    1116See `./configure --help' for more information. 
  • Makefile.in

    re13aed0 r52d7937  
    8080# 
    8181CCFLAGS += $(DEFINE) $(INCLUDE) 
    82 CCFLAGS += -Wall 
     82CCFLAGS += -Wall -Winline 
    8383CCFLAGS += -D_REENTRANT 
    8484CCFLAGS += -D_GNU_SOURCE 
    8585 
    8686# flags needed for clean beos compilation 
     87ifeq ($(SYS),beos) 
    8788CCFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual 
     89endif 
    8890 
    8991# Optimizations : don't compile debug versions with them 
  • debian/vlc.1

    r9d08c9c r52d7937  
    33.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection 
    44.\" other parameters are allowed: see man(7), man(1) 
    5 .TH VLC 1 "March 13, 2000" 
     5.TH VLC 1 "July 30, 2000" 
    66.\" Please adjust this date whenever revising the manpage. 
    77.\" 
     
    3737.TP 
    3838.B \-\-aout <plugin> 
    39 Specify an audio output plugin
     39Specify an audio output plugin: "dsp", "esd", for instance
    4040.TP 
    4141.B \-\-stereo, \-\-mono 
     
    4646.TP 
    4747.B \-\-vout <plugin> 
    48 Specify a video output plugin. 
     48Specify a video output plugin: "gnome", "fb", "glide", for instance. 
     49.TP 
     50.B \-\-yuv <plugin> 
     51Specify a YUV plugin: "mmx", "nommx", for instance. 
    4952.TP 
    5053.B \-\-display <display> 
  • include/video.h

    r9cb93a1 r52d7937  
    9191 
    9292/* Pictures status */ 
    93 #define FREE_PICTURE            0       /* picture is free and not allocated */ 
    94 #define RESERVED_PICTURE        1       /* picture is allocated and reserved */ 
    95 #define RESERVED_DATED_PICTURE  2   /* picture is waiting for DisplayPicture */ 
    96 #define RESERVED_DISP_PICTURE   3    /* picture is waiting for a DatePixture */ 
    97 #define READY_PICTURE           4            /* picture is ready for display */ 
    98 #define DISPLAYED_PICTURE       5/* picture has been displayed but is linked */ 
    99 #define DESTROYED_PICTURE       6   /* picture is allocated but no more used */ 
     93#define FREE_PICTURE            0                  /* free and not allocated */ 
     94#define RESERVED_PICTURE        1                  /* allocated and reserved */ 
     95#define RESERVED_DATED_PICTURE  2              /* waiting for DisplayPicture */ 
     96#define RESERVED_DISP_PICTURE   3               /* waiting for a DatePicture */ 
     97#define READY_PICTURE           4                       /* ready for display */ 
     98#define DISPLAYED_PICTURE       5            /* been displayed but is linked */ 
     99#define DESTROYED_PICTURE       6              /* allocated but no more used */ 
    100100 
    101101/* Aspect ratios (ISO/IEC 13818-2 section 6.3.3, table 6-3) */ 
     
    106106 
    107107/***************************************************************************** 
    108  * subpicture_t: video sub picture unit 
     108 * subpicture_t: video subtitle 
    109109 ***************************************************************************** 
    110  * Any sub picture unit destined to be displayed by a video output thread should 
     110 * Any subtitle destined to be displayed by a video output thread should 
    111111 * be stored in this structure from it's creation to it's effective display. 
    112112 * Subtitle type and flags should only be modified by the output thread. Note 
     
    119119    int             i_status;                                       /* flags */ 
    120120    int             i_size;                                     /* data size */ 
    121     struct subpicture_s *   p_next;              /* next SPU to be displayed */ 
     121    struct subpicture_s *   p_next;         /* next subtitle to be displayed */ 
    122122 
    123123    /* Other properties */ 
     
    127127    /* Display properties - these properties are only indicative and may be 
    128128     * changed by the video output thread, or simply ignored depending of the 
    129      * subpicture type. */ 
     129     * subtitle type. */ 
    130130    int             i_x;                   /* offset from alignment position */ 
    131131    int             i_y;                   /* offset from alignment position */ 
     
    161161 
    162162/* Subpicture type */ 
    163 #define EMPTY_SUBPICTURE        0    /* subtitle slot is empty and available */ 
    164 #define DVD_SUBPICTURE          100                   /* DVD subpicture unit */ 
    165 #define TEXT_SUBPICTURE        200                      /* single line text */ 
     163#define EMPTY_SUBPICTURE       0     /* subtitle slot is empty and available */ 
     164#define DVD_SUBPICTURE         100                    /* DVD subpicture unit */ 
     165#define TEXT_SUBPICTURE        200                       /* single line text */ 
    166166 
    167167/* Subpicture status */ 
    168 #define FREE_SUBPICTURE        0    /* subpicture is free and not allocated */ 
    169 #define RESERVED_SUBPICTURE    1    /* subpicture is allocated and reserved */ 
    170 #define READY_SUBPICTURE        2         /* subpicture is ready for display */ 
    171 #define DESTROYED_SUBPICTURE    3/* subpicture is allocated but no more used */ 
     168#define FREE_SUBPICTURE        0                   /* free and not allocated */ 
     169#define RESERVED_SUBPICTURE    1                   /* allocated and reserved */ 
     170#define READY_SUBPICTURE       2                        /* ready for display */ 
     171#define DESTROYED_SUBPICTURE   3           /* allocated but not used anymore */ 
    172172 
    173173/* Alignment types */ 
    174 #define RIGHT_ALIGN            10                /* x is absolute for right */ 
    175 #define LEFT_ALIGN              11                 /* x is absolute for left */ 
    176 #define RIGHT_RALIGN            12     /* x is relative for right from right */ 
    177 #define LEFT_RALIGN            13       /* x is relative for left from left */ 
     174#define RIGHT_ALIGN            10                 /* x is absolute for right */ 
     175#define LEFT_ALIGN             11                  /* x is absolute for left */ 
     176#define RIGHT_RALIGN           12      /* x is relative for right from right */ 
     177#define LEFT_RALIGN            13        /* x is relative for left from left */ 
    178178 
    179 #define CENTER_ALIGN            20           /* x, y are absolute for center */ 
    180 #define CENTER_RALIGN          21 /* x, y are relative for center from center */ 
     179#define CENTER_ALIGN           20            /* x, y are absolute for center */ 
     180#define CENTER_RALIGN          21 /* x,y are relative for center from center */ 
    181181 
    182 #define BOTTOM_ALIGN            30               /* y is absolute for bottom */ 
    183 #define TOP_ALIGN              31                  /* y is absolute for top */ 
    184 #define BOTTOM_RALIGN          32   /* y is relative for bottom from bottom */ 
    185 #define TOP_RALIGN              33         /* y is relative for top from top */ 
    186 #define SUBTITLE_RALIGN        34 /* y is relative for center from subtitle */ 
     182#define BOTTOM_ALIGN           30                /* y is absolute for bottom */ 
     183#define TOP_ALIGN              31                   /* y is absolute for top */ 
     184#define BOTTOM_RALIGN          32    /* y is relative for bottom from bottom */ 
     185#define TOP_RALIGN             33          /* y is relative for top from top */ 
     186#define SUBTITLE_RALIGN        34 /* y is relative for center from subtitle */ 
    187187 
    188188 
  • include/video_output.h

    r57e189e r52d7937  
    2525 
    2626/***************************************************************************** 
    27  * vout_yuv_convert_t: YUV convertion function 
    28  ***************************************************************************** 
    29  * This is the prototype common to all convertion functions. The type of p_pic 
    30  * will change depending of the screen depth treated
     27 * vout_yuv_convert_t: YUV conversion function 
     28 ***************************************************************************** 
     29 * This is the prototype common to all conversion functions. The type of p_pic 
     30 * will change depending on the processed screen depth
    3131 * Parameters: 
    3232 *      p_vout                          video output thread 
     
    4646 
    4747/***************************************************************************** 
    48  * vout_yuv_t: pre-calculated YUV convertion tables 
    49  ***************************************************************************** 
    50  * These tables are used by convertion and scaling functions. 
     48 * vout_yuv_t: pre-calculated YUV conversion tables 
     49 ***************************************************************************** 
     50 * These tables are used by conversion and scaling functions. 
    5151 *****************************************************************************/ 
    5252typedef struct vout_yuv_s 
    5353{ 
    54     /* Convertion functions */ 
     54    /* conversion functions */ 
    5555    vout_yuv_convert_t *        p_Convert420;         /* YUV 4:2:0 converter */ 
    5656    vout_yuv_convert_t *        p_Convert422;         /* YUV 4:2:2 converter */ 
     
    7070 
    7171    /* Temporary conversion buffer and offset array */ 
    72     void *              p_buffer;                       /* convertion buffer */ 
     72    void *              p_buffer;                       /* conversion buffer */ 
    7373    int *               p_offset;                            /* offset array */ 
    7474} vout_yuv_t; 
     
    7777 * vout_buffer_t: rendering buffer 
    7878 ***************************************************************************** 
    79  * This structure store informations about a buffer. Buffers are not completely 
     79 * This structure stores information about a buffer. Buffers are not completely 
    8080 * cleared between displays, and modified areas need to be stored. 
    8181 *****************************************************************************/ 
     
    8484    /* Picture area */ 
    8585    int         i_pic_x, i_pic_y;                       /* picture position  */ 
    86     int         i_pic_width, i_pic_height;              /* picture extension */ 
     86    int         i_pic_width, i_pic_height;                   /* picture size */ 
    8787 
    8888    /* Other areas - only vertical extensions of areas are stored */ 
     
    173173    /* Pictures and rendering properties */ 
    174174    boolean_t           b_grayscale;           /* color or grayscale display */ 
    175     boolean_t           b_info;            /* print additionnal informations */ 
     175    boolean_t           b_info;              /* print additional information */ 
    176176    boolean_t           b_interface;                     /* render interface */ 
    177177    boolean_t           b_scale;                    /* allow picture scaling */ 
     
    193193    vout_buffer_t       p_buffer[2];                   /* buffers properties */ 
    194194 
    195     /* Videos heap and translation tables */ 
     195    /* Video heap and translation tables */ 
    196196    picture_t           p_picture[VOUT_MAX_PICTURES];            /* pictures */ 
    197197    subpicture_t        p_subpicture[VOUT_MAX_PICTURES];      /* subpictures */ 
     
    203203    p_vout_font_t       p_large_font;                          /* large font */ 
    204204 
    205     /* Synchronisation informations - synchro level is updated by the vout 
     205    /* Synchronization informations - synchro level is updated by the vout 
    206206     * thread and read by decoder threads */ 
    207207    int                 i_synchro_level;                   /* trashing level */ 
  • plugins/esd/aout_esd.c

    re13aed0 r52d7937  
    7474    int i_func = ESD_PLAY; 
    7575 
    76     fprintf(stderr, "aout-esd !!\n"); 
    7776    /* Allocate structure */ 
    7877    p_aout->p_sys = malloc( sizeof( aout_sys_t ) ); 
  • plugins/yuvmmx/video_yuv.c

    re13aed0 r52d7937  
    11/***************************************************************************** 
    2  * video_yuv.c: YUV transformation functions 
     2 * video_yuv.c: MMX YUV transformation functions 
    33 * Provides functions to perform the YUV conversion. The functions provided here 
    44 * are a complete and portable C implementation, and may be replaced in certain 
     
    5656    size_t      tables_size;                        /* tables size, in bytes */ 
    5757 
    58     /* Computes tables size - 3 Bpp use 32 bits pixel entries in tables */ 
    59     switch( p_vout->i_bytes_per_pixel ) 
    60     { 
    61     case 1: 
     58    /* Computes tables size for 8bbp only */ 
     59    if( p_vout->i_bytes_per_pixel == 1 ) 
     60    { 
    6261        tables_size = sizeof( u8 ) 
    6362                * (p_vout->b_grayscale ? GRAY_TABLE_SIZE : PALETTE_TABLE_SIZE); 
    64         break; 
    65     case 2: 
    66         tables_size = sizeof( u16 ) 
    67                 * (p_vout->b_grayscale ? GRAY_TABLE_SIZE : RGB_TABLE_SIZE); 
    68         break; 
    69     case 3: 
    70     case 4: 
    71     default: 
    72         tables_size = sizeof( u32 ) 
    73                 * (p_vout->b_grayscale ? GRAY_TABLE_SIZE : RGB_TABLE_SIZE); 
    74         break; 
    75     } 
    76  
    77     /* Allocate memory */ 
    78     p_vout->yuv.p_base = malloc( tables_size ); 
    79     if( p_vout->yuv.p_base == NULL ) 
    80     { 
    81         intf_ErrMsg("error: %s\n", strerror(ENOMEM)); 
    82         return( 1 ); 
     63 
     64        /* Allocate memory */ 
     65        p_vout->yuv.p_base = malloc( tables_size ); 
     66        if( p_vout->yuv.p_base == NULL ) 
     67        { 
     68            intf_ErrMsg("error: %s\n", strerror(ENOMEM)); 
     69            return( 1 ); 
     70        } 
     71    } 
     72    else 
     73    { 
     74        p_vout->yuv.p_base = NULL; 
    8375    } 
    8476 
     
    112104void yuv_MMXEnd( vout_thread_t *p_vout ) 
    113105{ 
    114     free( p_vout->yuv.p_base ); 
     106    if( p_vout->i_bytes_per_pixel == 1 ) 
     107    { 
     108        free( p_vout->yuv.p_base ); 
     109    } 
     110 
    115111    free( p_vout->yuv.p_buffer ); 
    116112    free( p_vout->yuv.p_offset ); 
     
    130126 
    131127/* following functions are local */ 
    132  
    133 /***************************************************************************** 
    134  * SetGammaTable: return intensity table transformed by gamma curve. 
    135  ***************************************************************************** 
    136  * pi_table is a table of 256 entries from 0 to 255. 
    137  *****************************************************************************/ 
    138 void SetGammaTable( int *pi_table, double f_gamma ) 
    139 { 
    140     int         i_y;                                       /* base intensity */ 
    141  
    142     /* Use exp(gamma) instead of gamma */ 
    143     f_gamma = exp( f_gamma ); 
    144  
    145     /* Build gamma table */ 
    146     for( i_y = 0; i_y < 256; i_y++ ) 
    147     { 
    148         pi_table[ i_y ] = pow( (double)i_y / 256, f_gamma ) * 256; 
    149     } 
    150  } 
    151128 
    152129/***************************************************************************** 
     
    167144    { 
    168145        /* Grayscale: build gray table */ 
    169         switch( p_vout->i_bytes_per_pixel ) 
    170         { 
    171         case 1: 
    172             { 
    173                 u16 bright[256], transp[256]; 
    174  
    175                 p_vout->yuv.yuv.p_gray8 =  (u8 *)p_vout->yuv.p_base + GRAY_MARGIN; 
    176                 for( i_index = 0; i_index < GRAY_MARGIN; i_index++ ) 
    177                 { 
    178                     p_vout->yuv.yuv.p_gray8[ -i_index ] =      RGB2PIXEL( p_vout, pi_gamma[0], pi_gamma[0], pi_gamma[0] ); 
    179                     p_vout->yuv.yuv.p_gray8[ 256 + i_index ] = RGB2PIXEL( p_vout, pi_gamma[255], pi_gamma[255], pi_gamma[255] ); 
    180                 } 
    181                 for( i_index = 0; i_index < 256; i_index++) 
    182                 { 
    183                     p_vout->yuv.yuv.p_gray8[ i_index ] = pi_gamma[ i_index ]; 
    184                     bright[ i_index ] = i_index << 8; 
    185                     transp[ i_index ] = 0; 
    186                 } 
    187                 /* the colors have been allocated, we can set the palette */ 
    188                 p_vout->p_set_palette( p_vout, bright, bright, bright, transp ); 
    189                 p_vout->i_white_pixel = 0xff; 
    190                 p_vout->i_black_pixel = 0x00; 
    191                 p_vout->i_gray_pixel = 0x44; 
    192                 p_vout->i_blue_pixel = 0x3b; 
    193  
    194                 break; 
    195             } 
    196         case 2: 
    197             p_vout->yuv.yuv.p_gray16 =  (u16 *)p_vout->yuv.p_base + GRAY_MARGIN; 
    198             for( i_index = 0; i_index < GRAY_MARGIN; i_index++ ) 
    199             { 
    200                 p_vout->yuv.yuv.p_gray16[ -i_index ] =      RGB2PIXEL( p_vout, pi_gamma[0], pi_gamma[0], pi_gamma[0] ); 
    201                 p_vout->yuv.yuv.p_gray16[ 256 + i_index ] = RGB2PIXEL( p_vout, pi_gamma[255], pi_gamma[255], pi_gamma[255] ); 
    202             } 
     146        if( p_vout->i_bytes_per_pixel == 1 ) 
     147        { 
     148            u16 bright[256], transp[256]; 
     149 
    203150            for( i_index = 0; i_index < 256; i_index++) 
    204151            { 
    205                 p_vout->yuv.yuv.p_gray16[ i_index ] = RGB2PIXEL( p_vout, pi_gamma[i_index], pi_gamma[i_index], pi_gamma[i_index] ); 
     152                bright[ i_index ] = i_index << 8; 
     153                transp[ i_index ] = 0; 
    206154            } 
    207             break; 
    208         case 3: 
    209         case 4: 
    210             p_vout->yuv.yuv.p_gray32 =  (u32 *)p_vout->yuv.p_base + GRAY_MARGIN; 
    211             for( i_index = 0; i_index < GRAY_MARGIN; i_index++ ) 
     155            /* the colors have been allocated, we can set the palette */ 
     156            p_vout->p_set_palette( p_vout, bright, bright, bright, transp ); 
     157            p_vout->i_white_pixel = 0xff; 
     158            p_vout->i_black_pixel = 0x00; 
     159            p_vout->i_gray_pixel = 0x44; 
     160            p_vout->i_blue_pixel = 0x3b; 
     161        } 
     162    } 
     163    else 
     164    { 
     165        /* Color: build red, green and blue tables */ 
     166        if( p_vout->i_bytes_per_pixel == 1 ) 
     167        { 
     168            #define RGB_MIN 0 
     169            #define RGB_MAX 255 
     170            #define CLIP( x ) ( ((x < 0) ? 0 : (x > 255) ? 255 : x) << 8 ) 
     171            #define SHIFT 20 
     172            #define U_GREEN_COEF    ((int)(-0.391 * (1<<SHIFT) / 1.164)) 
     173            #define U_BLUE_COEF     ((int)(2.018 * (1<<SHIFT) / 1.164)) 
     174            #define V_RED_COEF      ((int)(1.596 * (1<<SHIFT) / 1.164)) 
     175            #define V_GREEN_COEF    ((int)(-0.813 * (1<<SHIFT) / 1.164)) 
     176 
     177            int y,u,v; 
     178            int r,g,b; 
     179            int uvr, uvg, uvb; 
     180            int i = 0, j = 0; 
     181            u16 red[256], green[256], blue[256], transp[256]; 
     182            unsigned char lookup[PALETTE_TABLE_SIZE]; 
     183 
     184            p_vout->yuv.yuv.p_rgb8 = (u8 *)p_vout->yuv.p_base; 
     185 
     186            /* this loop calculates the intersection of an YUV box 
     187             * and the RGB cube. */ 
     188            for ( y = 0; y <= 256; y += 16 ) 
    212189            { 
    213                 p_vout->yuv.yuv.p_gray32[ -i_index ] =      RGB2PIXEL( p_vout, pi_gamma[0], pi_gamma[0], pi_gamma[0] ); 
    214                 p_vout->yuv.yuv.p_gray32[ 256 + i_index ] = RGB2PIXEL( p_vout, pi_gamma[255], pi_gamma[255], pi_gamma[255] ); 
     190                for ( u = 0; u <= 256; u += 32 ) 
     191                for ( v = 0; v <= 256; v += 32 ) 
     192                { 
     193                    uvr = (V_RED_COEF*(v-128)) >> SHIFT; 
     194                    uvg = (U_GREEN_COEF*(u-128) + V_GREEN_COEF*(v-128)) >> SHIFT; 
     195                    uvb = (U_BLUE_COEF*(u-128)) >> SHIFT; 
     196                    r = y + uvr; 
     197                    g = y + uvg; 
     198                    b = y + uvb; 
     199 
     200                    if( r >= RGB_MIN && g >= RGB_MIN && b >= RGB_MIN 
     201                            && r <= RGB_MAX && g <= RGB_MAX && b <= RGB_MAX ) 
     202                    { 
     203                        /* this one should never happen unless someone fscked up my code */ 
     204                        if(j == 256) { intf_ErrMsg( "vout error: no colors left to build palette\n" ); break; } 
     205 
     206                        /* clip the colors */ 
     207                        red[j] = CLIP( r ); 
     208                        green[j] = CLIP( g ); 
     209                        blue[j] = CLIP( b ); 
     210                        transp[j] = 0; 
     211 
     212                        /* allocate color */ 
     213                        lookup[i] = 1; 
     214                        p_vout->yuv.yuv.p_rgb8[i++] = j; 
     215                        j++; 
     216                    } 
     217                    else 
     218                    { 
     219                        lookup[i] = 0; 
     220                        p_vout->yuv.yuv.p_rgb8[i++] = 0; 
     221                    } 
     222                } 
     223                i += 128-81; 
    215224            } 
    216             for( i_index = 0; i_index < 256; i_index++) 
     225 
     226            /* the colors have been allocated, we can set the palette */ 
     227            /* there will eventually be a way to know which colors 
     228             * couldn't be allocated and try to find a replacement */ 
     229            p_vout->p_set_palette( p_vout, red, green, blue, transp ); 
     230 
     231            p_vout->i_white_pixel = 0xff; 
     232            p_vout->i_black_pixel = 0x00; 
     233            p_vout->i_gray_pixel = 0x44; 
     234            p_vout->i_blue_pixel = 0x3b; 
     235 
     236            i = 0; 
     237            /* this loop allocates colors that got outside 
     238             * the RGB cube */ 
     239            for ( y = 0; y <= 256; y += 16 ) 
    217240            { 
    218                 p_vout->yuv.yuv.p_gray32[ i_index ] = RGB2PIXEL( p_vout, pi_gamma[i_index], pi_gamma[i_index], pi_gamma[i_index] ); 
    219             } 
    220             break; 
    221          } 
    222     } 
    223     else 
    224     { 
    225         /* Color: build red, green and blue tables */ 
    226         switch( p_vout->i_bytes_per_pixel ) 
    227         { 
    228         case 1: 
    229             { 
    230                 #define RGB_MIN 0 
    231                 #define RGB_MAX 255 
    232                 #define CLIP( x ) ( ((x < 0) ? 0 : (x > 255) ? 255 : x) << 8 ) 
    233  
    234                 int y,u,v; 
    235                 int r,g,b; 
    236                 int uvr, uvg, uvb; 
    237                 int i = 0, j = 0; 
    238                 u16 red[256], green[256], blue[256], transp[256]; 
    239                 unsigned char lookup[PALETTE_TABLE_SIZE]; 
    240  
    241                 p_vout->yuv.yuv.p_rgb8 = (u8 *)p_vout->yuv.p_base; 
    242  
    243                 /* this loop calculates the intersection of an YUV box 
    244                  * and the RGB cube. */ 
    245                 for ( y = 0; y <= 256; y += 16 ) 
     241                for ( u = 0; u <= 256; u += 32 ) 
    246242                { 
    247                     for ( u = 0; u <= 256; u += 32 ) 
    248                     for ( v = 0; v <= 256; v += 32 ) 
    249                     { 
    250                         uvr = (V_RED_COEF*(v-128)) >> SHIFT; 
    251                         uvg = (U_GREEN_COEF*(u-128) + V_GREEN_COEF*(v-128)) >> SHIFT; 
    252                         uvb = (U_BLUE_COEF*(u-128)) >> SHIFT; 
    253                         r = y + uvr; 
    254                         g = y + uvg; 
    255                         b = y + uvb; 
    256  
    257                         if( r >= RGB_MIN && g >= RGB_MIN && b >= RGB_MIN 
    258                                 && r <= RGB_MAX && g <= RGB_MAX && b <= RGB_MAX ) 
    259                         { 
    260                             /* this one should never happen unless someone fscked up my code */ 
    261                             if(j == 256) { intf_ErrMsg( "vout error: no colors left to build palette\n" ); break; } 
    262  
    263                             /* clip the colors */ 
    264                             red[j] = CLIP( r ); 
    265                             green[j] = CLIP( g ); 
    266                             blue[j] = CLIP( b ); 
    267                             transp[j] = 0; 
    268  
    269                             /* allocate color */ 
    270                             lookup[i] = 1; 
    271                             p_vout->yuv.yuv.p_rgb8[i++] = j; 
    272                             j++; 
    273                         } 
    274                         else 
    275                         { 
    276                             lookup[i] = 0; 
    277                             p_vout->yuv.yuv.p_rgb8[i++] = 0; 
    278                         } 
    279                     } 
    280                     i += 128-81; 
    281                 } 
    282  
    283                 /* the colors have been allocated, we can set the palette */ 
    284                 /* there will eventually be a way to know which colors 
    285                  * couldn't be allocated and try to find a replacement */ 
    286                 p_vout->p_set_palette( p_vout, red, green, blue, transp ); 
    287  
    288                 p_vout->i_white_pixel = 0xff; 
    289                 p_vout->i_black_pixel = 0x00; 
    290                 p_vout->i_gray_pixel = 0x44; 
    291                 p_vout->i_blue_pixel = 0x3b; 
    292  
    293                 i = 0; 
    294                 /* this loop allocates colors that got outside 
    295                  * the RGB cube */ 
    296                 for ( y = 0; y <= 256; y += 16 ) 
    297                 { 
    298                     for ( u = 0; u <= 256; u += 32 ) 
    299243                    for ( v = 0; v <= 256; v += 32 ) 
    300244                    { 
     
    332276                        i++; 
    333277                    } 
    334                     i += 128-81; 
    335278                } 
    336  
    337                 break; 
     279                i += 128-81; 
    338280            } 
    339         case 2: 
    340             p_vout->yuv.yuv.p_rgb16 = (u16 *)p_vout->yuv.p_base; 
    341             for( i_index = 0; i_index < RED_MARGIN; i_index++ ) 
    342             { 
    343                 p_vout->yuv.yuv.p_rgb16[RED_OFFSET - RED_MARGIN + i_index] = RGB2PIXEL( p_vout, pi_gamma[0], 0, 0 ); 
    344                 p_vout->yuv.yuv.p_rgb16[RED_OFFSET + 256 + i_index] =        RGB2PIXEL( p_vout, pi_gamma[255], 0, 0 ); 
    345             } 
    346             for( i_index = 0; i_index < GREEN_MARGIN; i_index++ ) 
    347             { 
    348                 p_vout->yuv.yuv.p_rgb16[GREEN_OFFSET - GREEN_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[0], 0 ); 
    349                 p_vout->yuv.yuv.p_rgb16[GREEN_OFFSET + 256 + i_index] =          RGB2PIXEL( p_vout, 0, pi_gamma[255], 0 ); 
    350             } 
    351             for( i_index = 0; i_index < BLUE_MARGIN; i_index++ ) 
    352             { 
    353                 p_vout->yuv.yuv.p_rgb16[BLUE_OFFSET - BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[0] ); 
    354                 p_vout->yuv.yuv.p_rgb16[BLUE_OFFSET + BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[255] ); 
    355             } 
    356             for( i_index = 0; i_index < 256; i_index++ ) 
    357             { 
    358                 p_vout->yuv.yuv.p_rgb16[RED_OFFSET + i_index] =   RGB2PIXEL( p_vout, pi_gamma[ i_index ], 0, 0 ); 
    359                 p_vout->yuv.yuv.p_rgb16[GREEN_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[ i_index ], 0 ); 
    360                 p_vout->yuv.yuv.p_rgb16[BLUE_OFFSET + i_index] =  RGB2PIXEL( p_vout, 0, 0, pi_gamma[ i_index ] ); 
    361             } 
    362             break; 
    363         case 3: 
    364         case 4: 
    365             p_vout->yuv.yuv.p_rgb32 = (u32 *)p_vout->yuv.p_base; 
    366             for( i_index = 0; i_index < RED_MARGIN; i_index++ ) 
    367             { 
    368                 p_vout->yuv.yuv.p_rgb32[RED_OFFSET - RED_MARGIN + i_index] = RGB2PIXEL( p_vout, pi_gamma[0], 0, 0 ); 
    369                 p_vout->yuv.yuv.p_rgb32[RED_OFFSET + 256 + i_index] =        RGB2PIXEL( p_vout, pi_gamma[255], 0, 0 ); 
    370             } 
    371             for( i_index = 0; i_index < GREEN_MARGIN; i_index++ ) 
    372             { 
    373                 p_vout->yuv.yuv.p_rgb32[GREEN_OFFSET - GREEN_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[0], 0 ); 
    374                 p_vout->yuv.yuv.p_rgb32[GREEN_OFFSET + 256 + i_index] =          RGB2PIXEL( p_vout, 0, pi_gamma[255], 0 ); 
    375             } 
    376             for( i_index = 0; i_index < BLUE_MARGIN; i_index++ ) 
    377             { 
    378                 p_vout->yuv.yuv.p_rgb32[BLUE_OFFSET - BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[0] ); 
    379                 p_vout->yuv.yuv.p_rgb32[BLUE_OFFSET + BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[255] ); 
    380             } 
    381             for( i_index = 0; i_index < 256; i_index++ ) 
    382             { 
    383                 p_vout->yuv.yuv.p_rgb32[RED_OFFSET + i_index] =   RGB2PIXEL( p_vout, pi_gamma[ i_index ], 0, 0 ); 
    384                 p_vout->yuv.yuv.p_rgb32[GREEN_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[ i_index ], 0 ); 
    385                 p_vout->yuv.yuv.p_rgb32[BLUE_OFFSET + i_index] =  RGB2PIXEL( p_vout, 0, 0, pi_gamma[ i_index ] ); 
    386             } 
    387             break; 
    388281        } 
    389282    } 
  • plugins/yuvmmx/video_yuv.h

    r57e189e r52d7937  
    11/***************************************************************************** 
    2  * video_yuv.h: YUV transformation functions 
     2 * video_yuv.h: MMX YUV transformation functions 
    33 * Provides functions to perform the YUV conversion. The functions provided here 
    44 * are a complete and portable C implementation, and may be replaced in certain 
     
    2929 *****************************************************************************/ 
    3030 
    31 /* Margins and offsets in conversion tables - Margins are used in case a RGB 
    32  * RGB conversion would give a value outside the 0-255 range. Offsets have been 
    33  * calculated to avoid using the same cache line for 2 tables. conversion tables 
    34  * are 2*MARGIN + 256 long and stores pixels.*/ 
    35 #define RED_MARGIN      178 
    36 #define GREEN_MARGIN    135 
    37 #define BLUE_MARGIN     224 
    38 #define RED_OFFSET      1501                                 /* 1323 to 1935 */ 
    39 #define GREEN_OFFSET    135                                      /* 0 to 526 */ 
    40 #define BLUE_OFFSET     818                                   /* 594 to 1298 */ 
    41 #define RGB_TABLE_SIZE  1935                             /* total table size */ 
    42  
    4331#define GRAY_MARGIN     384 
    4432#define GRAY_TABLE_SIZE 1024                             /* total table size */ 
    4533 
    4634#define PALETTE_TABLE_SIZE 2176          /* YUV -> 8bpp palette lookup table */ 
    47  
    48 /* macros used for YUV pixel conversions */ 
    49 #define SHIFT 20 
    50 #define U_GREEN_COEF    ((int)(-0.391 * (1<<SHIFT) / 1.164)) 
    51 #define U_BLUE_COEF     ((int)(2.018 * (1<<SHIFT) / 1.164)) 
    52 #define V_RED_COEF      ((int)(1.596 * (1<<SHIFT) / 1.164)) 
    53 #define V_GREEN_COEF    ((int)(-0.813 * (1<<SHIFT) / 1.164)) 
    5435 
    5536/* argument lists for YUV functions */ 
  • plugins/yuvmmx/video_yuv16.c

    r57e189e r52d7937  
    100100                     : : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) ); 
    101101 
    102             __asm__( ".align 8" MMX_YUV_MUL MMX_YUV_ADD MMX_UNPACK_16 
     102            __asm__( ".align 8" 
     103                     MMX_YUV_MUL 
     104                     MMX_YUV_ADD 
     105                     MMX_UNPACK_16 
    103106                     : : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) ); 
    104107 
  • plugins/yuvmmx/video_yuv24.c

    r57e189e r52d7937  
    11/***************************************************************************** 
    2  * video_yuv24.c: YUV transformation functions for 24 bpp 
     2 * video_yuv24.c: MMX YUV transformation functions for 24 bpp 
    33 * Provides functions to perform the YUV conversion. The functions provided here 
    44 * are a complete and portable C implementation, and may be replaced in certain 
  • plugins/yuvmmx/video_yuv32.c

    r57e189e r52d7937  
    11/***************************************************************************** 
    2  * video_yuv32.c: YUV transformation functions for 32 bpp 
     2 * video_yuv32.c: MMX YUV transformation functions for 32 bpp 
    33 * Provides functions to perform the YUV conversion. The functions provided here 
    44 * are a complete and portable C implementation, and may be replaced in certain 
  • plugins/yuvmmx/video_yuv8.c

    r57e189e r52d7937  
    11/***************************************************************************** 
    2  * video_yuv8.c: YUV transformation functions for 8bpp 
     2 * video_yuv8.c: MMX YUV transformation functions for 8bpp 
    33 * Provides functions to perform the YUV conversion. The functions provided here 
    44 * are a complete and portable C implementation, and may be replaced in certain 
  • plugins/yuvmmx/video_yuv_asm.h

    r57e189e r52d7937  
    11/***************************************************************************** 
    2  * video_yuv_asm.h: YUV transformation assembly 
     2 * video_yuv_asm.h: MMX YUV transformation assembly 
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
     
    8383pmulhw    mmx_V_green, %%mm3    # Mul Cr with green coeff -> Cr green       \n\ 
    8484pmulhw    mmx_U_blue, %%mm0     # Mul Cb -> Cblue 00 b3 00 b2 00 b1 00 b0   \n\ 
    85 pmulhw    mmx_V_red, %%mm1      # Mul Cr -> Cred  00 r3 00 r2 00 r1 00      \n\ 
     85pmulhw    mmx_V_red, %%mm1      # Mul Cr -> Cred  00 r3 00 r2 00 r1 00 r0   \n\ 
    8686paddsw    %%mm3, %%mm2          # Cb green + Cr green -> Cgreen             \n\ 
    8787                                                                            \n\ 
  • plugins/yuvmmx/video_yuv_macros.h

    r57e189e r52d7937  
    11/***************************************************************************** 
    2  * video_yuv_macros.h: YUV transformation macros 
     2 * video_yuv_macros.h: MMX YUV transformation macros 
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
  • src/audio_output/audio_output.c

    re13aed0 r52d7937  
    7676 
    7777/***************************************************************************** 
     78 * InitializeIncrement 
     79 *****************************************************************************/ 
     80static __inline__ void InitializeIncrement( aout_increment_t * p_increment, long l_numerator, long l_denominator ) 
     81{ 
     82    p_increment->l_remainder = -l_denominator; 
     83 
     84    p_increment->l_euclidean_integer = 0; 
     85    while ( l_numerator >= l_denominator ) 
     86    { 
     87        p_increment->l_euclidean_integer++; 
     88        l_numerator -= l_denominator; 
     89    } 
     90 
     91    p_increment->l_euclidean_remainder = l_numerator; 
     92 
     93    p_increment->l_euclidean_denominator = l_denominator; 
     94} 
     95 
     96/***************************************************************************** 
    7897 * aout_CreateThread: initialize audio thread 
    7998 *****************************************************************************/ 
     
    467486 
    468487/* Following f