[FFmpeg-devel] [RFC PATCH v2] libavcodec/jpeg2000_parser: Add jpeg2000 parser

Michael Niedermayer michael at niedermayer.cc
Wed May 20 23:21:44 EEST 2020


On Wed, May 20, 2020 at 08:48:41PM +0530, Gautam Ramakrishnan wrote:
> On Tue, Apr 21, 2020 at 3:41 AM Michael Niedermayer
> <michael at niedermayer.cc> wrote:
> >
> > On Mon, Apr 20, 2020 at 04:13:44PM +0530, Gautam Ramakrishnan wrote:
> > > On Mon, Apr 20, 2020 at 3:38 PM Michael Niedermayer
> > > <michael at niedermayer.cc> wrote:
> > > >
> > > > On Mon, Apr 20, 2020 at 01:36:47AM +0530, gautamramk at gmail.com wrote:
> > > > > From: Gautam Ramakrishnan <gautamramk at gmail.com>
> > > > >
> > > > > I have attempted to write a JPEG2000 Parser. Need
> > > > > help on testing the code and some tips on how to
> > > >
> > > > to test the code i would sugest to generate a file
> > > > or files with many jpeg2000 images and then try to
> > > > decode it to -f framecrc
> > > This helps me check whether the image is correct by comparing the CRC value?
> > > > if that work repeat while varying the packet size
> > > > input to the parser, a parser must work with anything
> > > > from 1 byte per input to sizes being larger than a
> > > > single frame.
> > > >
> > > So a packet to a parser is basically a smaller unit to which the parser is fed
> > > data to? When I tried printing buffer size during parse, it shows 4096.
> >
> > > Does that mean the packet size was 4096?
> >
> > yes, that likely comes from
> > libavformat/img2dec.c:            size[0] = 4096;
> From my understanding of the documentation, the -packetsize option can
> change the
> value from 4096 to any particular I want right? However when I try setting the
> -packetsize option, the buf_size variable still shows up as 4096.

img2dec hardcodes 4096, thats something you could change of course.
packetsize currently is listed with AV_OPT_FLAG_ENCODING_PARAM so its a muxer
option. Some demuxers seem to set packet_size though instead of using it as
input from the user
The header does not document packet_size with any detail

Its probably best to add a new AVOption to img2dec to adjust the 4096

also improving the documentation is certainly not a bad idea

Thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200520/28b81055/attachment.sig>


More information about the ffmpeg-devel mailing list