comparison libmpcodecs/vf_smartblur.c @ 33311:00ab9ef28181

vf_smartblur: fix threshold condition. The threshold condition was broken (spotted because of a bad cast warning) and should now be fixed and using both luma and chroma threshold. The patch also fixes setting MP_IMGFLAG_READABLE (priorities fixed with the brackets) in the vf_get_image call.
author cboesch
date Sat, 07 May 2011 16:29:57 +0000
parents 7af3e6f901fd
children 8b0d95785db2
comparison
equal deleted inserted replaced
33310:464563f22be1 33311:00ab9ef28181
181 } 181 }
182 182
183 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ 183 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
184 int cw= mpi->w >> mpi->chroma_x_shift; 184 int cw= mpi->w >> mpi->chroma_x_shift;
185 int ch= mpi->h >> mpi->chroma_y_shift; 185 int ch= mpi->h >> mpi->chroma_y_shift;
186 FilterParam *f= &vf->priv; 186 int threshold = vf->priv->luma.threshold || vf->priv->chroma.threshold;
187 187
188 mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, 188 mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
189 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE| 189 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|
190 (f->threshold) ? MP_IMGFLAG_READABLE : 0, 190 (threshold ? MP_IMGFLAG_READABLE : 0),
191 mpi->w,mpi->h); 191 mpi->w,mpi->h);
192 192
193 assert(mpi->flags&MP_IMGFLAG_PLANAR); 193 assert(mpi->flags&MP_IMGFLAG_PLANAR);
194 194
195 blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma); 195 blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma);