diff options
author | Anton Fedchin <anightik@gmail.com> | 2017-07-21 12:17:28 +0300 |
---|---|---|
committer | Anton Fedchin <anightik@gmail.com> | 2017-07-23 14:21:29 +0300 |
commit | ee4e709e5208c7d4f15b559914559ee56910524b (patch) | |
tree | 20a5c02d75bc4e332b3384cde599a92818523d2b | |
parent | dd1d0477ab726f55583fc0286f6afb2b0ae17e5a (diff) |
[VideoPlayer] WinRenderBuffer: cosmetics.
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp | 14 | ||||
-rw-r--r-- | xbmc/utils/win32/memcpy_sse2.h | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp index 4b0d18f4d7..fd7504f419 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp @@ -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/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); } |