mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
Merge branch 'change/isp_hsize_check_v5.4' into 'release/v5.4'
isp: hsize check and lut size check (v5.4) See merge request espressif/esp-idf!46989
This commit is contained in:
@@ -75,6 +75,7 @@ esp_err_t esp_isp_new_processor(const esp_isp_processor_cfg_t *proc_config, isp_
|
|||||||
{
|
{
|
||||||
esp_err_t ret = ESP_FAIL;
|
esp_err_t ret = ESP_FAIL;
|
||||||
ESP_RETURN_ON_FALSE(proc_config && ret_proc, ESP_ERR_INVALID_ARG, TAG, "invalid argument: null pointer");
|
ESP_RETURN_ON_FALSE(proc_config && ret_proc, ESP_ERR_INVALID_ARG, TAG, "invalid argument: null pointer");
|
||||||
|
ESP_RETURN_ON_FALSE(proc_config->h_res <= ISP_LL_HSIZE_MAX && proc_config->v_res <= ISP_LL_VSIZE_MAX, ESP_ERR_INVALID_ARG, TAG, "invalid h_res or v_res");
|
||||||
ESP_RETURN_ON_FALSE(proc_config->input_data_source != ISP_INPUT_DATA_SOURCE_DWGDMA, ESP_ERR_NOT_SUPPORTED, TAG, "input source not supported yet");
|
ESP_RETURN_ON_FALSE(proc_config->input_data_source != ISP_INPUT_DATA_SOURCE_DWGDMA, ESP_ERR_NOT_SUPPORTED, TAG, "input source not supported yet");
|
||||||
|
|
||||||
isp_processor_t *proc = heap_caps_calloc(1, sizeof(isp_processor_t), ISP_MEM_ALLOC_CAPS);
|
isp_processor_t *proc = heap_caps_calloc(1, sizeof(isp_processor_t), ISP_MEM_ALLOC_CAPS);
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ esp_err_t esp_isp_lsc_allocate_gain_array(isp_proc_handle_t isp_proc, esp_isp_ls
|
|||||||
int num_grids_x = ISP_LSC_GET_GRIDS(isp_proc->h_res);
|
int num_grids_x = ISP_LSC_GET_GRIDS(isp_proc->h_res);
|
||||||
int num_grids_y = ISP_LSC_GET_GRIDS(isp_proc->v_res);
|
int num_grids_y = ISP_LSC_GET_GRIDS(isp_proc->v_res);
|
||||||
ESP_LOGD(TAG, "num_grids_x_max: %d, num_grids_x: %d, num_grids_y_max: %d, num_grids_y: %d", num_grids_x_max, num_grids_y_max, num_grids_x, num_grids_y);
|
ESP_LOGD(TAG, "num_grids_x_max: %d, num_grids_x: %d, num_grids_y_max: %d, num_grids_y: %d", num_grids_x_max, num_grids_y_max, num_grids_x, num_grids_y);
|
||||||
|
ESP_RETURN_ON_FALSE(num_grids_x * num_grids_y <= ISP_LL_LUT_LSC_SIZE_MAX, ESP_ERR_INVALID_ARG, TAG, "invalid number of grids, max is %d, num_grids_x: %d, num_grids_y: %d", ISP_LL_LUT_LSC_SIZE_MAX, num_grids_x, num_grids_y);
|
||||||
ESP_RETURN_ON_FALSE(num_grids_x <= num_grids_x_max && num_grids_y <= num_grids_y_max, ESP_ERR_INVALID_ARG, TAG, "invalid h_res or v_res");
|
ESP_RETURN_ON_FALSE(num_grids_x <= num_grids_x_max && num_grids_y <= num_grids_y_max, ESP_ERR_INVALID_ARG, TAG, "invalid h_res or v_res");
|
||||||
|
|
||||||
gain_array->gain_r = (isp_lsc_gain_t *)heap_caps_calloc(1, num_grids_x * num_grids_y * sizeof(isp_lsc_gain_t), ISP_MEM_ALLOC_CAPS);
|
gain_array->gain_r = (isp_lsc_gain_t *)heap_caps_calloc(1, num_grids_x * num_grids_y * sizeof(isp_lsc_gain_t), ISP_MEM_ALLOC_CAPS);
|
||||||
|
|||||||
@@ -106,13 +106,6 @@ extern "C" {
|
|||||||
---------------------------------------------------------------*/
|
---------------------------------------------------------------*/
|
||||||
#define ISP_LL_BF_DEFAULT_TEMPLATE_VAL 15
|
#define ISP_LL_BF_DEFAULT_TEMPLATE_VAL 15
|
||||||
|
|
||||||
/*---------------------------------------------------------------
|
|
||||||
DVP
|
|
||||||
---------------------------------------------------------------*/
|
|
||||||
#define ISP_LL_DVP_DATA_TYPE_RAW8 0x2A
|
|
||||||
#define ISP_LL_DVP_DATA_TYPE_RAW10 0x2B
|
|
||||||
#define ISP_LL_DVP_DATA_TYPE_RAW12 0x2C
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------
|
/*---------------------------------------------------------------
|
||||||
Color
|
Color
|
||||||
---------------------------------------------------------------*/
|
---------------------------------------------------------------*/
|
||||||
@@ -122,12 +115,6 @@ extern "C" {
|
|||||||
#define ISP_LL_COLOR_BRIGNTNESS_MIN -128
|
#define ISP_LL_COLOR_BRIGNTNESS_MIN -128
|
||||||
#define ISP_LL_COLOR_BRIGNTNESS_MAX 127
|
#define ISP_LL_COLOR_BRIGNTNESS_MAX 127
|
||||||
|
|
||||||
/*---------------------------------------------------------------
|
|
||||||
LSC
|
|
||||||
---------------------------------------------------------------*/
|
|
||||||
#define ISP_LL_LSC_GRID_HEIGHT 32
|
|
||||||
#define ISP_LL_LSC_GRID_WIDTH 32
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------
|
/*---------------------------------------------------------------
|
||||||
CCM
|
CCM
|
||||||
---------------------------------------------------------------*/
|
---------------------------------------------------------------*/
|
||||||
@@ -140,6 +127,26 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#define ISP_LL_CCM_MATRIX_TOT_BITS (ISP_LL_CCM_MATRIX_INT_BITS + ISP_LL_CCM_MATRIX_FRAC_BITS + 1) // including one sign bit
|
#define ISP_LL_CCM_MATRIX_TOT_BITS (ISP_LL_CCM_MATRIX_INT_BITS + ISP_LL_CCM_MATRIX_FRAC_BITS + 1) // including one sign bit
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------
|
||||||
|
DVP
|
||||||
|
---------------------------------------------------------------*/
|
||||||
|
#define ISP_LL_DVP_DATA_TYPE_RAW8 0x2A
|
||||||
|
#define ISP_LL_DVP_DATA_TYPE_RAW10 0x2B
|
||||||
|
#define ISP_LL_DVP_DATA_TYPE_RAW12 0x2C
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------
|
||||||
|
LSC
|
||||||
|
---------------------------------------------------------------*/
|
||||||
|
#define ISP_LL_LSC_GRID_HEIGHT 32
|
||||||
|
#define ISP_LL_LSC_GRID_WIDTH 32
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------
|
||||||
|
LUT
|
||||||
|
---------------------------------------------------------------*/
|
||||||
|
#define ISP_LL_LUT_LSC_SIZE_MAX 560
|
||||||
|
#define ISP_LL_LUT_DPC_SIZE_MAX 512
|
||||||
|
#define ISP_LL_LUT_AWB_SIZE_MAX 104
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
struct {
|
struct {
|
||||||
uint32_t fraction: ISP_LL_AWB_RGB_RATIO_FRAC_BITS;
|
uint32_t fraction: ISP_LL_AWB_RGB_RATIO_FRAC_BITS;
|
||||||
|
|||||||
Reference in New Issue
Block a user