comparison libmpcodecs/vf_field.c @ 10141:7d6a854a5fe5

cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
author rfelker
date Tue, 20 May 2003 18:36:55 +0000
parents e9a2af584986
children 1cb1a9584c3b
comparison
equal deleted inserted replaced
10140:30cad6ad9dbc 10141:7d6a854a5fe5
10 10
11 #include "../libvo/fastmemcpy.h" 11 #include "../libvo/fastmemcpy.h"
12 12
13 struct vf_priv_s { 13 struct vf_priv_s {
14 int field; 14 int field;
15 mp_image_t *dmpi;
16 }; 15 };
17 16
18 //===========================================================================// 17 //===========================================================================//
19 18
20 static int config(struct vf_instance_s* vf, 19 static int config(struct vf_instance_s* vf,
27 if(mpi->flags&MP_IMGFLAG_DIRECT){ 26 if(mpi->flags&MP_IMGFLAG_DIRECT){
28 // we've used DR, so we're ready... 27 // we've used DR, so we're ready...
29 return vf_next_put_image(vf,(mp_image_t*)mpi->priv); 28 return vf_next_put_image(vf,(mp_image_t*)mpi->priv);
30 } 29 }
31 30
32 vf->priv->dmpi=vf_get_image(vf->next,mpi->imgfmt, 31 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,
33 MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE, 32 MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,
34 mpi->width, mpi->height/2); 33 mpi->width, mpi->height/2);
35 34
36 // set up mpi as a double-stride image of dmpi: 35 // set up mpi as a double-stride image of dmpi:
37 vf->priv->dmpi->planes[0]=mpi->planes[0]+mpi->stride[0]*vf->priv->field; 36 vf->dmpi->planes[0]=mpi->planes[0]+mpi->stride[0]*vf->priv->field;
38 vf->priv->dmpi->stride[0]=2*mpi->stride[0]; 37 vf->dmpi->stride[0]=2*mpi->stride[0];
39 if(vf->priv->dmpi->flags&MP_IMGFLAG_PLANAR){ 38 if(vf->dmpi->flags&MP_IMGFLAG_PLANAR){
40 vf->priv->dmpi->planes[1]=mpi->planes[1]+ 39 vf->dmpi->planes[1]=mpi->planes[1]+
41 mpi->stride[1]*vf->priv->field; 40 mpi->stride[1]*vf->priv->field;
42 vf->priv->dmpi->stride[1]=2*mpi->stride[1]; 41 vf->dmpi->stride[1]=2*mpi->stride[1];
43 vf->priv->dmpi->planes[2]=mpi->planes[2]+ 42 vf->dmpi->planes[2]=mpi->planes[2]+
44 mpi->stride[2]*vf->priv->field; 43 mpi->stride[2]*vf->priv->field;
45 vf->priv->dmpi->stride[2]=2*mpi->stride[2]; 44 vf->dmpi->stride[2]=2*mpi->stride[2];
46 } else 45 } else
47 vf->priv->dmpi->planes[1]=mpi->planes[1]; // passthru bgr8 palette!!! 46 vf->dmpi->planes[1]=mpi->planes[1]; // passthru bgr8 palette!!!
48 47
49 return vf_next_put_image(vf,vf->priv->dmpi); 48 return vf_next_put_image(vf,vf->dmpi);
50 } 49 }
51 50
52 //===========================================================================// 51 //===========================================================================//
53 52
54 static void uninit(struct vf_instance_s* vf) 53 static void uninit(struct vf_instance_s* vf)