Skip to content

Commit 2ae2623

Browse files
WangYuxin-espigrr
authored andcommitted
feat: add an option for s3 converter range mode
1 parent b927e9a commit 2ae2623

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,16 @@ menu "Camera configuration"
190190
config LCD_CAM_CONV_BT709_ENABLED
191191
bool "BT709"
192192
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.
193205
endmenu

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)