[x264-devel] rdo: Use ALIGNED_ARRAY for stack arrays
Anton Mitrofanov
git at videolan.org
Thu Jan 18 21:22:56 CET 2018
x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Wed Jan 17 18:19:44 2018 +0300| [d75b93b0e82cefa93e5db2d6b0be475566101431] | committer: Henrik Gramner
rdo: Use ALIGNED_ARRAY for stack arrays
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=d75b93b0e82cefa93e5db2d6b0be475566101431
---
encoder/rdo.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/encoder/rdo.c b/encoder/rdo.c
index bc92fdee..41a5dddb 100644
--- a/encoder/rdo.c
+++ b/encoder/rdo.c
@@ -912,8 +912,8 @@ int quant_trellis_cavlc( x264_t *h, dctcoef *dct,
const uint8_t *zigzag, int ctx_block_cat, int lambda2, int b_ac,
int b_chroma, int dc, int num_coefs, int idx, int b_8x8 )
{
- ALIGNED_16( dctcoef quant_coefs[2][16] );
- ALIGNED_16( dctcoef coefs[16] ) = {0};
+ ALIGNED_ARRAY_16( dctcoef, quant_coefs,[2],[16] );
+ ALIGNED_ARRAY_16( dctcoef, coefs,[16] );
const uint32_t *coef_weight1 = b_8x8 ? x264_dct8_weight_tab : x264_dct4_weight_tab;
const uint32_t *coef_weight2 = b_8x8 ? x264_dct8_weight2_tab : x264_dct4_weight2_tab;
int delta_distortion[16];
@@ -923,6 +923,9 @@ int quant_trellis_cavlc( x264_t *h, dctcoef *dct,
int nC = b_chroma && dc ? 3 + (num_coefs>>2)
: ct_index[x264_mb_predict_non_zero_code( h, !b_chroma && dc ? (idx - LUMA_DC)*16 : idx )];
+ for( i = 0; i < 16; i += 16/sizeof(*coefs) )
+ M128( &coefs[i] ) = M128_ZERO;
+
/* Code for handling 8x8dct -> 4x4dct CAVLC munging. Input/output use a different
* step/start/end than internal processing. */
int step = 1;
More information about the x264-devel
mailing list