Camera Hal OEM模块 ---- 3dnr算法流程( 三 )


3,me 流程 3.1 构建
使用 in 参数的地址
orig_image.gpuHandle = out->private_data;orig_image.bufferY = (unsigned char *)in->src_frame.addr_vir.addr_y;orig_image.bufferU = orig_image.bufferY + threednr_handle->width * threednr_handle->height;orig_image.bufferV = orig_image.bufferU;
3.2 构建
使用 ->,即在中通过 -> 申请的,并且在 ess 中 作为scale的dst
small_image.cpu_buffer.bufferY = (unsigned char *)threednr_handle->small_buf_vir[cur_frm];small_image.cpu_buffer.bufferU = small_image.cpu_buffer.bufferY + threednr_handle->small_width * threednr_handle->small_height;small_image.cpu_buffer.bufferV = small_image.cpu_buffer.bufferU;small_image.cpu_buffer.fd = threednr_handle->small_buf_fd[cur_frm];

Camera Hal OEM模块 ---- 3dnr算法流程

文章插图
3.3 构建
使用上面的和
process_param.proc_param.cap_new_param.small_image = &small_image;process_param.proc_param.cap_new_param.orig_image = &orig_image;process_param.callWay = 1;
3.4 跑
是去执行降噪算法的指令,之前所有的准备工作都是为了这步
ret = sprd_mfnr_adpt_ctrl(threednr_handle->proc_handle, SPRD_MFNR_PROC_CAPTURE_CMD, (void *)&process_param);
到这里,3dnr的算法流程已经全部走完了,我们通过一个实际暗环境拍照的log来巩固下这个流程
open:
Line 292277: 06-03 17:36:53.1714677763 D cmr_3dnr_sw: 396, threednr_open: ELine 292289: 06-03 17:36:53.1744677763 D cmr_3dnr_sw: 478, threednr_open: OK to malloc buffers for small imageLine 292290: 06-03 17:36:53.1744677763 D cmr_3dnr_sw: 501, threednr_open: af_roi: x=1314, y=1065, w=1430, h=987Line 292291: 06-03 17:36:53.1744677763 D cmr_3dnr_sw: 128, threednr_get_sns_match_index: sensor 3dnr param sum is 1Line 292292: 06-03 17:36:53.1744677763 D cmr_3dnr_sw: 550, threednr_open: auto3dnr_flag 2 sprd_3dnr_type 8 sensor_id 0 index 0 search window 11x11 threthold[3][2] 7Line 292341: 06-03 17:36:53.1774677763 D cmr_3dnr_sw: 611, threednr_open: ok to call threednr_initLine 292347: 06-03 17:36:53.1774677763 D cmr_3dnr_sw: 639, threednr_open: X
处理第一帧
Line 292556: 06-03 17:36:53.2854677763 D cmr_3dnr_sw: 1929, threednr_transfer_frame: get one frame, num 0, 0Line 292557: 06-03 17:36:53.2854677763 D cmr_3dnr_sw: 1937, threednr_transfer_frame: fd 0x1e yaddr 0xdc6c3000Line 292559: 06-03 17:36:53.2854677999 D cmr_3dnr_sw: 1030, threadnr_scaler_process: fd 0x1e E. yaddr 0x dc6c3000 cur_frm: 0Line 292562: 06-03 17:36:53.2854677999 D cmr_3dnr_sw: 1074, threadnr_scaler_process: Call the threednr_start_scale().src Y: 0xdc6c3000, 0x1e, dst Y: 0xd256a000, 0x81Line 292671: 06-03 17:36:53.3794677998 D cmr_3dnr_sw: 957, threednr_process_thread_proc: CMR_EVT_3DNR_PROCESSLine 292672: 06-03 17:36:53.3794677999 D cmr_3dnr_sw: 1124, threadnr_scaler_process: X cur_frm: 0Line 292673: 06-03 17:36:53.3804677998 D cmr_3dnr_sw: 831, threednr_process_frame: Call the threednr_function() yaddr 0xdc6c3000 cur_frm: 0 run_type 0 sprd_3dnr_type 8Line 292674: 06-03 17:36:53.3804677998 D cmr_3dnr_sw: 872, threednr_process_frame: Call the threednr_function().big Y: 0xdc6c3000, small 0xd256a000. ,threednr_handle->is_stop 0Line 292675: 06-03 17:36:53.3804677998 D cmr_3dnr_sw: 879, threednr_process_frame: big_buf.fd=0x1e, vaddr=0xdc6c3000, gpu_buffer.handle 0xe5682530
处理第二帧
Line 292701: 06-03 17:36:53.3904677763 D cmr_3dnr_sw: 1929, threednr_transfer_frame: get one frame, num 1, 1Line 292702: 06-03 17:36:53.3904677763 D cmr_3dnr_sw: 1937, threednr_transfer_frame: fd 0x23 yaddr 0xdb431000Line 292703: 06-03 17:36:53.3904677999 D cmr_3dnr_sw: 1030, threadnr_scaler_process: fd 0x23 E. yaddr 0x db431000 cur_frm: 1Line 292704: 06-03 17:36:53.3904677999 D cmr_3dnr_sw: 1074, threadnr_scaler_process: Call the threednr_start_scale().src Y: 0xdb431000, 0x23, dst Y: 0xd23a8000, 0x83Line 292821: 06-03 17:36:53.4874677998 D cmr_3dnr_sw: 957, threednr_process_thread_proc: CMR_EVT_3DNR_PROCESSLine 292822: 06-03 17:36:53.4884677999 D cmr_3dnr_sw: 1124, threadnr_scaler_process: X cur_frm: 1Line 292823: 06-03 17:36:53.4884677998 D cmr_3dnr_sw: 831, threednr_process_frame: Call the threednr_function() yaddr 0xdb431000 cur_frm: 1 run_type 0 sprd_3dnr_type 8Line 292824: 06-03 17:36:53.4884677998 D cmr_3dnr_sw: 872, threednr_process_frame: Call the threednr_function().big Y: 0xdb431000, small 0xd23a8000. ,threednr_handle->is_stop 0Line 292825: 06-03 17:36:53.4884677998 D cmr_3dnr_sw: 879, threednr_process_frame: big_buf.fd=0x23, vaddr=0xdb431000, gpu_buffer.handle 0xe56832f0