I use a look-up-table created using a Gamma Curve.
GAMMA by
fiftyonepointsix, on Flickr
The idea- applying the Gamma Curve using the look-up-table going from 14-bits to 16-bits avoids "collisions", two input values mapping to the same output value that it would if going from 14-bit to 14-bit. The slope would have to exceed 4 on the curve for a collision to happen when mapping to 16-bits. I also set the Black Value of the DNG to one that better matches the CCD in my camera. Leica was throwing away a lot of shadow detail with the value they chose.
My M Monochrom with the new sensor developed an "underperforming line" evident at ISO 10,000. Well that was annoying. It took me one morning to write code to correct the error. I "hardwired" the code to my camera, meaning "Column 3203 row 3105", found by looking at the image in Photoshop. I'm...
www.rangefinderforum.com
The same code also restores under-performing Columns on the CCD. What I found: "Bad Columns" were not dead. They had a DC offset issue. On the theory that the pixel cannot change value so quickly, compute the DC offset for the column looking on each side of it- and add it back.