[MPlayer-dev-eng] [PATCH] mp_image flags in filters

Ivan Kalvachev ikalvachev at gmail.com
Thu Jul 28 00:04:44 CEST 2005


On 7/27/05, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> Hi,
> I think a lot of filters use the wrong flags in their vf_get_image
> calls, most of them use MP_IMAGETYPE_TEMP, to which mp_image.h says:
> > //codec just needs some WO memory, where it writes/copies the whole frame
> 
> But a lot of codecs also read from it, IMHO they should/must set
> MP_IMGFLAG_READABLE then (as it currently is this just gives horrible
> performance when doign dr directly into video ram).
> For others like softpulldown, telecine and tinterlace I really can't see why they
> set MP_IMGFLAG_PRESERVE, since they seem to never use that mp_image
> again.
> For tile I think MP_IMGTYPE_STATIC is not neccessary, as I understand it
> you'd only need that if you call vf_next_put_image more than once with
> the same mp_image, which is not the case here.

I would preffer this to stay static. Don;t forget that tile is called
multiple times over same (result) image


> Please tell me if I misunderstood something or if you have any
> comments/questions.
> Proposed patch attached.
> 
> Greetings,
> Reimar Döffinger
> P.S. some filters _really_ miss direct rendering support, like e.g.
> rectangle and bmovl, they change hardly anything of the image but
> nevertheless memcpy all of it...

boxblur, doesn't seem to support direct rendering. It doesn't
implement get_image funtion. So setting readable in the dest image is
bad (will actually prevent DR in valid case). I guess that the
algorithm requires not to modify the source image.

denoise3d - same as above

dint - MAXROWSIZE should be commited separately;)

divtc - commit that, it does reading and the other get_image() do use readable.

down3dright - commit that too.

pp - no idea, ask michael ;)

rectangle - commit. This could really be done better. 

smartblur - commit.

softpulldown - I don't see why are you removing PRESERVE flag. This
filter obviously doesn't want to allow next filters to mess the image,
as it needs it on next pass.(btw this also mean that vo cannot draw
osd in it;) It seems static and preserve is valid trick for storing
image.

telecine - same as above. (and this is rich filters)

tinterlace - same as softpulldown. But I agree that READABLE is
probably not needed here. We don't read from destination buffer.

Happy Coding
  Ivan Kalvachev
 iive




More information about the MPlayer-dev-eng mailing list