[vlc-commits] dxva2_deinterlace: use a function to fill the DXVA2_VideoProcessBltParams
Steve Lhomme
git at videolan.org
Fri Aug 4 10:17:58 CEST 2017
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Aug 1 10:25:45 2017 +0200| [6679171615711283e6fd4ecbb19ef2064e59b925] | committer: Jean-Baptiste Kempf
dxva2_deinterlace: use a function to fill the DXVA2_VideoProcessBltParams
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6679171615711283e6fd4ecbb19ef2064e59b925
---
modules/video_output/win32/dxva2_deinterlace.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/modules/video_output/win32/dxva2_deinterlace.c b/modules/video_output/win32/dxva2_deinterlace.c
index d4152f2e4a..3995b333c5 100644
--- a/modules/video_output/win32/dxva2_deinterlace.c
+++ b/modules/video_output/win32/dxva2_deinterlace.c
@@ -101,6 +101,20 @@ static void FillSample( DXVA2_VideoSample *p_sample,
p_sample->PlanarAlpha = DXVA2_Fixed32OpaqueAlpha();
}
+static void FillBlitParams( DXVA2_VideoProcessBltParams *params, const RECT *area,
+ const DXVA2_VideoSample *samples, int order )
+{
+ memset(params, 0, sizeof(*params));
+ params->TargetFrame = (samples->End - samples->Start) * order / 2;
+ params->TargetRect = *area;
+ params->DestData = 0;
+ params->Alpha = DXVA2_Fixed32OpaqueAlpha();
+ params->DestFormat.SampleFormat = DXVA2_SampleProgressiveFrame;
+ params->BackgroundColor.Alpha = 0xFFFF;
+ params->ConstrictionSize.cx = params->TargetRect.right;
+ params->ConstrictionSize.cy = params->TargetRect.bottom;
+}
+
static int RenderPic( filter_t *filter, picture_t *p_outpic, picture_t *src,
int order, int i_field )
{
@@ -108,7 +122,7 @@ static int RenderPic( filter_t *filter, picture_t *p_outpic, picture_t *src,
const int i_samples = sys->decoder_caps.NumBackwardRefSamples + 1 +
sys->decoder_caps.NumForwardRefSamples;
HRESULT hr;
- DXVA2_VideoProcessBltParams params = {0};
+ DXVA2_VideoProcessBltParams params;
DXVA2_VideoSample samples[i_samples];
picture_t *pictures[i_samples];
D3DSURFACE_DESC srcDesc, dstDesc;
@@ -156,12 +170,7 @@ static int RenderPic( filter_t *filter, picture_t *p_outpic, picture_t *src,
}
}
- params.TargetFrame = (samples[0].End - samples[0].Start) * order / 2;
- params.TargetRect = area;
- params.DestData = 0;
- params.Alpha = DXVA2_Fixed32OpaqueAlpha();
- params.DestFormat.SampleFormat = DXVA2_SampleProgressiveFrame;
- params.BackgroundColor.Alpha = 0xFFFF;
+ FillBlitParams( ¶ms, &area, samples, order );
hr = IDirectXVideoProcessor_VideoProcessBlt( sys->processor,
sys->hw_surface,
More information about the vlc-commits
mailing list