Originally committed as revision 21866 to svn://svn.ffmpeg.org/ffmpeg/trunktags/v0.6
@@ -398,6 +398,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i | |||||
DNXHDEncContext *ctx = avctx->priv_data; | DNXHDEncContext *ctx = avctx->priv_data; | ||||
int mb_y = jobnr, mb_x; | int mb_y = jobnr, mb_x; | ||||
int qscale = ctx->qscale; | int qscale = ctx->qscale; | ||||
LOCAL_ALIGNED_16(DCTELEM, block, [64]); | |||||
ctx = ctx->thread[threadnr]; | ctx = ctx->thread[threadnr]; | ||||
ctx->m.last_dc[0] = | 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); | dnxhd_get_blocks(ctx, mb_x, mb_y); | ||||
for (i = 0; i < 8; i++) { | for (i = 0; i < 8; i++) { | ||||
DECLARE_ALIGNED_16(DCTELEM, block)[64]; | |||||
DCTELEM *src_block = ctx->blocks[i]; | DCTELEM *src_block = ctx->blocks[i]; | ||||
int overflow, nbits, diff, last_index; | int overflow, nbits, diff, last_index; | ||||
int n = dnxhd_switch_matrix(ctx, i); | 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); | last_index = ctx->m.dct_quantize((MpegEncContext*)ctx, block, i, qscale, &overflow); | ||||
ac_bits += dnxhd_calc_ac_bits(ctx, block, last_index); | ac_bits += dnxhd_calc_ac_bits(ctx, block, last_index); | ||||
@@ -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){ | static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | ||||
MpegEncContext * const s= (MpegEncContext *)c; | MpegEncContext * const s= (MpegEncContext *)c; | ||||
DECLARE_ALIGNED_16(DCTELEM, temp)[64]; | |||||
LOCAL_ALIGNED_16(DCTELEM, temp, [64]); | |||||
assert(h==8); | 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){ | static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | ||||
MpegEncContext * const s= (MpegEncContext *)c; | MpegEncContext * const s= (MpegEncContext *)c; | ||||
DECLARE_ALIGNED_16(DCTELEM, temp)[64]; | |||||
LOCAL_ALIGNED_16(DCTELEM, temp, [64]); | |||||
int sum=0, i; | int sum=0, i; | ||||
assert(h==8); | 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){ | static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | ||||
MpegEncContext * const s= (MpegEncContext *)c; | MpegEncContext * const s= (MpegEncContext *)c; | ||||
DECLARE_ALIGNED_16(DCTELEM, temp)[64*2]; | |||||
LOCAL_ALIGNED_16(DCTELEM, temp, [64*2]); | |||||
DCTELEM * const bak = temp+64; | DCTELEM * const bak = temp+64; | ||||
int sum=0, i; | 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){ | static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | ||||
MpegEncContext * const s= (MpegEncContext *)c; | MpegEncContext * const s= (MpegEncContext *)c; | ||||
const uint8_t *scantable= s->intra_scantable.permutated; | 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; | int i, last, run, bits, level, distortion, start_i; | ||||
const int esc_length= s->ac_esc_length; | const int esc_length= s->ac_esc_length; | ||||
uint8_t * 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){ | static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | ||||
MpegEncContext * const s= (MpegEncContext *)c; | MpegEncContext * const s= (MpegEncContext *)c; | ||||
const uint8_t *scantable= s->intra_scantable.permutated; | 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; | int i, last, run, bits, level, start_i; | ||||
const int esc_length= s->ac_esc_length; | const int esc_length= s->ac_esc_length; | ||||
uint8_t * length; | uint8_t * length; | ||||
@@ -532,16 +532,16 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) | |||||
PutBitContext pb, vs_pb; | PutBitContext pb, vs_pb; | ||||
GetBitContext gb; | GetBitContext gb; | ||||
BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1; | 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; | const int log2_blocksize = 3-s->avctx->lowres; | ||||
int is_field_mode[5]; | int is_field_mode[5]; | ||||
assert((((int)mb_bit_buffer) & 7) == 0); | assert((((int)mb_bit_buffer) & 7) == 0); | ||||
assert((((int)vs_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 */ | /* pass 1 : read DC and AC coefficients in blocks */ | ||||
buf_ptr = &s->buf[work_chunk->buf_offset*80]; | 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 int *weight; | ||||
const uint8_t* zigzag_scan; | const uint8_t* zigzag_scan; | ||||
DECLARE_ALIGNED_16(DCTELEM, blk)[64]; | |||||
LOCAL_ALIGNED_16(DCTELEM, blk, [64]); | |||||
int i, area; | int i, area; | ||||
/* We offer two different methods for class number assignment: the | /* We offer two different methods for class number assignment: the | ||||
method suggested in SMPTE 314M Table 22, and an improved | 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 { | } else { | ||||
/* We rely on the fact that encoding all zeros leads to an immediate EOB, | /* 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. */ | 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->dct_mode = 0; | ||||
} | } | ||||
bi->mb[0] = blk[0]; | bi->mb[0] = blk[0]; | ||||
@@ -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); | filter_mb_edgech( &img_cr[2*2*uvlinesize], uvlinesize, bS3, qpc, h); | ||||
return; | return; | ||||
} else { | } 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; | uint64_t (*bSv)[4] = (uint64_t(*)[4])bS; | ||||
int edges; | int edges; | ||||
if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 ) { | if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 ) { | ||||
@@ -563,7 +563,7 @@ not_coded: | |||||
static int h263_skip_b_part(MpegEncContext *s, int cbp) | 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; | int i, mbi; | ||||
/* we have to set s->mb_intra to zero to decode B-part of PB-frame correctly | /* we have to set s->mb_intra to zero to decode B-part of PB-frame correctly | ||||
@@ -3311,7 +3311,7 @@ static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise? | |||||
DCTELEM *block, int16_t *weight, DCTELEM *orig, | DCTELEM *block, int16_t *weight, DCTELEM *orig, | ||||
int n, int qscale){ | int n, int qscale){ | ||||
int16_t rem[64]; | 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 *scantable= s->intra_scantable.scantable; | ||||
const uint8_t *perm_scantable= s->intra_scantable.permutated; | const uint8_t *perm_scantable= s->intra_scantable.permutated; | ||||
// unsigned int threshold1, threshold2; | // unsigned int threshold1, threshold2; | ||||
@@ -1385,7 +1385,7 @@ static void render_slice(Vp3DecodeContext *s, int slice) | |||||
{ | { | ||||
int x; | int x; | ||||
int16_t *dequantizer; | int16_t *dequantizer; | ||||
DECLARE_ALIGNED_16(DCTELEM, block)[64]; | |||||
LOCAL_ALIGNED_16(DCTELEM, block, [64]); | |||||
int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef; | int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef; | ||||
int motion_halfpel_index; | int motion_halfpel_index; | ||||
uint8_t *motion_source; | uint8_t *motion_source; | ||||