This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4AH-Q1: How to calculate Mesh image size for LDC

Part Number: TDA4AH-Q1

Hi Team,

I referred below link for using LDC LUT header file,  

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1058565/faq-tda4vm-how-to-create-a-ldc-mesh-lut-for-fisheye-distortion-correction-on-tda4?keyMatch=LDC%20FAQ

for that I referred multi_cam_codec_ldc_module application logic at [ti-processor-sdk-rtos-j784s4-evm-09_02_00_05/vision_apps/apps/basic_demos/app_multi_cam_codec/multi_cam_codec_ldc_module.c] path

where they are using ldc_lut_1920x1080.h for lut and we want to use same logic 

Step1: We used the Matlab script and get the x,y co-ordinate values. As follow:

 

 

Step2: then pass this mesh.txt file to DCC tool:

 

 

 

And generate then XML and LUT.txt file:

 

Step3: XML and LUT.txt file copied in wdr folder.

 

Step4: updated generate_dcc.sh file updated the XML name:

 

Step5: after building imaging folder dcc_ldc_ar023_wdr.h file is generated in include folder

 

This file we are giving as mesh_img input in code.

 

But for our file the formula calculation is as follows:

   ldcObj->table_width = (((ldcObj->image_width / (1 << ldcObj->ds_factor)) + 1u) + 15u) & (~15u);

   ldcObj->table_height = (ldcObj->image_height / (1 << ldcObj->ds_factor)) + 1u;

ldcObj->table_width = 1920/4  +16= 496

ldcObj->table_height = 1280/4 +1 = 321

 

Total size of the table = 496*321 = 159216

And have unint 32 i.e. multiplied with 4 bytes

Then

Mesh_img = 159216 * 4 = 636864 which is not matching 623812 with dcc_ldc_ar023_wdr.h data size:

 

 

 Question is 

1. How can we calculate the mesh_img size formula to get same bytes in dcc_ldc_ar023_wdr.h file ?, we are getting garbage values