Mercurial > libavcodec.hg
comparison dsputil.c @ 10094:a1f5f022adba libavcodec
dsputil: declare some arrays 16-byte aligned
These arrays are passed to functions for which we promise 16-byte
alignment, so make sure we fulfil that promise.
author | mru |
---|---|
date | Wed, 26 Aug 2009 13:17:06 +0000 |
parents | 1315878bc455 |
children | 0fa3d21b317e |
comparison
equal
deleted
inserted
replaced
10093:beb616cf1885 | 10094:a1f5f022adba |
---|---|
3786 } | 3786 } |
3787 #endif | 3787 #endif |
3788 | 3788 |
3789 static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 3789 static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
3790 MpegEncContext * const s= (MpegEncContext *)c; | 3790 MpegEncContext * const s= (MpegEncContext *)c; |
3791 DECLARE_ALIGNED_8(uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]); | 3791 DECLARE_ALIGNED_16(uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]); |
3792 DCTELEM * const temp= (DCTELEM*)aligned_temp; | 3792 DCTELEM * const temp= (DCTELEM*)aligned_temp; |
3793 int sum=0, i; | 3793 int sum=0, i; |
3794 | 3794 |
3795 assert(h==8); | 3795 assert(h==8); |
3796 | 3796 |
3803 return sum; | 3803 return sum; |
3804 } | 3804 } |
3805 | 3805 |
3806 static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 3806 static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
3807 MpegEncContext * const s= (MpegEncContext *)c; | 3807 MpegEncContext * const s= (MpegEncContext *)c; |
3808 DECLARE_ALIGNED_8 (uint64_t, aligned_temp[sizeof(DCTELEM)*64*2/8]); | 3808 DECLARE_ALIGNED_16(uint64_t, aligned_temp[sizeof(DCTELEM)*64*2/8]); |
3809 DCTELEM * const temp= (DCTELEM*)aligned_temp; | 3809 DCTELEM * const temp= (DCTELEM*)aligned_temp; |
3810 DCTELEM * const bak = ((DCTELEM*)aligned_temp)+64; | 3810 DCTELEM * const bak = ((DCTELEM*)aligned_temp)+64; |
3811 int sum=0, i; | 3811 int sum=0, i; |
3812 | 3812 |
3813 assert(h==8); | 3813 assert(h==8); |
3828 } | 3828 } |
3829 | 3829 |
3830 static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 3830 static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
3831 MpegEncContext * const s= (MpegEncContext *)c; | 3831 MpegEncContext * const s= (MpegEncContext *)c; |
3832 const uint8_t *scantable= s->intra_scantable.permutated; | 3832 const uint8_t *scantable= s->intra_scantable.permutated; |
3833 DECLARE_ALIGNED_8 (uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]); | 3833 DECLARE_ALIGNED_16(uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]); |
3834 DECLARE_ALIGNED_8 (uint64_t, aligned_src1[8]); | 3834 DECLARE_ALIGNED_16(uint64_t, aligned_src1[8]); |
3835 DECLARE_ALIGNED_8 (uint64_t, aligned_src2[8]); | 3835 DECLARE_ALIGNED_16(uint64_t, aligned_src2[8]); |
3836 DCTELEM * const temp= (DCTELEM*)aligned_temp; | 3836 DCTELEM * const temp= (DCTELEM*)aligned_temp; |
3837 uint8_t * const lsrc1 = (uint8_t*)aligned_src1; | 3837 uint8_t * const lsrc1 = (uint8_t*)aligned_src1; |
3838 uint8_t * const lsrc2 = (uint8_t*)aligned_src2; | 3838 uint8_t * const lsrc2 = (uint8_t*)aligned_src2; |
3839 int i, last, run, bits, level, distortion, start_i; | 3839 int i, last, run, bits, level, distortion, start_i; |
3840 const int esc_length= s->ac_esc_length; | 3840 const int esc_length= s->ac_esc_length; |
3907 } | 3907 } |
3908 | 3908 |
3909 static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 3909 static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
3910 MpegEncContext * const s= (MpegEncContext *)c; | 3910 MpegEncContext * const s= (MpegEncContext *)c; |
3911 const uint8_t *scantable= s->intra_scantable.permutated; | 3911 const uint8_t *scantable= s->intra_scantable.permutated; |
3912 DECLARE_ALIGNED_8 (uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]); | 3912 DECLARE_ALIGNED_16(uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]); |
3913 DCTELEM * const temp= (DCTELEM*)aligned_temp; | 3913 DCTELEM * const temp= (DCTELEM*)aligned_temp; |
3914 int i, last, run, bits, level, start_i; | 3914 int i, last, run, bits, level, start_i; |
3915 const int esc_length= s->ac_esc_length; | 3915 const int esc_length= s->ac_esc_length; |
3916 uint8_t * length; | 3916 uint8_t * length; |
3917 uint8_t * last_length; | 3917 uint8_t * last_length; |