comparison dnxhdenc.c @ 11195:d464f498e19f libavcodec

Use LOCAL_ALIGNED macro for local arrays
author mru
date Wed, 17 Feb 2010 20:36:20 +0000
parents 34a65026fa06
children 8a4984c5cacc
comparison
equal deleted inserted replaced
11194:7b3f6955462b 11195:d464f498e19f
396 static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr) 396 static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
397 { 397 {
398 DNXHDEncContext *ctx = avctx->priv_data; 398 DNXHDEncContext *ctx = avctx->priv_data;
399 int mb_y = jobnr, mb_x; 399 int mb_y = jobnr, mb_x;
400 int qscale = ctx->qscale; 400 int qscale = ctx->qscale;
401 LOCAL_ALIGNED_16(DCTELEM, block, [64]);
401 ctx = ctx->thread[threadnr]; 402 ctx = ctx->thread[threadnr];
402 403
403 ctx->m.last_dc[0] = 404 ctx->m.last_dc[0] =
404 ctx->m.last_dc[1] = 405 ctx->m.last_dc[1] =
405 ctx->m.last_dc[2] = 1024; 406 ctx->m.last_dc[2] = 1024;
412 int i; 413 int i;
413 414
414 dnxhd_get_blocks(ctx, mb_x, mb_y); 415 dnxhd_get_blocks(ctx, mb_x, mb_y);
415 416
416 for (i = 0; i < 8; i++) { 417 for (i = 0; i < 8; i++) {
417 DECLARE_ALIGNED_16(DCTELEM, block)[64];
418 DCTELEM *src_block = ctx->blocks[i]; 418 DCTELEM *src_block = ctx->blocks[i];
419 int overflow, nbits, diff, last_index; 419 int overflow, nbits, diff, last_index;
420 int n = dnxhd_switch_matrix(ctx, i); 420 int n = dnxhd_switch_matrix(ctx, i);
421 421
422 memcpy(block, src_block, sizeof(block)); 422 memcpy(block, src_block, 64*sizeof(*block));
423 last_index = ctx->m.dct_quantize((MpegEncContext*)ctx, block, i, qscale, &overflow); 423 last_index = ctx->m.dct_quantize((MpegEncContext*)ctx, block, i, qscale, &overflow);
424 ac_bits += dnxhd_calc_ac_bits(ctx, block, last_index); 424 ac_bits += dnxhd_calc_ac_bits(ctx, block, last_index);
425 425
426 diff = block[0] - ctx->m.last_dc[n]; 426 diff = block[0] - ctx->m.last_dc[n];
427 if (diff < 0) nbits = av_log2_16bit(-2*diff); 427 if (diff < 0) nbits = av_log2_16bit(-2*diff);