static int encode_slice_plane(AVCodecContext *avctx, int mb_count,

        uint8_t *src, int src_stride, uint8_t *buf, unsigned buf_size,

        int *qmat, int chroma)

{

    ProresContext* ctx = avctx->priv_data;

    FDCTDSPContext *fdsp = &ctx->fdsp;

    DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block;

    int i, blocks_per_slice;

    PutBitContext pb;



    block = blocks;

    for (i = 0; i < mb_count; i++) {

        fdct_get(fdsp, src,                  src_stride, block + (0 << 6));

        fdct_get(fdsp, src + 8 * src_stride, src_stride, block + ((2 - chroma) << 6));

        if (!chroma) {

            fdct_get(fdsp, src + 16,                  src_stride, block + (1 << 6));

            fdct_get(fdsp, src + 16 + 8 * src_stride, src_stride, block + (3 << 6));

        }



        block += (256 >> chroma);

        src   += (32  >> chroma);

    }



    blocks_per_slice = mb_count << (2 - chroma);

    init_put_bits(&pb, buf, buf_size << 3);



    encode_dc_coeffs(&pb, blocks, blocks_per_slice, qmat);

    encode_ac_coeffs(avctx, &pb, blocks, blocks_per_slice, qmat);



    flush_put_bits(&pb);

    return put_bits_ptr(&pb) - pb.buf;

}

static int encode_slice_plane(AVCodecContext *avctx, int mb_count,

        uint8_t *src, int src_stride, uint8_t *buf, unsigned buf_size,

        int *qmat, int chroma)

{

    ProresContext* ctx = avctx->priv_data;

    FDCTDSPContext *fdsp = &ctx->fdsp;

    DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block;

    int i, blocks_per_slice;

    PutBitContext pb;



    block = blocks;

    for (i = 0; i < mb_count; i++) {

        fdct_get(fdsp, src,                  src_stride, block + (0 << 6));

        fdct_get(fdsp, src + 8 * src_stride, src_stride, block + ((2 - chroma) << 6));

        if (!chroma) {

            fdct_get(fdsp, src + 16,                  src_stride, block + (1 << 6));

            fdct_get(fdsp, src + 16 + 8 * src_stride, src_stride, block + (3 << 6));

        }



        block += (256 >> chroma);

        src   += (32  >> chroma);

    }



    blocks_per_slice = mb_count << (2 - chroma);

    init_put_bits(&pb, buf, buf_size << 3);



    encode_dc_coeffs(&pb, blocks, blocks_per_slice, qmat);

    encode_ac_coeffs(avctx, &pb, blocks, blocks_per_slice, qmat);



    flush_put_bits(&pb);

    return put_bits_ptr(&pb) - pb.buf;

}

    init_put_bits(&pb, buf, buf_size << 3);
static int FUNC_0(AVCodecContext *VAR_0, int VAR_1,

        uint8_t *VAR_2, int VAR_3, uint8_t *VAR_4, unsigned VAR_5,

        int *VAR_6, int VAR_7)

{

    ProresContext* ctx = VAR_0->priv_data;

    FDCTDSPContext *fdsp = &ctx->fdsp;

    DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block;

    int VAR_8, VAR_9;

    PutBitContext pb;



    block = blocks;

    for (VAR_8 = 0; VAR_8 < VAR_1; VAR_8++) {

        fdct_get(fdsp, VAR_2,                  VAR_3, block + (0 << 6));

        fdct_get(fdsp, VAR_2 + 8 * VAR_3, VAR_3, block + ((2 - VAR_7) << 6));

        if (!VAR_7) {

            fdct_get(fdsp, VAR_2 + 16,                  VAR_3, block + (1 << 6));

            fdct_get(fdsp, VAR_2 + 16 + 8 * VAR_3, VAR_3, block + (3 << 6));

        }



        block += (256 >> VAR_7);

        VAR_2   += (32  >> VAR_7);

    }



    VAR_9 = VAR_1 << (2 - VAR_7);

    init_put_bits(&pb, VAR_4, VAR_5 << 3);



    encode_dc_coeffs(&pb, blocks, VAR_9, VAR_6);

    encode_ac_coeffs(VAR_0, &pb, blocks, VAR_9, VAR_6);



    flush_put_bits(&pb);

    return put_bits_ptr(&pb) - pb.VAR_4;

}

static int FUNC_0(AVCodecContext *VAR_0, int VAR_1,
uint8_t *VAR_2, int VAR_3, uint8_t *VAR_4, unsigned VAR_5,
int *VAR_6, int VAR_7)
{ ProresContext* ctx = VAR_0->priv_data; FDCTDSPContext *fdsp = &ctx->fdsp; DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block; int VAR_8, VAR_9; PutBitContext pb; block = blocks; for (VAR_8 = 0; VAR_8 < VAR_1; VAR_8++) { fdct_get(fdsp, VAR_2,                  VAR_3, block + (0 << 6)); fdct_get(fdsp, VAR_2 + 8 * VAR_3, VAR_3, block + ((2 - VAR_7) << 6)); if (!VAR_7) { fdct_get(fdsp, VAR_2 + 16,                  VAR_3, block + (1 << 6)); fdct_get(fdsp, VAR_2 + 16 + 8 * VAR_3, VAR_3, block + (3 << 6)); } block += (256 >> VAR_7); VAR_2   += (32  >> VAR_7); } VAR_9 = VAR_1 << (2 - VAR_7); init_put_bits(&pb, VAR_4, VAR_5 << 3); encode_dc_coeffs(&pb, blocks, VAR_9, VAR_6); encode_ac_coeffs(VAR_0, &pb, blocks, VAR_9, VAR_6); flush_put_bits(&pb); return put_bits_ptr(&pb) - pb.VAR_4; }