static void dirac_unpack_block_motion_data(DiracContext *s)

{

    GetBitContext *gb = &s->gb;

    uint8_t *sbsplit = s->sbsplit;

    int i, x, y, q, p;

    DiracArith arith[8];



    align_get_bits(gb);



    /* [DIRAC_STD] 11.2.4 and 12.2.1 Number of blocks and superblocks */

    s->sbwidth  = DIVRNDUP(s->source.width,  4*s->plane[0].xbsep);

    s->sbheight = DIVRNDUP(s->source.height, 4*s->plane[0].ybsep);

    s->blwidth  = 4 * s->sbwidth;

    s->blheight = 4 * s->sbheight;



    /* [DIRAC_STD] 12.3.1 Superblock splitting modes. superblock_split_modes()

       decode superblock split modes */

    ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb));     /* svq3_get_ue_golomb(gb) is the length */

    for (y = 0; y < s->sbheight; y++) {

        for (x = 0; x < s->sbwidth; x++) {

            int split  = dirac_get_arith_uint(arith, CTX_SB_F1, CTX_SB_DATA);

            sbsplit[x] = (split + pred_sbsplit(sbsplit+x, s->sbwidth, x, y)) % 3;

        }

        sbsplit += s->sbwidth;

    }



    /* setup arith decoding */

    ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb));

    for (i = 0; i < s->num_refs; i++) {

        ff_dirac_init_arith_decoder(arith + 4 + 2 * i, gb, svq3_get_ue_golomb(gb));

        ff_dirac_init_arith_decoder(arith + 5 + 2 * i, gb, svq3_get_ue_golomb(gb));

    }

    for (i = 0; i < 3; i++)

        ff_dirac_init_arith_decoder(arith+1+i, gb, svq3_get_ue_golomb(gb));



    for (y = 0; y < s->sbheight; y++)

        for (x = 0; x < s->sbwidth; x++) {

            int blkcnt = 1 << s->sbsplit[y * s->sbwidth + x];

            int step   = 4 >> s->sbsplit[y * s->sbwidth + x];



            for (q = 0; q < blkcnt; q++)

                for (p = 0; p < blkcnt; p++) {

                    int bx = 4 * x + p*step;

                    int by = 4 * y + q*step;

                    DiracBlock *block = &s->blmotion[by*s->blwidth + bx];

                    decode_block_params(s, arith, block, s->blwidth, bx, by);

                    propagate_block_data(block, s->blwidth, step);

                }

        }

}

static void dirac_unpack_block_motion_data(DiracContext *s)

{

    GetBitContext *gb = &s->gb;

    uint8_t *sbsplit = s->sbsplit;

    int i, x, y, q, p;

    DiracArith arith[8];



    align_get_bits(gb);



    

    s->sbwidth  = DIVRNDUP(s->source.width,  4*s->plane[0].xbsep);

    s->sbheight = DIVRNDUP(s->source.height, 4*s->plane[0].ybsep);

    s->blwidth  = 4 * s->sbwidth;

    s->blheight = 4 * s->sbheight;



    



    ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb));     

    for (y = 0; y < s->sbheight; y++) {

        for (x = 0; x < s->sbwidth; x++) {

            int split  = dirac_get_arith_uint(arith, CTX_SB_F1, CTX_SB_DATA);

            sbsplit[x] = (split + pred_sbsplit(sbsplit+x, s->sbwidth, x, y)) % 3;

        }

        sbsplit += s->sbwidth;

    }



    

    ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb));

    for (i = 0; i < s->num_refs; i++) {

        ff_dirac_init_arith_decoder(arith + 4 + 2 * i, gb, svq3_get_ue_golomb(gb));

        ff_dirac_init_arith_decoder(arith + 5 + 2 * i, gb, svq3_get_ue_golomb(gb));

    }

    for (i = 0; i < 3; i++)

        ff_dirac_init_arith_decoder(arith+1+i, gb, svq3_get_ue_golomb(gb));



    for (y = 0; y < s->sbheight; y++)

        for (x = 0; x < s->sbwidth; x++) {

            int blkcnt = 1 << s->sbsplit[y * s->sbwidth + x];

            int step   = 4 >> s->sbsplit[y * s->sbwidth + x];



            for (q = 0; q < blkcnt; q++)

                for (p = 0; p < blkcnt; p++) {

                    int bx = 4 * x + p*step;

                    int by = 4 * y + q*step;

                    DiracBlock *block = &s->blmotion[by*s->blwidth + bx];

                    decode_block_params(s, arith, block, s->blwidth, bx, by);

                    propagate_block_data(block, s->blwidth, step);

                }

        }

}

static void dirac_unpack_block_motion_data(DiracContext *s)             int split  = dirac_get_arith_uint(arith, CTX_SB_F1, CTX_SB_DATA);
static void FUNC_0(DiracContext *VAR_0)

{

    GetBitContext *gb = &VAR_0->gb;

    uint8_t *sbsplit = VAR_0->sbsplit;

    int VAR_1, VAR_2, VAR_3, VAR_4, VAR_5;

    DiracArith arith[8];



    align_get_bits(gb);



    

    VAR_0->sbwidth  = DIVRNDUP(VAR_0->source.width,  4*VAR_0->plane[0].xbsep);

    VAR_0->sbheight = DIVRNDUP(VAR_0->source.height, 4*VAR_0->plane[0].ybsep);

    VAR_0->blwidth  = 4 * VAR_0->sbwidth;

    VAR_0->blheight = 4 * VAR_0->sbheight;



    



    ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb));     

    for (VAR_3 = 0; VAR_3 < VAR_0->sbheight; VAR_3++) {

        for (VAR_2 = 0; VAR_2 < VAR_0->sbwidth; VAR_2++) {

            int split  = dirac_get_arith_uint(arith, CTX_SB_F1, CTX_SB_DATA);

            sbsplit[VAR_2] = (split + pred_sbsplit(sbsplit+VAR_2, VAR_0->sbwidth, VAR_2, VAR_3)) % 3;

        }

        sbsplit += VAR_0->sbwidth;

    }



    

    ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb));

    for (VAR_1 = 0; VAR_1 < VAR_0->num_refs; VAR_1++) {

        ff_dirac_init_arith_decoder(arith + 4 + 2 * VAR_1, gb, svq3_get_ue_golomb(gb));

        ff_dirac_init_arith_decoder(arith + 5 + 2 * VAR_1, gb, svq3_get_ue_golomb(gb));

    }

    for (VAR_1 = 0; VAR_1 < 3; VAR_1++)

        ff_dirac_init_arith_decoder(arith+1+VAR_1, gb, svq3_get_ue_golomb(gb));



    for (VAR_3 = 0; VAR_3 < VAR_0->sbheight; VAR_3++)

        for (VAR_2 = 0; VAR_2 < VAR_0->sbwidth; VAR_2++) {

            int blkcnt = 1 << VAR_0->sbsplit[VAR_3 * VAR_0->sbwidth + VAR_2];

            int step   = 4 >> VAR_0->sbsplit[VAR_3 * VAR_0->sbwidth + VAR_2];



            for (VAR_4 = 0; VAR_4 < blkcnt; VAR_4++)

                for (VAR_5 = 0; VAR_5 < blkcnt; VAR_5++) {

                    int bx = 4 * VAR_2 + VAR_5*step;

                    int by = 4 * VAR_3 + VAR_4*step;

                    DiracBlock *block = &VAR_0->blmotion[by*VAR_0->blwidth + bx];

                    decode_block_params(VAR_0, arith, block, VAR_0->blwidth, bx, by);

                    propagate_block_data(block, VAR_0->blwidth, step);

                }

        }

}

static void FUNC_0(DiracContext *VAR_0)
{ GetBitContext *gb = &VAR_0->gb; uint8_t *sbsplit = VAR_0->sbsplit; int VAR_1, VAR_2, VAR_3, VAR_4, VAR_5; DiracArith arith[8]; align_get_bits(gb); VAR_0->sbwidth  = DIVRNDUP(VAR_0->source.width,  4*VAR_0->plane[0].xbsep); VAR_0->sbheight = DIVRNDUP(VAR_0->source.height, 4*VAR_0->plane[0].ybsep); VAR_0->blwidth  = 4 * VAR_0->sbwidth; VAR_0->blheight = 4 * VAR_0->sbheight; ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb)); for (VAR_3 = 0; VAR_3 < VAR_0->sbheight; VAR_3++) { for (VAR_2 = 0; VAR_2 < VAR_0->sbwidth; VAR_2++) { int split  = dirac_get_arith_uint(arith, CTX_SB_F1, CTX_SB_DATA); sbsplit[VAR_2] = (split + pred_sbsplit(sbsplit+VAR_2, VAR_0->sbwidth, VAR_2, VAR_3)) % 3; } sbsplit += VAR_0->sbwidth; } ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb)); for (VAR_1 = 0; VAR_1 < VAR_0->num_refs; VAR_1++) { ff_dirac_init_arith_decoder(arith + 4 + 2 * VAR_1, gb, svq3_get_ue_golomb(gb)); ff_dirac_init_arith_decoder(arith + 5 + 2 * VAR_1, gb, svq3_get_ue_golomb(gb)); } for (VAR_1 = 0; VAR_1 < 3; VAR_1++) ff_dirac_init_arith_decoder(arith+1+VAR_1, gb, svq3_get_ue_golomb(gb)); for (VAR_3 = 0; VAR_3 < VAR_0->sbheight; VAR_3++) for (VAR_2 = 0; VAR_2 < VAR_0->sbwidth; VAR_2++) { int blkcnt = 1 << VAR_0->sbsplit[VAR_3 * VAR_0->sbwidth + VAR_2]; int step   = 4 >> VAR_0->sbsplit[VAR_3 * VAR_0->sbwidth + VAR_2]; for (VAR_4 = 0; VAR_4 < blkcnt; VAR_4++) for (VAR_5 = 0; VAR_5 < blkcnt; VAR_5++) { int bx = 4 * VAR_2 + VAR_5*step; int by = 4 * VAR_3 + VAR_4*step; DiracBlock *block = &VAR_0->blmotion[by*VAR_0->blwidth + bx]; decode_block_params(VAR_0, arith, block, VAR_0->blwidth, bx, by); propagate_block_data(block, VAR_0->blwidth, step); } } }