[vlc-commits] dxva2_deinterlace: set the default ProcAmpValues when deinterlacing
Steve Lhomme
git at videolan.org
Sat Oct 14 19:03:44 CEST 2017
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Fri Oct 13 12:59:15 2017 +0200| [6b26dff71d7e8961e8ef82d9f44e8b480ebf3cde] | committer: Jean-Baptiste Kempf
dxva2_deinterlace: set the default ProcAmpValues when deinterlacing
Fixes #18599
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6b26dff71d7e8961e8ef82d9f44e8b480ebf3cde
---
modules/video_output/win32/dxva2_deinterlace.c | 44 ++++++++++++++++++++++++--
1 file changed, 42 insertions(+), 2 deletions(-)
diff --git a/modules/video_output/win32/dxva2_deinterlace.c b/modules/video_output/win32/dxva2_deinterlace.c
index d35dc12fbf..98444d19d6 100644
--- a/modules/video_output/win32/dxva2_deinterlace.c
+++ b/modules/video_output/win32/dxva2_deinterlace.c
@@ -50,6 +50,11 @@ struct filter_sys_t
DXVA2_VideoProcessorCaps decoder_caps;
+ SHORT Brightness;
+ SHORT Contrast;
+ SHORT Hue;
+ SHORT Saturation;
+
struct deinterlace_ctx context;
picture_t * (*buffer_new)( filter_t * );
};
@@ -102,7 +107,8 @@ static void FillSample( DXVA2_VideoSample *p_sample,
p_sample->PlanarAlpha = DXVA2_Fixed32OpaqueAlpha();
}
-static void FillBlitParams( DXVA2_VideoProcessBltParams *params, const RECT *area,
+static void FillBlitParams( filter_sys_t *sys,
+ DXVA2_VideoProcessBltParams *params, const RECT *area,
const DXVA2_VideoSample *samples, int order )
{
memset(params, 0, sizeof(*params));
@@ -114,6 +120,11 @@ static void FillBlitParams( DXVA2_VideoProcessBltParams *params, const RECT *are
params->BackgroundColor.Alpha = 0xFFFF;
params->ConstrictionSize.cx = params->TargetRect.right;
params->ConstrictionSize.cy = params->TargetRect.bottom;
+
+ params->ProcAmpValues.Brightness.Value = sys->Brightness;
+ params->ProcAmpValues.Contrast.Value = sys->Contrast;
+ params->ProcAmpValues.Hue.Value = sys->Hue;
+ params->ProcAmpValues.Saturation.Value = sys->Saturation;
}
static int RenderPic( filter_t *filter, picture_t *p_outpic, picture_t *src,
@@ -171,7 +182,7 @@ static int RenderPic( filter_t *filter, picture_t *p_outpic, picture_t *src,
}
}
- FillBlitParams( ¶ms, &area, samples, order );
+ FillBlitParams( sys, ¶ms, &area, samples, order );
hr = IDirectXVideoProcessor_VideoProcessBlt( sys->processor,
sys->hw_surface,
@@ -401,6 +412,35 @@ static int Open(vlc_object_t *obj)
if (FAILED(hr))
goto error;
+ DXVA2_ValueRange Range;
+ hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, processorGUID, &dsc,
+ dstDesc.Format, DXVA2_ProcAmp_Brightness,
+ &Range );
+ if (FAILED(hr))
+ goto error;
+ sys->Brightness = Range.DefaultValue.Value;
+
+ hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, processorGUID, &dsc,
+ dstDesc.Format, DXVA2_ProcAmp_Contrast,
+ &Range );
+ if (FAILED(hr))
+ goto error;
+ sys->Contrast = Range.DefaultValue.Value;
+
+ hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, processorGUID, &dsc,
+ dstDesc.Format, DXVA2_ProcAmp_Hue,
+ &Range );
+ if (FAILED(hr))
+ goto error;
+ sys->Hue = Range.DefaultValue.Value;
+
+ hr = IDirectXVideoProcessorService_GetProcAmpRange( processor, processorGUID, &dsc,
+ dstDesc.Format, DXVA2_ProcAmp_Saturation,
+ &Range );
+ if (FAILED(hr))
+ goto error;
+ sys->Saturation = Range.DefaultValue.Value;
+
sys->hdecoder_dll = hdecoder_dll;
sys->d3d9_dll = d3d9_dll;
sys->decoder_caps = best_caps;
More information about the vlc-commits
mailing list