]> git.sesse.net Git - vlc/commitdiff
copy: fix download from VA surface with odd sizes.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 8 Apr 2014 16:55:22 +0000 (18:55 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 30 Apr 2014 15:38:51 +0000 (17:38 +0200)
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@intel.com>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/video_chroma/copy.c

index 9eed17f7d72fcb9e163244f9c43c3afe69558eb3..d29843c037e494170f0d6bc976bea8439dd6115b 100644 (file)
@@ -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");
 }