summaryrefslogtreecommitdiffstats
path: root/libavcodec/dnxhdenc.c
diff options
context:
space:
mode:
authorRoman Shaposhnik <roman@shaposhnik.org>2008-11-12 17:47:23 +0000
committerRoman Shaposhnik <roman@shaposhnik.org>2008-11-12 17:47:23 +0000
commit3a84713aaa5a0f83cbb3fdca62c83df609822c9c (patch)
treefb2e3a6047cc289f35bcb451bd82e85e5b2a18f1 /libavcodec/dnxhdenc.c
parent52ece4105788c533625600b887e6bc762a97508d (diff)
downloadffmpeg-streaming-3a84713aaa5a0f83cbb3fdca62c83df609822c9c.zip
ffmpeg-streaming-3a84713aaa5a0f83cbb3fdca62c83df609822c9c.tar.gz
Making it easier to send arbitrary structures as work orders to MT workers
Originally committed as revision 15804 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r--libavcodec/dnxhdenc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 6b1a214..534b850 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -449,7 +449,7 @@ static av_always_inline int dnxhd_switch_matrix(DNXHDEncContext *ctx, int i)
static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg)
{
- DNXHDEncContext *ctx = arg;
+ DNXHDEncContext *ctx = *(void**)arg;
int mb_y, mb_x;
int qscale = ctx->thread[0]->qscale;
@@ -499,7 +499,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg)
static int dnxhd_encode_thread(AVCodecContext *avctx, void *arg)
{
- DNXHDEncContext *ctx = arg;
+ DNXHDEncContext *ctx = *(void**)arg;
int mb_y, mb_x;
for (mb_y = ctx->m.start_mb_y; mb_y < ctx->m.end_mb_y; mb_y++) {
@@ -555,7 +555,7 @@ static void dnxhd_setup_threads_slices(DNXHDEncContext *ctx, uint8_t *buf)
static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg)
{
- DNXHDEncContext *ctx = arg;
+ DNXHDEncContext *ctx = *(void**)arg;
int mb_y, mb_x;
for (mb_y = ctx->m.start_mb_y; mb_y < ctx->m.end_mb_y; mb_y++) {
for (mb_x = 0; mb_x < ctx->m.mb_width; mb_x++) {
@@ -578,7 +578,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
for (q = 1; q < avctx->qmax; q++) {
ctx->qscale = q;
- avctx->execute(avctx, dnxhd_calc_bits_thread, (void**)&ctx->thread[0], NULL, avctx->thread_count);
+ avctx->execute(avctx, dnxhd_calc_bits_thread, (void**)&ctx->thread[0], NULL, avctx->thread_count, sizeof(void*));
}
up_step = down_step = 2<<LAMBDA_FRAC_BITS;
lambda = ctx->lambda;
@@ -658,7 +658,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
bits = 0;
ctx->qscale = qscale;
// XXX avoid recalculating bits
- ctx->m.avctx->execute(ctx->m.avctx, dnxhd_calc_bits_thread, (void**)&ctx->thread[0], NULL, ctx->m.avctx->thread_count);
+ ctx->m.avctx->execute(ctx->m.avctx, dnxhd_calc_bits_thread, (void**)&ctx->thread[0], NULL, ctx->m.avctx->thread_count, sizeof(void*));
for (y = 0; y < ctx->m.mb_height; y++) {
for (x = 0; x < ctx->m.mb_width; x++)
bits += ctx->mb_rc[qscale][y*ctx->m.mb_width+x].bits;
@@ -731,7 +731,7 @@ static int dnxhd_encode_fast(AVCodecContext *avctx, DNXHDEncContext *ctx)
}
if (!ret) {
if (RC_VARIANCE)
- avctx->execute(avctx, dnxhd_mb_var_thread, (void**)&ctx->thread[0], NULL, avctx->thread_count);
+ avctx->execute(avctx, dnxhd_mb_var_thread, (void**)&ctx->thread[0], NULL, avctx->thread_count, sizeof(void*));
qsort(ctx->mb_cmp, ctx->m.mb_num, sizeof(RCEntry), dnxhd_rc_cmp);
for (x = 0; x < ctx->m.mb_num && max_bits > ctx->frame_bits; x++) {
int mb = ctx->mb_cmp[x].mb;
@@ -803,7 +803,7 @@ static int dnxhd_encode_picture(AVCodecContext *avctx, unsigned char *buf, int b
assert(!(ctx->slice_size[i] & 3));
}
- avctx->execute(avctx, dnxhd_encode_thread, (void**)&ctx->thread[0], NULL, avctx->thread_count);
+ avctx->execute(avctx, dnxhd_encode_thread, (void**)&ctx->thread[0], NULL, avctx->thread_count, sizeof(void*));
AV_WB32(buf + ctx->cid_table->coding_unit_size - 4, 0x600DC0DE); // EOF
OpenPOWER on IntegriCloud