作者 ookk303

保存

1 # 编译链的配置 1 # 编译链的配置
2 2
3 #1、编译链与设备类型的选择 3 #1、编译链与设备类型的选择
4 -set(DEVICE_NAME JZ_U3S) 4 +set(DEVICE_NAME JZ_C1)
5 #上一行为禁止修改行 5 #上一行为禁止修改行
6 6
7 if("${DEVICE_NAME}" STREQUAL "JZ_H1E") 7 if("${DEVICE_NAME}" STREQUAL "JZ_H1E")
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 #define VERSION_CHOOSE_H 7 #define VERSION_CHOOSE_H
8 #include "./ConfigParams.h" 8 #include "./ConfigParams.h"
9 //1~10行 除了D可以修改版本选择 禁止动任何东西 9 //1~10行 除了D可以修改版本选择 禁止动任何东西
10 -#define DEVICE_VERSION JZ_U3S 10 +#define DEVICE_VERSION JZ_C1
11 11
12 //禁止修改行 选择是串口程序 还是 psdk程序 12 //禁止修改行 选择是串口程序 还是 psdk程序
13 #define APP_VERSION APP_PSDK 13 #define APP_VERSION APP_PSDK
@@ -19,13 +19,13 @@ @@ -19,13 +19,13 @@
19 #define MAJOR_VERSION 0x01 19 #define MAJOR_VERSION 0x01
20 #define MINOR_VERSION 0x03 20 #define MINOR_VERSION 0x03
21 #define MODIFY_VERSION 0x09 21 #define MODIFY_VERSION 0x09
22 -#define DEBUG_VERSION 0x01 22 +#define DEBUG_VERSION 0x02
23 23
24 //禁止修改行 滤波方式 24 //禁止修改行 滤波方式
25 #define FILTERING_TYPE HIGH_PASS_FILTERING 25 #define FILTERING_TYPE HIGH_PASS_FILTERING
26 26
27 //禁止修改行固件属地 目前 国内版/海外版 27 //禁止修改行固件属地 目前 国内版/海外版
28 -#define FIRMWARE_ORIGIN DOMESTIC_VERSION 28 +#define FIRMWARE_ORIGIN OVERSEAS_VERSION
29 29
30 //禁止修改行指定特殊固件 30 //禁止修改行指定特殊固件
31 #define SPECIAL_VERSION SPECIAL_NORMAL 31 #define SPECIAL_VERSION SPECIAL_NORMAL
@@ -58,7 +58,8 @@ int PCM_PooL_Interface_PcmData(struct AudioDealInfo *AD_Info,unsigned int in_sam @@ -58,7 +58,8 @@ int PCM_PooL_Interface_PcmData(struct AudioDealInfo *AD_Info,unsigned int in_sam
58 } 58 }
59 59
60 //重采样 //仅处理一半样本量 60 //重采样 //仅处理一半样本量
61 - void *resampledData = FF_Resample_Send_And_Get_ResampleData(AD_Info, &data, dealLen/2, &out_nb_samples); 61 + //void *resampledData = FF_Resample_Send_And_Get_ResampleData(AD_Info, &data, dealLen/2, &out_nb_samples);
  62 + void *resampledData = FF_Resample_Send_And_Get_ResampleData(AD_Info, &data, dealLen, &out_nb_samples);
62 63
63 //如果滤波打开 64 //如果滤波打开
64 //滤波处理 65 //滤波处理
@@ -152,6 +152,8 @@ void *FF_Resample_Send_And_Get_ResampleData(struct AudioDealInfo *AD_Info, unsig @@ -152,6 +152,8 @@ void *FF_Resample_Send_And_Get_ResampleData(struct AudioDealInfo *AD_Info, unsig
152 return NULL; 152 return NULL;
153 } 153 }
154 154
  155 + JZSDK_LOG_INFO("原长度 *out_nb_samples:%d",*out_nb_samples);
  156 +
155 //重采样 157 //重采样
156 ret = swr_convert(ResampleInfo->m_swr, &dst, *out_nb_samples, (const uint8_t**)src, nb_samples); 158 ret = swr_convert(ResampleInfo->m_swr, &dst, *out_nb_samples, (const uint8_t**)src, nb_samples);
157 if (ret < 0) { 159 if (ret < 0) {
@@ -160,6 +162,8 @@ void *FF_Resample_Send_And_Get_ResampleData(struct AudioDealInfo *AD_Info, unsig @@ -160,6 +162,8 @@ void *FF_Resample_Send_And_Get_ResampleData(struct AudioDealInfo *AD_Info, unsig
160 return NULL; 162 return NULL;
161 } 163 }
162 164
  165 + JZSDK_LOG_INFO("重采样后长度:%d", ret);
  166 +
163 *out_nb_samples = ret; 167 *out_nb_samples = ret;
164 168
165 return (void*)dst; 169 return (void*)dst;
@@ -105,6 +105,8 @@ typedef struct IRC_param @@ -105,6 +105,8 @@ typedef struct IRC_param
105 105
106 unsigned int IRC_outPixelMode; //IRC输出像素模式 RGB888 YUV420 106 unsigned int IRC_outPixelMode; //IRC输出像素模式 RGB888 YUV420
107 107
  108 + unsigned int RingRepair; //环状修复
  109 +
108 //IRC画框坐标 110 //IRC画框坐标
109 unsigned int RegionBox[4]; // 0 一号点x 1 一号点y 2 二号点x 3 二号点y 111 unsigned int RegionBox[4]; // 0 一号点x 1 一号点y 2 二号点x 3 二号点y
110 112
@@ -200,6 +200,14 @@ static T_JZsdkReturnCode IRC_data_PreliminaryDeal(U8_t *rawData , int dataSize, @@ -200,6 +200,14 @@ static T_JZsdkReturnCode IRC_data_PreliminaryDeal(U8_t *rawData , int dataSize,
200 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 200 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
201 } 201 }
202 202
  203 +
  204 +unsigned int Get_2DImage_PointToArray(int x, int y, int width, int height)
  205 +{
  206 + return (x + y*width);
  207 +}
  208 +
  209 +
  210 +
203 /* 211 /*
204 功能:IRC后处理 212 功能:IRC后处理
205 213
@@ -212,6 +220,8 @@ static T_JZsdkReturnCode IRC_Postdeal(unsigned char *rgb_data, struct IRC_param @@ -212,6 +220,8 @@ static T_JZsdkReturnCode IRC_Postdeal(unsigned char *rgb_data, struct IRC_param
212 220
213 if (MirrorImageFlag == JZ_FLAGCODE_ON) 221 if (MirrorImageFlag == JZ_FLAGCODE_ON)
214 { 222 {
  223 + int x, y = 0;
  224 +
215 int bytes_per_row = dealInfo->Width * 3; // 每行的字节数 225 int bytes_per_row = dealInfo->Width * 3; // 每行的字节数
216 unsigned char *temp_row = (unsigned char *)malloc(bytes_per_row); // 临时缓冲区,用于存储一行的像素数据 226 unsigned char *temp_row = (unsigned char *)malloc(bytes_per_row); // 临时缓冲区,用于存储一行的像素数据
217 227
@@ -221,13 +231,13 @@ static T_JZsdkReturnCode IRC_Postdeal(unsigned char *rgb_data, struct IRC_param @@ -221,13 +231,13 @@ static T_JZsdkReturnCode IRC_Postdeal(unsigned char *rgb_data, struct IRC_param
221 } 231 }
222 232
223 // 遍历图像的每一行 233 // 遍历图像的每一行
224 - for (int y = 0; y < dealInfo->Height; y++) 234 + for (y = 0; y < dealInfo->Height; y++)
225 { 235 {
226 // 复制当前行到临时缓冲区 236 // 复制当前行到临时缓冲区
227 memcpy(temp_row, rgb_data + y * bytes_per_row, bytes_per_row); 237 memcpy(temp_row, rgb_data + y * bytes_per_row, bytes_per_row);
228 238
229 // 从右向左(即反向)复制临时缓冲区的数据回原位置 239 // 从右向左(即反向)复制临时缓冲区的数据回原位置
230 - for (int x = 0; x < dealInfo->Width; x++) { 240 + for (x = 0; x < dealInfo->Width; x++) {
231 int source_index = (dealInfo->Width - 1 - x) * 3; // 计算源像素的索引 241 int source_index = (dealInfo->Width - 1 - x) * 3; // 计算源像素的索引
232 int dest_index = x * 3; // 计算目标像素的索引 242 int dest_index = x * 3; // 计算目标像素的索引
233 243
@@ -242,6 +252,80 @@ static T_JZsdkReturnCode IRC_Postdeal(unsigned char *rgb_data, struct IRC_param @@ -242,6 +252,80 @@ static T_JZsdkReturnCode IRC_Postdeal(unsigned char *rgb_data, struct IRC_param
242 } 252 }
243 253
244 254
  255 + //修复外圈图像
  256 + if (dealInfo->RingRepair == JZ_FLAGCODE_ON)
  257 + {
  258 + int x, y = 0;
  259 +
  260 + //修复上边
  261 + for (x = 2; x <= dealInfo->Width - 2; x++)
  262 + {
  263 + int SourceIndex = Get_2DImage_PointToArray(x, 3, dealInfo->Width, dealInfo->Height);
  264 +
  265 + int FirstIndex = Get_2DImage_PointToArray(x, 0, dealInfo->Width, dealInfo->Height);
  266 + int SecondIndex = Get_2DImage_PointToArray(x, 1, dealInfo->Width, dealInfo->Height);
  267 +
  268 + rgb_data[FirstIndex] = rgb_data[SourceIndex];
  269 + rgb_data[FirstIndex + 1] = rgb_data[SourceIndex + 1];
  270 + rgb_data[FirstIndex + 2] = rgb_data[SourceIndex + 2];
  271 +
  272 + rgb_data[SecondIndex] = rgb_data[SourceIndex];
  273 + rgb_data[SecondIndex + 1] = rgb_data[SourceIndex + 1];
  274 + rgb_data[SecondIndex + 2] = rgb_data[SourceIndex + 2];
  275 + }
  276 +
  277 + //修复下边
  278 + for (x = 2; x <= dealInfo->Width - 2; x++)
  279 + {
  280 + int SourceIndex = Get_2DImage_PointToArray(x, dealInfo->Height - 3, dealInfo->Width, dealInfo->Height);
  281 +
  282 + int FirstIndex = Get_2DImage_PointToArray(x, dealInfo->Height - 1, dealInfo->Width, dealInfo->Height);
  283 + int SecondIndex = Get_2DImage_PointToArray(x, dealInfo->Height - 2, dealInfo->Width, dealInfo->Height);
  284 +
  285 + rgb_data[FirstIndex] = rgb_data[SourceIndex];
  286 + rgb_data[FirstIndex + 1] = rgb_data[SourceIndex + 1];
  287 + rgb_data[FirstIndex + 2] = rgb_data[SourceIndex + 2];
  288 +
  289 + rgb_data[SecondIndex] = rgb_data[SourceIndex];
  290 + rgb_data[SecondIndex + 1] = rgb_data[SourceIndex + 1];
  291 + rgb_data[SecondIndex + 2] = rgb_data[SourceIndex + 2];
  292 + }
  293 +
  294 + //修复左边
  295 + for (int y = 0; y <= dealInfo->Height; y++)
  296 + {
  297 + int SourceIndex = Get_2DImage_PointToArray(2, y, dealInfo->Width, dealInfo->Height);
  298 +
  299 + int FirstIndex = Get_2DImage_PointToArray(0, y, dealInfo->Width, dealInfo->Height);
  300 + int SecondIndex = Get_2DImage_PointToArray(1, y, dealInfo->Width, dealInfo->Height);
  301 +
  302 + rgb_data[FirstIndex] = rgb_data[SourceIndex];
  303 + rgb_data[FirstIndex + 1] = rgb_data[SourceIndex + 1];
  304 + rgb_data[FirstIndex + 2] = rgb_data[SourceIndex + 2];
  305 +
  306 + rgb_data[SecondIndex] = rgb_data[SourceIndex];
  307 + rgb_data[SecondIndex + 1] = rgb_data[SourceIndex + 1];
  308 + rgb_data[SecondIndex + 2] = rgb_data[SourceIndex + 2];
  309 + }
  310 +
  311 + //修复右边
  312 + for (int y = 0; y <= dealInfo->Height; y++)
  313 + {
  314 + int SourceIndex = Get_2DImage_PointToArray(dealInfo->Width - 3, y, dealInfo->Width, dealInfo->Height);
  315 + int FirstIndex = Get_2DImage_PointToArray(dealInfo->Width - 1, y, dealInfo->Width, dealInfo->Height);
  316 + int SecondIndex = Get_2DImage_PointToArray(dealInfo->Width - 2, y, dealInfo->Width, dealInfo->Height);
  317 +
  318 + rgb_data[FirstIndex] = rgb_data[SourceIndex];
  319 + rgb_data[FirstIndex + 1] = rgb_data[SourceIndex + 1];
  320 + rgb_data[FirstIndex + 2] = rgb_data[SourceIndex + 2];
  321 +
  322 + rgb_data[SecondIndex] = rgb_data[SourceIndex];
  323 + rgb_data[SecondIndex + 1] = rgb_data[SourceIndex + 1];
  324 + rgb_data[SecondIndex + 2] = rgb_data[SourceIndex + 2];
  325 + }
  326 + }
  327 +
  328 +
245 // 在rgb图上画图形 329 // 在rgb图上画图形
246 330
247 //不画 331 //不画
@@ -307,6 +391,10 @@ T_JZsdkReturnCode IRC_FrameDeal(unsigned char *rawData ,unsigned int dataSize, u @@ -307,6 +391,10 @@ T_JZsdkReturnCode IRC_FrameDeal(unsigned char *rawData ,unsigned int dataSize, u
307 KtLib_DataDeal(U16_data, U16_dataSize, &RGB_data, &RGB_dataSize,g_IRC_Param); 391 KtLib_DataDeal(U16_data, U16_dataSize, &RGB_data, &RGB_dataSize,g_IRC_Param);
308 break; 392 break;
309 393
  394 + case IRC_DEALMODE_JZSDK:
  395 + JZIrcLib_DataDeal(U16_data, U16_dataSize, &RGB_data, &RGB_dataSize,g_IRC_Param);
  396 + break;
  397 +
310 default: 398 default:
311 return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; 399 return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
312 break; 400 break;
@@ -934,7 +1022,7 @@ static T_JZsdkReturnCode IRC_param_Init(struct IRC_param **index, int height, in @@ -934,7 +1022,7 @@ static T_JZsdkReturnCode IRC_param_Init(struct IRC_param **index, int height, in
934 return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER; 1022 return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
935 } 1023 }
936 1024
937 - IrcDealCfg->DealWay = IRC_DEALMODE_KTLIB; 1025 + IrcDealCfg->DealWay = IRC_DEALMODE_JZSDK;
938 IrcDealCfg->ImgDataBits = 14; //图像为14位图像 1026 IrcDealCfg->ImgDataBits = 14; //图像为14位图像
939 IrcDealCfg->Height = height; 1027 IrcDealCfg->Height = height;
940 IrcDealCfg->Width = width; 1028 IrcDealCfg->Width = width;
@@ -955,6 +1043,8 @@ static T_JZsdkReturnCode IRC_param_Init(struct IRC_param **index, int height, in @@ -955,6 +1043,8 @@ static T_JZsdkReturnCode IRC_param_Init(struct IRC_param **index, int height, in
955 1043
956 IrcDealCfg->OutputPixelColorMode = 0; 1044 IrcDealCfg->OutputPixelColorMode = 0;
957 1045
  1046 + IrcDealCfg->RingRepair = JZ_FLAGCODE_ON;
  1047 +
958 //单点部分 1048 //单点部分
959 IrcDealCfg->FirstSPC_flag = JZ_FLAGCODE_OFF; 1049 IrcDealCfg->FirstSPC_flag = JZ_FLAGCODE_OFF;
960 IrcDealCfg->SPC_ResetFlag = JZ_FLAGCODE_OFF; 1050 IrcDealCfg->SPC_ResetFlag = JZ_FLAGCODE_OFF;
1 # cmake 最低版本要求 第三行名字不能动 1 # cmake 最低版本要求 第三行名字不能动
2 cmake_minimum_required(VERSION 2.8) 2 cmake_minimum_required(VERSION 2.8)
3 -project(JZ_U3S) 3 +project(JZ_C1)
4 4
5 set(CMAKE_C_FLAGS "-pthread -std=gnu99 -lm -ldl -lstdc++") 5 set(CMAKE_C_FLAGS "-pthread -std=gnu99 -lm -ldl -lstdc++")
6 #"-pthread":指定在编译时链接POSIX线程库,以支持多线程程序。 6 #"-pthread":指定在编译时链接POSIX线程库,以支持多线程程序。