[FFmpeg-devel] [PATCH] libopenjpeg wrapper for jpeg2k decoding

Jai Menon jmenon86
Wed Jan 28 09:53:46 CET 2009


Hi,

On Wed, Jan 28, 2009 at 1:56 PM, Diego Biurrun <diego at biurrun.de> wrote:
> On Wed, Jan 28, 2009 at 11:24:47AM +0530, Jai Menon wrote:
>>
>> --- configure (revision 16716)
>> +++ configure (working copy)
>> @@ -1904,6 +1907,7 @@
>>  enabled libmp3lame && require  libmp3lame lame/lame.h lame_init -lmp3lame -lm
>>  enabled libnut     && require  libnut libnut.h nut_demuxer_init -lnut
>> +enabled libopenjpeg && require2 libopenjpeg libopenjpeg/openjpeg.h opj_version -lopenjpeg
>
> I think 'require' should work here.

yes, changed.

>
>> --- libavcodec/libopenjpeg.c  (revision 0)
>> +++ libavcodec/libopenjpeg.c  (revision 0)
>> @@ -0,0 +1,183 @@
>> +static int check_image_attributes(opj_image_t *image)
>> +{
>> +    return(image->comps[0].dx == image->comps[1].dx
>> +           && image->comps[1].dx == image->comps[2].dx
>> +           && image->comps[0].dy == image->comps[1].dy
>> +           && image->comps[1].dy == image->comps[2].dy
>> +           && image->comps[0].prec == image->comps[1].prec
>> +           && image->comps[1].prec == image->comps[2].prec);
>
> This could be aligned in a nicer way if you put the && at the end of the line.

done.

>> +static int libopenjpeg_decode_frame(AVCodecContext *avctx,
>> +                                 void *data, int *data_size,
>> +                                 const uint8_t *buf, int buf_size)
>
> indentation

fixed.

>> +    if(!image) {
>> +    }
>> +    if (avcodec_check_dimensions(avctx, width, height) < 0) {
>> +    }
>
> Inconsistent formatting; I would suggest K&R style with spaces.

ok, done.

>> +                     av_log(avctx, AV_LOG_ERROR, "Only first component will be used\n");
>
> .
>
>> +        default: av_log(avctx, AV_LOG_ERROR, "%d components unsupported \n", image->numcomps);
>
> .
>
>> +            av_log(avctx, AV_LOG_ERROR, "Couldn't allocate image buffer\n");
>
> Here also: End sentences in a period.

sure, fixed.

> Diego

revised patch attached.

-- 
Regards,

Jai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libopenjpeg_wrapper.patch
Type: text/x-patch
Size: 11678 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090128/f0f48099/attachment.bin>



More information about the ffmpeg-devel mailing list