Mercurial > mplayer.hg
comparison libmpcodecs/vf_pp.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 | c4f7ffafb559 |
children | e40dee59f3ba |
comparison
equal
deleted
inserted
replaced
10140:30cad6ad9dbc | 10141:7d6a854a5fe5 |
---|---|
28 | 28 |
29 struct vf_priv_s { | 29 struct vf_priv_s { |
30 int pp; | 30 int pp; |
31 pp_mode_t *ppMode[PP_QUALITY_MAX+1]; | 31 pp_mode_t *ppMode[PP_QUALITY_MAX+1]; |
32 void *context; | 32 void *context; |
33 mp_image_t *dmpi; | |
34 unsigned int outfmt; | 33 unsigned int outfmt; |
35 }; | 34 }; |
36 | 35 |
37 //===========================================================================// | 36 //===========================================================================// |
38 | 37 |
95 if((mpi->type==MP_IMGTYPE_IPB || vf->priv->pp) && | 94 if((mpi->type==MP_IMGTYPE_IPB || vf->priv->pp) && |
96 mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change | 95 mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change |
97 if(!(mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE) && mpi->imgfmt!=vf->priv->outfmt) | 96 if(!(mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE) && mpi->imgfmt!=vf->priv->outfmt) |
98 return; // colorspace differ | 97 return; // colorspace differ |
99 // ok, we can do pp in-place (or pp disabled): | 98 // ok, we can do pp in-place (or pp disabled): |
100 vf->priv->dmpi=vf_get_image(vf->next,mpi->imgfmt, | 99 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
101 mpi->type, mpi->flags, mpi->w, mpi->h); | 100 mpi->type, mpi->flags, mpi->w, mpi->h); |
102 mpi->planes[0]=vf->priv->dmpi->planes[0]; | 101 mpi->planes[0]=vf->dmpi->planes[0]; |
103 mpi->stride[0]=vf->priv->dmpi->stride[0]; | 102 mpi->stride[0]=vf->dmpi->stride[0]; |
104 mpi->width=vf->priv->dmpi->width; | 103 mpi->width=vf->dmpi->width; |
105 if(mpi->flags&MP_IMGFLAG_PLANAR){ | 104 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
106 mpi->planes[1]=vf->priv->dmpi->planes[1]; | 105 mpi->planes[1]=vf->dmpi->planes[1]; |
107 mpi->planes[2]=vf->priv->dmpi->planes[2]; | 106 mpi->planes[2]=vf->dmpi->planes[2]; |
108 mpi->stride[1]=vf->priv->dmpi->stride[1]; | 107 mpi->stride[1]=vf->dmpi->stride[1]; |
109 mpi->stride[2]=vf->priv->dmpi->stride[2]; | 108 mpi->stride[2]=vf->dmpi->stride[2]; |
110 } | 109 } |
111 mpi->flags|=MP_IMGFLAG_DIRECT; | 110 mpi->flags|=MP_IMGFLAG_DIRECT; |
112 } | 111 } |
113 | 112 |
114 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){ | 113 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){ |
115 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ | 114 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ |
116 // no DR, so get a new image! hope we'll get DR buffer: | 115 // no DR, so get a new image! hope we'll get DR buffer: |
117 vf->priv->dmpi=vf_get_image(vf->next,mpi->imgfmt, | 116 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
118 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE, | 117 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE, |
119 // MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, | 118 // MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, |
120 // mpi->w,mpi->h); | 119 // mpi->w,mpi->h); |
121 (mpi->w+7)&(~7),(mpi->h+7)&(~7)); | 120 (mpi->w+7)&(~7),(mpi->h+7)&(~7)); |
122 vf->priv->dmpi->w=mpi->w; vf->priv->dmpi->h=mpi->h; // display w;h | 121 vf->dmpi->w=mpi->w; vf->dmpi->h=mpi->h; // display w;h |
123 } | 122 } |
124 | 123 |
125 if(vf->priv->pp || !(mpi->flags&MP_IMGFLAG_DIRECT)){ | 124 if(vf->priv->pp || !(mpi->flags&MP_IMGFLAG_DIRECT)){ |
126 // do the postprocessing! (or copy if no DR) | 125 // do the postprocessing! (or copy if no DR) |
127 pp_postprocess(mpi->planes ,mpi->stride, | 126 pp_postprocess(mpi->planes ,mpi->stride, |
128 vf->priv->dmpi->planes,vf->priv->dmpi->stride, | 127 vf->dmpi->planes,vf->dmpi->stride, |
129 (mpi->w+7)&(~7),mpi->h, | 128 (mpi->w+7)&(~7),mpi->h, |
130 mpi->qscale, mpi->qstride, | 129 mpi->qscale, mpi->qstride, |
131 vf->priv->ppMode[ vf->priv->pp ], vf->priv->context, | 130 vf->priv->ppMode[ vf->priv->pp ], vf->priv->context, |
132 #ifdef PP_PICT_TYPE_QP2 | 131 #ifdef PP_PICT_TYPE_QP2 |
133 mpi->pict_type | (mpi->qscale_type ? PP_PICT_TYPE_QP2 : 0)); | 132 mpi->pict_type | (mpi->qscale_type ? PP_PICT_TYPE_QP2 : 0)); |
134 #else | 133 #else |
135 mpi->pict_type); | 134 mpi->pict_type); |
136 #endif | 135 #endif |
137 } | 136 } |
138 return vf_next_put_image(vf,vf->priv->dmpi); | 137 return vf_next_put_image(vf,vf->dmpi); |
139 } | 138 } |
140 | 139 |
141 //===========================================================================// | 140 //===========================================================================// |
142 | 141 |
143 extern int divx_quality; | 142 extern int divx_quality; |