Changeset 00a30b7bca39ee783fb2912aa15962dcf18dd97b
- Timestamp:
- 09/01/03 18:47:05 (6 years ago)
- git-parent:
- Files:
-
- modules/video_filter/adjust.c (modified) (10 diffs)
- modules/video_filter/clone.c (modified) (4 diffs)
- modules/video_filter/crop.c (modified) (14 diffs)
- modules/video_filter/distort.c (modified) (19 diffs)
- modules/video_filter/invert.c (modified) (7 diffs)
- modules/video_filter/motionblur.c (modified) (11 diffs)
- modules/video_filter/transform.c (modified) (3 diffs)
- modules/video_filter/wall.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/video_filter/adjust.c
rb752985 r00a30b7 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001 VideoLAN 5 * $Id: adjust.c,v 1. 7 2003/01/09 16:26:14sam Exp $5 * $Id: adjust.c,v 1.8 2003/01/09 17:47:05 sam Exp $ 6 6 * 7 7 * Authors: Simon Latapie <garf@via.ecp.fr>, Samuel Hocevar <sam@zoy.org> … … 196 196 197 197 picture_t *p_outpic; 198 uint8_t *p_in, *p_in_ u, *p_in_v, *p_in_end, *p_line_end;199 uint8_t *p_out, *p_out_ u, *p_out_v;198 uint8_t *p_in, *p_in_v, *p_in_end, *p_line_end; 199 uint8_t *p_out, *p_out_v; 200 200 201 201 double f_hue; … … 264 264 265 265 p_in += p_pic->p[0].i_pitch - p_pic->p[0].i_visible_pitch; 266 p_out += p_outpic->p[0].i_pitch - p_outpic->p[0].i_visible_pitch; 266 267 } 267 268 … … 270 271 */ 271 272 272 p_in _u= p_pic->p[1].p_pixels;273 p_in = p_pic->p[1].p_pixels; 273 274 p_in_v = p_pic->p[2].p_pixels; 274 p_in_end = p_in _u+ p_pic->p[1].i_lines * p_pic->p[1].i_pitch - 8;275 276 p_out _u= p_outpic->p[1].p_pixels;275 p_in_end = p_in + p_pic->p[1].i_lines * p_pic->p[1].i_pitch - 8; 276 277 p_out = p_outpic->p[1].p_pixels; 277 278 p_out_v = p_outpic->p[2].p_pixels; 278 279 … … 286 287 { 287 288 #define WRITE_UV_CLIP() \ 288 i_u = *p_in _u++ ; i_v = *p_in_v++ ; \289 *p_out _u++ = clip( (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \289 i_u = *p_in++ ; i_v = *p_in_v++ ; \ 290 *p_out++ = clip( (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \ 290 291 * i_sat) >> 8) + 128); \ 291 292 *p_out_v++ = clip( (( ((i_v * i_cos - i_u * i_sin - i_y) >> 8) \ … … 294 295 uint8_t i_u, i_v; 295 296 296 for( ; p_in _u< p_in_end ; )297 { 298 p_line_end = p_in _u+ p_pic->p[1].i_visible_pitch - 8;299 300 for( ; p_in _u< p_line_end ; )297 for( ; p_in < p_in_end ; ) 298 { 299 p_line_end = p_in + p_pic->p[1].i_visible_pitch - 8; 300 301 for( ; p_in < p_line_end ; ) 301 302 { 302 303 /* Do 8 pixels at a time */ … … 309 310 p_line_end += 8; 310 311 311 for( ; p_in _u< p_line_end ; )312 for( ; p_in < p_line_end ; ) 312 313 { 313 314 WRITE_UV_CLIP(); 314 315 } 315 316 316 p_in _u+= p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch;317 p_in += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch; 317 318 p_in_v += p_pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch; 318 p_out _u += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch;319 p_out_v += p_ pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch;319 p_out += p_outpic->p[1].i_pitch - p_outpic->p[1].i_visible_pitch; 320 p_out_v += p_outpic->p[2].i_pitch - p_outpic->p[2].i_visible_pitch; 320 321 } 321 322 } … … 323 324 { 324 325 #define WRITE_UV() \ 325 i_u = *p_in _u++ ; i_v = *p_in_v++ ; \326 *p_out _u++ = (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \326 i_u = *p_in++ ; i_v = *p_in_v++ ; \ 327 *p_out++ = (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \ 327 328 * i_sat) >> 8) + 128; \ 328 329 *p_out_v++ = (( ((i_v * i_cos - i_u * i_sin - i_y) >> 8) \ … … 331 332 uint8_t i_u, i_v; 332 333 333 for( ; p_in _u< p_in_end ; )334 for( ; p_in < p_in_end ; ) 334 335 { 335 336 p_line_end = p_in + p_pic->p[1].i_visible_pitch - 8; 336 337 337 for( ; p_in _u< p_line_end ; )338 for( ; p_in < p_line_end ; ) 338 339 { 339 340 /* Do 8 pixels at a time */ … … 344 345 p_line_end += 8; 345 346 346 for( ; p_in _u< p_line_end ; )347 for( ; p_in < p_line_end ; ) 347 348 { 348 349 WRITE_UV(); 349 350 } 350 351 351 p_in _u+= p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch;352 p_in += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch; 352 353 p_in_v += p_pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch; 353 p_out _u += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch;354 p_out_v += p_ pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch;354 p_out += p_outpic->p[1].i_pitch - p_outpic->p[1].i_visible_pitch; 355 p_out_v += p_outpic->p[2].i_pitch - p_outpic->p[2].i_visible_pitch; 355 356 } 356 357 } modules/video_filter/clone.c
re2da42f r00a30b7 3 3 ***************************************************************************** 4 4 * Copyright (C) 2002 VideoLAN 5 * $Id: clone.c,v 1. 3 2002/11/28 17:35:00sam Exp $5 * $Id: clone.c,v 1.4 2003/01/09 17:47:05 sam Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 11 11 * the Free Software Foundation; either version 2 of the License, or 12 12 * (at your option) any later version. 13 * 13 * 14 14 * This program is distributed in the hope that it will be useful, 15 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 122 122 int i_index, i_vout; 123 123 picture_t *p_pic; 124 124 125 125 I_OUTPUTPICTURES = 0; 126 126 … … 218 218 for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) 219 219 { 220 u 8*p_in, *p_in_end, *p_out;220 uint8_t *p_in, *p_in_end, *p_out; 221 221 int i_in_pitch = p_pic->p[i_plane].i_pitch; 222 222 const int i_out_pitch = p_outpic->p[i_plane].i_pitch; 223 const int i_copy_pitch = p_outpic->p[i_plane].i_visible_pitch; 223 224 224 225 p_in = p_pic->p[i_plane].p_pixels; 225 226 p_in_end = p_in + p_outpic->p[i_plane].i_lines227 * p_pic->p[i_plane].i_pitch;228 229 226 p_out = p_outpic->p[i_plane].p_pixels; 230 227 231 while( p_in < p_in_end ) 228 if( i_in_pitch == i_copy_pitch 229 && i_out_pitch == i_copy_pitch ) 232 230 { 233 p_vout->p_vlc->pf_memcpy( p_out, p_in, i_out_pitch ); 234 p_in += i_in_pitch; 235 p_out += i_out_pitch; 231 p_vout->p_vlc->pf_memcpy( p_out, p_in, i_in_pitch 232 * p_outpic->p[i_plane].i_lines ); 233 } 234 else 235 { 236 p_in_end = p_in + i_in_pitch * p_outpic->p[i_plane].i_lines; 237 238 while( p_in < p_in_end ) 239 { 240 p_vout->p_vlc->pf_memcpy( p_out, p_in, i_copy_pitch ); 241 p_in += i_in_pitch; 242 p_out += i_out_pitch; 243 } 236 244 } 237 245 } modules/video_filter/crop.c
rade615b r00a30b7 3 3 ***************************************************************************** 4 4 * Copyright (C) 2002 VideoLAN 5 * $Id: crop.c,v 1. 5 2002/12/06 16:34:07sam Exp $5 * $Id: crop.c,v 1.6 2003/01/09 17:47:05 sam Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 11 11 * the Free Software Foundation; either version 2 of the License, or 12 12 * (at your option) any later version. 13 * 13 * 14 14 * This program is distributed in the hope that it will be useful, 15 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 99 99 { 100 100 msg_Err( p_vout, "out of memory" ); 101 return 1;101 return VLC_ENOMEM; 102 102 } 103 103 … … 108 108 p_vout->pf_display = NULL; 109 109 110 return 0;110 return VLC_SUCCESS; 111 111 } 112 112 … … 119 119 char *psz_var; 120 120 picture_t *p_pic; 121 121 122 122 I_OUTPUTPICTURES = 0; 123 123 124 124 p_vout->p_sys->i_lastchange = 0; 125 p_vout->p_sys->b_changed = 0;125 p_vout->p_sys->b_changed = VLC_FALSE; 126 126 127 127 /* Initialize the output structure */ … … 239 239 { 240 240 msg_Err( p_vout, "failed to create vout" ); 241 return 0;241 return VLC_EGENERIC; 242 242 } 243 243 244 244 ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES ); 245 245 246 return 0;246 return VLC_SUCCESS; 247 247 } 248 248 … … 285 285 if( !p_vout->p_sys->b_changed ) 286 286 { 287 return 0;287 return VLC_SUCCESS; 288 288 } 289 289 … … 296 296 { 297 297 msg_Err( p_vout, "failed to create vout" ); 298 return 1;299 } 300 301 p_vout->p_sys->b_changed = 0;298 return VLC_EGENERIC; 299 } 300 301 p_vout->p_sys->b_changed = VLC_FALSE; 302 302 p_vout->p_sys->i_lastchange = 0; 303 303 304 return 0;304 return VLC_SUCCESS; 305 305 } 306 306 … … 340 340 for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) 341 341 { 342 u 8*p_in, *p_out, *p_out_end;342 uint8_t *p_in, *p_out, *p_out_end; 343 343 int i_in_pitch = p_pic->p[i_plane].i_pitch; 344 344 const int i_out_pitch = p_outpic->p[i_plane].i_pitch; 345 const int i_copy_pitch = p_outpic->p[i_plane].i_visible_pitch; 345 346 346 347 p_in = p_pic->p[i_plane].p_pixels … … 356 357 while( p_out < p_out_end ) 357 358 { 358 p_vout->p_vlc->pf_memcpy( p_out, p_in, i_ out_pitch );359 p_vout->p_vlc->pf_memcpy( p_out, p_in, i_copy_pitch ); 359 360 p_in += i_in_pitch; 360 361 p_out += i_out_pitch; … … 366 367 367 368 /* The source image may still be in the cache ... parse it! */ 368 if( !p_vout->p_sys->b_autocrop ) 369 { 370 return; 371 } 372 373 UpdateStats( p_vout, p_pic ); 369 if( p_vout->p_sys->b_autocrop ) 370 { 371 UpdateStats( p_vout, p_pic ); 372 } 374 373 } 375 374 … … 378 377 uint8_t *p_in = p_pic->p[0].p_pixels; 379 378 int i_pitch = p_pic->p[0].i_pitch; 379 int i_visible_pitch = p_pic->p[0].i_visible_pitch; 380 380 int i_lines = p_pic->p[0].i_lines; 381 381 int i_firstwhite = -1, i_lastwhite = -1, i; … … 392 392 393 393 if( p_in[i_col/2] > 40 394 && p_in[i_ pitch /2] > 40395 && p_in[i_ pitch/2 + i_col/2] > 40 )394 && p_in[i_visible_pitch/2] > 40 395 && p_in[i_visible_pitch/2 + i_col/2] > 40 ) 396 396 { 397 397 if( i_lastwhite == -1 ) … … 458 458 * p_vout->p_sys->i_width / p_vout->output.i_width; 459 459 460 p_vout->p_sys->b_changed = 1; 461 } 460 p_vout->p_sys->b_changed = VLC_TRUE; 461 } 462 modules/video_filter/distort.c
re2da42f r00a30b7 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001 VideoLAN 5 * $Id: distort.c,v 1. 4 2002/11/28 17:35:00sam Exp $5 * $Id: distort.c,v 1.5 2003/01/09 17:47:05 sam Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 11 11 * the Free Software Foundation; either version 2 of the License, or 12 12 * (at your option) any later version. 13 * 13 * 14 14 * This program is distributed in the hope that it will be useful, 15 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 100 100 { 101 101 msg_Err( p_vout, "out of memory" ); 102 return ( 1 );102 return VLC_ENOMEM; 103 103 } 104 104 … … 114 114 { 115 115 msg_Err( p_vout, "configuration variable %s empty", "filter" ); 116 return ( 1 );116 return VLC_EGENERIC; 117 117 } 118 118 while( *psz_method && *psz_method != ':' ) … … 142 142 } 143 143 else { 144 144 145 145 if( !strcmp( psz_method, "wave" ) ) 146 146 { … … 151 151 p_vout->p_sys->i_mode = DISTORT_MODE_RIPPLE; 152 152 } 153 154 153 else 155 154 { … … 161 160 } 162 161 free( psz_method_tmp ); 163 164 return ( 0 );165 } 166 162 163 return VLC_SUCCESS; 164 } 165 167 166 /***************************************************************************** 168 167 * Init: initialize Distort video thread output method … … 193 192 msg_Err( p_vout, "cannot open vout, aborting" ); 194 193 195 return ( 0 );194 return VLC_EGENERIC; 196 195 } 197 196 … … 201 200 p_vout->p_sys->last_date = 0; 202 201 203 return ( 0 );202 return VLC_SUCCESS; 204 203 } 205 204 … … 291 290 { 292 291 int i_line, i_num_lines, i_offset; 293 u 8black_pixel;294 u 8*p_in, *p_out;292 uint8_t black_pixel; 293 uint8_t *p_in, *p_out; 295 294 296 295 p_in = p_inpic->p[i_index].p_pixels; … … 305 304 { 306 305 /* Calculate today's offset, don't go above 1/20th of the screen */ 307 i_offset = (int)( (double)(p_inpic->p[i_index].i_ pitch)306 i_offset = (int)( (double)(p_inpic->p[i_index].i_visible_pitch) 308 307 * sin( f_angle + 10.0 * (double)i_line 309 308 / (double)i_num_lines ) … … 315 314 { 316 315 p_vout->p_vlc->pf_memcpy( p_out, p_in - i_offset, 317 p_inpic->p[i_index].i_pitch + i_offset );316 p_inpic->p[i_index].i_visible_pitch + i_offset ); 318 317 p_in += p_inpic->p[i_index].i_pitch; 319 318 p_out += p_outpic->p[i_index].i_pitch; … … 323 322 { 324 323 p_vout->p_vlc->pf_memcpy( p_out + i_offset, p_in, 325 p_inpic->p[i_index].i_pitch - i_offset );324 p_inpic->p[i_index].i_visible_pitch - i_offset ); 326 325 memset( p_out, black_pixel, i_offset ); 327 326 p_in += p_inpic->p[i_index].i_pitch; … … 332 331 { 333 332 p_vout->p_vlc->pf_memcpy( p_out, p_in, 334 p_inpic->p[i_index].i_ pitch );333 p_inpic->p[i_index].i_visible_pitch ); 335 334 p_in += p_inpic->p[i_index].i_pitch; 336 335 p_out += p_outpic->p[i_index].i_pitch; … … 358 357 { 359 358 int i_line, i_first_line, i_num_lines, i_offset; 360 u 8black_pixel;361 u 8*p_in, *p_out;359 uint8_t black_pixel; 360 uint8_t *p_in, *p_out; 362 361 363 362 black_pixel = ( i_index == Y_PLANE ) ? 0x00 : 0x80; … … 370 369 p_out = p_outpic->p[i_index].p_pixels; 371 370 372 p_vout->p_vlc->pf_memcpy( p_out, p_in, 373 i_first_line * p_inpic->p[i_index].i_pitch ); 374 375 p_in += i_first_line * p_inpic->p[i_index].i_pitch; 376 p_out += i_first_line * p_outpic->p[i_index].i_pitch; 371 for( i_line = 0 ; i_line < i_first_line ; i_line++ ) 372 { 373 p_vout->p_vlc->pf_memcpy( p_out, p_in, 374 p_inpic->p[i_index].i_visible_pitch ); 375 p_in += p_inpic->p[i_index].i_pitch; 376 p_out += p_outpic->p[i_index].i_pitch; 377 } 377 378 378 379 /* Ok, we do 3 times the sin() calculation for each line. So what ? */ … … 393 394 { 394 395 p_vout->p_vlc->pf_memcpy( p_out, p_in - i_offset, 395 p_inpic->p[i_index].i_pitch + i_offset );396 p_inpic->p[i_index].i_visible_pitch + i_offset ); 396 397 p_in -= p_inpic->p[i_index].i_pitch; 397 398 p_out += p_outpic->p[i_index].i_pitch; … … 401 402 { 402 403 p_vout->p_vlc->pf_memcpy( p_out + i_offset, p_in, 403 p_inpic->p[i_index].i_pitch - i_offset );404 p_inpic->p[i_index].i_visible_pitch - i_offset ); 404 405 memset( p_out, black_pixel, i_offset ); 405 406 p_in -= p_inpic->p[i_index].i_pitch; … … 410 411 { 411 412 p_vout->p_vlc->pf_memcpy( p_out, p_in, 412 p_inpic->p[i_index].i_ pitch );413 p_inpic->p[i_index].i_visible_pitch ); 413 414 p_in -= p_inpic->p[i_index].i_pitch; 414 415 p_out += p_outpic->p[i_index].i_pitch; modules/video_filter/invert.c
re2da42f r00a30b7 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001 VideoLAN 5 * $Id: invert.c,v 1. 3 2002/11/28 17:35:00sam Exp $5 * $Id: invert.c,v 1.4 2003/01/09 17:47:05 sam Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 11 11 * the Free Software Foundation; either version 2 of the License, or 12 12 * (at your option) any later version. 13 * 13 * 14 14 * This program is distributed in the hope that it will be useful, 15 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 120 120 return( 0 ); 121 121 } 122 122 123 123 ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES ); 124 124 … … 147 147 *****************************************************************************/ 148 148 static void Destroy( vlc_object_t *p_this ) 149 { 149 { 150 150 vout_thread_t *p_vout = (vout_thread_t *)p_this; 151 151 … … 176 176 } 177 177 msleep( VOUT_OUTMEM_SLEEP ); 178 } 178 } 179 179 180 180 vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date ); … … 183 183 for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ ) 184 184 { 185 u 8 *p_in, *p_in_end, *p_out;185 uint8_t *p_in, *p_in_end, *p_line_end, *p_out; 186 186 187 187 p_in = p_pic->p[i_index].p_pixels; 188 p_in_end = p_in - 64+ p_pic->p[i_index].i_lines189 * p_pic->p[i_index].i_pitch;188 p_in_end = p_in + p_pic->p[i_index].i_lines 189 * p_pic->p[i_index].i_pitch; 190 190 191 191 p_out = p_outpic->p[i_index].p_pixels; … … 193 193 for( ; p_in < p_in_end ; ) 194 194 { 195 /* Do 64 pixels at a time */ 196 *((u64*)p_out)++ = ~( *((u64*)p_in)++ ); 197 *((u64*)p_out)++ = ~( *((u64*)p_in)++ ); 198 *((u64*)p_out)++ = ~( *((u64*)p_in)++ ); 199 *((u64*)p_out)++ = ~( *((u64*)p_in)++ ); 200 *((u64*)p_out)++ = ~( *((u64*)p_in)++ ); 201 *((u64*)p_out)++ = ~( *((u64*)p_in)++ ); 202 *((u64*)p_out)++ = ~( *((u64*)p_in)++ ); 203 *((u64*)p_out)++ = ~( *((u64*)p_in)++ ); 195 p_line_end = p_in + p_pic->p[i_index].i_visible_pitch - 64; 196 197 for( ; p_in < p_line_end ; ) 198 { 199 /* Do 64 pixels at a time */ 200 *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ ); 201 *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ ); 202 *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ ); 203 *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ ); 204 *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ ); 205 *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ ); 206 *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ ); 207 *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ ); 208 } 209 210 p_line_end += 64; 211 212 for( ; p_in < p_line_end ; ) 213 { 214 *p_out++ = ~( *p_in++ ); 215 } 216 217 p_in += p_pic->p[i_index].i_pitch 218 - p_pic->p[i_index].i_visible_pitch; 219 p_out += p_outpic->p[i_index].i_pitch 220 - p_outpic->p[i_index].i_visible_pitch; 204 221 } 205 206 p_in_end += 64;207 208 for( ; p_in < p_in_end ; )209 {210 /* Do 1 pixel at a time */211 *p_out++ = ~( *p_in++ );212 }213 222 } 214 223 modules/video_filter/motionblur.c
re2da42f r00a30b7 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001 VideoLAN 5 * $Id: motionblur.c,v 1. 4 2002/11/28 17:35:00sam Exp $5 * $Id: motionblur.c,v 1.5 2003/01/09 17:47:05 sam Exp $ 6 6 * 7 7 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> … … 11 11 * the Free Software Foundation; either version 2 of the License, or 12 12 * (at your option) any later version. 13 * 13 * 14 14 * This program is distributed in the hope that it will be useful, 15 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 84 84 *****************************************************************************/ 85 85 static int Create( vlc_object_t *p_this ) 86 { 86 { 87 87 vout_thread_t *p_vout = (vout_thread_t *)p_this; 88 88 … … 92 92 { 93 93 msg_Err( p_vout, "out of memory" ); 94 return 1;94 return VLC_ENOMEM; 95 95 } 96 96 … … 106 106 p_vout->p_sys->p_lastpic = NULL; 107 107 108 return 0;108 return VLC_SUCCESS; 109 109 } 110 110 … … 116 116 int i_index; 117 117 picture_t *p_pic; 118 118 119 119 I_OUTPUTPICTURES = 0; 120 120 … … 134 134 135 135 default: 136 return 0; /* unknown chroma */136 return VLC_EGENERIC; /* unknown chroma */ 137 137 break; 138 138 } … … 158 158 msg_Err( p_vout, "cannot open vout, aborting" ); 159 159 160 return 0;161 } 162 160 return VLC_EGENERIC; 161 } 162 163 163 ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES ); 164 164 165 return 0;165 return VLC_SUCCESS; 166 166 } 167 167 … … 215 215 } 216 216 vout_DatePicture( p_vout, p_outpic, p_pic->date ); 217 217 218 218 if ( p_vout->p_sys->p_lastpic == NULL ) 219 219 { … … 253 253 CopyPicture( p_vout, p_vout->p_sys->p_lastpic, p_outpic ); 254 254 vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic ); 255 256 } 257 258 static void CopyPicture( vout_thread_t *p_vout, 259 picture_t *p_dest, picture_t *p_source) 260 { 261 int i_plane; 262 263 for( i_plane = 0 ; i_plane < p_dest->i_planes ; i_plane++ ) 264 { 265 u8 *p_in, *p_out; 266 267 p_in = p_source->p[i_plane].p_pixels; 268 269 p_out = p_dest->p[i_plane].p_pixels; 270 p_vout->p_vlc->pf_memcpy( p_out, p_in, 271 p_dest->p[i_plane].i_pitch * 272 p_dest->p[i_plane].i_lines); 273 } 274 } 275 /***************************************************************************** 276 * RenderBob: renders a bob picture 255 } 256 257 /* FIXME: this is a verbatim copy from src/video_output/vout_pictures.c */ 258 /* XXX: the order is fucked up!! */ 259 static void CopyPicture( vout_thread_t * p_vout, 260 picture_t *p_dest, picture_t *p_src ) 261 { 262 int i; 263 264 for( i = 0; i < p_src->i_planes ; i++ ) 265 { 266 if( p_src->p[i].i_pitch == p_dest->p[i].i_pitch ) 267 { 268 /* There are margins, but with the same width : perfect ! */ 269 p_vout->p_vlc->pf_memcpy( 270 p_dest->p[i].p_pixels, p_src->p[i].p_pixels, 271 p_src->p[i].i_pitch * p_src->p[i].i_lines ); 272 } 273 else 274 { 275 /* We need to proceed line by line */ 276 uint8_t *p_in = p_src->p[i].p_pixels; 277 uint8_t *p_out = p_dest->p[i].p_pixels; 278 int i_line; 279 280 for( i_line = p_src->p[i].i_lines; i_line--; ) 281 { 282 p_vout->p_vlc->pf_memcpy( p_out, p_in, 283 p_src->p[i].i_visible_pitch ); 284 p_in += p_src->p[i].i_pitch; 285 p_out += p_dest->p[i].i_pitch; 286 } 287 } 288 } 289 } 290 291 /***************************************************************************** 292 * RenderBlur: renders a blurred picture 277 293 *****************************************************************************/ 278 294 static void RenderBlur( vout_thread_t *p_vout, picture_t *p_oldpic, … … 284 300 for( i_plane = 0; i_plane < p_outpic->i_planes; i_plane++ ) 285 301 { 286 u 8 *p_old, *p_new, *p_out, *p_out_end;302 uint8_t *p_old, *p_new, *p_out, *p_out_end, *p_out_line_end; 287 303 p_out = p_outpic->p[i_plane].p_pixels; 288 304 p_new = p_newpic->p[i_plane].p_pixels; 289 305 p_old = p_oldpic->p[i_plane].p_pixels; 290 306 p_out_end = p_out + p_outpic->p[i_plane].i_pitch * 291 p_outpic->p[i_plane].i_lines;307 p_outpic->p[i_plane].i_lines; 292 308 while ( p_out < p_out_end ) 293 309 { 294 *p_out++ = (((*p_old++) * i_oldfactor) + 295 ((*p_new++) * i_newfactor)) >> 7; 296 297 // *p_out++ = (*p_old++ >> 1) + (*p_new++ >> 1); 298 299 } 300 } 301 } 310 p_out_line_end = p_out + p_outpic->p[i_plane].i_visible_pitch; 311 312 while ( p_out < p_out_line_end ) 313 { 314 *p_out++ = (((*p_old++) * i_oldfactor) + 315 ((*p_new++) * i_newfactor)) >> 7; 316 317 // *p_out++ = (*p_old++ >> 1) + (*p_new++ >> 1); 318 } 319 320 p_old += p_oldpic->p[i_plane].i_pitch 321 - p_oldpic->p[i_plane].i_visible_pitch; 322 p_new += p_newpic->p[i_plane].i_pitch 323 - p_newpic->p[i_plane].i_visible_pitch; 324 p_out += p_outpic->p[i_plane].i_pitch 325 - p_outpic->p[i_plane].i_visible_pitch; 326 } 327 } 328 } 329 modules/video_filter/transform.c
rf86eec5 r00a30b7 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001 VideoLAN 5 * $Id: transform.c,v 1. 5 2003/01/09 14:00:00sam Exp $5 * $Id: transform.c,v 1.6 2003/01/09 17:47:05 sam Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 289 289 290 290 case TRANSFORM_MODE_180: 291 /* FIXME: we should use i_visible_pitch here */292 291 for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ ) 293 292 { … … 300 299 for( ; p_in < p_in_end ; ) 301 300 { 302 *p_out++ = *(--p_in_end); 301 uint8_t *p_line_start = p_in - p_pic->p[i_index].i_pitch; 302 p_in_end -= p_pic->p[i_index].i_pitch 303 - p_pic->p[i_index].i_visible_pitch; 304 305 for( ; p_line_start < p_in_end ; ) 306 { 307 *p_out++ = *(--p_in_end); 308 } 309 310 p_out += p_outpic->p[i_index].i_pitch 311 - p_outpic->p[i_index].i_visible_pitch; 303 312 } 304 313 } modules/video_filter/wall.c
re2da42f r00a30b7 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001 VideoLAN 5 * $Id: wall.c,v 1. 4 2002/11/28 17:35:00sam Exp $5 * $Id: wall.c,v 1.5 2003/01/09 17:47:05 sam Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 11 11 * the Free Software Foundation; either version 2 of the License, or 12 12 * (at your option) any later version. 13 * 13 * 14 14 * This program is distributed in the hope that it will be useful, 15 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of … … 107 107 { 108 108 msg_Err( p_vout, "out of memory" ); 109 return ( 1 );109 return VLC_ENOMEM; 110 110 } 111 111 … … 133 133 msg_Err( p_vout, "out of memory" ); 134 134 free( p_vout->p_sys ); 135 return ( 1 );135 return VLC_ENOMEM; 136 136 } 137 137 … … 186 186 free( psz_method_tmp ); 187 187 188 return ( 0 );188 return VLC_SUCCESS; 189 189 } 190 190 … … 196 196 int i_index, i_row, i_col, i_width, i_height; 197 197 picture_t *p_pic; 198 198 199 199 I_OUTPUTPICTURES = 0; 200 200 … … 259 259 p_vout->p_sys->i_col, p_vout->p_sys->i_row ); 260 260 RemoveAllVout( p_vout ); 261 return 0;261 return VLC_EGENERIC; 262 262 } 263 263 … … 268 268 ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES ); 269 269 270 return ( 0 );270 return VLC_SUCCESS; 271 271 } 272 272 … … 364 364 for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) 365 365 { 366 u 8*p_in, *p_in_end, *p_out;366 uint8_t *p_in, *p_in_end, *p_out; 367 367 int i_in_pitch = p_pic->p[i_plane].i_pitch; 368 368 int i_out_pitch = p_outpic->p[i_plane].i_pitch; 369 int i_copy_pitch = p_outpic->p[i_plane].i_visible_pitch; 369 370 370 371 p_in = p_pic->p[i_plane].p_pixels … … 378 379 while( p_in < p_in_end ) 379 380 { 380 p_vout->p_vlc->pf_memcpy( p_out, p_in, i_ out_pitch );381 p_vout->p_vlc->pf_memcpy( p_out, p_in, i_copy_pitch ); 381 382 p_in += i_in_pitch; 382 383 p_out += i_out_pitch;
