int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)

{

    AVCodecContext *const avctx = h->avctx;

    H264Context *hx;

    int i;



    if (h->mb_y >= h->mb_height) {

        av_log(h->avctx, AV_LOG_ERROR,

               "Input contains more MB rows than the frame height.\n");

        return AVERROR_INVALIDDATA;

    }



    if (h->avctx->hwaccel)

        return 0;

    if (context_count == 1) {

        return decode_slice(avctx, &h);

    } else {

        for (i = 1; i < context_count; i++) {

            hx                 = h->thread_context[i];

            hx->er.error_count = 0;

        }



        avctx->execute(avctx, decode_slice, h->thread_context,

                       NULL, context_count, sizeof(void *));



        /* pull back stuff from slices to master context */

        hx                   = h->thread_context[context_count - 1];

        h->mb_x              = hx->mb_x;

        h->mb_y              = hx->mb_y;

        h->droppable         = hx->droppable;

        h->picture_structure = hx->picture_structure;

        for (i = 1; i < context_count; i++)

            h->er.error_count += h->thread_context[i]->er.error_count;

    }



    return 0;

}

int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)

{

    AVCodecContext *const avctx = h->avctx;

    H264Context *hx;

    int i;



    if (h->mb_y >= h->mb_height) {

        av_log(h->avctx, AV_LOG_ERROR,

               "Input contains more MB rows than the frame height.\n");

        return AVERROR_INVALIDDATA;

    }



    if (h->avctx->hwaccel)

        return 0;

    if (context_count == 1) {

        return decode_slice(avctx, &h);

    } else {

        for (i = 1; i < context_count; i++) {

            hx                 = h->thread_context[i];

            hx->er.error_count = 0;

        }



        avctx->execute(avctx, decode_slice, h->thread_context,

                       NULL, context_count, sizeof(void *));



        

        hx                   = h->thread_context[context_count - 1];

        h->mb_x              = hx->mb_x;

        h->mb_y              = hx->mb_y;

        h->droppable         = hx->droppable;

        h->picture_structure = hx->picture_structure;

        for (i = 1; i < context_count; i++)

            h->er.error_count += h->thread_context[i]->er.error_count;

    }



    return 0;

}

int FUNC_0(H264Context *VAR_0, unsigned VAR_1)

{

    AVCodecContext *const avctx = VAR_0->avctx;

    H264Context *hx;

    int VAR_2;



    if (VAR_0->mb_y >= VAR_0->mb_height) {

        av_log(VAR_0->avctx, AV_LOG_ERROR,

               "Input contains more MB rows than the frame height.\n");

        return AVERROR_INVALIDDATA;

    }



    if (VAR_0->avctx->hwaccel)

        return 0;

    if (VAR_1 == 1) {

        return decode_slice(avctx, &VAR_0);

    } else {

        for (VAR_2 = 1; VAR_2 < VAR_1; VAR_2++) {

            hx                 = VAR_0->thread_context[VAR_2];

            hx->er.error_count = 0;

        }



        avctx->execute(avctx, decode_slice, VAR_0->thread_context,

                       NULL, VAR_1, sizeof(void *));



        

        hx                   = VAR_0->thread_context[VAR_1 - 1];

        VAR_0->mb_x              = hx->mb_x;

        VAR_0->mb_y              = hx->mb_y;

        VAR_0->droppable         = hx->droppable;

        VAR_0->picture_structure = hx->picture_structure;

        for (VAR_2 = 1; VAR_2 < VAR_1; VAR_2++)

            VAR_0->er.error_count += VAR_0->thread_context[VAR_2]->er.error_count;

    }



    return 0;

}

int FUNC_0(H264Context *VAR_0, unsigned VAR_1)
{ AVCodecContext *const avctx = VAR_0->avctx; H264Context *hx; int VAR_2; if (VAR_0->mb_y >= VAR_0->mb_height) { av_log(VAR_0->avctx, AV_LOG_ERROR,
"Input contains more MB rows than the frame height.\n"); return AVERROR_INVALIDDATA; } if (VAR_0->avctx->hwaccel)
return 0; if (VAR_1 == 1) { return decode_slice(avctx, &VAR_0); } else { for (VAR_2 = 1; VAR_2 < VAR_1; VAR_2++) { hx                 = VAR_0->thread_context[VAR_2]; hx->er.error_count = 0; } avctx->execute(avctx, decode_slice, VAR_0->thread_context,
NULL, VAR_1, sizeof(void *)); hx                   = VAR_0->thread_context[VAR_1 - 1]; VAR_0->mb_x              = hx->mb_x; VAR_0->mb_y              = hx->mb_y; VAR_0->droppable         = hx->droppable; VAR_0->picture_structure = hx->picture_structure; for (VAR_2 = 1; VAR_2 < VAR_1; VAR_2++) VAR_0->er.error_count += VAR_0->thread_context[VAR_2]->er.error_count; } return 0; }