[FFmpeg-devel] openjpeg: 12bits JP2 file (16bits support + patch)
Mathieu Malaterre
mathieu.malaterre
Thu Feb 12 10:58:33 CET 2009
On Wed, Feb 11, 2009 at 7:15 PM, Baptiste Coudurier
<baptiste.coudurier at gmail.com> wrote:
> Hi,
>
> On 2/11/2009 5:50 AM, Mathieu Malaterre wrote:
>> [...]
>>
>
> Some nipticks:
>
>> @@ -114,7 +115,11 @@
>>
>> switch(image->numcomps)
>> {
>> - case 1: avctx->pix_fmt = PIX_FMT_GRAY8;
>> + case 1: if( image->comps[0].prec <= 8) avctx->pix_fmt = PIX_FMT_GRAY8;
>> + else if( image->comps[0].prec <= 16) avctx->pix_fmt = PIX_FMT_GRAY16LE;
>> + //else if( image->comps[0].prec <= 32) avctx->pix_fmt = PIX_FMT_GRAY32;
>
> Space after '('
>
>> + else av_log(avctx, AV_LOG_ERROR, "%d components prec unsupported.\n", image->comps[0].prec );
>
> Space before ')'
>
>> + assert( image->comps[0].sgnd == 0 );
>
> Space after '(' and before ')'
>
>> break;
>> case 3: if(check_image_attributes(image)) {
>> avctx->pix_fmt = PIX_FMT_RGB24;
>> @@ -145,8 +150,13 @@
>> for(y = 0; y < height; y++) {
>> index = y*width;
>> img_ptr = picture->data[0] + y*picture->linesize[0];
>> + img_ptr16 = picture->data[0] + y*picture->linesize[0];
>> for(x = 0; x < width; x++, index++) {
>> - *img_ptr++ = image->comps[0].data[index] >> adjust[0];
>> + if( avctx->pix_fmt == PIX_FMT_GRAY8 )
done.
But again I am not 100% sure about the patch:
1. Does not handle 32bits grayscale image
2. Does not handle pixel sign (j2k allow signed pixel data)
Thanks anyway,
--
Mathieu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openjpeg2.patch
Type: text/x-diff
Size: 1882 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090212/17406055/attachment.patch>
More information about the ffmpeg-devel
mailing list