[vlc-commits] copy: fix the cache copy size

Quentin Chateau git at videolan.org
Fri Mar 8 20:34:10 CET 2019


vlc/vlc-3.0 | branch: master | Quentin Chateau <quentin.chateau at gmail.com> | Fri Mar  1 23:36:00 2019 +0100| [f2af75bc23292c4d2ae9f0b8f1fbbcc71a984e17] | committer: Jean-Baptiste Kempf

copy: fix the cache copy size

This fixes a regression from 09d421a20851e1c49aa98e117957dd118620fae4

Signed-off-by: Thomas Guillem <thomas at gllm.fr>
(cherry picked from commit 051a97edb978baa7eed41f06258069c1378ea790)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f2af75bc23292c4d2ae9f0b8f1fbbcc71a984e17
---

 modules/video_chroma/copy.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/video_chroma/copy.c b/modules/video_chroma/copy.c
index 2baf076d53..2b3a49a034 100644
--- a/modules/video_chroma/copy.c
+++ b/modules/video_chroma/copy.c
@@ -469,7 +469,7 @@ static void SSE_CopyPlane(uint8_t *dst, size_t dst_pitch,
     const size_t copy_pitch = __MIN(src_pitch, dst_pitch);
     const unsigned w16 = (copy_pitch+15) & ~15;
     const unsigned hstep = cache_size / w16;
-    const unsigned cache_width = __MIN(src_pitch, hstep);
+    const unsigned cache_width = __MIN(src_pitch, cache_size);
     assert(hstep > 0);
 
     /* If SSE4.1: CopyFromUswc is faster than memcpy */
@@ -502,8 +502,8 @@ SSE_InterleavePlanes(uint8_t *dst, size_t dst_pitch,
     size_t copy_pitch = __MIN(dst_pitch / 2, srcu_pitch);
     unsigned int const  w16 = (srcu_pitch+15) & ~15;
     unsigned int const  hstep = (cache_size) / (2*w16);
-    const unsigned cacheu_width = __MIN(srcu_pitch, hstep);
-    const unsigned cachev_width = __MIN(srcv_pitch, hstep);
+    const unsigned cacheu_width = __MIN(srcu_pitch, cache_size);
+    const unsigned cachev_width = __MIN(srcv_pitch, cache_size);
     assert(hstep > 0);
 
     for (unsigned int y = 0; y < height; y += hstep)
@@ -536,7 +536,7 @@ static void SSE_SplitPlanes(uint8_t *dstu, size_t dstu_pitch,
     size_t copy_pitch = __MIN(__MIN(src_pitch / 2, dstu_pitch), dstv_pitch);
     const unsigned w16 = (src_pitch+15) & ~15;
     const unsigned hstep = cache_size / w16;
-    const unsigned cache_width = __MIN(src_pitch, hstep);
+    const unsigned cache_width = __MIN(src_pitch, cache_size);
     assert(hstep > 0);
 
     for (unsigned y = 0; y < height; y += hstep) {



More information about the vlc-commits mailing list