diff options
author | Nayan Deshmukh <[email protected]> | 2016-08-12 19:32:51 +0530 |
---|---|---|
committer | Christian König <[email protected]> | 2016-08-16 10:07:35 +0200 |
commit | 09dff7ae2e179d5a3490481762c6bd3d50430c9f (patch) | |
tree | 2f1c51d314407704b60c321b4184b69d995d85ed /src/gallium/state_trackers/vdpau/mixer.c | |
parent | 1f47f78fc3193ecff13799305a8e35af82e68a06 (diff) |
st/vdpau: change the order in which filters are applied(v3)
Apply the median and matrix filter before the compostioning
we apply the deinterlacing first to avoid the extra overhead
in processing the past and the future surfaces in deinterlacing.
v2: apply the filters on all the surfaces (Christian)
v3: use get_sampler_view_planes() instead of
get_sampler_view_components() and iterate over
VL_MAX_SURFACES (Christian)
Signed-off-by: Nayan Deshmukh <[email protected]>
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau/mixer.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/mixer.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c index cb0ef039722..56b667d320d 100644 --- a/src/gallium/state_trackers/vdpau/mixer.c +++ b/src/gallium/state_trackers/vdpau/mixer.c @@ -240,8 +240,8 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, struct u_rect rect, clip, *prect, dirty_area; unsigned i, layer = 0; struct pipe_video_buffer *video_buffer; - struct pipe_sampler_view *sampler_view; - struct pipe_surface *surface; + struct pipe_sampler_view *sampler_view, **sampler_views; + struct pipe_surface *surface, **surfaces; vlVdpVideoMixer *vmixer; vlVdpSurface *surf; @@ -325,6 +325,22 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, } } + surfaces = video_buffer->get_surfaces(video_buffer); + sampler_views = video_buffer->get_sampler_view_planes(video_buffer); + + for(i = 0; i < VL_MAX_SURFACES; ++i) { + if(sampler_views[i] != NULL && surfaces[i] != NULL) { + if (vmixer->noise_reduction.filter) + vl_median_filter_render(vmixer->noise_reduction.filter, + sampler_views[i], surfaces[i]); + + if (vmixer->sharpness.filter) + vl_matrix_filter_render(vmixer->sharpness.filter, + sampler_views[i], surfaces[i]); + + } + } + prect = RectToPipe(video_source_rect, &rect); if (!prect) { rect.x0 = 0; @@ -394,14 +410,6 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, else { vl_compositor_render(&vmixer->cstate, compositor, surface, &dirty_area, true); - if (vmixer->noise_reduction.filter) - vl_median_filter_render(vmixer->noise_reduction.filter, - sampler_view, surface); - - if (vmixer->sharpness.filter) - vl_matrix_filter_render(vmixer->sharpness.filter, - sampler_view, surface); - if (vmixer->bicubic.filter) vl_bicubic_filter_render(vmixer->bicubic.filter, sampler_view, dst->surface, |