Skip to content

Commit 33daec7

Browse files
Merge branch 'master' into feature/better_use_of_sccb_interface
2 parents 77d71b0 + 2ae2623 commit 33daec7

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

Kconfig

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ menu "Camera configuration"
142142
bool "Subsample Mode"
143143
endchoice
144144

145+
config CAMERA_TASK_STACK_SIZE
146+
int "CAM task stack size"
147+
default 2048
148+
help
149+
Camera task stack size
150+
145151
choice CAMERA_TASK_PINNED_TO_CORE
146152
bool "Camera task pinned to core"
147153
default CAMERA_CORE0
@@ -163,8 +169,8 @@ menu "Camera configuration"
163169
default 32768
164170
help
165171
Maximum value of DMA buffer
166-
Larger values may fail to allocate due to insufficient contiguous memory blocks, and smaller value may cause DMA interrupt to be too frequent
167-
172+
Larger values may fail to allocate due to insufficient contiguous memory blocks, and smaller value may cause DMA interrupt to be too frequent.
173+
168174
config CAMERA_CONVERTER_ENABLED
169175
bool "Enable camera RGB/YUV converter"
170176
depends on IDF_TARGET_ESP32S3
@@ -184,4 +190,16 @@ menu "Camera configuration"
184190
config LCD_CAM_CONV_BT709_ENABLED
185191
bool "BT709"
186192
endchoice
193+
194+
config LCD_CAM_CONV_FULL_RANGE_ENABLED
195+
bool "Camera converter full range mode"
196+
depends on CAMERA_CONVERTER_ENABLED
197+
default y
198+
help
199+
Supports format conversion under both full color range mode and limited color range mode.
200+
If full color range mode is selected, the color range of RGB or YUV is 0~255.
201+
If limited color range mode is selected, the color range of RGB is 16~240, and the color range of YUV is Y[16~240], UV[16~235].
202+
Full color range mode has a wider color range, so details in the image show more clearly.
203+
Please confirm the color range mode of the current camera sensor, incorrect color range mode may cause color difference in the final converted image.
204+
Full range mode is used by default. If this option is not selected, the format conversion function will be done using the limited range mode.
187205
endmenu

driver/cam_hal.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
#endif // ESP_IDF_VERSION_MAJOR
3333
#define ESP_CAMERA_ETS_PRINTF ets_printf
3434

35+
#if CONFIG_CAM_TASK_STACK_SIZE
36+
#define CAM_TASK_STACK CONFIG_CAM_TASK_STACK_SIZE
37+
#else
38+
#define CAM_TASK_STACK (2*1024)
39+
#endif
40+
3541
static const char *TAG = "cam_hal";
3642
static cam_obj_t *cam_obj = NULL;
3743

@@ -392,11 +398,11 @@ esp_err_t cam_config(const camera_config_t *config, framesize_t frame_size, uint
392398

393399

394400
#if CONFIG_CAMERA_CORE0
395-
xTaskCreatePinnedToCore(cam_task, "cam_task", 2048, NULL, configMAX_PRIORITIES - 2, &cam_obj->task_handle, 0);
401+
xTaskCreatePinnedToCore(cam_task, "cam_task", CAM_TASK_STACK, NULL, configMAX_PRIORITIES - 2, &cam_obj->task_handle, 0);
396402
#elif CONFIG_CAMERA_CORE1
397-
xTaskCreatePinnedToCore(cam_task, "cam_task", 2048, NULL, configMAX_PRIORITIES - 2, &cam_obj->task_handle, 1);
403+
xTaskCreatePinnedToCore(cam_task, "cam_task", CAM_TASK_STACK, NULL, configMAX_PRIORITIES - 2, &cam_obj->task_handle, 1);
398404
#else
399-
xTaskCreate(cam_task, "cam_task", 2048, NULL, configMAX_PRIORITIES - 2, &cam_obj->task_handle);
405+
xTaskCreate(cam_task, "cam_task", CAM_TASK_STACK, NULL, configMAX_PRIORITIES - 2, &cam_obj->task_handle);
400406
#endif
401407

402408
ESP_LOGI(TAG, "cam config ok");

target/esp32s3/ll_cam.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,13 @@ static esp_err_t ll_cam_converter_config(cam_obj_t *cam, const camera_config_t *
218218
#else
219219
LCD_CAM.cam_rgb_yuv.cam_conv_protocol_mode = 0;
220220
#endif
221+
#if CONFIG_LCD_CAM_CONV_FULL_RANGE_ENABLED
222+
LCD_CAM.cam_rgb_yuv.cam_conv_data_out_mode = 1;
223+
LCD_CAM.cam_rgb_yuv.cam_conv_data_in_mode = 1;
224+
#else
221225
LCD_CAM.cam_rgb_yuv.cam_conv_data_out_mode = 0;
222226
LCD_CAM.cam_rgb_yuv.cam_conv_data_in_mode = 0;
227+
#endif
223228
LCD_CAM.cam_rgb_yuv.cam_conv_mode_8bits_on = 1;
224229
LCD_CAM.cam_rgb_yuv.cam_conv_bypass = 1;
225230
cam->conv_mode = config->conv_mode;

0 commit comments

Comments
 (0)