CS7622
backlighting conditions. Details in dark areas stay
visible, even in very complex lighting conditions.
These three modes can be selected through 2 regis-
ter bits in operational control.
Bits_out register bits
0x
10
11
Output mode
10 bits companded
13 bits
12 bits (clipped)
Table 1.
In the 12-bit clipped mode, any input above 4095
gets clipped to 4095. In the 10-bit companded
mode, the input gets companded through a four
segment, three knees, fully programmable curve.
To program the curve, the placement of the three
knees in the companding curve must be deter-
mined. The next step is to determine the slope of
the four segments created by the three knees (slope
for each segment is defined as delta y / delta x). Fi-
nally, offsets must be calculated to keep the com-
panding curve continuous.
A fourth knee exists in the curve, which represents
the black level value. There are two options for the
10-bit black value. In case one, a linear mapping is
employed such that “blacker-than-black” pixel in-
formation is kept, with black (code 64 in the 13 bit
data) being defined as code 8 in the 10 bit domain.
The second option clips all pixel values less than
black (code 64 in the 13 bit data) to a programma-
ble offset value, offset1. This may be set to 0 if de-
sired. This option will lose the “blacker-than-
black” pixel information, but allow for slightly
more dynamic range. Note: If using the linear mode
(option 1), offset1 must be set to 8.
Registers x1 through x3 should be programmed
with the x coordinates of each one of the three
knees.
Registers slope1 through slope4 should be pro-
grammed with 256 multiplied by the calculated
slopes.
Finally, the offsets can be programmed following
the formulas below:
y1 = slope1/256 × (x1-64) + offset1
y2 = slope2/256 × (x2-x1) + y1
y3 = slope3/256 × (x3-x2) + y2
offset2 = y1 - (x1 × slope2 / 256)
offset3 = y2 - (x2 × slope3 / 256)
offset4 = y3 - (x3 × slope4 / 256)
(use integer division and discard the remainder)
When using the 10 bit companded output, be aware
of the non-linearity of the output data. If linear out-
put is needed to perform Auto White Balance
(AWB) or Automatic Gain Control (AGC), a linear
curve can be implemented to gather statistics. This
can be achieved by writing 8191 to x1 (set register
CODE_OUT
OFFSET4
OFFSET3
1023
OFFSET2
(x1,y1)
(x3,y3)
(x2,y2)
SLOPE3
SLOPE2
SLOPE4
OFFSET1
SLOPE1
64 X1
X2
X3
Figure 13. 13-to-10 bit compander
8191 CODE_IN
DS322PP1
13