m5_isp_dpf.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 0x2800
  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_DPF_MODE", "Mode Control for De-noising Pre-Filter Block",
  20. 0x00002800, 0x00000000, 9, 9, "use_nf_gain", "0: DPF_NF_GAINs will not be used. (Default)" LINE_PADDING_6TAB
  21. "1: DPF_NF_GAINs will be used."},
  22. {NULL, NULL, 0x00002800, 0x00000000, 8, 8, "lsc_gain_en", "0: LSC gain will not be processed. Use LSC gain factor of 1. (Default)" LINE_PADDING_6TAB
  23. "1: LSC gain will be processed"},
  24. {NULL, NULL, 0x00002800, 0x00000000, 7, 7, "awb_gain_en", "Only relevant when use_nf_gain==0 and ISP_CTRL::ISP_AWB_ENABLE==1" LINE_PADDING_6TAB
  25. "0: ISP_AWB gains will not be processed. Use AWB gain factor of 1. (Default)" LINE_PADDING_6TAB
  26. "1: ISP_AWB gains will be processed"},
  27. {NULL, NULL, 0x00002800, 0x00000000, 6, 6, "nll_equ_segm", "0: equidistant segmentation for NLL (Default)" LINE_PADDING_6TAB
  28. "1: optimized logarithmic like segmentation for Noise Level Lookup (NLL)"},
  29. {NULL, NULL, 0x00002800, 0x00000000, 5, 5, "rb_filter_size9x9", "0: Wide Red and Blue filter kernel size of 13x9 (7x5 active) pixels (Default)" LINE_PADDING_6TAB
  30. "1: Red and Blue filter kernel size of 9x9 (5x5 active) pixels"},
  31. {NULL, NULL, 0x00002800, 0x00000000, 4, 4, "r_filter_off", "0: filter R pixels (Default)" LINE_PADDING_6TAB
  32. "1: disable filter processing for red pixels (R)"},
  33. {NULL, NULL, 0x00002800, 0x00000000, 3, 3, "gr_filter_off", "0: filter GB pixels (Default)" LINE_PADDING_6TAB
  34. "1: disable filter processing for green pixels in green/blue lines (GB)"},
  35. {NULL, NULL, 0x00002800, 0x00000000, 2, 2, "gb_filter_off", "0: filter GB pixels (Default)" LINE_PADDING_6TAB
  36. "1: disable filter processing for green pixels in green/blue lines (GB)"},
  37. {NULL, NULL, 0x00002800, 0x00000000, 1, 1, "b_filter_off", "0: filter B pixels (Default); 1: disable filter processing for blue pixels (B)"},
  38. {NULL, NULL, 0x00002800, 0x00000000, 0, 0, "cfg_dpf_enable", "De-noising pre-filter; 0: Bypass DPF (Default); 1: Enable DPF"},
  39. };
  40. int light_isp_dpf_reg_dump(reg_analyzer_info_s *ra_info)
  41. {
  42. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  43. return ra_dump_reg_fields(ra_info, reg_desc, count);
  44. }
  45. int light_isp_dpf_reg_define(reg_analyzer_info_s *ra_info)
  46. {
  47. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  48. return ra_dump_reg_define(ra_info, reg_desc, count);
  49. }
  50. int light_isp_dpf_reg_find(reg_analyzer_info_s *ra_info)
  51. {
  52. uint32_t count = sizeof(reg_desc) / sizeof(reg_desc[0]);
  53. return ra_dump_reg_find(ra_info, reg_desc, count);
  54. }