static int thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size)

{

    SliceThreadContext *c = avctx->internal->thread_ctx;

    int dummy_ret;



    if (!(avctx->active_thread_type&FF_THREAD_SLICE) || avctx->thread_count <= 1)

        return avcodec_default_execute(avctx, func, arg, ret, job_count, job_size);



    if (job_count <= 0)

        return 0;



    pthread_mutex_lock(&c->current_job_lock);



    c->current_job = avctx->thread_count;

    c->job_count = job_count;

    c->job_size = job_size;

    c->args = arg;

    c->func = func;

    if (ret) {

        c->rets = ret;

        c->rets_count = job_count;

    } else {

        c->rets = &dummy_ret;

        c->rets_count = 1;

    }

    c->current_execute++;

    pthread_cond_broadcast(&c->current_job_cond);



    thread_park_workers(c, avctx->thread_count);



    return 0;

}

static int thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size)

{

    SliceThreadContext *c = avctx->internal->thread_ctx;

    int dummy_ret;



    if (!(avctx->active_thread_type&FF_THREAD_SLICE) || avctx->thread_count <= 1)

        return avcodec_default_execute(avctx, func, arg, ret, job_count, job_size);



    if (job_count <= 0)

        return 0;



    pthread_mutex_lock(&c->current_job_lock);



    c->current_job = avctx->thread_count;

    c->job_count = job_count;

    c->job_size = job_size;

    c->args = arg;

    c->func = func;

    if (ret) {

        c->rets = ret;

        c->rets_count = job_count;

    } else {

        c->rets = &dummy_ret;

        c->rets_count = 1;

    }

    c->current_execute++;

    pthread_cond_broadcast(&c->current_job_cond);



    thread_park_workers(c, avctx->thread_count);



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, action_func* VAR_1, void *VAR_2, int *VAR_3, int VAR_4, int VAR_5)

{

    SliceThreadContext *c = VAR_0->internal->thread_ctx;

    int VAR_6;



    if (!(VAR_0->active_thread_type&FF_THREAD_SLICE) || VAR_0->thread_count <= 1)

        return avcodec_default_execute(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4, VAR_5);



    if (VAR_4 <= 0)

        return 0;



    pthread_mutex_lock(&c->current_job_lock);



    c->current_job = VAR_0->thread_count;

    c->VAR_4 = VAR_4;

    c->VAR_5 = VAR_5;

    c->args = VAR_2;

    c->VAR_1 = VAR_1;

    if (VAR_3) {

        c->rets = VAR_3;

        c->rets_count = VAR_4;

    } else {

        c->rets = &VAR_6;

        c->rets_count = 1;

    }

    c->current_execute++;

    pthread_cond_broadcast(&c->current_job_cond);



    thread_park_workers(c, VAR_0->thread_count);



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, action_func* VAR_1, void *VAR_2, int *VAR_3, int VAR_4, int VAR_5)
{ SliceThreadContext *c = VAR_0->internal->thread_ctx; int VAR_6; if (!(VAR_0->active_thread_type&FF_THREAD_SLICE) || VAR_0->thread_count <= 1)
return avcodec_default_execute(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4, VAR_5); if (VAR_4 <= 0)
return 0; pthread_mutex_lock(&c->current_job_lock); c->current_job = VAR_0->thread_count; c->VAR_4 = VAR_4; c->VAR_5 = VAR_5; c->args = VAR_2; c->VAR_1 = VAR_1; if (VAR_3) { c->rets = VAR_3; c->rets_count = VAR_4; } else { c->rets = &VAR_6; c->rets_count = 1; } c->current_execute++; pthread_cond_broadcast(&c->current_job_cond); thread_park_workers(c, VAR_0->thread_count); return 0; }