[FFmpeg-devel] Pixel format 12bit grayscale

Marco Porsch m.porsch at intenta.de
Mon Apr 13 11:59:57 CEST 2015


Hi,

our automotive cameras generate a weird kind of 12bit RAW format that I would like to encode using FFVHUFF. Unfortunately, the 12bit grayscale pixel format is not yet supported.
Can you point me on the right track to implement this pixel format? And will the encoder be able to handle the 12bit depth?

I'll draw a little ASCII art concerning the bit mapping below. Basically a group of 4x8bit MSBs are given as block followed by a 4x4bit LSBs block. The pattern continues correspondingly.

|---------------------|---------------------|---------------------|---------------------|
|      P0[11..4]      |      P1[11..4]      |      P2[11..4]      |      P3[11..4]      |
|---------------------|---------------------|---------------------|---------------------|
| P0[0..3] | P1[0..3] | P2[0..3] | P3[0..3] |      P4[11..4]      |      P5[11..4]      |
|---------------------|---------------------|---------------------|---------------------|
|      P6[11..4]      |      P7[11..4]      | P4[0..3] | P5[0..3] | P6[0..3] | P7[0..3] |
|---------------------|---------------------|---------------------|---------------------|
|      P8[11..4]      |      P9[11..4]      |     P10[11..4]      |     P11[11..4]      |
|---------------------|---------------------|---------------------|---------------------|
| P8[0..3] | P9[0..3] |P10[0..3] |P11[0..3] |
|---------------------|---------------------|

Previously we had regular 16bit RAW that worked like a charm as input to FFmpeg. The naïve approach of upscaling the 12bit to 16bit destroys the compression efficiency of course...

Thanks and best regards,
--Marco


More information about the ffmpeg-devel mailing list