[FFmpeg-devel] JPEG2000 decoder

rukhsana afroz rukhsana.afroz at gmail.com
Mon May 2 15:42:36 CEST 2011


On Sun, May 1, 2011 at 4:42 PM, Michael Niedermayer <michaelni at gmx.at>wrote:

> Thanks for the patches.
>
> The problem i see with testfiles_jp2/file1.jp2
> is that the buf array in jasper contains signed values
> while our decoder uses unsigend uint8_t
>
> thus the values -2,-1,0,1,2 are 0xFE,0xFF,0,1,2 on our side, both
> have the same binary representation though namely
> 11111110, 11111111, 00000000, 00000001, 00000010
>
> but their type that the compiler uses to interpret them differs.
>
> Now C extends things to int when passing the arguments to printf()
> this does not change their values, they are still
> -2,-1,0,1,2 and 0xFE,0xFF,0,1,2
> but their representation now changes due to sign extension used for
> signed values, thus they become
> for jasper: 11111111111111111111111111111110,
> 11111111111111111111111111111111, 00000000000000000000000000000000, ...
> for us    : 00000000000000000000000011111110,
> 00000000000000000000000011111111, 00000000000000000000000000000000, ...
>
> and in the last step "%x" is for unsigned values and prints them as
> 0xFFFFFFFE, 0xFFFFFFFF,0x0, 0x1
> and
> 0xFE, 0xFF,0x0, 0x1
>
> Which looks different
>
> also stdout & stderr from jasper can get intermixed in somewhat
> random ways
>
>
> The following in our decoder produces identical outpiut for the values
> if the other lines are ignored
> for(x = 0; x < cblk->length; x++)
>    av_log(s->avctx, AV_LOG_INFO, "0X%02x ", (int8_t)cblk->data[x]);
>
>
>
Thank you Michael for testing the code. Yes, you are right, for file1.jp2,
the code block data is identical to jasper. But if you test p1_01.j2k file,
you will find, code block data are completely between our decoder and jasper
decoder. And, for file1.jp2, i also need to check both decoders in terms of
coding iterations, how the contexts are changed in every iteration, whether
they are identical or not. Please let me know, how you do think.



-- 
Rukhsana Ruby
Phd Student
Department of Electrical & Computer Engineering
The University of British Columbia
============================


More information about the ffmpeg-devel mailing list