summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/avc/enc/src
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2012-04-13 14:23:26 +0300
committerMartin Storsjo <martin@martin.st>2012-07-10 14:16:02 +0300
commitf5af6314db25ff3bef9bd2eeba201bc6cc60805d (patch)
tree85b8a3ecc385390a00e1709092de6873725cc7dc /media/libstagefright/codecs/avc/enc/src
parentffb829430ff20ccd6c13e6ed894f2373b2d93939 (diff)
downloadframeworks_av-f5af6314db25ff3bef9bd2eeba201bc6cc60805d.zip
frameworks_av-f5af6314db25ff3bef9bd2eeba201bc6cc60805d.tar.gz
frameworks_av-f5af6314db25ff3bef9bd2eeba201bc6cc60805d.tar.bz2
avcenc: Clarify the ifdefs surrounding inline assembly
Previously, the code was structured like this: #if defined(__GNUC__) && defined(__arm__) /* Generic C implementation */ #elif defined(__CC_ARM) /* RVCT version */ #elif defined(__GNUC__) && defined(__arm__) /* GCC arm assembly version */ #endif This had two implications - the gcc arm version never was used in practice, and the code required -D__arm__ to build at all for other architectures. The inline assembly constraints are buggy (requires changes so as to not crash), and if fixed, the optimizations still aren't faster than the generic C code on modern gcc versions. Therefore, just ignore them and use the generic C code. Due to the peculiar code block ordering and preprocessor conditions, the generic C code is what has been used before anyway, but it did require -D__arm__ to build, which can cause problems if building for other architectures, if the system headers have ifdefs for this define. This change makes it build without that define. Change-Id: Ib3fcf5651ee720310b7dff10fd04279b5f90759c
Diffstat (limited to 'media/libstagefright/codecs/avc/enc/src')
-rw-r--r--media/libstagefright/codecs/avc/enc/src/sad_halfpel_inline.h5
-rw-r--r--media/libstagefright/codecs/avc/enc/src/sad_inline.h5
-rw-r--r--media/libstagefright/codecs/avc/enc/src/sad_mb_offset.h5
3 files changed, 12 insertions, 3 deletions
diff --git a/media/libstagefright/codecs/avc/enc/src/sad_halfpel_inline.h b/media/libstagefright/codecs/avc/enc/src/sad_halfpel_inline.h
index 3a21647..bb4a510 100644
--- a/media/libstagefright/codecs/avc/enc/src/sad_halfpel_inline.h
+++ b/media/libstagefright/codecs/avc/enc/src/sad_halfpel_inline.h
@@ -24,7 +24,10 @@ extern "C"
{
#endif
-#if defined(__GNUC__) && defined(__arm__) /* ARM GNU COMPILER */
+/* Intentionally not using the gcc asm version, since it (if fixed so
+ * as to not crash - the current register constraints are faulty) is
+ * slightly slower than the plain C version on modern GCC versions. */
+#if !defined(__CC_ARM) /* Generic C version */
__inline int32 INTERP1_SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
{
diff --git a/media/libstagefright/codecs/avc/enc/src/sad_inline.h b/media/libstagefright/codecs/avc/enc/src/sad_inline.h
index 3f18483..f6c3554 100644
--- a/media/libstagefright/codecs/avc/enc/src/sad_inline.h
+++ b/media/libstagefright/codecs/avc/enc/src/sad_inline.h
@@ -23,7 +23,10 @@ extern "C"
{
#endif
-#if defined(__GNUC__) && defined(__arm__) /* ARM GNU COMPILER */
+/* Intentionally not using the gcc asm version, since it (if fixed so
+ * as to not crash - the current register constraints are faulty) is
+ * slightly slower than the plain C version on modern GCC versions. */
+#if !defined(__CC_ARM) /* Generic C version */
__inline int32 SUB_SAD(int32 sad, int32 tmp, int32 tmp2)
{
diff --git a/media/libstagefright/codecs/avc/enc/src/sad_mb_offset.h b/media/libstagefright/codecs/avc/enc/src/sad_mb_offset.h
index d5d4a42..88ff164 100644
--- a/media/libstagefright/codecs/avc/enc/src/sad_mb_offset.h
+++ b/media/libstagefright/codecs/avc/enc/src/sad_mb_offset.h
@@ -16,7 +16,10 @@
* -------------------------------------------------------------------
*/
-#if defined(__GNUC__) && defined(__arm__) /* ARM GNU COMPILER */
+/* Intentionally not using the gcc asm version, since it (if fixed so
+ * as to not crash - the current register constraints are faulty) is
+ * slightly slower than the plain C version on modern GCC versions. */
+#if !defined(__CC_ARM) /* Generic C version */
#if (NUMBER==3)
__inline int32 sad_mb_offset3(uint8 *ref, uint8 *blk, int lx, int dmin)