stf_isp_shrp_rdma.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /**
  2. ******************************************************************************
  3. * @file stf_isp_shrp_rdma.h
  4. * @author StarFive Isp Team
  5. * @version V1.0
  6. * @date 12/14/2019
  7. * @brief
  8. ******************************************************************************
  9. * @copy
  10. *
  11. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  12. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  13. * TIME. AS A RESULT, STARFIVE SHALL NOT BE HELD LIABLE FOR ANY
  14. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  15. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  16. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  17. *
  18. * Copyright (C) 2019 - 2022 StarFive Technology Co., Ltd.
  19. */
  20. #ifndef __STF_ISP_SHRP_RDMA_H__
  21. #define __STF_ISP_SHRP_RDMA_H__
  22. #include "registers/stf_isp_rdma.h"
  23. #define SHRP_WT_Y_DIFF_LEN ((ADDR_REG_ISHRP1_14 - ADDR_REG_ISHRP1_0) / sizeof(STF_U32) + 1)
  24. #define SHRP_FACTOR_SLOPE_LEN ((ADDR_REG_ISHRP2_5 - ADDR_REG_ISHRP2_0) / sizeof(STF_U32) + 1)
  25. #define SHRP_WT_N11N_LEN ((ADDR_REG_ISHRP3 - ADDR_REG_ISHRP3) / sizeof(STF_U32) + 1)
  26. #define SHRP_UV_SMTH_CRV_LEN ((ADDR_REG_IUVS2 - ADDR_REG_IUVS1) / sizeof(STF_U32) + 1)
  27. #define SHRP_UV_COLR_KILL_LEN ((ADDR_REG_IUVCKS2 - ADDR_REG_IUVCKS1) / sizeof(STF_U32) + 1)
  28. #define SHRP_EDGE_SMTH_LEN ((ADDR_REG_ISHRPET - ADDR_REG_ISHRPET) / sizeof(STF_U32) + 1)
  29. /* add sharpening registers structure */
  30. typedef struct _ST_SHRP_REG {
  31. REG_ISHRP1_0 W0_LD1; // 0x0E80, Sharpen Edge Amplification Weight and Difference 0.
  32. REG_ISHRP1_1 W1_LD2; // 0x0E84, Sharpen Edge Amplification Weight and Difference 1.
  33. REG_ISHRP1_2 W2_LD3; // 0x0E88, Sharpen Edge Amplification Weight and Difference 2.
  34. REG_ISHRP1_3 W3_LD4; // 0x0E8C, Sharpen Edge Amplification Weight and Difference 3.
  35. REG_ISHRP1_4 W4_MD1; // 0x0E90, Sharpen Edge Amplification Weight and Difference 4.
  36. REG_ISHRP1_5 W5_MD2; // 0x0E94, Sharpen Edge Amplification Weight and Difference 5.
  37. REG_ISHRP1_6 W6_MD3; // 0x0E98, Sharpen Edge Amplification Weight and Difference 6.
  38. REG_ISHRP1_7 W7_MD4; // 0x0E9C, Sharpen Edge Amplification Weight and Difference 7.
  39. REG_ISHRP1_8 W8; // 0x0EA0, Sharpen Edge Amplification Weight 8.
  40. REG_ISHRP1_9 W9; // 0x0EA4, Sharpen Edge Amplification Weight 9.
  41. REG_ISHRP1_10 W10; // 0x0EA8, Sharpen Edge Amplification Weight 10.
  42. REG_ISHRP1_11 W11; // 0x0EAC, Sharpen Edge Amplification Weight 11.
  43. REG_ISHRP1_12 W12; // 0x0EB0, Sharpen Edge Amplification Weight 12.
  44. REG_ISHRP1_13 W13; // 0x0EB4, Sharpen Edge Amplification Weight 13.
  45. REG_ISHRP1_14 W14; // 0x0EB8, Sharpen Edge Amplification Weight 14.
  46. REG_ISHRP2_0 LF1_LS1; // 0x0EBC, Sharpen Edge Amplification Factor and Slope 0.
  47. REG_ISHRP2_1 LF2_LS2; // 0x0EC0, Sharpen Edge Amplification Factor and Slope 1.
  48. REG_ISHRP2_2 LF3_LS3; // 0x0EC4, Sharpen Edge Amplification Factor and Slope 2.
  49. REG_ISHRP2_3 MF1_MS1; // 0x0EC8, Sharpen Edge Amplification Factor and Slope 3.
  50. REG_ISHRP2_4 MF2_MS2; // 0x0ECC, Sharpen Edge Amplification Factor and Slope 4.
  51. REG_ISHRP2_5 MF3_MS3; // 0x0ED0, Sharpen Edge Amplification Factor and Slope 5.
  52. REG_ISHRP3 WSum_NDirF_PDirF; // 0x0ED4, Sharpen Edge Amplification Weight Normalization.
  53. REG_IUVS1 UvSmoothDiff1_2; // 0x0ED8, UV smoothing Register 1.
  54. REG_IUVS2 UvSmoothSlope_Factor; // 0x0EDC, UV smoothing Register 2.
  55. REG_IUVCKS1 UvCKDiff1_2; // 0x0EE0, UV Color Kill Register 1.
  56. REG_IUVCKS2 UvCKSlope; // 0x0EE4, UV Color Kill Register 2.
  57. REG_ISHRPET EdgeSmoothCfg; // 0x0EE8, Sharpen Edge Threshold.
  58. } ST_SHRP_REG, *PST_SHRP_REG;
  59. #define ST_SHRP_REG_SIZE (sizeof(ST_SHRP_REG))
  60. #define ST_SHRP_REG_LEN (ST_SHRP_REG_SIZE / sizeof(STF_U32))
  61. #pragma pack(push, 8)
  62. typedef struct _ST_SHRP_RDMA {
  63. #if defined(SUPPORT_RDMA_FEATURE)
  64. ST_RDMA_CMD stRdmaStartCmd __attribute__ ((aligned (8)));
  65. #endif //SUPPORT_RDMA_FEATURE
  66. ST_SHRP_REG stShrpReg __attribute__ ((aligned (8)));
  67. #if defined(SUPPORT_RDMA_FEATURE)
  68. ST_RDMA_CMD stRdmaEndCmd __attribute__ ((aligned (8)));
  69. #endif //SUPPORT_RDMA_FEATURE
  70. } ST_SHRP_RDMA, *PST_SHRP_RDMA;
  71. #define ST_SHRP_RDMA_SIZE (sizeof(ST_SHRP_RDMA))
  72. #define ST_SHRP_RDMA_LEN (ST_SHRP_RDMA_SIZE / (sizeof(STF_U32) * 2))
  73. typedef struct _ST_ISP_SHRP_RDMA {
  74. STF_U8 u8IspIdx;
  75. ST_SHRP_RDMA stShrpRdma __attribute__ ((aligned (8)));
  76. } ST_ISP_SHRP_RDMA, *PST_ISP_SHRP_RDMA;
  77. #pragma pack(pop)
  78. ///* sharpening registers interface */
  79. ////-----------------------------------------------------------------------------
  80. //extern
  81. //STF_VOID STFHAL_ISP_SHRP_SetReg(
  82. // STF_U8 u8IspIdx,
  83. // ST_SHRP_RDMA *pstShrpRdma
  84. // );
  85. ////-----------------------------------------------------------------------------
  86. //extern
  87. //STF_VOID STFHAL_ISP_SHRP_SetWeightAndYDifferent(
  88. // STF_U8 u8IspIdx,
  89. // ST_SHRP_RDMA *pstShrpRdma
  90. // );
  91. //extern
  92. //STF_VOID STFHAL_ISP_SHRP_SetFactorAndSlope(
  93. // STF_U8 u8IspIdx,
  94. // ST_SHRP_RDMA *pstShrpRdma
  95. // );
  96. //extern
  97. //STF_VOID STFHAL_ISP_SHRP_SetWeightNormalization(
  98. // STF_U8 u8IspIdx,
  99. // ST_SHRP_RDMA *pstShrpRdma
  100. // );
  101. //extern
  102. //STF_VOID STFHAL_ISP_SHRP_SetUvSmoothCurve(
  103. // STF_U8 u8IspIdx,
  104. // ST_SHRP_RDMA *pstShrpRdma
  105. // );
  106. //extern
  107. //STF_VOID STFHAL_ISP_SHRP_SetUvColorKillCurve(
  108. // STF_U8 u8IspIdx,
  109. // ST_SHRP_RDMA *pstShrpRdma
  110. // );
  111. //extern
  112. //STF_VOID STFHAL_ISP_SHRP_SetEdgeParam(
  113. // STF_U8 u8IspIdx,
  114. // ST_SHRP_RDMA *pstShrpRdma
  115. // );
  116. //
  117. //
  118. #endif //__STF_ISP_SHRP_RDMA_H__