aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.cpp9
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp16
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp2
-rw-r--r--xbmc/utils/win32/memcpy_sse2.h12
4 files changed, 18 insertions, 21 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.cpp
index 46e141c720..11d5a92ba7 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.cpp
@@ -654,12 +654,9 @@ void CYUV2RGBShader::PrepareParameters(CRenderBuffer* videoBuffer, CRect sourceR
void CYUV2RGBShader::SetShaderParameters(CRenderBuffer* videoBuffer)
{
m_effect.SetTechnique("YUV2RGB_T");
- ID3D11ShaderResourceView* ppSRView[3] =
- {
- reinterpret_cast<ID3D11ShaderResourceView*>(videoBuffer->GetView(0)),
- reinterpret_cast<ID3D11ShaderResourceView*>(videoBuffer->GetView(1)),
- reinterpret_cast<ID3D11ShaderResourceView*>(videoBuffer->GetView(2)),
- };
+ ID3D11ShaderResourceView* ppSRView[3] = {};
+ for (unsigned i = 0, max_i = videoBuffer->GetActivePlanes(); i < max_i; i++)
+ ppSRView[i] = reinterpret_cast<ID3D11ShaderResourceView*>(videoBuffer->GetView(i));
m_effect.SetResources("g_Texture", ppSRView, videoBuffer->GetActivePlanes());
m_effect.SetMatrix("g_ColorMatrix", m_matrix.Matrix());
m_effect.SetFloatArray("g_StepXY", m_texSteps, ARRAY_SIZE(m_texSteps));
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp
index bdce087f98..fd7504f419 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp
@@ -285,7 +285,7 @@ bool CRenderBuffer::UploadBuffer()
{
case BUFFER_FMT_D3D11_BYPASS:
{
- auto const buf = dynamic_cast<DXVA::CDXVAOutputBuffer*>(videoBuffer);
+ const auto buf = static_cast<DXVA::CDXVAOutputBuffer*>(videoBuffer);
// rewrite dimension to actual values for proper usage in shaders
m_widthTex = buf->width;
m_heightTex = buf->height;
@@ -352,7 +352,7 @@ ID3D11View* CRenderBuffer::GetView(unsigned idx)
ID3D11View* CRenderBuffer::GetHWView() const
{
- auto buf = dynamic_cast<DXVA::CDXVAOutputBuffer*>(videoBuffer);
+ const auto buf = dynamic_cast<DXVA::CDXVAOutputBuffer*>(videoBuffer);
return buf ? buf->view : nullptr;
}
@@ -397,7 +397,7 @@ bool CRenderBuffer::UnmapPlane(unsigned idx) const
bool CRenderBuffer::HasPic() const
{
- auto dxva_buffer = dynamic_cast<DXVA::CDXVAOutputBuffer*>(videoBuffer);
+ const auto dxva_buffer = dynamic_cast<DXVA::CDXVAOutputBuffer*>(videoBuffer);
return dxva_buffer || m_textures[0].Get();
}
@@ -456,27 +456,27 @@ bool CRenderBuffer::CopyToD3D11()
copy_plane(src[0], srcStrides[0], height, width, dst[0], dstStride[0]);
}, [&]() {
// convert U+V -> UV
- convert_yuv420_nv12_chrome(&src[1], &srcStrides[1], height, width, &dst[1], &dstStride[1]);
+ convert_yuv420_nv12_chrome(&src[1], &srcStrides[1], height, width, dst[1], dstStride[1]);
});
// copy cache size of UV line again to fix Intel cache issue
// height and width multiplied by two because they will be divided by func
- convert_yuv420_nv12_chrome(&src[1], &srcStrides[1], 2, 64, &dst[1], &dstStride[1]);
+ convert_yuv420_nv12_chrome(&src[1], &srcStrides[1], 2, 64, dst[1], dstStride[1]);
}
// convert 10/16bit
else if ( buffer_format == AV_PIX_FMT_YUV420P10
|| buffer_format == AV_PIX_FMT_YUV420P16 )
{
- uint8_t bpp = buffer_format == AV_PIX_FMT_YUV420P10 ? 10 : 16;
+ const uint8_t bpp = buffer_format == AV_PIX_FMT_YUV420P10 ? 10 : 16;
Concurrency::parallel_invoke([&]() {
// copy Y
copy_plane(src[0], srcStrides[0], height, width, dst[0], dstStride[0], bpp);
}, [&]() {
// convert U+V -> UV
- convert_yuv420_p01x_chrome(&src[1], &srcStrides[1], height, width, &dst[1], &dstStride[1], bpp);
+ convert_yuv420_p01x_chrome(&src[1], &srcStrides[1], height, width, dst[1], dstStride[1], bpp);
});
// copy cache size of UV line again to fix Intel cache issue
// height multiplied by two because it will be divided by func
- convert_yuv420_p01x_chrome(&src[1], &srcStrides[1], 2, 32, &dst[1], &dstStride[1], bpp);
+ convert_yuv420_p01x_chrome(&src[1], &srcStrides[1], 2, 32, dst[1], dstStride[1], bpp);
}
return true;
}
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
index ed4fa1d7ce..f664200852 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
@@ -239,7 +239,7 @@ bool CWinRenderer::Configure(const VideoPicture &picture, float fps, unsigned fl
m_format = picture.videoBuffer->GetFormat();
if (m_format == AV_PIX_FMT_D3D11VA_VLD)
{
- DXVA::CDXVAOutputBuffer *dxvaBuf = dynamic_cast<DXVA::CDXVAOutputBuffer*>(picture.videoBuffer);
+ DXVA::CDXVAOutputBuffer *dxvaBuf = static_cast<DXVA::CDXVAOutputBuffer*>(picture.videoBuffer);
m_dxva_format = dxvaBuf->format;
}
diff --git a/xbmc/utils/win32/memcpy_sse2.h b/xbmc/utils/win32/memcpy_sse2.h
index 6760784804..12c05c0558 100644
--- a/xbmc/utils/win32/memcpy_sse2.h
+++ b/xbmc/utils/win32/memcpy_sse2.h
@@ -166,7 +166,7 @@ inline void copy_plane(uint8_t *const src, const int srcStride, int height, int
}
}
-inline void convert_yuv420_nv12_chrome(uint8_t *const *src, const int *srcStride, int height, int width, uint8_t *const *dst, const int *dstStride)
+inline void convert_yuv420_nv12_chrome(uint8_t *const *src, const int *srcStride, int height, int width, uint8_t *const dst, const int dstStride)
{
__m128i xmm0, xmm1, xmm2, xmm3, xmm4;
_mm_sfence();
@@ -179,7 +179,7 @@ inline void convert_yuv420_nv12_chrome(uint8_t *const *src, const int *srcStride
{
uint8_t * u = src[0] + line * srcStride[0];
uint8_t * v = src[1] + line * srcStride[1];
- uint8_t * d = dst[0] + line * dstStride[0];
+ uint8_t * d = dst + line * dstStride;
// if memory is not aligned use memcpy
if (((size_t)(u) | (size_t)(v) | (size_t)(d)) & 0xF)
@@ -238,7 +238,7 @@ inline void convert_yuv420_nv12_chrome(uint8_t *const *src, const int *srcStride
}
}
-inline void convert_yuv420_p01x_chrome(uint8_t *const *src, const int *srcStride, int height, int width, uint8_t *const *dst, const int *dstStride, uint8_t bpp)
+inline void convert_yuv420_p01x_chrome(uint8_t *const *src, const int *srcStride, int height, int width, uint8_t *const dst, const int dstStride, uint8_t bpp)
{
const uint8_t shift = 16 - bpp;
__m128i xmm0, xmm1, xmm2, xmm3, xmm4;
@@ -253,7 +253,7 @@ inline void convert_yuv420_p01x_chrome(uint8_t *const *src, const int *srcStride
{
uint16_t * u = (uint16_t*)(src[0] + line * srcStride[0]);
uint16_t * v = (uint16_t*)(src[1] + line * srcStride[1]);
- uint16_t * d = (uint16_t*)(dst[0] + line * dstStride[0]);
+ uint16_t * d = (uint16_t*)(dst + line * dstStride);
// if memory is not aligned use memcpy
if (((size_t)(u) | (size_t)(v) | (size_t)(d)) & 0xF)
@@ -301,7 +301,7 @@ inline void convert_yuv420_nv12(uint8_t *const src[], const int srcStride[], int
// Convert to NV12 - Luma
copy_plane(src[0], srcStride[0], height, width, dst[0], dstStride[0]);
// Convert to NV12 - Chroma
- convert_yuv420_nv12_chrome(&src[1], &srcStride[1], height, width, &dst[1], &dstStride[1]);
+ convert_yuv420_nv12_chrome(&src[1], &srcStride[1], height, width, dst[1], dstStride[1]);
}
inline void convert_yuv420_p01x(uint8_t *const src[], const int srcStride[], int height, int width, uint8_t *const dst[], const int dstStride[], uint8_t bpp)
@@ -309,5 +309,5 @@ inline void convert_yuv420_p01x(uint8_t *const src[], const int srcStride[], int
// Convert to P01x - Luma
copy_plane(src[0], srcStride[0], height, width, dst[0], dstStride[0], bpp);
// Convert to P01x - Chroma
- convert_yuv420_p01x_chrome(&src[1], &srcStride[1], height, width, &dst[1], &dstStride[1], bpp);
+ convert_yuv420_p01x_chrome(&src[1], &srcStride[1], height, width, dst[1], dstStride[1], bpp);
}