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_WARNING, "extra cblk styles %X\n", c->cblk_style);

    }

    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;

}

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; 

     c->log2_cblk_width = bytestream_get_byte(&s->buf) + 2; 

    c->log2_cblk_height = bytestream_get_byte(&s->buf) + 2; 



    c->cblk_style = bytestream_get_byte(&s->buf);

    if (c->cblk_style != 0){ 

        av_log(s->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", c->cblk_style);

    }

    c->transform = bytestream_get_byte(&s->buf); 

    if (c->csty & J2K_CSTY_PREC) {

        int i;

        for (i = 0; i < c->nreslevels; i++)

            bytestream_get_byte(&s->buf);

    }

    return 0;

}

        return AVERROR(EINVAL);     if (s->buf_end - s->buf < 5)     c->cblk_style = bytestream_get_byte(&s->buf);             bytestream_get_byte(&s->buf);     if (s->buf_end - s->buf < 5)
static int FUNC_0(J2kDecoderContext *VAR_0, J2kCodingStyle *VAR_1)

{

    if (VAR_0->buf_end - VAR_0->buf < 5)

        return AVERROR(EINVAL);

          VAR_1->nreslevels = bytestream_get_byte(&VAR_0->buf) + 1; 

     VAR_1->log2_cblk_width = bytestream_get_byte(&VAR_0->buf) + 2; 

    VAR_1->log2_cblk_height = bytestream_get_byte(&VAR_0->buf) + 2; 



    VAR_1->cblk_style = bytestream_get_byte(&VAR_0->buf);

    if (VAR_1->cblk_style != 0){ 

        av_log(VAR_0->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", VAR_1->cblk_style);

    }

    VAR_1->transform = bytestream_get_byte(&VAR_0->buf); 

    if (VAR_1->csty & J2K_CSTY_PREC) {

        int VAR_2;

        for (VAR_2 = 0; VAR_2 < VAR_1->nreslevels; VAR_2++)

            bytestream_get_byte(&VAR_0->buf);

    }

    return 0;

}

static int FUNC_0(J2kDecoderContext *VAR_0, J2kCodingStyle *VAR_1)
{ if (VAR_0->buf_end - VAR_0->buf < 5)
return AVERROR(EINVAL); VAR_1->nreslevels = bytestream_get_byte(&VAR_0->buf) + 1; VAR_1->log2_cblk_width = bytestream_get_byte(&VAR_0->buf) + 2; VAR_1->log2_cblk_height = bytestream_get_byte(&VAR_0->buf) + 2; VAR_1->cblk_style = bytestream_get_byte(&VAR_0->buf); if (VAR_1->cblk_style != 0){ av_log(VAR_0->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", VAR_1->cblk_style); } VAR_1->transform = bytestream_get_byte(&VAR_0->buf); if (VAR_1->csty & J2K_CSTY_PREC) { int VAR_2; for (VAR_2 = 0; VAR_2 < VAR_1->nreslevels; VAR_2++) bytestream_get_byte(&VAR_0->buf); } return 0; }