]> git.sesse.net Git - vlc/blobdiff - modules/arm_neon/i420_yuy2.c
smem: Allow usage of RGBA
[vlc] / modules / arm_neon / i420_yuy2.c
index ae5d60be73915a7927f964e056bc1e5bdcfaaaa3..6b73c7ad8b682575aa4f5aefe3ee19e154787c8e 100644 (file)
@@ -33,33 +33,35 @@ vlc_module_begin ()
     set_description (N_("ARM NEON video chroma conversions"))
     set_capability ("video filter2", 250)
     set_callbacks (Open, NULL)
-    add_requirement (NEON)
 vlc_module_end ()
 
 void i420_yuyv_neon (uint8_t *out, const uint8_t **in,
-                     uintptr_t pitch, uintptr_t height);
+                     unsigned int pitch, unsigned int s_off,
+                     unsigned int height);
 
 static void I420_YUYV (filter_t *filter, picture_t *src, picture_t *dst)
 {
     uint8_t *out = dst->p->p_pixels;
     const uint8_t *yuv[3] = { src->Y_PIXELS, src->U_PIXELS, src->V_PIXELS, };
-    size_t pitch = (filter->fmt_in.video.i_width + 15) & ~15;
     size_t height = filter->fmt_in.video.i_height;
+    int i_pitch = (dst->p->i_pitch >> 1) & ~0xF;
+    int s_offset = src->p->i_pitch - i_pitch;
 
-    i420_yuyv_neon (out, yuv, pitch, height);
+    i420_yuyv_neon (out, yuv, i_pitch, s_offset, height);
 }
 
 void i420_uyvy_neon (uint8_t *out, const uint8_t **in,
-                     uintptr_t pitch, uintptr_t height);
+                     uintptr_t pitch, uintptr_t s_off, uintptr_t height);
 
 static void I420_UYVY (filter_t *filter, picture_t *src, picture_t *dst)
 {
     uint8_t *out = dst->p->p_pixels;
     const uint8_t *yuv[3] = { src->Y_PIXELS, src->U_PIXELS, src->V_PIXELS, };
-    size_t pitch = (filter->fmt_in.video.i_width + 15) & ~15;
     size_t height = filter->fmt_in.video.i_height;
+    int i_pitch = (dst->p->i_pitch >> 1) & ~0xF;
+    int s_offset = src->p->i_pitch - i_pitch;
 
-    i420_yuyv_neon (out, yuv, pitch, height);
+    i420_uyvy_neon (out, yuv, i_pitch, s_offset, height);
 }
 
 VIDEO_FILTER_WRAPPER (I420_YUYV)