1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Use LOCAL_ALIGNED macro for local arrays

Originally committed as revision 21866 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2010-02-17 20:36:20 +00:00
parent e6a0c3540d
commit 40d1122752
7 changed files with 19 additions and 19 deletions

View File

@ -398,6 +398,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i
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 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i
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);

View File

@ -3788,7 +3788,7 @@ static int hadamard8_intra8x8_c(/*MpegEncContext*/ void *s, uint8_t *src, uint8_
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 dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s
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 dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2
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 quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s
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 rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int
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;

View File

@ -532,16 +532,16 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
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 @@ static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i
{
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 @@ static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i
} 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];

View File

@ -367,7 +367,7 @@ void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y,
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 ) {

View File

@ -563,7 +563,7 @@ not_coded:
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

View File

@ -3311,7 +3311,7 @@ static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise?
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;

View File

@ -1385,7 +1385,7 @@ static void render_slice(Vp3DecodeContext *s, int slice)
{
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;