Commit 82867920 authored by Sébastien Toque's avatar Sébastien Toque
Browse files

I420->RGB : use chroma_neon.h + comment the C version of the converter (kept as a reference)

parent 956a498e
From d40d25b479e1975d86201b686b4ff2004f98b6a3 Mon Sep 17 00:00:00 2001
From 47101cb6e74e6cdfdb3ab3debb8cccafb93d6e93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-Philippe=20Andr=C3=A9?= <jpeg@videolan.org>
Date: Thu, 2 Jun 2011 15:15:57 +0200
Subject: [PATCH 1/5] Android: add compatibility pthread_cancel
Subject: [PATCH 1/6] Android: add compatibility pthread_cancel
Original-code: c1ee19f63a6c6773400e98a9265b0a7e49fd528c
7884ed8d407647a1523afb8be6a2859477d54fd7
......@@ -320,10 +320,10 @@ index 0000000..8a39f5d
+ return ret;
+}
diff --git a/configure.ac b/configure.ac
index b4fd802..9711ab6 100644
index 205501e..6f413fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -530,6 +530,10 @@ if test "${SYS}" = "mingw32" ; then
@@ -528,6 +528,10 @@ if test "${SYS}" = "mingw32" ; then
CFLAGS="${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
fi
......@@ -335,10 +335,10 @@ index b4fd802..9711ab6 100644
dnl Buggy glibc prevention. Purposedly not cached.
dnl See sourceware.org bugs 5058 and 5443.
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 9ad95f5..81a0d37 100644
index dee3dbd..bd711c6 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -338,6 +338,28 @@ long nrand48 (unsigned short subi[3]);
@@ -343,6 +343,28 @@ long nrand48 (unsigned short subi[3]);
# undef __cplusplus
# endif
char *tempnam(const char *, const char *);
......@@ -465,5 +465,5 @@ index 8e94ead..ed8dad5 100644
pthread_attr_destroy (attr);
return ret;
--
1.7.6
1.7.4.1
From 4d18397a90b164c986d702ee4490303ea4839a1d Mon Sep 17 00:00:00 2001
From 139e917595bf81ece7292d968372fb871d1f33da Mon Sep 17 00:00:00 2001
From: Dominique Martinet <asmadeus@codewreck.org>
Date: Thu, 2 Jun 2011 12:50:50 +0200
Subject: [PATCH 2/5] Android: use a custom poll(), fixes HTTP playback
Subject: [PATCH 2/6] Android: use a custom poll(), fixes HTTP playback
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
---
......@@ -10,10 +10,10 @@ Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2 files changed, 72 insertions(+), 1 deletions(-)
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 81a0d37..ed000ef 100644
index bd711c6..3ca0988 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -272,7 +272,7 @@ struct pollfd
@@ -277,7 +277,7 @@ struct pollfd
#endif
#ifndef HAVE_POLL
# define poll(a, b, c) vlc_poll(a, b, c)
......@@ -105,5 +105,5 @@ index 24335c2..aa2e260 100644
# include <vlc_network.h>
--
1.7.6
1.7.4.1
From 4d329f057fec7e5e8e990433ab5db4e55cdc5bbe Mon Sep 17 00:00:00 2001
From 054afb010cefa90f3ad8d50c23959be7375475b8 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Sun, 31 Jul 2011 00:20:40 +0200
Subject: [PATCH 3/5] Push messages to Android stack
Subject: [PATCH 3/6] Push messages to Android stack
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
---
......@@ -11,10 +11,10 @@ Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9711ab6..fe5fd35 100644
index 6f413fa..85e2a39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -532,6 +532,7 @@ fi
@@ -530,6 +530,7 @@ fi
if test "${HAVE_ANDROID}" = "1"; then
AC_REPLACE_FUNCS([pthread_cancel])
......@@ -93,5 +93,5 @@ index ed8dad5..5627f66 100644
fflush (stderr);
--
1.7.6
1.7.4.1
From dda28c9911381af863538f0f66b02ed871cca84e Mon Sep 17 00:00:00 2001
From 8f0b9e2db10319c82c5b6595f96c6768b9627ca7 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Kempf <jb@videolan.org>
Date: Sun, 31 Jul 2011 00:05:21 +0200
Subject: [PATCH 4/5] Old contribs: compile live on Android
Subject: [PATCH 4/6] Old contribs: compile live on Android
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
---
......@@ -86,5 +86,5 @@ index f203895..23252d0 100644
LIVE_TARGET-$(ENABLED) = linux
LIVE_TARGET-$(HAVE_WIN32) = mingw
--
1.7.6
1.7.4.1
From 34b5ba6d908a1f2f3a83f421c96d3bf561c3cee5 Mon Sep 17 00:00:00 2001
From 67d037e3d1c3fc06edd651ba4738d68a9b5d2b72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Toque?= <xilasz@gmail.com>
Date: Thu, 1 Sep 2011 01:09:44 +0200
Subject: [PATCH 5/5] i420->RGB convertor in NEON
Date: Mon, 5 Sep 2011 22:25:10 +0200
Subject: [PATCH 5/6] i420->RGB convertor in NEON
---
modules/arm_neon/Modules.am | 8 ++
modules/arm_neon/i420_rgb.S | 205 +++++++++++++++++++++++++++++++++++++++++++
modules/arm_neon/i420_rgb.c | 167 +++++++++++++++++++++++++++++++++++
3 files changed, 380 insertions(+), 0 deletions(-)
modules/arm_neon/Modules.am | 8 ++
modules/arm_neon/chroma_neon.h | 4 +
modules/arm_neon/i420_rgb.S | 206 ++++++++++++++++++++++++++++++++++++++++
modules/arm_neon/i420_rgb.c | 147 ++++++++++++++++++++++++++++
4 files changed, 365 insertions(+), 0 deletions(-)
create mode 100644 modules/arm_neon/i420_rgb.S
create mode 100644 modules/arm_neon/i420_rgb.c
......@@ -31,16 +32,29 @@ index 83576eb..61c7703 100644
libchroma_yuv_neon_plugin.la \
+ libi420_rgb_neon_plugin.la \
$(NULL)
diff --git a/modules/arm_neon/chroma_neon.h b/modules/arm_neon/chroma_neon.h
index 204c5f1..81de86a 100644
--- a/modules/arm_neon/chroma_neon.h
+++ b/modules/arm_neon/chroma_neon.h
@@ -64,3 +64,7 @@ void yuyv_i422_neon (struct yuv_planes *const out,
/* UYVY to I422 conversion. */
void uyvy_i422_neon (struct yuv_planes *const out,
const struct yuv_pack *const in, int width, int height);
+
+/* I420 to YUYV conversion. */
+void i420_rgb_neon (struct yuv_pack *const out,
+ const struct yuv_planes *const in, int width, int height);
diff --git a/modules/arm_neon/i420_rgb.S b/modules/arm_neon/i420_rgb.S
new file mode 100644
index 0000000..0532cce
index 0000000..38ba599
--- /dev/null
+++ b/modules/arm_neon/i420_rgb.S
@@ -0,0 +1,205 @@
@@ -0,0 +1,206 @@
+ @*****************************************************************************
+ @ i420_rgb.S : ARM NEONv1 I420 to RGB chroma conversion
+ @*****************************************************************************
+ @ Copyright (C) 2011 Sébastien Toque
+ @ Rémi Denis-Courmont
+ @
+ @ This program is free software; you can redistribute it and/or modify
+ @ it under the terms of the GNU General Public License as published by
......@@ -244,14 +258,15 @@ index 0000000..0532cce
+ b loop_row
diff --git a/modules/arm_neon/i420_rgb.c b/modules/arm_neon/i420_rgb.c
new file mode 100644
index 0000000..ab92cfc
index 0000000..b0b0334
--- /dev/null
+++ b/modules/arm_neon/i420_rgb.c
@@ -0,0 +1,167 @@
@@ -0,0 +1,147 @@
+/*****************************************************************************
+ * i420_rgb.c : ARM NEONv1 YUV 4:2:0 to RGB32 chroma conversion for VLC
+ *****************************************************************************
+ * Copyright (C) 2011 Sébastien Toque
+ * Rémi Denis-Courmont
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
......@@ -276,6 +291,7 @@ index 0000000..ab92cfc
+#include <vlc_plugin.h>
+#include <vlc_filter.h>
+#include <vlc_cpu.h>
+#include "chroma_neon.h"
+
+static int Open (vlc_object_t *);
+
......@@ -285,36 +301,14 @@ index 0000000..ab92cfc
+ set_callbacks (Open, NULL)
+vlc_module_end ()
+
+/*
+static int CoefY[256];
+static int CoefRV[256];
+static int CoefGU[256];
+static int CoefGV[256];
+static int CoefBU[256];
+
+/* Planes must start on a 16-bytes boundary. Pitches must be multiples of 16
+ * bytes even for subsampled components. */
+
+/* Planar picture buffer.
+ * Pitch corresponds to luminance component in bytes. Chrominance pitches are
+ * inferred from the color subsampling ratio. */
+struct yuv_planes
+{
+ void *y, *u, *v;
+ size_t pitch;
+};
+
+/* Packed picture buffer. Pitch is in bytes (_not_ pixels). */
+struct yuv_pack
+{
+ void *yuv;
+ size_t pitch;
+};
+
+/* I420 to YUYV conversion. */
+void i420_rgb_neon (struct yuv_pack *const out,
+ const struct yuv_planes *const in,
+ int width, int height);
+
+// C reference version of the converter
+static void I420_RGBA_C (filter_t *filter, picture_t *src, picture_t *dst)
+{
+ const uint8_t *const out = dst->p->p_pixels;
......@@ -357,7 +351,7 @@ index 0000000..ab92cfc
+ ((uint32_t*)out)[d + i] = R | (G<<8) | (B<<16);
+ }
+ }
+}
+}*/
+
+static void I420_RGBA (filter_t *filter, picture_t *src, picture_t *dst)
+{
......@@ -394,8 +388,8 @@ index 0000000..ab92cfc
+ return VLC_EGENERIC;
+ }
+
+ //precompute some values
+ const int coefY = (int)(1.164 * 32768 + 0.5);
+ //precompute some values for the C version
+ /*const int coefY = (int)(1.164 * 32768 + 0.5);
+ const int coefRV = (int)(1.793 * 32768 + 0.5);
+ const int coefGU = (int)(0.213 * 32768 + 0.5);
+ const int coefGV = (int)(0.533 * 32768 + 0.5);
......@@ -407,7 +401,7 @@ index 0000000..ab92cfc
+ CoefGU[i] = -coefGU*(i-128);
+ CoefGV[i] = -coefGV*(i-128);
+ CoefBU[i] = coefBU*(i-128);
+ }
+ }*/
+
+ msg_Dbg(filter, "%4.4s(%dx%d) to %4.4s(%dx%d)",
+ (char*)&filter->fmt_in.video.i_chroma, filter->fmt_in.video.i_width, filter->fmt_in.video.i_height,
......@@ -416,5 +410,5 @@ index 0000000..ab92cfc
+ return VLC_SUCCESS;
+}
--
1.7.6
1.7.4.1
From 9d40b7c46afdf7a1f8cbf57d838f6f5706384836 Mon Sep 17 00:00:00 2001
From 7962bff5eb8d3d54abdfcb554284e9654ce1f839 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Duraffort?= <ivoire@videolan.org>
Date: Sun, 7 Nov 2010 19:11:51 +0100
Subject: [PATCH 6/6] Implement rw_locks.
......@@ -140,5 +140,5 @@ index 5627f66..38d998c 100644
/**
* Allocates a thread-specific variable.
--
1.7.5.4
1.7.4.1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment