[Mesa-dev] [PATCH 2/4] st/vdpau: use median filter for noise reduction

Christian König deathsimple at vodafone.de
Mon Feb 13 04:09:29 PST 2012


On 13.02.2012 09:00, Maarten Lankhorst wrote:
> Is dynamically allocating vmixer->noise_reduction.filter really needed?
> Wouldn't it make more sense to make it a static member, and making
> the cleanup member set things to null again as needed.
> And again, why dynamically allocate the filter.. make the destructor 
> function handle NULL correctly where needed. 
No, it's not really needed, but I had it this way in the first place and 
you need a lot of "if (something_is_not_null) cleanup(something)" in the 
destructor functions, and with this implementation we only need to test 
if it's allocated once, and that looked allot cleaner.

> This is a get function, not a set?
> So you did notice it was wrong in previous patch. 
Yeah, but moved it into the wrong patch while rebasing.... sorry for 
that, but both patches are already committed.

> Wouldn't it make more sense to only have a single matrix filter with 
> separate matrices for each filter so you only have to run a single shader?
Hui? What do you mean with that? The median filter isn't a 
matrix/convolution filter so you can't implement it the same way. And 
for bluring/sharpening applying both at the same time doesn't make any 
sense.

Christian.


More information about the mesa-dev mailing list