pdaf添加实例(2p7,type2)[通俗易懂]

pdaf添加实例(2p7,type2)[通俗易懂]/***s5k2p7_pdaf.h**Copyright(c)2015QualcommTechnologies,Inc.*AllRightsReserved.*ConfidentialandProprietary-QualcommTechnologies,Inc.*/.vendor_id=QTI,.stats_dt=0x30

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

/**
* s5k2p7_pdaf.h
*
* Copyright (c) 2015 Qualcomm Technologies, Inc.
* All Rights Reserved.
* Confidential and Proprietary – Qualcomm Technologies, Inc.
*/
.vendor_id = QTI,
.stats_dt = 0x30,
//尾巴模式里的data type,此处的VC通道应在对应sensor驱动的h文件里配置
pdaf添加实例(2p7,type2)[通俗易懂]

.orientation= PDAF_ORIENTATION_DEFAULT,
.sensor_native_pattern_info =
//有几组res支持pdaf就需要添加对应的res组,因为2p7是全尺寸和预览的半尺寸支持pdaf,所以此处配置res0和res1.
{
/* Res 0 */
{
.block_pattern = {
.pd_offset_horizontal = 16,
.pd_offset_vertical = 16,
//pd的横坐标纵坐标的偏移量
pdaf添加实例(2p7,type2)[通俗易懂]

.pix_count = 32,
//一块中有多少个像素点
pdaf添加实例(2p7,type2)[通俗易懂]

.block_dim = {
.width = 64,
//横块数
.height = 64,
//纵块数
},
pdaf添加实例(2p7,type2)[通俗易懂]

.pix_coords =
{
//像素的坐标,A1是左点,A2是右点
pdaf添加实例(2p7,type2)[通俗易懂]

{20, 23, PDAF_LEFT_PIXEL,},
{20, 27, PDAF_RIGHT_PIXEL,},
{36, 27, PDAF_LEFT_PIXEL,},
{36, 31, PDAF_RIGHT_PIXEL,},
{56, 27, PDAF_LEFT_PIXEL,},
{56, 31, PDAF_RIGHT_PIXEL,},
{72, 23, PDAF_LEFT_PIXEL,},
{72, 27, PDAF_RIGHT_PIXEL,},
{24, 43, PDAF_LEFT_PIXEL,},
{24, 39, PDAF_RIGHT_PIXEL,},
{40, 47, PDAF_LEFT_PIXEL,},
{40, 43, PDAF_RIGHT_PIXEL,},
{52, 47, PDAF_LEFT_PIXEL,},
{52, 43, PDAF_RIGHT_PIXEL,},
{68, 43, PDAF_LEFT_PIXEL,},
{68, 39, PDAF_RIGHT_PIXEL,},
{24, 59, PDAF_LEFT_PIXEL,},
{24, 63, PDAF_RIGHT_PIXEL,},
{40, 55, PDAF_LEFT_PIXEL,},
{40, 59, PDAF_RIGHT_PIXEL,},
{52, 55, PDAF_LEFT_PIXEL,},
{52, 59, PDAF_RIGHT_PIXEL,},
{68, 59, PDAF_LEFT_PIXEL,},
{68, 63, PDAF_RIGHT_PIXEL,},
{20, 79, PDAF_LEFT_PIXEL,},
{20, 75, PDAF_RIGHT_PIXEL,},
{36, 75, PDAF_LEFT_PIXEL,},
{36, 71, PDAF_RIGHT_PIXEL,},
{56, 75, PDAF_LEFT_PIXEL,},
{56, 71, PDAF_RIGHT_PIXEL,},
{72, 79, PDAF_LEFT_PIXEL,},
{72, 75, PDAF_RIGHT_PIXEL,},
},
},
.block_count_horizontal = 72,
//pd的像素范围的width/横块数
.block_count_vertical = 54,
//pd的像素范围的height/纵块数
},
/* res 1 */
{//半尺寸的配置
.block_pattern = {
.pd_offset_horizontal = 8,
.pd_offset_vertical = 8,
//这儿有写全尺寸和半尺寸的起始坐标
pdaf添加实例(2p7,type2)[通俗易懂]

.pix_count = 32,
//半尺寸的像素数目和全尺寸的是一致的
.block_dim = {
//全尺寸的一半
.width = 32,
.height = 32,
},
.pix_coords =
{
//半尺寸的像素坐标
pdaf添加实例(2p7,type2)[通俗易懂]

{10, 11, PDAF_LEFT_PIXEL,},
{10, 13, PDAF_RIGHT_PIXEL,},
{18, 13, PDAF_LEFT_PIXEL,},
{18, 15, PDAF_RIGHT_PIXEL,},
{28, 13, PDAF_LEFT_PIXEL,},
{28, 15, PDAF_RIGHT_PIXEL,},
{36, 11, PDAF_LEFT_PIXEL,},
{36, 13, PDAF_RIGHT_PIXEL,},
{12, 21, PDAF_LEFT_PIXEL,},
{12, 19, PDAF_RIGHT_PIXEL,},
{20, 23, PDAF_LEFT_PIXEL,},
{20, 21, PDAF_RIGHT_PIXEL,},
{26, 23, PDAF_LEFT_PIXEL,},
{26, 21, PDAF_RIGHT_PIXEL,},
{34, 21, PDAF_LEFT_PIXEL,},
{34, 19, PDAF_RIGHT_PIXEL,},
{12, 29, PDAF_LEFT_PIXEL,},
{12, 31, PDAF_RIGHT_PIXEL,},
{20, 27, PDAF_LEFT_PIXEL,},
{20, 29, PDAF_RIGHT_PIXEL,},
{26, 27, PDAF_LEFT_PIXEL,},
{26, 29, PDAF_RIGHT_PIXEL,},
{34, 29, PDAF_LEFT_PIXEL,},
{34, 31, PDAF_RIGHT_PIXEL,},
{10, 39, PDAF_LEFT_PIXEL,},
{10, 37, PDAF_RIGHT_PIXEL,},
{18, 37, PDAF_LEFT_PIXEL,},
{18, 35, PDAF_RIGHT_PIXEL,},
{28, 37, PDAF_LEFT_PIXEL,},
{28, 35, PDAF_RIGHT_PIXEL,},
{36, 39, PDAF_LEFT_PIXEL,},
{36, 37, PDAF_RIGHT_PIXEL,},
},
},
/* use estimate blk level instead of ref to chromatix */
.block_count_horizontal = 72,
//半尺寸pd有效范围的width/横块数
.block_count_vertical = 54,
//半尺寸pd有效范围的height/纵块数
},
},
.buffer_block_pattern_info =
{
//这个部分就是将tail mode里面的像素点的坐标写进来
pdaf添加实例(2p7,type2)[通俗易懂]

/* Res 0 */
{
.block_pattern = {
.pix_count = 32,
//4*8
.pix_coords =
{
//如上图,先是两个左点,然后两个右点,两个左点,四个右点……最后四个左点
{
.x = 0,
.y = 0,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 0,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 1,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 1,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 2,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 2,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 3,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 3,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 4,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 4,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 5,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 5,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 6,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 6,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 7,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 7,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 8,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 8,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 9,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 9,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 10,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 10,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 11,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 11,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 12,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 12,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 13,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 13,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 14,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 14,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 15,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 15,
.flag = PDAF_LEFT_PIXEL,
},
},
.pd_offset_horizontal = 0,
.pd_offset_vertical = 0,
.block_dim = {
.width = 2,
.height = 16,
},
},
.stride = 184,//
64(一行的块数)*2(每一行有两个pd点)*10(每个点的数据都是10位的)/8(mipi打包是8位)
.buffer_data_type = PDAF_DATA_TYPE_RAW10_PACKED,
//数据打包格式
pdaf添加实例(2p7,type2)[通俗易懂]

.buffer_type = PDAF_BUFFER_FLAG_SEQUENTIAL_LINE,
//PDAF_BUFFER_FLAG_SPARSE(type 3),PDAF_BUFFER_FLAG_SEQUENTIAL_LINE(type 2)
},
/* res 1 */
{
.block_pattern = {
.pix_count = 32,
//4*8
.pix_coords =
{
{
.x = 0,
.y = 0,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 0,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 1,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 1,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 2,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 2,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 3,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 3,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 4,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 4,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 5,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 5,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 6,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 6,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 7,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 7,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 8,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 8,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 9,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 9,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 10,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 10,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 11,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 11,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 12,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 12,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 13,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 1,
.y = 13,
.flag = PDAF_RIGHT_PIXEL,
},
{
.x = 0,
.y = 14,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 14,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 0,
.y = 15,
.flag = PDAF_LEFT_PIXEL,
},
{
.x = 1,
.y = 15,
.flag = PDAF_LEFT_PIXEL,
},
},
.pd_offset_horizontal = 0,
.pd_offset_vertical = 0,
.block_dim = {
.width = 2,
.height = 16,
//tail mode里像素的width和height
},
},
.stride = 184,
//同上
.buffer_data_type = PDAF_DATA_TYPE_RAW10_PACKED,
//同上
.buffer_type = PDAF_BUFFER_FLAG_SEQUENTIAL_LINE,
//同上
},
},
/* use estimate blk level instead of ref to chromatix */
.black_level = 64,
.cali_version = CALIBRATION_VERSION_2D,
.window_configure = {
.pdaf_sw_window_mode = FIXED_GRID_WINDOW,
/* ingore the floating window configuration */
.fixed_grid_window_configure =
{
.af_fix_window = {
.pdaf_address_start_hori = 0.33333,
.pdaf_address_start_ver = 0.33334,
.pdaf_address_end_hori = 0.66668,
.pdaf_address_end_ver = 0.66668,
},
.window_number_hori = 1,
.window_number_ver = 1,
},
},
.defocus_confidence_th = 200,


在sensor驱动文件里需要定义如下内容:
1:配置data type
#define
S5K2P7_CSI_PD_ISTATS            0x30
/* VC = 1, DT = 0x30 */
2:需要配置传输pd数据的VC
  .sensor_stream_info_array =
  {
    .sensor_stream_info =
    {
      {
        .vc_cfg_size = 2,
        .vc_cfg =
        {
          {
            .cid = 0,
            .dt = CSI_RAW10,
            .decode_format = CSI_DECODE_10BIT
          },
   {
            .cid = 4,
            .dt =
S5K2P7_CSI_PD_ISTATS,
            .decode_format = CSI_DECODE_10BIT
          },
        },
        .pix_data_fmt =
        {
          SENSOR_BAYER,
   SENSOR_META,
        },
      },
  {
        .vc_cfg_size = 1,
        .vc_cfg =
        {
          {
            .cid = 0,
            .dt = CSI_RAW10,
            .decode_format = CSI_DECODE_10BIT,
          },
        },
        .pix_data_fmt =
        {
          SENSOR_BAYER,
        },
      },
    },
    .size = 2,
  },
3:支持pdaf的res需要配置相应的VC
  .csid_lut_params_array =
  {
    .lut_params =
    {
      /* Res 0 */
      {
        .num_cid = 2,
        .vc_cfg_a =
        {
          {
            .cid = 0,
            .dt = CSI_RAW10,
            .decode_format = CSI_DECODE_10BIT
          },
          {
            .cid = 4,
            .dt =
S5K2P7_CSI_PD_ISTATS,
            .decode_format = CSI_DECODE_10BIT
          },
        },
      },
      /* Res 1 */
      {
        .num_cid = 2,
        .vc_cfg_a =
        {
          {
            .cid = 0,
            .dt = CSI_RAW10,
            .decode_format = CSI_DECODE_10BIT
          },
   {
            .cid = 4,
            .dt =
S5K2P7_CSI_PD_ISTATS,
            .decode_format = CSI_DECODE_10BIT
          },
        },
      },
      /* Res 2 */
      {
        .num_cid = 1,
        .vc_cfg_a =
        {
          {
            .cid = 0,
            .dt = CSI_RAW10,
            .decode_format = CSI_DECODE_10BIT
          },
        },
      },
      /* Res 3 */
      {
        .num_cid = 1,
        .vc_cfg_a =
        {
          {
            .cid = 0,
            .dt = CSI_RAW10,
            .decode_format = CSI_DECODE_10BIT
          },
        },
      },
      /* Res 4 */
      {
        .num_cid = 1,
        .vc_cfg_a =
        {
          {
            .cid = 0,
            .dt = CSI_RAW10,
            .decode_format = CSI_DECODE_10BIT
          },
        },
      },
      /* Res 5 */
      {
        .num_cid = 1,
        .vc_cfg_a =
        {
          {
            .cid = 0,
            .dt = CSI_RAW10,
            .decode_format = CSI_DECODE_10BIT
          },
        },
      },
    },
    .size = 6,
  },
4:
  .meta_data_out_info_array =
  {
    .meta_data_out_info =
    {
      {
/* tail of af size*/
        .width = 144,
        .height = 864,
        .stats_type = PD_STATS,
.dt =
S5K2P7_CSI_PD_ISTATS,
pdaf添加实例(2p7,type2)[通俗易懂]


      },
    },
    .size = 1,
  },
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/196383.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 人工势场法(APF) —— Path Planning「建议收藏」

    人工势场法(APF) —— Path Planning「建议收藏」版权声明:本文为博主原创博文,未经允许不得转载,若要转载,请说明出处并给出博文链接人工势场法(ArtificialPotentialField,APF)是一种将机器人的外形视为势场中的一个点,这个势场结合了对目标的吸引力和对障碍物的排斥力。得到的轨迹作为路径输出。该方法具有计算量小、容易理解等优点。然而,它们可能陷入势场的局部极小值而无法找到路径,或者无法找到最优路径。人工势场可以被视为与静电势场类似的连续方程(将机器人视为点电荷),或者通过场的运动可以使用一组语言规则进行离散…

  • html——form表单提交方法及表单提交注意点

    html——form表单提交方法及表单提交注意点1、type=”submit”<formname=”form”method=”post”action=”#"><inputtype=”submit”name=”submit”value=”提交&quo

  • Java课程设计——学生成绩管理系统

    Java课程设计——学生成绩管理系统Java课程设计题目:学生成绩管理系统摘要在现今信息时代,生活速度的加快,使得人们越来越向信息化、数字化发展。随着学校的规模不断扩大,学生数量急剧增加,有关学生的各种信息量也成倍增长,尤其是学生的考试成绩数据。面对庞大的学生的成绩,需要有学生成绩管理系统来提高学生管理工作的效率。介于此提出了学生成绩管理系统,学生管理系统是计算机对学生档案信息进行管理,具有手工管理无可比拟的优点,如索检迅速、查找方便、可靠性高、存储量大等有点。现在我国的大中专院校的学生成绩管理水平正在不断提高,停留在纸介质

  • 网页导航菜单制作

    网页导航菜单制作导航部分可分为三部分:第一部分:登陆/注册第二部分:导航,无序列表部分第三部分:图标部分具体步骤:1.先新建一个div容纳整个导航部分的内容2.再新建p标签包含第一部分内容,左浮(p标签本为行级元素不能设置宽高,但左浮后,变成行块元素可以设置宽高),再设置height与line-height值相同,则可上下居中。3.导航部分右边属于一个无序列表,要实

  • 安防监控行业未来发展解析「建议收藏」

    安防监控行业未来发展解析「建议收藏」随着我国社会经济的快速发展,“十二五”期间政府继续大力推动“平安城市”、“智慧城市”建设,另外安防监控设备企业自身的创新拓展加之与IT企业、电信企业、家电企业的交融发展,极大地扩充了安防的内涵和应用领域。我国安防行业又将进入一个十分重要的发展时期,机遇与挑战并存:市场规范有待加强,企业经营有待引导,未来发展走多元化、专一化之路。  安防监控市场规范有待加强  虽然安防…

  • yarn的安装和使用(yarn安装mysql)

    升级yarn升级指定版本(例:升级到v1.22.10版本)yarnupgradev1.22.10npmyarn安装/升级最新版本npminstallyarn@latest-g查看yarn历史版本npmviewyarnversions–json[“0.1.0″,”0.1.1″,”0.1.2″,”0.1.3″,”0.15.1″,”0.16.0″,”0.16.1″,”0.17.0”,”0.17…

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号