interpolation_functions_f16.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /******************************************************************************
  2. * @file interpolation_functions_f16.h
  3. * @brief Public header file for NMSIS DSP Library
  4. * @version V1.10.0
  5. * @date 08 July 2021
  6. * Target Processor: RISC-V Cores
  7. ******************************************************************************/
  8. /*
  9. * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved.
  10. * Copyright (c) 2019 Nuclei Limited. All rights reserved.
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the License); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at
  17. *
  18. * www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  22. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. */
  26. #ifndef INTERPOLATION_FUNCTIONS_F16_H_
  27. #define INTERPOLATION_FUNCTIONS_F16_H_
  28. #include "riscv_math_types_f16.h"
  29. #include "riscv_math_memory.h"
  30. #include "dsp/none.h"
  31. #include "dsp/utils.h"
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. #if defined(RISCV_FLOAT16_SUPPORTED)
  37. /**
  38. * @brief Instance structure for the half floating-point Linear Interpolate function.
  39. */
  40. typedef struct
  41. {
  42. uint32_t nValues; /**< nValues */
  43. float16_t x1; /**< x1 */
  44. float16_t xSpacing; /**< xSpacing */
  45. const float16_t *pYData; /**< pointer to the table of Y values */
  46. } riscv_linear_interp_instance_f16;
  47. /**
  48. * @brief Instance structure for the floating-point bilinear interpolation function.
  49. */
  50. typedef struct
  51. {
  52. uint16_t numRows;/**< number of rows in the data table. */
  53. uint16_t numCols;/**< number of columns in the data table. */
  54. const float16_t *pData; /**< points to the data table. */
  55. } riscv_bilinear_interp_instance_f16;
  56. /**
  57. * @addtogroup LinearInterpolate
  58. * @{
  59. */
  60. /**
  61. * @brief Process function for the floating-point Linear Interpolation Function.
  62. * @param[in,out] S is an instance of the floating-point Linear Interpolation structure
  63. * @param[in] x input sample to process
  64. * @return y processed output sample.
  65. */
  66. float16_t riscv_linear_interp_f16(
  67. const riscv_linear_interp_instance_f16 * S,
  68. float16_t x);
  69. /**
  70. * @} end of LinearInterpolate group
  71. */
  72. /**
  73. * @addtogroup BilinearInterpolate
  74. * @{
  75. */
  76. /**
  77. * @brief Floating-point bilinear interpolation.
  78. * @param[in,out] S points to an instance of the interpolation structure.
  79. * @param[in] X interpolation coordinate.
  80. * @param[in] Y interpolation coordinate.
  81. * @return out interpolated value.
  82. */
  83. float16_t riscv_bilinear_interp_f16(
  84. const riscv_bilinear_interp_instance_f16 * S,
  85. float16_t X,
  86. float16_t Y);
  87. /**
  88. * @} end of BilinearInterpolate group
  89. */
  90. #endif /*defined(RISCV_FLOAT16_SUPPORTED)*/
  91. #ifdef __cplusplus
  92. }
  93. #endif
  94. #endif /* ifndef _INTERPOLATION_FUNCTIONS_F16_H_ */