chromium/third_party/libaom/source/libaom/aom_ports/mem_ops_aligned.h

/*
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
 *
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
 */

#ifndef AOM_AOM_PORTS_MEM_OPS_ALIGNED_H_
#define AOM_AOM_PORTS_MEM_OPS_ALIGNED_H_

#include "aom/aom_integer.h"

/* \file
 * \brief Provides portable memory access primitives for operating on aligned
 *        data
 *
 * This file is split from mem_ops.h for easier maintenance. See mem_ops.h
 * for a more detailed description of these primitives.
 */
#ifndef INCLUDED_BY_MEM_OPS_H
#error Include mem_ops.h, not mem_ops_aligned.h directly.
#endif

/* Architectures that provide instructions for doing this byte swapping
 * could redefine these macros.
 */
#define swap_endian_16
#define swap_endian_32
#define swap_endian_16_se
#define swap_endian_32_se

#define mem_get_ne_aligned_generic

#define mem_get_sne_aligned_generic

#define mem_get_se_aligned_generic

#define mem_get_sse_aligned_generic

#define mem_put_ne_aligned_generic

#define mem_put_se_aligned_generic

#include "config/aom_config.h"

#if CONFIG_BIG_ENDIAN
#define mem_get_be_aligned_generic
#define mem_get_sbe_aligned_generic
#define mem_get_le_aligned_generic
#define mem_get_sle_aligned_generic
#define mem_put_be_aligned_generic
#define mem_put_le_aligned_generic
#else
#define mem_get_be_aligned_generic(sz)
#define mem_get_sbe_aligned_generic(sz)
#define mem_get_le_aligned_generic(sz)
#define mem_get_sle_aligned_generic(sz)
#define mem_put_be_aligned_generic(sz)
#define mem_put_le_aligned_generic(sz)
#endif

/* clang-format off */
#undef  mem_get_be16_aligned
#define mem_get_be16_aligned
mem_get_be_aligned_generic()

#undef  mem_get_be32_aligned
#define mem_get_be32_aligned
mem_get_be_aligned_generic()

#undef  mem_get_le16_aligned
#define mem_get_le16_aligned
mem_get_le_aligned_generic()

#undef  mem_get_le32_aligned
#define mem_get_le32_aligned
mem_get_le_aligned_generic()

#undef  mem_get_sbe16_aligned
#define mem_get_sbe16_aligned
mem_get_sbe_aligned_generic()

#undef  mem_get_sbe32_aligned
#define mem_get_sbe32_aligned
mem_get_sbe_aligned_generic()

#undef  mem_get_sle16_aligned
#define mem_get_sle16_aligned
mem_get_sle_aligned_generic()

#undef  mem_get_sle32_aligned
#define mem_get_sle32_aligned
mem_get_sle_aligned_generic()

#undef  mem_put_be16_aligned
#define mem_put_be16_aligned
mem_put_be_aligned_generic()

#undef  mem_put_be32_aligned
#define mem_put_be32_aligned
mem_put_be_aligned_generic()

#undef  mem_put_le16_aligned
#define mem_put_le16_aligned
mem_put_le_aligned_generic()

#undef  mem_put_le32_aligned
#define mem_put_le32_aligned
mem_put_le_aligned_generic()

#undef mem_get_ne_aligned_generic
#undef mem_get_se_aligned_generic
#undef mem_get_sne_aligned_generic
#undef mem_get_sse_aligned_generic
#undef mem_put_ne_aligned_generic
#undef mem_put_se_aligned_generic
#undef swap_endian_16
#undef swap_endian_32
#undef swap_endian_16_se
#undef swap_endian_32_se
/* clang-format on */

#endif  // AOM_AOM_PORTS_MEM_OPS_ALIGNED_H_