[FFmpeg-devel] [PATCH] avcodec/ffv1dec: fix some unsupported pix_fmt

Jerome Martinez jerome at mediaarea.net
Mon Jun 13 21:57:03 CEST 2016

Le 13/06/2016 à 19:31, Jerome Martinez a écrit :
> [...]
> - JPEG 2000 RCT 9/10/12/14 bit depths with alpha are mapped to a 
> FFmpeg pix_fmt without alpha (e.g. AV_PIX_FMT_GBRP9 for 9-bit with 
> alpha), which is not expected.

Sorry, I forgot a remark about this part of the patch: the decoder can 
decode the bitstream, the issue is that the alpha content is trashed:

             if (lbd)
                 *((uint32_t*)(src[0] + x*4 + stride[0]*y)) = b + (g<<8) 
+ (r<<16) + (a<<24);
             else {
                 *((uint16_t*)(src[0] + x*2 + stride[0]*y)) = b;
                 *((uint16_t*)(src[1] + x*2 + stride[1]*y)) = g;
                 *((uint16_t*)(src[2] + x*2 + stride[2]*y)) = r;

(lbd is 1 if s->avctx->bits_per_raw_sample <= 8, "a" is used in that case)

In my patch, I chose to forbid the decoding in order to not let the user 
think that the decoding is lossless, but another possibility is to add a 

More information about the ffmpeg-devel mailing list