vputypes.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Copyright (c) 2019, Chips&Media
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright notice, this
  9. * list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright notice,
  11. * this list of conditions and the following disclaimer in the documentation
  12. * and/or other materials provided with the distribution.
  13. *
  14. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  18. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  21. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef _VPU_TYPES_H_
  26. #define _VPU_TYPES_H_
  27. #include <stdint.h>
  28. #ifdef USE_FEEDING_METHOD_BUFFER
  29. #include "wave511/vpuapi/vputypes.h"
  30. #else
  31. #include "vputypes.h"
  32. #endif
  33. #define STATIC static
  34. /**
  35. * @brief This type is an 8-bit unsigned integral type, which is used for declaring pixel data.
  36. */
  37. typedef uint8_t Uint8;
  38. /**
  39. * @brief This type is a 32-bit unsigned integral type, which is used for declaring variables with wide ranges and no signs such as size of buffer.
  40. */
  41. typedef uint32_t Uint32;
  42. /**
  43. * @brief This type is a 16-bit unsigned integral type.
  44. */
  45. typedef uint16_t Uint16;
  46. /**
  47. * @brief This type is an 8-bit signed integral type.
  48. */
  49. typedef int8_t Int8;
  50. /**
  51. * @brief This type is a 32-bit signed integral type.
  52. */
  53. typedef int32_t Int32;
  54. /**
  55. * @brief This type is a 16-bit signed integral type.
  56. */
  57. typedef int16_t Int16;
  58. #if defined(_MSC_VER)
  59. typedef unsigned __int64 Uint64;
  60. typedef __int64 Int64;
  61. #else
  62. typedef uint64_t Uint64;
  63. typedef int64_t Int64;
  64. #endif
  65. #ifndef PhysicalAddress
  66. /**
  67. * @brief This is a type for representing physical addresses which are recognizable by VPU.
  68. In general, VPU hardware does not know about virtual address space
  69. which is set and handled by host processor. All these virtual addresses are
  70. translated into physical addresses by Memory Management Unit.
  71. All data buffer addresses such as stream buffer and frame buffer should be given to
  72. VPU as an address on physical address space.
  73. */
  74. #ifdef SUPPORT_64BIT_MEM_ADDR
  75. typedef Uint64 PhysicalAddress;
  76. #else
  77. typedef Uint32 PhysicalAddress;
  78. #endif
  79. #endif
  80. #ifndef BYTE
  81. /**
  82. * @brief This type is an 8-bit unsigned integral type.
  83. */
  84. typedef unsigned char BYTE;
  85. #endif
  86. #ifndef BOOL
  87. typedef int BOOL;
  88. #endif
  89. #ifndef TRUE
  90. #define TRUE 1
  91. #endif /* TRUE */
  92. #ifndef FALSE
  93. #define FALSE 0
  94. #endif /* FALSE */
  95. #ifndef NULL
  96. #define NULL 0
  97. #endif
  98. #ifndef UNREFERENCED_PARAMETER
  99. #define UNREFERENCED_PARAMETER(P) \
  100. /*lint -save -e527 -e530 */ \
  101. { \
  102. (P) = (P); \
  103. } \
  104. /*lint -restore */
  105. #endif
  106. #ifdef __GNUC__
  107. #define UNREFERENCED_FUNCTION __attribute__ ((unused))
  108. #else
  109. #define UNREFERENCED_FUNCTION
  110. #endif
  111. #endif /* _VPU_TYPES_H_ */