[FFmpeg-devel] GSoC project (JPEG 2000)

Michael Niedermayer michaelni at gmx.at
Wed Apr 6 18:24:32 CEST 2011


On Tue, Apr 05, 2011 at 04:37:08PM -0700, rukhsana afroz wrote:
> On Tue, Apr 5, 2011 at 11:28 AM, Michael Niedermayer <michaelni at gmx.at>wrote:
> 
> >
> > This results in
> > J2K_SIZ = 0xff51
> > J2K_COD = 0xff52
> > J2K_COC = 0xff53
> >
> 
> Thanks Michael, I understood that, it was my mistake. While processing
> 0xff52 (J2K_SOD) marker, the current decoder fails in the following code
> segment.
> 
> /** get common part for COD and COC segments */
> static int get_cox(J2kDecoderContext *s, J2kCodingStyle *c)
> {
>     if (s->buf_end - s->buf < 5)
>         return AVERROR(EINVAL);
>           c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of
> resolution levels - 1
>      c->log2_cblk_width = bytestream_get_byte(&s->buf) + 2; // cblk width
>     c->log2_cblk_height = bytestream_get_byte(&s->buf) + 2; // cblk height
> 
>     c->cblk_style = bytestream_get_byte(&s->buf);
>     if (c->cblk_style != 0){ // cblk style
>         av_log(s->avctx, AV_LOG_ERROR, "no extra cblk styles supported\n");
>         return -1;
>     }
>     c->transform = bytestream_get_byte(&s->buf); // transformation
>     if (c->csty & J2K_CSTY_PREC) {
>         int i;
>         for (i = 0; i < c->nreslevels; i++)
>             bytestream_get_byte(&s->buf);
>     }
>     return 0;
> }
> 
> /** get coding parameters for a particular tile or whole image*/
> static int get_cod(J2kDecoderContext *s, J2kCodingStyle *c, uint8_t
> *properties)
> {
>     J2kCodingStyle tmp;
>     int compno;
> 
>     av_log(s->avctx, AV_LOG_ERROR, "Inside get_cod\n");
> 
>     if (s->buf_end - s->buf < 5)
>         return AVERROR(EINVAL);
> 
>     tmp.log2_prec_width  =
>     tmp.log2_prec_height = 15;
> 
>     tmp.csty = bytestream_get_byte(&s->buf);
> 
>     if (bytestream_get_byte(&s->buf)){ // progression level
>         av_log(s->avctx, AV_LOG_ERROR, "only LRCP progression supported\n");
>         return -1;
>     }
> 
>     tmp.nlayers = bytestream_get_be16(&s->buf);
>         tmp.mct = bytestream_get_byte(&s->buf); // multiple component
> transformation
> 
>     get_cox(s, &tmp);
>     for (compno = 0; compno < s->ncomponents; compno++){
>         if (!(properties[compno] & HAD_COC))
>             memcpy(c + compno, &tmp, sizeof(J2kCodingStyle));
>     }
>     return 0;
> }
> 
> In the get_cox function, the decoder shows the error "no extra cblk style
> supported". But, I am wondering, why this IF statement. The specification
> (page-45) says, there could be one byte in this position

I suspect the If statement is there as the implementation only supports
cblk_style==0
the others simply are not implemented

Do you think you can implement them?


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

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110406/427a517b/attachment.asc>


More information about the ffmpeg-devel mailing list