Imx6q with 10 bit image capture scaled to 16 bit

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

Imx6q with 10 bit image capture scaled to 16 bit

1,284 Views
aruncyriac
Contributor I

Hi everyone,

I am using an imx6q board to capture a raw10 bit  image. I need to scale it from 10 bit to 16 bit .

I did necessary changes such as disabling the compander . I am able to get 16 bit image as output.

My doubt is that how scaling is done to make 10bit to 16 bit . Whether 0's or 1's are simply added for  extra bits to make it 16 bit or any other technique is used?

Where can i  find the code portion for scaling ?

Labels (6)
0 Kudos
Reply
7 Replies

1,058 Views
aruncyriac
Contributor I

Dear all,

I am still facing this issue. Any help is appreciated.

0 Kudos
Reply

1,058 Views
aruncyriac
Contributor I

Hi igor,

Thank you for your response.

I looked in to that portion. But how scaling is happens from raw 10 bit to 16 bit.What will be those extra bits to make it to 16 bit ?

0 Kudos
Reply

1,058 Views
igorpadykov
NXP Employee
NXP Employee

Hi Arun

could you describe more: how

did you get 16 bit image at output.

Best regards

igor

0 Kudos
Reply

1,058 Views
aruncyriac
Contributor I

Hi igor,

We got a 16-bit output. However, our observation is that the 10-bit data is somehow scaled using some factor to make it 16-bit.

What we expect is 10-bit original data (without any alteration) padded with 0's or 1's (either at LSB or MSB) to make it 16-bit. How can we achieve this? We are using i.MX6q with OV5647 sensor.

0 Kudos
Reply

1,058 Views
igorpadykov
NXP Employee
NXP Employee

Hi Arun

if you did not add special processing, then seems ipu just

writes camera 10 bits data to the MSB of a 16-bit word, this is

described in Table 37-2. Data Formats Supported By The Camera Port

i.MX6DQ Reference Manual

http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf

Best regards

igor

0 Kudos
Reply

1,058 Views
aruncyriac
Contributor I

Hi igor,

In mxc_v4l2_capture.c, we are using index 1 (CSI MEM) as input. Hence, we assume there is no special processing involved in storing 10-bit data in 2 bytes. Is this correct?

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

static struct v4l2_input mxc_capture_inputs[MXC_V4L2_CAPTURE_NUM_INPUTS] = {

    {

     .index = 0,

     .name = "CSI IC MEM",

     .type = V4L2_INPUT_TYPE_CAMERA,

     .audioset = 0,

     .tuner = 0,

     .std = V4L2_STD_UNKNOWN,

     .status = 0,

     },

    {

     .index = 1,

     .name = "CSI MEM",

     .type = V4L2_INPUT_TYPE_CAMERA,

     .audioset = 0,

     .tuner = 0,

     .std = V4L2_STD_UNKNOWN,

     .status = V4L2_IN_ST_NO_POWER,

     },

};

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

0 Kudos
Reply

1,058 Views
igorpadykov
NXP Employee
NXP Employee

Hi Arun

I am not aware of companding examples but

companding formula is given in sect.37.4.3.5 Companding i.MX6DQ RM:

Companding is performed as follows:

input: 10-bit unsigned number.In case that component's size is bigger than 10 bit, 10

MSB bits are taken. In case that component's size is less than 10 bit, color extraction is

performed.

First step: shift:

x-> clip(x + offset, 0, 1023)

where the offset is a 10 bit signed number that is configured in CPD_OFFSET1 and

CPD_OFFSET2 registers.

second step - piecewise-linear map:

y = Min[255, (y1[k]+(((x-x1[k])*slope[k])>>6 + 1))>>1]

where:

- the input range 0..1023 is partitioned to 16 equal segments: x1[k] .. x1[k+1] - 1 where

x1[k] = 0, 64, 128, 192, 256, .. . 960.

- The linear map, in each segment, is characterized by y1[k] (9-bit unsigned number) and

slope[k] (8-bit unsigned number).

Best regards

igor

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

Note: If this post answers your question, please click the Correct Answer button. Thank you!

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