Mercurial > mplayer.hg
comparison libmpcodecs/vf_expand.c @ 6539:79b536a37e40
better planar support, chroma subsampling support and Y8/Y800 support
author | alex |
---|---|
date | Sun, 23 Jun 2002 21:08:31 +0000 |
parents | ae203145245e |
children | cb1180ccac76 |
comparison
equal
deleted
inserted
replaced
6538:afb4f3c107e7 | 6539:79b536a37e40 |
---|---|
197 mpi->type, mpi->flags, vf->priv->exp_w, vf->priv->exp_h); | 197 mpi->type, mpi->flags, vf->priv->exp_w, vf->priv->exp_h); |
198 // set up mpi as a cropped-down image of dmpi: | 198 // set up mpi as a cropped-down image of dmpi: |
199 if(mpi->flags&MP_IMGFLAG_PLANAR){ | 199 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
200 mpi->planes[0]=vf->priv->dmpi->planes[0]+ | 200 mpi->planes[0]=vf->priv->dmpi->planes[0]+ |
201 vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x; | 201 vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x; |
202 if (mpi->imgfmt == IMGFMT_YVU9) | |
203 { | |
204 mpi->planes[1]=vf->priv->dmpi->planes[1]+ | 202 mpi->planes[1]=vf->priv->dmpi->planes[1]+ |
205 (vf->priv->exp_y>>2)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>2); | 203 (vf->priv->exp_y>>mpi->chroma_y_shift)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>mpi->chroma_x_shift); |
206 mpi->planes[2]=vf->priv->dmpi->planes[2]+ | 204 mpi->planes[2]=vf->priv->dmpi->planes[2]+ |
207 (vf->priv->exp_y>>2)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>2); | 205 (vf->priv->exp_y>>mpi->chroma_y_shift)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>mpi->chroma_x_shift); |
208 } | |
209 else | |
210 { | |
211 mpi->planes[1]=vf->priv->dmpi->planes[1]+ | |
212 (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>1); | |
213 mpi->planes[2]=vf->priv->dmpi->planes[2]+ | |
214 (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>1); | |
215 } | |
216 mpi->stride[1]=vf->priv->dmpi->stride[1]; | 206 mpi->stride[1]=vf->priv->dmpi->stride[1]; |
217 mpi->stride[2]=vf->priv->dmpi->stride[2]; | 207 mpi->stride[2]=vf->priv->dmpi->stride[2]; |
218 } else { | 208 } else { |
219 mpi->planes[0]=vf->priv->dmpi->planes[0]+ | 209 mpi->planes[0]=vf->priv->dmpi->planes[0]+ |
220 vf->priv->exp_y*vf->priv->dmpi->stride[0]+ | 210 vf->priv->exp_y*vf->priv->dmpi->stride[0]+ |
244 if(mpi->flags&MP_IMGFLAG_PLANAR){ | 234 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
245 memcpy_pic(vf->priv->dmpi->planes[0]+ | 235 memcpy_pic(vf->priv->dmpi->planes[0]+ |
246 vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x, | 236 vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x, |
247 mpi->planes[0], mpi->w, mpi->h, | 237 mpi->planes[0], mpi->w, mpi->h, |
248 vf->priv->dmpi->stride[0],mpi->stride[0]); | 238 vf->priv->dmpi->stride[0],mpi->stride[0]); |
249 if (mpi->imgfmt == IMGFMT_YVU9) | |
250 { | |
251 memcpy_pic(vf->priv->dmpi->planes[1]+ | 239 memcpy_pic(vf->priv->dmpi->planes[1]+ |
252 (vf->priv->exp_y>>2)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>2), | 240 (vf->priv->exp_y>>mpi->chroma_y_shift)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>mpi->chroma_x_shift), |
253 mpi->planes[1], mpi->w>>2, mpi->h>>2, | 241 mpi->planes[1], mpi->chroma_width, mpi->chroma_height, |
254 vf->priv->dmpi->stride[1],mpi->stride[1]); | 242 vf->priv->dmpi->stride[1],mpi->stride[1]); |
255 memcpy_pic(vf->priv->dmpi->planes[2]+ | 243 memcpy_pic(vf->priv->dmpi->planes[2]+ |
256 (vf->priv->exp_y>>2)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>2), | 244 (vf->priv->exp_y>>mpi->chroma_y_shift)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>mpi->chroma_x_shift), |
257 mpi->planes[2], mpi->w>>2, mpi->h>>2, | 245 mpi->planes[2], mpi->chroma_width, mpi->chroma_height, |
258 vf->priv->dmpi->stride[2],mpi->stride[2]); | 246 vf->priv->dmpi->stride[2],mpi->stride[2]); |
259 } | |
260 else | |
261 { | |
262 memcpy_pic(vf->priv->dmpi->planes[1]+ | |
263 (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[1]+(vf->priv->exp_x>>1), | |
264 mpi->planes[1], mpi->w>>1, mpi->h>>1, | |
265 vf->priv->dmpi->stride[1],mpi->stride[1]); | |
266 memcpy_pic(vf->priv->dmpi->planes[2]+ | |
267 (vf->priv->exp_y>>1)*vf->priv->dmpi->stride[2]+(vf->priv->exp_x>>1), | |
268 mpi->planes[2], mpi->w>>1, mpi->h>>1, | |
269 vf->priv->dmpi->stride[2],mpi->stride[2]); | |
270 } | |
271 } else { | 247 } else { |
272 memcpy_pic(vf->priv->dmpi->planes[0]+ | 248 memcpy_pic(vf->priv->dmpi->planes[0]+ |
273 vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x*(vf->priv->dmpi->bpp/8), | 249 vf->priv->exp_y*vf->priv->dmpi->stride[0]+vf->priv->exp_x*(vf->priv->dmpi->bpp/8), |
274 mpi->planes[0], mpi->w*(vf->priv->dmpi->bpp/8), mpi->h, | 250 mpi->planes[0], mpi->w*(vf->priv->dmpi->bpp/8), mpi->h, |
275 vf->priv->dmpi->stride[0],mpi->stride[0]); | 251 vf->priv->dmpi->stride[0],mpi->stride[0]); |