Changeset 52d7937c89ef32288f99b79dcefd91dd48ae691a
- Timestamp:
- 07/31/00 01:42:12 (8 years ago)
- git-parent:
- Files:
-
- ChangeLog (modified) (1 diff)
- INSTALL (modified) (1 diff)
- Makefile.in (modified) (1 diff)
- debian/vlc.1 (modified) (3 diffs)
- include/video.h (modified) (5 diffs)
- include/video_output.h (modified) (8 diffs)
- plugins/esd/aout_esd.c (modified) (1 diff)
- plugins/yuvmmx/video_yuv.c (modified) (6 diffs)
- plugins/yuvmmx/video_yuv.h (modified) (2 diffs)
- plugins/yuvmmx/video_yuv16.c (modified) (1 diff)
- plugins/yuvmmx/video_yuv24.c (modified) (1 diff)
- plugins/yuvmmx/video_yuv32.c (modified) (1 diff)
- plugins/yuvmmx/video_yuv8.c (modified) (1 diff)
- plugins/yuvmmx/video_yuv_asm.h (modified) (2 diffs)
- plugins/yuvmmx/video_yuv_macros.h (modified) (1 diff)
- src/audio_output/audio_output.c (modified) (2 diffs)
- src/input/input.c (modified) (5 diffs)
- src/video_output/video_output.c (modified) (21 diffs)
- src/video_output/video_text.h (modified) (1 diff)
- src/video_output/video_yuv.c (modified) (3 diffs)
- src/video_parser/vpar_synchro.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ChangeLog
r4af2fd1 r52d7937 1 [] 2 0.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 1 9 Thu Jul 20 15:14:06 CEST 2000 2 10 0.1.99e : INSTALL
r57e189e r52d7937 8 8 9 9 ./configure --prefix=/usr --enable-mmx --enable-gnome 10 11 For 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 10 15 11 16 See `./configure --help' for more information. Makefile.in
re13aed0 r52d7937 80 80 # 81 81 CCFLAGS += $(DEFINE) $(INCLUDE) 82 CCFLAGS += -Wall 82 CCFLAGS += -Wall -Winline 83 83 CCFLAGS += -D_REENTRANT 84 84 CCFLAGS += -D_GNU_SOURCE 85 85 86 86 # flags needed for clean beos compilation 87 ifeq ($(SYS),beos) 87 88 CCFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual 89 endif 88 90 89 91 # Optimizations : don't compile debug versions with them debian/vlc.1
r9d08c9c r52d7937 3 3 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection 4 4 .\" other parameters are allowed: see man(7), man(1) 5 .TH VLC 1 " March 13, 2000"5 .TH VLC 1 "July 30, 2000" 6 6 .\" Please adjust this date whenever revising the manpage. 7 7 .\" … … 37 37 .TP 38 38 .B \-\-aout <plugin> 39 Specify an audio output plugin .39 Specify an audio output plugin: "dsp", "esd", for instance. 40 40 .TP 41 41 .B \-\-stereo, \-\-mono … … 46 46 .TP 47 47 .B \-\-vout <plugin> 48 Specify a video output plugin. 48 Specify a video output plugin: "gnome", "fb", "glide", for instance. 49 .TP 50 .B \-\-yuv <plugin> 51 Specify a YUV plugin: "mmx", "nommx", for instance. 49 52 .TP 50 53 .B \-\-display <display> include/video.h
r9cb93a1 r52d7937 91 91 92 92 /* Pictures status */ 93 #define FREE_PICTURE 0 /* picture isfree and not allocated */94 #define RESERVED_PICTURE 1 /* picture isallocated and reserved */95 #define RESERVED_DATED_PICTURE 2 /* picture iswaiting for DisplayPicture */96 #define RESERVED_DISP_PICTURE 3 /* picture is waiting for a DatePixture */97 #define READY_PICTURE 4 /* picture isready for display */98 #define DISPLAYED_PICTURE 5 /* picture hasbeen displayed but is linked */99 #define DESTROYED_PICTURE 6 /* picture isallocated 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 */ 100 100 101 101 /* Aspect ratios (ISO/IEC 13818-2 section 6.3.3, table 6-3) */ … … 106 106 107 107 /***************************************************************************** 108 * subpicture_t: video sub picture unit108 * subpicture_t: video subtitle 109 109 ***************************************************************************** 110 * Any sub picture unitdestined to be displayed by a video output thread should110 * Any subtitle destined to be displayed by a video output thread should 111 111 * be stored in this structure from it's creation to it's effective display. 112 112 * Subtitle type and flags should only be modified by the output thread. Note … … 119 119 int i_status; /* flags */ 120 120 int i_size; /* data size */ 121 struct subpicture_s * p_next; /* next SPUto be displayed */121 struct subpicture_s * p_next; /* next subtitle to be displayed */ 122 122 123 123 /* Other properties */ … … 127 127 /* Display properties - these properties are only indicative and may be 128 128 * changed by the video output thread, or simply ignored depending of the 129 * sub picture type. */129 * subtitle type. */ 130 130 int i_x; /* offset from alignment position */ 131 131 int i_y; /* offset from alignment position */ … … 161 161 162 162 /* 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 */ 166 166 167 167 /* Subpicture status */ 168 #define FREE_SUBPICTURE 0 /* subpicture isfree and not allocated */169 #define RESERVED_SUBPICTURE 1 /* subpicture isallocated and reserved */170 #define READY_SUBPICTURE 2 /* subpicture isready 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 */ 172 172 173 173 /* 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 */ 178 178 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 */ 181 181 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 */ 187 187 188 188 include/video_output.h
r57e189e r52d7937 25 25 26 26 /***************************************************************************** 27 * vout_yuv_convert_t: YUV conver tion function28 ***************************************************************************** 29 * This is the prototype common to all conver tion functions. The type of p_pic30 * will change depending o f 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. 31 31 * Parameters: 32 32 * p_vout video output thread … … 46 46 47 47 /***************************************************************************** 48 * vout_yuv_t: pre-calculated YUV conver tion tables49 ***************************************************************************** 50 * These tables are used by conver tion and scaling functions.48 * vout_yuv_t: pre-calculated YUV conversion tables 49 ***************************************************************************** 50 * These tables are used by conversion and scaling functions. 51 51 *****************************************************************************/ 52 52 typedef struct vout_yuv_s 53 53 { 54 /* Convertion functions */54 /* conversion functions */ 55 55 vout_yuv_convert_t * p_Convert420; /* YUV 4:2:0 converter */ 56 56 vout_yuv_convert_t * p_Convert422; /* YUV 4:2:2 converter */ … … 70 70 71 71 /* Temporary conversion buffer and offset array */ 72 void * p_buffer; /* conver tion buffer */72 void * p_buffer; /* conversion buffer */ 73 73 int * p_offset; /* offset array */ 74 74 } vout_yuv_t; … … 77 77 * vout_buffer_t: rendering buffer 78 78 ***************************************************************************** 79 * This structure store informationsabout a buffer. Buffers are not completely79 * This structure stores information about a buffer. Buffers are not completely 80 80 * cleared between displays, and modified areas need to be stored. 81 81 *****************************************************************************/ … … 84 84 /* Picture area */ 85 85 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 */ 87 87 88 88 /* Other areas - only vertical extensions of areas are stored */ … … 173 173 /* Pictures and rendering properties */ 174 174 boolean_t b_grayscale; /* color or grayscale display */ 175 boolean_t b_info; /* print additionnal informations*/175 boolean_t b_info; /* print additional information */ 176 176 boolean_t b_interface; /* render interface */ 177 177 boolean_t b_scale; /* allow picture scaling */ … … 193 193 vout_buffer_t p_buffer[2]; /* buffers properties */ 194 194 195 /* Video sheap and translation tables */195 /* Video heap and translation tables */ 196 196 picture_t p_picture[VOUT_MAX_PICTURES]; /* pictures */ 197 197 subpicture_t p_subpicture[VOUT_MAX_PICTURES]; /* subpictures */ … … 203 203 p_vout_font_t p_large_font; /* large font */ 204 204 205 /* Synchroni sation informations - synchro level is updated by the vout205 /* Synchronization informations - synchro level is updated by the vout 206 206 * thread and read by decoder threads */ 207 207 int i_synchro_level; /* trashing level */ plugins/esd/aout_esd.c
re13aed0 r52d7937 74 74 int i_func = ESD_PLAY; 75 75 76 fprintf(stderr, "aout-esd !!\n");77 76 /* Allocate structure */ 78 77 p_aout->p_sys = malloc( sizeof( aout_sys_t ) ); plugins/yuvmmx/video_yuv.c
re13aed0 r52d7937 1 1 /***************************************************************************** 2 * video_yuv.c: YUV transformation functions2 * video_yuv.c: MMX YUV transformation functions 3 3 * Provides functions to perform the YUV conversion. The functions provided here 4 4 * are a complete and portable C implementation, and may be replaced in certain … … 56 56 size_t tables_size; /* tables size, in bytes */ 57 57 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 { 62 61 tables_size = sizeof( u8 ) 63 62 * (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; 83 75 } 84 76 … … 112 104 void yuv_MMXEnd( vout_thread_t *p_vout ) 113 105 { 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 115 111 free( p_vout->yuv.p_buffer ); 116 112 free( p_vout->yuv.p_offset ); … … 130 126 131 127 /* 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 }151 128 152 129 /***************************************************************************** … … 167 144 { 168 145 /* 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 203 150 for( i_index = 0; i_index < 256; i_index++) 204 151 { 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; 206 154 } 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 ) 212 189 { 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; 215 224 } 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 ) 217 240 { 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 ) 246 242 { 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_MIN258 && 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 else275 {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 colors285 * 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 outside295 * the RGB cube */296 for ( y = 0; y <= 256; y += 16 )297 {298 for ( u = 0; u <= 256; u += 32 )299 243 for ( v = 0; v <= 256; v += 32 ) 300 244 { … … 332 276 i++; 333 277 } 334 i += 128-81;335 278 } 336 337 break; 279 i += 128-81; 338 280 } 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;388 281 } 389 282 } plugins/yuvmmx/video_yuv.h
r57e189e r52d7937 1 1 /***************************************************************************** 2 * video_yuv.h: YUV transformation functions2 * video_yuv.h: MMX YUV transformation functions 3 3 * Provides functions to perform the YUV conversion. The functions provided here 4 4 * are a complete and portable C implementation, and may be replaced in certain … … 29 29 *****************************************************************************/ 30 30 31 /* Margins and offsets in conversion tables - Margins are used in case a RGB32 * RGB conversion would give a value outside the 0-255 range. Offsets have been33 * calculated to avoid using the same cache line for 2 tables. conversion tables34 * are 2*MARGIN + 256 long and stores pixels.*/35 #define RED_MARGIN 17836 #define GREEN_MARGIN 13537 #define BLUE_MARGIN 22438 #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 43 31 #define GRAY_MARGIN 384 44 32 #define GRAY_TABLE_SIZE 1024 /* total table size */ 45 33 46 34 #define PALETTE_TABLE_SIZE 2176 /* YUV -> 8bpp palette lookup table */ 47 48 /* macros used for YUV pixel conversions */49 #define SHIFT 2050 #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))54 35 55 36 /* argument lists for YUV functions */ plugins/yuvmmx/video_yuv16.c
r57e189e r52d7937 100 100 : : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) ); 101 101 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 103 106 : : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) ); 104 107 plugins/yuvmmx/video_yuv24.c
r57e189e r52d7937 1 1 /***************************************************************************** 2 * video_yuv24.c: YUV transformation functions for 24 bpp2 * video_yuv24.c: MMX YUV transformation functions for 24 bpp 3 3 * Provides functions to perform the YUV conversion. The functions provided here 4 4 * are a complete and portable C implementation, and may be replaced in certain plugins/yuvmmx/video_yuv32.c
r57e189e r52d7937 1 1 /***************************************************************************** 2 * video_yuv32.c: YUV transformation functions for 32 bpp2 * video_yuv32.c: MMX YUV transformation functions for 32 bpp 3 3 * Provides functions to perform the YUV conversion. The functions provided here 4 4 * are a complete and portable C implementation, and may be replaced in certain plugins/yuvmmx/video_yuv8.c
r57e189e r52d7937 1 1 /***************************************************************************** 2 * video_yuv8.c: YUV transformation functions for 8bpp2 * video_yuv8.c: MMX YUV transformation functions for 8bpp 3 3 * Provides functions to perform the YUV conversion. The functions provided here 4 4 * are a complete and portable C implementation, and may be replaced in certain plugins/yuvmmx/video_yuv_asm.h
r57e189e r52d7937 1 1 /***************************************************************************** 2 * video_yuv_asm.h: YUV transformation assembly2 * video_yuv_asm.h: MMX YUV transformation assembly 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999, 2000 VideoLAN … … 83 83 pmulhw mmx_V_green, %%mm3 # Mul Cr with green coeff -> Cr green \n\ 84 84 pmulhw 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\85 pmulhw mmx_V_red, %%mm1 # Mul Cr -> Cred 00 r3 00 r2 00 r1 00 r0 \n\ 86 86 paddsw %%mm3, %%mm2 # Cb green + Cr green -> Cgreen \n\ 87 87 \n\ plugins/yuvmmx/video_yuv_macros.h
r57e189e r52d7937 1 1 /***************************************************************************** 2 * video_yuv_macros.h: YUV transformation macros2 * video_yuv_macros.h: MMX YUV transformation macros 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999, 2000 VideoLAN src/audio_output/audio_output.c
re13aed0 r52d7937 76 76 77 77 /***************************************************************************** 78 * InitializeIncrement 79 *****************************************************************************/ 80 static __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 /***************************************************************************** 78 97 * aout_CreateThread: initialize audio thread 79 98 *****************************************************************************/ … … 467 486 468 487 /* Following f
