[IMX8MP] ISP PWL de-companding calculation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[IMX8MP] ISP PWL de-companding calculation

2,341 Views
jjiimmyy
Contributor II

Hi,

From reading the Camera and Display guide, it seems the X axis knee point distance has to be 2^n. 

Screenshot from 2024-12-10 10-06-25.png

 

I am porting a sensor whose PWL decmpanding data  can not meet IMX8MP ISP PWL spec.  Please the attached data points. 

Do you have suggestion? 

I can adjust X and Y, but the following data (20 -> 12 bits) is provided by the sensor FAE. 

Screenshot from 2024-12-10 10-03-38.png

 

0 Kudos
Reply
20 Replies

429 Views
joanxie
NXP TechSupport
NXP TechSupport

根据我们之前邮件沟通的,你只要把我发给你的

compress curve configuration换成compress.txt里的,把expand curve configuration换成expand.txt里面的。

 

 

0 Kudos
Reply

87 Views
jjiimmyy
Contributor II
Joan,

I replied you in the email about the effect of the compress.txt and expand.txt. There is an attachment for the comparison.

Please help clarifying

Thanks
0 Kudos
Reply

669 Views
joanxie
NXP TechSupport
NXP TechSupport

as I mentioned in the mail, 

Here are my comments for the next step:

1. "I can get the compress curve from our SENSOR FAE." As the customer can provide the compress curve, they can give it to us. But it should be in the right format as I have showed before. They can put the compress curve into the compress curve function and I can generate the expand curve for them.

2. For the calibration tool, we did not know that nxp will renew the contrast with vsi. Now we are discussing with vsi how to share the new tool with our customers. Customer will be able to get the tool in the future.

0 Kudos
Reply

602 Views
jjiimmyy
Contributor II

Hi Joan,

I reply you in the email.

There are a few things I need to clarity with you before asking our 

sensor FAE to provide the sensor data in the VSI format. 

Thanks

0 Kudos
Reply

1,660 Views
joanxie
NXP TechSupport
NXP TechSupport

"Please help me clarify #2

 

  1. XXX_get_expand_curve(….)  in isp-vvcam

I need to fit sensor PWL data to the ISP for the de-compand curve. I understand this.

 

  1. xxx_IsiSensorGetCompressCurveIss(…) in isp-imx

 

I does not fully understand what I need to do with this function for the NATIVE HDR sensor.  

Please tell me what I need to do.  "

 

 >for your question, I got reply is that you can just put your curve file in the  IsiSensorGetCompressCurveIss function of isp-imx like picture as below.  The IsiSensorGetExpandCurveIss will read the expand curve from vvcam driver

joanxie_0-1737531972267.png

 

0 Kudos
Reply

1,613 Views
jjiimmyy
Contributor II

@joanxie 

I reply you in the mail.

My concern is this function OV2775_IsiSensorGetCompressCurveIss(…)

does not match with OV2775 PWL compress curve equation.

--------------------------------------------------------------------------

On the other hand, the OV2775 de-compressing function in isp-vvcam does

match with OV2775 de-compression equation.

I need to clarify this issue before asking sensor FAE to adjust data for the ISP.

 

 

 

0 Kudos
Reply

1,608 Views
joanxie
NXP TechSupport
NXP TechSupport

My concern is this function OV2775_IsiSensorGetCompressCurveIss(…)

does not match with OV2775 PWL compress curve equation.

>why do you say this? after you add your curve file, what error do you get?

0 Kudos
Reply

1,590 Views
jjiimmyy
Contributor II

@joanxie 

This compress curve function XXX_IsiSensorGetCompressCurveIss(…) affects

the brightness and color of the image. My concern is the "CORRECTNESS" of implementing

this function. There is no error when I add the data points in this function. 

OV2775 the datasheet provides the compress curve equation. And  OV2775_IsiSensorGetCompressCurveIss(…)  you provided

does not follow the OV2775 compress equation.

You can pick any data point in the  OV2775_IsiSensorGetCompressCurveIss(…) and it just does not match with OV2775 compress equation. 

x[0] = 0, x[1]= 1024, px[0] = 10, y[0] = 0, y[1] = 390

Using OV2755 equation, y[1] = (1024 / 4) + 256 = 512

If OV2775_IsiSensorGetCompressCurveIss is really for OV2775 compress curve,

please tell me, why y[1] is 390 instead of 512 ?

Also the 1st knee point in the compression equation is 1024, but this function has no data points < 1024.

I attach the OV2775 equation and the function you provided previously again.

Please help to check the math.

joan.png

 

 

 

 

 

 

 

0 Kudos
Reply

2,289 Views
jjiimmyy
Contributor II

@joanxie 

Thanks for double checking with IMX8MP ISP spec. 

Our sensor is OMNIVISION OX03F10 which is NATIVE HDR, so PWL is used (20 bits -> 12 bits) . 

When you said  "if you set correct bits and numbers for px, x", I understand this.  

But the restriction from IMX8MP document and vvcam example ov2775 follows this rule, 

(1 << px[n]) = x[n+1] - x[n] 

But the sensor FAE provides the table that contradicts this rule.

I attached PWL X and Y table from the sensor FAE.

Could you tell me what the values should be for px[0], px[1] and px[2]?

I also attached a snippet of ov2775 codes from vvcam.

Thanks a lot

0 Kudos
Reply

2,283 Views
joanxie
NXP TechSupport
NXP TechSupport

I know this, I already read this document and ov2775 code before, and confirm this limitation, as I mentioned before, for native HDR camera, the sensor company only offer the companding curver, for de-companding curver, need to consult from ISP IP owner, we also need to consult from them, couldn't offer now

0 Kudos
Reply

2,259 Views
jjiimmyy
Contributor II

@joanxie 

If you find out the answer from the ISP owner. Please let me know.

Also, if you think our sensor needs to adjust the PWL values for the ISP, let me know as well. 

Thanks

0 Kudos
Reply

2,254 Views
joanxie
NXP TechSupport
NXP TechSupport

of course, any update, I will tell you

0 Kudos
Reply

2,075 Views
jjiimmyy
Contributor II

@joanxie 

 

Do you have any update on this issue?

 

 

0 Kudos
Reply

2,065 Views
joanxie
NXP TechSupport
NXP TechSupport

the vendor has released a new version of calibration tool which includes the function of calculating the decompression curve. We will review and do the field trial then share it with customers.

0 Kudos
Reply

1,974 Views
jjiimmyy
Contributor II

@joanxie 

 

I uploaded PWL data in the support portal.

Please help me setup the correct data structure in the isp-vvcam driver and isp-imx functions.

 

Thanks

0 Kudos
Reply

1,962 Views
joanxie
NXP TechSupport
NXP TechSupport

"If native HDR is needed, we can provide the curve after we get feedback from vsi. Then we will give instructions for how to change the code manually."

0 Kudos
Reply

2,288 Views
jjiimmyy
Contributor II

Screenshot from 2024-12-12 10-19-17.pngScreenshot from 2024-12-12 10-00-14.png

@joanxie 

Attached the PWL table and ov2775 PWL example 

 

0 Kudos
Reply

2,301 Views
joanxie
NXP TechSupport
NXP TechSupport

double confirm, do your camera is native HDR mode? if yes, maybe need ISP IP owner to calculate this curve, but you need offer more detailed information, where do you need to use this, if not native HDR, just try to use default one firstly

0 Kudos
Reply

2,307 Views
joanxie
NXP TechSupport
NXP TechSupport

confirm this again, customer doesn't need to care about this curve, ISP would convert it internal, so you just use the default one sensor company gave you

0 Kudos
Reply

2,308 Views
joanxie
NXP TechSupport
NXP TechSupport

didn't hear ISP has specific limitation for this, if you set correct bits and numbers for px, x, and we don't suggest customer to change this curve which should be offered by the sensor company, you can use default one firstly, if you have any issue, then contact us again

0 Kudos
Reply