stagefright aacenc/amrwbenc: Remove trailing whitespace

This was applied in AOSP master earlier, in commit
b21611e5b0f1797e39e781d91ade023bac87637f, but when merged
into the Google internal tree in
88c2d4d26d79384f32a25bd775cf873cb678b12a, none of these
changes have been brought in. (The diff of this merge commit
and its first parent, d94b71d, is empty.)

Therefore, reapply the rest of these changes on the files
that still are present in the current version.

Change-Id: I645a9b9134769958a11808a06163123d28d83e46
stagefright aacenc: Simplify the definition of __inline

This reduces the amount of ifdefs needed, into something that
works on both gcc and MSVC. This removes one occurrance of the
LINUX ifdef, simplifying compiling on various platforms.

Change-Id: I1e2af6c2517410dc280197ba922df877cf7afbd5
stagefright aacenc: Add missing newlines at the end of files

This avoids compiler warnings about missing newlines.

Change-Id: Ieb2bb7152d794dca47c629588879032d3ba65677
stagefright aacenc: Make the bits to write in WriteBits unsigned

They shouldn't, as far as I know, ever be a signed value.

Change-Id: I64429c7c0b2b52bec768a04d3c3eb0eb252955fa
stagefright amrwbenc: Make the mem_malloc function 64-bit safe

Change-Id: Iab0dbfdc6be09c62d353bee46596635686b784a6
stagefright aacenc: Don't address a Word32 with a Word16 pointer

Currently, a pointer to a Word32 is used as a pointer to Word16, which
doesn't work as intended on big endian architectures.

This change needs to be analyzed and tested properly so that it doesn't
cause issues with overflows in these variables. Another solution would be
to change all the scf arrays to 32 bit instead.

Change-Id: I53d9eb83bdaf8d3b1530eb5064dd10b08bce737a
stagefright aacenc: Fix type definitions for 64 bit platforms

Also don't require LINUX to be defined, enable the MSVC typedefs
only within _MSC_VER.

This fixes a lot of warnings about dereferencing pointer 'winPtr'
breaking strict aliasing rules.

Change-Id: I4afbe0ed81295ebe6e5ee2c7f0fb0cc2dc83c89b
stagefright aacenc: Fix inline asm constraints

Output-only parameters should use =r or =&r constrains, never +r.

This fixes a lot of warnings about the variable 'result' being
used uninitialized.

Change-Id: Ie689fce8c6ecd874d4fc66e87687c67551d9ab6a
stagefright aacenc: Fix inline asm

- don't write input-only registers
- use temp variables instead of hardcoded regs
- don't build constants manually, specify as asm inputs
- remove unnecessary volatile qualifiers

Change-Id: I3b9bb2d30768bcf409dc478bde4489135eeb50d7
stagefright aacenc: Use ARMv6 SSAT instruction

Change-Id: I652eaaa54e7766d9dca80fd8cc156ca481359471
stagefright aacenc: Remove useless inline asm for simple right shift

Change-Id: If1f40e9c16952182e974af1c86a14995259c2ade
stagefright aacenc: Use QDADD/QDSUB instructions

Change-Id: I46c81dba0486d515f1f2b89a13fae27f6ab1e122
stagefright aacenc: Fix an inline asm constraint

Output-only parameters should use =r or =&r constrains, never +r.

This avoids a warning about the variable 'result' being used
uninitialized.

This avoids loading the uninitialized value into the register,
before it is overwritten by the multiplication.

Change-Id: I0ef6179e133c35d290feb8e12bea180ecae11a05
stagefright aacenc: Properly terminate a comment

This avoids a warning about /* within a comment.

Change-Id: I9079909734d35db5ab0fd54b46173d7a1848d0c9
stagefright aacenc: Add const declarations to some pointers

This avoids some compilation warnings.

Change-Id: Ia89ab94020a9f1ee4c1df48823fb89325cca7d36
stagefright amrwbenc: Remove a useless check

Since the Length field is unsigned, the comparison will always
be false. The corresponding code in the aac encoder doesn't have
any check for Length.

This avoids a warning about comparison always being false.

Change-Id: I57c28ff9d09cb9ac4effeaeb40db608ab976acc6
stagefright amrwbenc: Change keyword ordering

This avoids warnings about 'static' not being at the beginning
of the declarations.

Change-Id: I80f91b8a0f7f61edcdca96c206fedbd74ec0d88e
stagefright aacenc: Add prototypes for arm specific implementations of functions

The arm specific functions are implemented in .s files,
without any function declarations in headers.

This fixes compiler warnings about implicit declarations
of these functions.

Change-Id: I1512560b6740c1879f378886e05aaad2e3a6c869
stagefright aacenc: Remove a stray semicolon

This avoids warnings about an empty body in an if statement.

mem_free does the same null check, so the accidental extra
semicolon was harmless, and the whole if statement actually
is needless. But if removing the if statements, all the
other ones should be removed too, for consistency.
(This could be done as a separate change).

Change-Id: I1b6064dedd15ffa949043bb5396148aaed9b43f6
stagefright amrwb: Change a C++ style cast into a C style cast

This fixes compilation as C - while the source files are named
.cpp, they actually are compileable as pure C (except for this
cast).

This was committed on the master branch of the opencore
repository in commit ae27d9b2ef68c4e6fc383a8cab93d6baa235ff6b,
based on AOSP contribution 10014.

Change-Id: I4f533313be041ad3e0a03ffc5f4207480894ddd1