* limitations under the License.
*/
+#include <endian.h>
#include <string.h>
#include <audio_utils/channels.h>
#include "private/private.h"
* Converts a uint8x3_t into an int32_t
*/
inline int32_t uint8x3_to_int32(uint8x3_t val) {
-#ifdef HAVE_BIG_ENDIAN
+#if _BYTE_ORDER == _BIG_ENDIAN
int32_t temp = (val.c[0] << 24 | val.c[1] << 16 | val.c[2] << 8) >> 8;
#else
int32_t temp = (val.c[2] << 24 | val.c[1] << 16 | val.c[0] << 8) >> 8;
*/
inline uint8x3_t int32_to_uint8x3(int32_t in) {
uint8x3_t out;
-#ifdef HAVE_BIG_ENDIAN
+#if _BYTE_ORDER == _BIG_ENDIAN
out.c[2] = in;
out.c[1] = in >> 8;
out.c[0] = in >> 16;
* limitations under the License.
*/
+#include <endian.h>
#include <cutils/bitops.h> /* for popcount() */
#include <audio_utils/primitives.h>
#include "private/private.h"
void memcpy_to_i16_from_p24(int16_t *dst, const uint8_t *src, size_t count)
{
while (count--) {
-#ifdef HAVE_BIG_ENDIAN
+#if _BYTE_ORDER == _BIG_ENDIAN
*dst++ = src[1] | (src[0] << 8);
#else
*dst++ = src[1] | (src[2] << 8);
void memcpy_to_i32_from_p24(int32_t *dst, const uint8_t *src, size_t count)
{
while (count--) {
-#ifdef HAVE_BIG_ENDIAN
+#if _BYTE_ORDER == _BIG_ENDIAN
*dst++ = (src[2] << 8) | (src[1] << 16) | (src[0] << 24);
#else
*dst++ = (src[0] << 8) | (src[1] << 16) | (src[2] << 24);
void memcpy_to_p24_from_i16(uint8_t *dst, const int16_t *src, size_t count)
{
while (count--) {
-#ifdef HAVE_BIG_ENDIAN
+#if _BYTE_ORDER == _BIG_ENDIAN
*dst++ = *src >> 8;
*dst++ = *src++;
*dst++ = 0;
while (count--) {
int32_t ival = clamp24_from_float(*src++);
-#ifdef HAVE_BIG_ENDIAN
+#if _BYTE_ORDER == _BIG_ENDIAN
*dst++ = ival >> 16;
*dst++ = ival >> 8;
*dst++ = ival;
while (count--) {
int32_t ival = clamp24_from_q8_23(*src++);
-#ifdef HAVE_BIG_ENDIAN
+#if _BYTE_ORDER == _BIG_ENDIAN
*dst++ = ival >> 16;
*dst++ = ival >> 8;
*dst++ = ival;
while (count--) {
int32_t ival = *src++ >> 8;
-#ifdef HAVE_BIG_ENDIAN
+#if _BYTE_ORDER == _BIG_ENDIAN
*dst++ = ival >> 16;
*dst++ = ival >> 8;
*dst++ = ival;
void memcpy_to_q8_23_from_p24(int32_t *dst, const uint8_t *src, size_t count)
{
while (count--) {
-#ifdef HAVE_BIG_ENDIAN
+#if _BYTE_ORDER == _BIG_ENDIAN
*dst++ = (int8_t)src[0] << 16 | src[1] << 8 | src[2];
#else
*dst++ = (int8_t)src[2] << 16 | src[1] << 8 | src[0];