common_dspr2.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VPX_VPX_DSP_MIPS_COMMON_DSPR2_H_
  11. #define VPX_VPX_DSP_MIPS_COMMON_DSPR2_H_
  12. #include <assert.h>
  13. #include "./vpx_config.h"
  14. #include "vpx/vpx_integer.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #if HAVE_DSPR2
  19. #define CROP_WIDTH 512
  20. extern uint8_t *vpx_ff_cropTbl; // From "vpx_dsp/mips/intrapred4_dspr2.c"
  21. static INLINE void prefetch_load(const unsigned char *src) {
  22. __asm__ __volatile__("pref 0, 0(%[src]) \n\t" : : [src] "r"(src));
  23. }
  24. /* prefetch data for store */
  25. static INLINE void prefetch_store(unsigned char *dst) {
  26. __asm__ __volatile__("pref 1, 0(%[dst]) \n\t" : : [dst] "r"(dst));
  27. }
  28. static INLINE void prefetch_load_streamed(const unsigned char *src) {
  29. __asm__ __volatile__("pref 4, 0(%[src]) \n\t" : : [src] "r"(src));
  30. }
  31. /* prefetch data for store */
  32. static INLINE void prefetch_store_streamed(unsigned char *dst) {
  33. __asm__ __volatile__("pref 5, 0(%[dst]) \n\t" : : [dst] "r"(dst));
  34. }
  35. #endif // #if HAVE_DSPR2
  36. #ifdef __cplusplus
  37. } // extern "C"
  38. #endif
  39. #endif // VPX_VPX_DSP_MIPS_COMMON_DSPR2_H_