[FFmpeg-cvslog] r21866 - in trunk/libavcodec: dnxhdenc.c dsputil.c dv.c h264_loopfilter.c ituh263dec.c mpegvideo_enc.c vp3.c

mru subversion
Wed Feb 17 21:36:21 CET 2010


Author: mru
Date: Wed Feb 17 21:36:20 2010
New Revision: 21866

Log:
Use LOCAL_ALIGNED macro for local arrays

Modified:
   trunk/libavcodec/dnxhdenc.c
   trunk/libavcodec/dsputil.c
   trunk/libavcodec/dv.c
   trunk/libavcodec/h264_loopfilter.c
   trunk/libavcodec/ituh263dec.c
   trunk/libavcodec/mpegvideo_enc.c
   trunk/libavcodec/vp3.c

Modified: trunk/libavcodec/dnxhdenc.c
==============================================================================
--- trunk/libavcodec/dnxhdenc.c	Wed Feb 17 21:36:15 2010	(r21865)
+++ trunk/libavcodec/dnxhdenc.c	Wed Feb 17 21:36:20 2010	(r21866)
@@ -398,6 +398,7 @@ static int dnxhd_calc_bits_thread(AVCode
     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(AVCode
         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);
 

Modified: trunk/libavcodec/dsputil.c
==============================================================================
--- trunk/libavcodec/dsputil.c	Wed Feb 17 21:36:15 2010	(r21865)
+++ trunk/libavcodec/dsputil.c	Wed Feb 17 21:36:20 2010	(r21866)
@@ -3788,7 +3788,7 @@ static int hadamard8_intra8x8_c(/*MpegEn
 
 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(/*MpegEncCont
 
 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
 
 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(/*MpegEncCont
 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*/ vo
 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;

Modified: trunk/libavcodec/dv.c
==============================================================================
--- trunk/libavcodec/dv.c	Wed Feb 17 21:36:15 2010	(r21865)
+++ trunk/libavcodec/dv.c	Wed Feb 17 21:36:20 2010	(r21866)
@@ -532,16 +532,16 @@ static int dv_decode_video_segment(AVCod
     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_
 {
     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_
     } 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];

Modified: trunk/libavcodec/h264_loopfilter.c
==============================================================================
--- trunk/libavcodec/h264_loopfilter.c	Wed Feb 17 21:36:15 2010	(r21865)
+++ trunk/libavcodec/h264_loopfilter.c	Wed Feb 17 21:36:20 2010	(r21866)
@@ -367,7 +367,7 @@ void ff_h264_filter_mb_fast( H264Context
         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 ) {

Modified: trunk/libavcodec/ituh263dec.c
==============================================================================
--- trunk/libavcodec/ituh263dec.c	Wed Feb 17 21:36:15 2010	(r21865)
+++ trunk/libavcodec/ituh263dec.c	Wed Feb 17 21:36:20 2010	(r21866)
@@ -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

Modified: trunk/libavcodec/mpegvideo_enc.c
==============================================================================
--- trunk/libavcodec/mpegvideo_enc.c	Wed Feb 17 21:36:15 2010	(r21865)
+++ trunk/libavcodec/mpegvideo_enc.c	Wed Feb 17 21:36:20 2010	(r21866)
@@ -3311,7 +3311,7 @@ static int dct_quantize_refine(MpegEncCo
                         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;

Modified: trunk/libavcodec/vp3.c
==============================================================================
--- trunk/libavcodec/vp3.c	Wed Feb 17 21:36:15 2010	(r21865)
+++ trunk/libavcodec/vp3.c	Wed Feb 17 21:36:20 2010	(r21866)
@@ -1385,7 +1385,7 @@ static void render_slice(Vp3DecodeContex
 {
     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;



More information about the ffmpeg-cvslog mailing list