[MPlayer-dev-eng] About r16155…

Clément Bœsch ubitux at gmail.com
Sat May 7 18:10:29 CEST 2011


On Fri, May 06, 2011 at 12:42:09PM +0300, Ivan Kalvachev wrote:
> On 5/6/11, Clément Bœsch <ubitux at gmail.com> wrote:
> > On Thu, May 05, 2011 at 11:28:45PM +0200, Clément Bœsch wrote:
> >> Yeah I know it's pretty old. But it seems this change introduced a strange
> >> warning. Is the attached patch correct? Should I select chroma? Something
> >> else? I admit I didn't test…
> >>
> >> Also, about the other warnings, the getSubSampleFactors (copied in a few
> >> other places) can be replaced with mp_get_chroma_shift and will fix the
> >> issue.
> >>
> >> Regards,
> >>
> >
> > After a discussion with Uoti, something like this may be more appropriate:
> >
> >  static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
> >         int cw= mpi->w >> mpi->chroma_x_shift;
> >         int ch= mpi->h >> mpi->chroma_y_shift;
> > -       FilterParam *f= &vf->priv;
> >
> >         mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
> >                 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|
> > -               (f->threshold) ? MP_IMGFLAG_READABLE : 0,
> > +               (vf->priv->luma.threshold || vf->priv->chroma.threshold) ?
> > MP_IMGFLAG_READABLE : 0,
> >                 mpi->w,mpi->h);
> >
> >
> > --
> 
> This patch looks more correct.
> But I think It needs another set of brackets around the (i?x:y).
> 
> Right now it is equivalent to if(ACCEPT_STRIDE| threshold) return
> READABLE; else return 0;

Well spotted. Thank you Ivan, thank you Uoti :)

Patch re-attached. Will be committed tomorrow with the following message:

vf_smartblur: fix threshold condition.

This will shut up a warning in the meantime.

-- 
Clément B.
-------------- next part --------------
Index: libmpcodecs/vf_smartblur.c
===================================================================
--- libmpcodecs/vf_smartblur.c	(revision 33396)
+++ libmpcodecs/vf_smartblur.c	(working copy)
@@ -183,11 +183,11 @@
 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
     int cw= mpi->w >> mpi->chroma_x_shift;
     int ch= mpi->h >> mpi->chroma_y_shift;
-    FilterParam *f= &vf->priv;
+    int threshold = vf->priv->luma.threshold || vf->priv->chroma.threshold;
 
     mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
         MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|
-        (f->threshold) ? MP_IMGFLAG_READABLE : 0,
+        (threshold ? MP_IMGFLAG_READABLE : 0),
         mpi->w,mpi->h);
 
     assert(mpi->flags&MP_IMGFLAG_PLANAR);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110507/be4b1754/attachment.asc>


More information about the MPlayer-dev-eng mailing list