# HG changeset patch # User mru # Date 1266438980 0 # Node ID d464f498e19fcbcd9d11027a7daf221db1da6368 # Parent 7b3f6955462b4ad0cdcaa3fbdfb71409ec3b0e8a Use LOCAL_ALIGNED macro for local arrays diff -r 7b3f6955462b -r d464f498e19f dnxhdenc.c --- a/dnxhdenc.c Wed Feb 17 20:36:12 2010 +0000 +++ b/dnxhdenc.c Wed Feb 17 20:36:20 2010 +0000 @@ -398,6 +398,7 @@ DNXHDEncContext *ctx = avctx->priv_data; int mb_y = jobnr, mb_x; int qscale = ctx->qscale; + LOCAL_ALIGNED_16(DCTELEM, block, [64]); ctx = ctx->thread[threadnr]; ctx->m.last_dc[0] = @@ -414,12 +415,11 @@ dnxhd_get_blocks(ctx, mb_x, mb_y); for (i = 0; i < 8; i++) { - DECLARE_ALIGNED_16(DCTELEM, block)[64]; DCTELEM *src_block = ctx->blocks[i]; int overflow, nbits, diff, last_index; int n = dnxhd_switch_matrix(ctx, i); - memcpy(block, src_block, sizeof(block)); + memcpy(block, src_block, 64*sizeof(*block)); last_index = ctx->m.dct_quantize((MpegEncContext*)ctx, block, i, qscale, &overflow); ac_bits += dnxhd_calc_ac_bits(ctx, block, last_index); diff -r 7b3f6955462b -r d464f498e19f dsputil.c --- a/dsputil.c Wed Feb 17 20:36:12 2010 +0000 +++ b/dsputil.c Wed Feb 17 20:36:20 2010 +0000 @@ -3788,7 +3788,7 @@ static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; - DECLARE_ALIGNED_16(DCTELEM, temp)[64]; + LOCAL_ALIGNED_16(DCTELEM, temp, [64]); assert(h==8); @@ -3852,7 +3852,7 @@ static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; - DECLARE_ALIGNED_16(DCTELEM, temp)[64]; + LOCAL_ALIGNED_16(DCTELEM, temp, [64]); int sum=0, i; assert(h==8); @@ -3868,7 +3868,7 @@ static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; - DECLARE_ALIGNED_16(DCTELEM, temp)[64*2]; + LOCAL_ALIGNED_16(DCTELEM, temp, [64*2]); DCTELEM * const bak = temp+64; int sum=0, i; @@ -3892,9 +3892,9 @@ static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; const uint8_t *scantable= s->intra_scantable.permutated; - DECLARE_ALIGNED_16(DCTELEM, temp)[64]; - DECLARE_ALIGNED_16(uint8_t, lsrc1)[64]; - DECLARE_ALIGNED_16(uint8_t, lsrc2)[64]; + LOCAL_ALIGNED_16(DCTELEM, temp, [64]); + LOCAL_ALIGNED_16(uint8_t, lsrc1, [64]); + LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]); int i, last, run, bits, level, distortion, start_i; const int esc_length= s->ac_esc_length; uint8_t * length; @@ -3968,7 +3968,7 @@ static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; const uint8_t *scantable= s->intra_scantable.permutated; - DECLARE_ALIGNED_16(DCTELEM, temp)[64]; + LOCAL_ALIGNED_16(DCTELEM, temp, [64]); int i, last, run, bits, level, start_i; const int esc_length= s->ac_esc_length; uint8_t * length; diff -r 7b3f6955462b -r d464f498e19f dv.c --- a/dv.c Wed Feb 17 20:36:12 2010 +0000 +++ b/dv.c Wed Feb 17 20:36:20 2010 +0000 @@ -532,16 +532,16 @@ PutBitContext pb, vs_pb; GetBitContext gb; BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1; - DECLARE_ALIGNED_16(DCTELEM, sblock)[5*DV_MAX_BPM][64]; - DECLARE_ALIGNED_16(uint8_t, mb_bit_buffer)[80 + 4]; /* allow some slack */ - DECLARE_ALIGNED_16(uint8_t, vs_bit_buffer)[5 * 80 + 4]; /* allow some slack */ + LOCAL_ALIGNED_16(DCTELEM, sblock, [5*DV_MAX_BPM], [64]); + LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [80 + 4]); /* allow some slack */ + LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5 * 80 + 4]); /* allow some slack */ const int log2_blocksize = 3-s->avctx->lowres; int is_field_mode[5]; assert((((int)mb_bit_buffer) & 7) == 0); assert((((int)vs_bit_buffer) & 7) == 0); - memset(sblock, 0, sizeof(sblock)); + memset(sblock, 0, 5*DV_MAX_BPM*sizeof(*sblock)); /* pass 1 : read DC and AC coefficients in blocks */ buf_ptr = &s->buf[work_chunk->buf_offset*80]; @@ -833,7 +833,7 @@ { const int *weight; const uint8_t* zigzag_scan; - DECLARE_ALIGNED_16(DCTELEM, blk)[64]; + LOCAL_ALIGNED_16(DCTELEM, blk, [64]); int i, area; /* We offer two different methods for class number assignment: the method suggested in SMPTE 314M Table 22, and an improved @@ -866,7 +866,7 @@ } else { /* We rely on the fact that encoding all zeros leads to an immediate EOB, which is precisely what the spec calls for in the "dummy" blocks. */ - memset(blk, 0, sizeof(blk)); + memset(blk, 0, 64*sizeof(*blk)); bi->dct_mode = 0; } bi->mb[0] = blk[0]; diff -r 7b3f6955462b -r d464f498e19f h264_loopfilter.c --- a/h264_loopfilter.c Wed Feb 17 20:36:12 2010 +0000 +++ b/h264_loopfilter.c Wed Feb 17 20:36:20 2010 +0000 @@ -367,7 +367,7 @@ filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, h); return; } else { - DECLARE_ALIGNED_8(int16_t, bS)[2][4][4]; + LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]); uint64_t (*bSv)[4] = (uint64_t(*)[4])bS; int edges; if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 ) { diff -r 7b3f6955462b -r d464f498e19f ituh263dec.c --- a/ituh263dec.c Wed Feb 17 20:36:12 2010 +0000 +++ b/ituh263dec.c Wed Feb 17 20:36:20 2010 +0000 @@ -563,7 +563,7 @@ static int h263_skip_b_part(MpegEncContext *s, int cbp) { - DECLARE_ALIGNED(16, DCTELEM, dblock)[64]; + LOCAL_ALIGNED_16(DCTELEM, dblock, [64]); int i, mbi; /* we have to set s->mb_intra to zero to decode B-part of PB-frame correctly diff -r 7b3f6955462b -r d464f498e19f mpegvideo_enc.c --- a/mpegvideo_enc.c Wed Feb 17 20:36:12 2010 +0000 +++ b/mpegvideo_enc.c Wed Feb 17 20:36:20 2010 +0000 @@ -3311,7 +3311,7 @@ DCTELEM *block, int16_t *weight, DCTELEM *orig, int n, int qscale){ int16_t rem[64]; - DECLARE_ALIGNED_16(DCTELEM, d1)[64]; + LOCAL_ALIGNED_16(DCTELEM, d1, [64]); const uint8_t *scantable= s->intra_scantable.scantable; const uint8_t *perm_scantable= s->intra_scantable.permutated; // unsigned int threshold1, threshold2; diff -r 7b3f6955462b -r d464f498e19f vp3.c --- a/vp3.c Wed Feb 17 20:36:12 2010 +0000 +++ b/vp3.c Wed Feb 17 20:36:20 2010 +0000 @@ -1385,7 +1385,7 @@ { int x; int16_t *dequantizer; - DECLARE_ALIGNED_16(DCTELEM, block)[64]; + LOCAL_ALIGNED_16(DCTELEM, block, [64]); int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef; int motion_halfpel_index; uint8_t *motion_source;