[vlc-commits] copy: fix download from VA surface with odd sizes.

Gwenole Beauchesne git at videolan.org
Wed Apr 30 17:41:37 CEST 2014


vlc | branch: master | Gwenole Beauchesne <gwenole.beauchesne at intel.com> | Tue Apr  8 18:55:22 2014 +0200| [5e4ff1146df7fb3dd18eb0ffd73381f58a9212e2] | committer: Jean-Baptiste Kempf

copy: fix download from VA surface with odd sizes.

Fix download from Uncacheable Speculative Write Combining (USWC) memory,
e.g. VA surfaces, when the dimensions are odd. In particular, make sure
to get the very last chroma component for each row.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

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

diff --git a/modules/video_chroma/copy.c b/modules/video_chroma/copy.c
index 9eed17f..d29843c 100644
--- a/modules/video_chroma/copy.c
+++ b/modules/video_chroma/copy.c
@@ -325,7 +325,7 @@ static void SSE_CopyFromNv12(picture_t *dst,
                     dst->p[1].p_pixels, dst->p[1].i_pitch,
                     src[1], src_pitch[1],
                     cache->buffer, cache->size,
-                    width/2, height/2, cpu);
+                    (width+1)/2, (height+1)/2, cpu);
     asm volatile ("emms");
 }
 
@@ -339,7 +339,7 @@ static void SSE_CopyFromYv12(picture_t *dst,
         SSE_CopyPlane(dst->p[n].p_pixels, dst->p[n].i_pitch,
                       src[n], src_pitch[n],
                       cache->buffer, cache->size,
-                      width/d, height/d, cpu);
+                      (width+d-1)/d, (height+d-1)/d, cpu);
     }
     asm volatile ("emms");
 }



More information about the vlc-commits mailing list