[vlc-commits] aom: use plane_CopyPixels to copy pixels

Steve Lhomme git at videolan.org
Wed Sep 12 11:40:00 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Sep 12 11:34:25 2018 +0200| [7b866338ae908010824852310509638bf3a58a12] | committer: Steve Lhomme

aom: use plane_CopyPixels to copy pixels

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

 modules/codec/aom.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/modules/codec/aom.c b/modules/codec/aom.c
index 2ee937d4f3..5bd40b1bc0 100644
--- a/modules/codec/aom.c
+++ b/modules/codec/aom.c
@@ -157,17 +157,10 @@ static vlc_fourcc_t FindVlcChroma( struct aom_image *img )
 static void CopyPicture(const struct aom_image *img, picture_t *pic)
 {
     for (int plane = 0; plane < pic->i_planes; plane++ ) {
-        uint8_t *src = img->planes[plane];
-        uint8_t *dst = pic->p[plane].p_pixels;
-        int src_stride = img->stride[plane];
-        int dst_stride = pic->p[plane].i_pitch;
-
-        int size = __MIN( src_stride, dst_stride );
-        for( int line = 0; line < pic->p[plane].i_visible_lines; line++ ) {
-            memcpy( dst, src, size );
-            src += src_stride;
-            dst += dst_stride;
-        }
+        plane_t src_plane = pic->p[plane];
+        src_plane.p_pixels = img->planes[plane];
+        src_plane.i_pitch = img->stride[plane];
+        plane_CopyPixels(&pic->p[plane], &src_plane);
     }
 }
 



More information about the vlc-commits mailing list