Mercurial > mplayer.hg
comparison libmpcodecs/vf.c @ 29263:0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
author | diego |
---|---|
date | Wed, 13 May 2009 02:58:57 +0000 |
parents | 6d0da4fd4544 |
children | 3fa15eca924e |
comparison
equal
deleted
inserted
replaced
29262:7d545a6b8aff | 29263:0f1b5b68af32 |
---|---|
266 | 266 |
267 if (w == -1) w = vf->w; | 267 if (w == -1) w = vf->w; |
268 if (h == -1) h = vf->h; | 268 if (h == -1) h = vf->h; |
269 | 269 |
270 w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w; | 270 w2=(mp_imgflag&MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE)?((w+15)&(~15)):w; |
271 | 271 |
272 if(vf->put_image==vf_next_put_image){ | 272 if(vf->put_image==vf_next_put_image){ |
273 // passthru mode, if the filter uses the fallback/default put_image() code | 273 // passthru mode, if the filter uses the fallback/default put_image() code |
274 return vf_get_image(vf->next,outfmt,mp_imgtype,mp_imgflag,w,h); | 274 return vf_get_image(vf->next,outfmt,mp_imgtype,mp_imgflag,w,h); |
275 } | 275 } |
276 | 276 |
277 // Note: we should call libvo first to check if it supports direct rendering | 277 // Note: we should call libvo first to check if it supports direct rendering |
278 // and if not, then fallback to software buffers: | 278 // and if not, then fallback to software buffers: |
279 switch(mp_imgtype & 0xff){ | 279 switch(mp_imgtype & 0xff){ |
280 case MP_IMGTYPE_EXPORT: | 280 case MP_IMGTYPE_EXPORT: |
281 if(!vf->imgctx.export_images[0]) vf->imgctx.export_images[0]=new_mp_image(w2,h); | 281 if(!vf->imgctx.export_images[0]) vf->imgctx.export_images[0]=new_mp_image(w2,h); |
341 if(!mpi->bpp) mp_image_setfmt(mpi,outfmt); | 341 if(!mpi->bpp) mp_image_setfmt(mpi,outfmt); |
342 if(!(mpi->flags&MP_IMGFLAG_ALLOCATED) && mpi->type>MP_IMGTYPE_EXPORT){ | 342 if(!(mpi->flags&MP_IMGFLAG_ALLOCATED) && mpi->type>MP_IMGTYPE_EXPORT){ |
343 | 343 |
344 // check libvo first! | 344 // check libvo first! |
345 if(vf->get_image) vf->get_image(vf,mpi); | 345 if(vf->get_image) vf->get_image(vf,mpi); |
346 | 346 |
347 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ | 347 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ |
348 // non-direct and not yet allocated image. allocate it! | 348 // non-direct and not yet allocated image. allocate it! |
349 if (!mpi->bpp) { // no way we can allocate this | 349 if (!mpi->bpp) { // no way we can allocate this |
350 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, | 350 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, |
351 "vf_get_image: Tried to allocate a format that can not be allocated!\n"); | 351 "vf_get_image: Tried to allocate a format that can not be allocated!\n"); |
352 return NULL; | 352 return NULL; |
353 } | 353 } |
354 | 354 |
355 // check if codec prefer aligned stride: | 355 // check if codec prefer aligned stride: |
356 if(mp_imgflag&MP_IMGFLAG_PREFER_ALIGNED_STRIDE){ | 356 if(mp_imgflag&MP_IMGFLAG_PREFER_ALIGNED_STRIDE){ |
357 int align=(mpi->flags&MP_IMGFLAG_PLANAR && | 357 int align=(mpi->flags&MP_IMGFLAG_PLANAR && |
358 mpi->flags&MP_IMGFLAG_YUV) ? | 358 mpi->flags&MP_IMGFLAG_YUV) ? |
359 (8<<mpi->chroma_x_shift)-1 : 15; // -- maybe FIXME | 359 (8<<mpi->chroma_x_shift)-1 : 15; // -- maybe FIXME |
360 w2=((w+align)&(~align)); | 360 w2=((w+align)&(~align)); |
367 mpi->width=w2; | 367 mpi->width=w2; |
368 mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; | 368 mpi->chroma_width=(w2 + (1<<mpi->chroma_x_shift) - 1)>>mpi->chroma_x_shift; |
369 } | 369 } |
370 } | 370 } |
371 } | 371 } |
372 | 372 |
373 // IF09 - allocate space for 4. plane delta info - unused | 373 // IF09 - allocate space for 4. plane delta info - unused |
374 if (mpi->imgfmt == IMGFMT_IF09) | 374 if (mpi->imgfmt == IMGFMT_IF09) |
375 { | 375 { |
376 mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8+ | 376 mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8+ |
377 mpi->chroma_width*mpi->chroma_height); | 377 mpi->chroma_width*mpi->chroma_height); |
380 } | 380 } |
381 else | 381 else |
382 mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); | 382 mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8); |
383 if(mpi->flags&MP_IMGFLAG_PLANAR){ | 383 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
384 // YV12/I420/YVU9/IF09. feel free to add other planar formats here... | 384 // YV12/I420/YVU9/IF09. feel free to add other planar formats here... |
385 //if(!mpi->stride[0]) | 385 //if(!mpi->stride[0]) |
386 mpi->stride[0]=mpi->width; | 386 mpi->stride[0]=mpi->width; |
387 //if(!mpi->stride[1]) | 387 //if(!mpi->stride[1]) |
388 if(mpi->num_planes > 2){ | 388 if(mpi->num_planes > 2){ |
389 mpi->stride[1]=mpi->stride[2]=mpi->chroma_width; | 389 mpi->stride[1]=mpi->stride[2]=mpi->chroma_width; |
390 if(mpi->flags&MP_IMGFLAG_SWAPPED){ | 390 if(mpi->flags&MP_IMGFLAG_SWAPPED){ |
391 // I420/IYUV (Y,U,V) | 391 // I420/IYUV (Y,U,V) |
392 mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; | 392 mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; |
400 // NV12/NV21 | 400 // NV12/NV21 |
401 mpi->stride[1]=mpi->chroma_width; | 401 mpi->stride[1]=mpi->chroma_width; |
402 mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; | 402 mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; |
403 } | 403 } |
404 } else { | 404 } else { |
405 //if(!mpi->stride[0]) | 405 //if(!mpi->stride[0]) |
406 mpi->stride[0]=mpi->width*mpi->bpp/8; | 406 mpi->stride[0]=mpi->width*mpi->bpp/8; |
407 } | 407 } |
408 // printf("clearing img!\n"); | 408 // printf("clearing img!\n"); |
409 vf_mpi_clear(mpi,0,0,mpi->width,mpi->height); | 409 vf_mpi_clear(mpi,0,0,mpi->width,mpi->height); |
410 mpi->flags|=MP_IMGFLAG_ALLOCATED; | 410 mpi->flags|=MP_IMGFLAG_ALLOCATED; |
723 | 723 |
724 //============================================================================ | 724 //============================================================================ |
725 | 725 |
726 vf_instance_t* append_filters(vf_instance_t* last){ | 726 vf_instance_t* append_filters(vf_instance_t* last){ |
727 vf_instance_t* vf; | 727 vf_instance_t* vf; |
728 int i; | 728 int i; |
729 | 729 |
730 if(vf_settings) { | 730 if(vf_settings) { |
731 // We want to add them in the 'right order' | 731 // We want to add them in the 'right order' |
732 for(i = 0 ; vf_settings[i].name ; i++) | 732 for(i = 0 ; vf_settings[i].name ; i++) |
733 /* NOP */; | 733 /* NOP */; |