PAS6167 拍照插值死机
现象与分析:
现象为第一次拍照正常,第二次拍照死机或白屏。
原因分析:第一次拍照分配内存没有释放,第二次再插值拍照会再申请内如内存小就会分配不到内存出问题,从而导致死机问题
09a的code 容易出现“插值拍照后内存不释放”问题,这个问题23C与23D都出现过
解决方法:
修改代码,把以下代码
#ifdef __Support_Image_Interpolate__
if (image_interpolate == KAL_TRUE)
{
kal_uint16 * inter_buff;
inter_buff = med_alloc_ext_mem(image_real_width*image_real_height*2);
EXT_ASSERT(inter_buff, image_real_width, image_real_height, 0);
PAS6167_Interpolate(176,144,(kal_uint8 *)capture_mem_param.capture_buff_addr,(kal_uint8 *)inter_buff);
CAM_FREE_EXT_BUFFER();
cam_context_p->extmem_start_address = (kal_uint32)inter_buff;
jpg_encode.image_buffer_address = (kal_uint32)inter_buff;
cam_context_p->image_width = image_real_width;
cam_context_p->image_height = image_real_height;
}
#endif
修改成如下:
#ifdef __Support_Image_Interpolate__
if (image_interpolate == KAL_TRUE)
{
kal_uint16 * inter_buff;
inter_buff = med_alloc_ext_mem(image_real_width*image_real_height*2);
EXT_ASSERT(inter_buff, image_real_width, image_real_height, 0);
PAS6167_Interpolate(176,144,(kal_uint8 *)capture_mem_param.capture_buff_addr,(kal_uint8 *)inter_buff);
cam_context_p->extmem_start_address = (kal_uint32)inter_buff;
jpg_encode.image_buffer_address = (kal_uint32)inter_buff;
cam_context_p->image_width = image_real_width;
cam_context_p->image_height = image_real_height;
CAM_FREE_EXT_BUFFER();
}
#endif
修改后反复测试,没有再出现死机现象