Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5af6314 authored by Martin Storsjo's avatar Martin Storsjo
Browse files

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
parent ffb82943
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ LOCAL_C_INCLUDES := \
    $(TOP)/frameworks/native/include/media/openmax

LOCAL_CFLAGS := \
    -D__arm__ \
    -DOSCL_IMPORT_REF= -DOSCL_UNUSED_ARG= -DOSCL_EXPORT_REF=

include $(BUILD_STATIC_LIBRARY)
+4 −1
Original line number Diff line number Diff line
@@ -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)
    {
+4 −1
Original line number Diff line number Diff line
@@ -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)
    {
+4 −1
Original line number Diff line number Diff line
@@ -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)