isp_denoise3d2.c 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2021 Alibaba Group Holding Limited
  3. * Author: LuChongzhi <chongzhi.lcz@alibaba-inc.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <stdint.h>
  12. #include <unistd.h>
  13. #include <string.h>
  14. #include "ra_common.h"
  15. #define REG_BASE 0x5300
  16. static const reg_field_s reg_desc[] = {
  17. /* structure field order
  18. reg_name, offset,reset_value,msb,lsb, field_name, field_desc */
  19. {"ISP_DENOISE3D2_CTRL", "Denoise3D2 ctrl",
  20. 0x00005300, 0x00000000, 12, 12, "denoise3d_v20_soft_rst", "Denoise3D2:soft reset bit"},
  21. {NULL, NULL, 0x00005300, 0x00000000, 11, 11, "denoise3d_v20_invgamma_en", "Denoise3D2: inv gamma enable bit"},
  22. {NULL, NULL, 0x00005300, 0x00000000, 10, 10, "denoise3d_v20_pregamma_en", "Denoise3D2: pregamma enable bit"},
  23. {NULL, NULL, 0x00005300, 0x00000000, 9, 9, "denoise3d_v20_erode_en", "Denoise3D2: motion erosion enable bit"},
  24. {NULL, NULL, 0x00005300, 0x00000000, 8, 8, "denoise3d_v20_motion_conv_en", "Denoise3D2: motion convergence enable bit"},
  25. {NULL, NULL, 0x00005300, 0x00000000, 7, 7, "denoise3d_v20_inv_dgain_en", "Denoise3D2: inv digital gain enable bit"},
  26. {NULL, NULL, 0x00005300, 0x00000000, 6, 6, "denoise3d_v20_inv_awb_gain_en", "Denoise3D2: inv awb gain enable bit"},
  27. {NULL, NULL, 0x00005300, 0x00000000, 5, 5, "denoise3d_v20_comp_luma_en", "Denoise3D2: luma compensation enable bit"},
  28. {NULL, NULL, 0x00005300, 0x00000000, 4, 4, "denoise3d_v20_ref_reset", "Denoise3D2: soft reset bit"},
  29. {NULL, NULL, 0x00005300, 0x00000000, 3, 3, "denoise3d_v20_motion_dilate_enable", "Denoise3D2: motion dilation enable bit"},
  30. {NULL, NULL, 0x00005300, 0x00000000, 2, 2, "denoise3d_v20_nlm_enable", "Denoise3D2: 2dnr enable bit"},
  31. {NULL, NULL, 0x00005300, 0x00000000, 1, 1, "denoise3d_v20_tnr_enable", "Denoise3D2: tnr enable bit"},
  32. {NULL, NULL, 0x00005300, 0x00000000, 0, 0, "denoise3d_v20_enable", "Denoise3D2: enable bit"},
  33. {"ISP_DENOISE3D2_PREGAMMA_Y_0", "Denoise3D2 Pregamma Y LUT Register",
  34. 0x00005400, 0x00000FFF, 29, 24, "denoise3d2_pregamma_y_2_a", "Denoise 3DV2 Pregamma Y 2 [11:6]"},
  35. {NULL, NULL, 0x00005400, 0x00000FFF, 23, 12, "denoise3d2_pregamma_y_1", "Denoise 3DV2 Pregamma Y 1"},
  36. {NULL, NULL, 0x00005400, 0x00000FFF, 11, 0, "denoise3d2_pregamma_y_0", "Denoise 3DV2 Pregamma Y 0"},
  37. };
  38. int light_isp_denoise3d2_reg_dump(reg_analyzer_info_s *ra_info)
  39. {
  40. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  41. return ra_dump_reg_fields(ra_info, reg_desc, count);
  42. }
  43. int light_isp_denoise3d2_reg_define(reg_analyzer_info_s *ra_info)
  44. {
  45. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  46. return ra_dump_reg_define(ra_info, reg_desc, count);
  47. }
  48. int light_isp_denoise3d2_reg_find(reg_analyzer_info_s *ra_info)
  49. {
  50. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  51. return ra_dump_reg_find(ra_info, reg_desc, count);
  52. }