Commit 729d9bcc authored by Fiona Glaser's avatar Fiona Glaser

Fix some crashes with high bit depth

Not all arrays were sufficiently aligned.
parent f92aa4ec
......@@ -500,7 +500,7 @@ SATD_X_DECL7( _neon )
#define INTRA_MBCMP_8x8( mbcmp, cpu )\
void x264_intra_##mbcmp##_x3_8x8##cpu( pixel *fenc, pixel edge[33], int res[3] )\
{\
pixel pix[8*FDEC_STRIDE];\
ALIGNED_ARRAY_16( pixel, pix, [8*FDEC_STRIDE] );\
x264_predict_8x8_v_c( pix, edge );\
res[0] = x264_pixel_##mbcmp##_8x8##cpu( pix, FDEC_STRIDE, fenc, FENC_STRIDE );\
x264_predict_8x8_h_c( pix, edge );\
......
......@@ -1530,7 +1530,7 @@ static void x264_mb_analyse_inter_p8x16( x264_t *h, x264_mb_analysis_t *a, int i
static int x264_mb_analyse_inter_p4x4_chroma( x264_t *h, x264_mb_analysis_t *a, pixel **p_fref, int i8x8, int size )
{
ALIGNED_ARRAY_8( pixel, pix1,[16*8] );
ALIGNED_ARRAY_16( pixel, pix1,[16*8] );
pixel *pix2 = pix1+8;
const int i_stride = h->mb.pic.i_stride[1];
const int or = 8*(i8x8&1) + 2*(i8x8&2)*i_stride;
......@@ -1686,8 +1686,8 @@ static void x264_mb_analyse_inter_p4x8( x264_t *h, x264_mb_analysis_t *a, int i8
static ALWAYS_INLINE int x264_analyse_bi_chroma( x264_t *h, x264_mb_analysis_t *a, int idx, int i_pixel )
{
ALIGNED_ARRAY_8( pixel, pix, [4],[8*8] );
ALIGNED_ARRAY_8( pixel, bi, [2],[8*8] );
ALIGNED_ARRAY_16( pixel, pix, [4],[8*8] );
ALIGNED_ARRAY_16( pixel, bi, [2],[8*8] );
int l0_mvy_offset, l1_mvy_offset;
int i_chroma_cost = 0;
......@@ -1875,8 +1875,8 @@ static void x264_mb_analyse_inter_b16x16( x264_t *h, x264_mb_analysis_t *a )
if( h->mb.b_chroma_me )
{
ALIGNED_ARRAY_8( pixel, pixuv, [2],[8*FENC_STRIDE] );
ALIGNED_ARRAY_8( pixel, bi, [8*FENC_STRIDE] );
ALIGNED_ARRAY_16( pixel, pixuv, [2],[8*FENC_STRIDE] );
ALIGNED_ARRAY_16( pixel, bi, [8*FENC_STRIDE] );
if( h->mb.b_interlaced & a->l0.bi16x16.i_ref )
{
......@@ -2018,7 +2018,7 @@ static inline void x264_mb_cache_mv_b8x16( x264_t *h, x264_mb_analysis_t *a, int
static void x264_mb_analyse_inter_b8x8_mixed_ref( x264_t *h, x264_mb_analysis_t *a )
{
ALIGNED_ARRAY_8( pixel, pix,[2],[8*8] );
ALIGNED_ARRAY_16( pixel, pix,[2],[8*8] );
int i_maxref[2] = {h->mb.pic.i_fref[0]-1, h->mb.pic.i_fref[1]-1};
/* early termination: if 16x16 chose ref 0, then evalute no refs older
......@@ -2133,7 +2133,7 @@ static void x264_mb_analyse_inter_b8x8( x264_t *h, x264_mb_analysis_t *a )
pixel **p_fref[2] =
{ h->mb.pic.p_fref[0][a->l0.me16x16.i_ref],
h->mb.pic.p_fref[1][a->l1.me16x16.i_ref] };
ALIGNED_ARRAY_8( pixel, pix,[2],[8*8] );
ALIGNED_ARRAY_16( pixel, pix,[2],[8*8] );
/* XXX Needed for x264_mb_predict_mv */
h->mb.i_partition = D_8x8;
......@@ -2301,7 +2301,7 @@ static void x264_mb_analyse_inter_b16x8( x264_t *h, x264_mb_analysis_t *a, int i
static void x264_mb_analyse_inter_b8x16( x264_t *h, x264_mb_analysis_t *a, int i_best_satd )
{
ALIGNED_ARRAY_8( pixel, pix,[2],[8*16] );
ALIGNED_ARRAY_16( pixel, pix,[2],[8*16] );
ALIGNED_4( int16_t mvc[3][2] );
h->mb.i_partition = D_8x16;
......
......@@ -945,8 +945,8 @@ static void ALWAYS_INLINE x264_me_refine_bidir( x264_t *h, x264_me_t *m0, x264_m
const int bw = x264_pixel_size[i_pixel].w;
const int bh = x264_pixel_size[i_pixel].h;
ALIGNED_ARRAY_16( pixel, pixy_buf,[2],[9][16*16] );
ALIGNED_ARRAY_8( pixel, pixu_buf,[2],[9][8*8] );
ALIGNED_ARRAY_8( pixel, pixv_buf,[2],[9][8*8] );
ALIGNED_ARRAY_16( pixel, pixu_buf,[2],[9][8*8] );
ALIGNED_ARRAY_16( pixel, pixv_buf,[2],[9][8*8] );
pixel *src[2][9];
pixel *pix = &h->mb.pic.p_fdec[0][8*x + 8*y*FDEC_STRIDE];
pixel *pixu = &h->mb.pic.p_fdec[1][4*x + 4*y*FDEC_STRIDE];
......
......@@ -159,7 +159,7 @@ static NOINLINE unsigned int x264_weight_cost_luma( x264_t *h, x264_frame_t *fen
int i_lines = fenc->i_lines_lowres;
int i_width = fenc->i_width_lowres;
pixel *fenc_plane = fenc->lowres[0];
ALIGNED_ARRAY_8( pixel, buf,[8*8] );
ALIGNED_ARRAY_16( pixel, buf,[8*8] );
int pixoff = 0;
int i_mb = 0;
......@@ -189,9 +189,9 @@ static NOINLINE unsigned int x264_weight_cost_chroma( x264_t *h, x264_frame_t *f
int i_lines = fenc->i_lines[1];
int i_width = fenc->i_width[1];
pixel *src = ref + i_offset;
ALIGNED_ARRAY_8( pixel, buf, [8*8] );
ALIGNED_ARRAY_16( pixel, buf, [8*8] );
int pixoff = 0;
ALIGNED_8( pixel flat[8] ) = {0};
ALIGNED_16( static pixel flat [8] ) = {0};
if( w )
{
for( int y = 0; y < i_lines; y += 8, pixoff = y*i_stride )
......@@ -370,7 +370,7 @@ static void x264_slicetype_mb_cost( x264_t *h, x264_mb_analysis_t *a,
i_mb_y > 0 && i_mb_y < h->mb.i_mb_height - 1) ||
h->mb.i_mb_width <= 2 || h->mb.i_mb_height <= 2;
ALIGNED_ARRAY_8( pixel, pix1,[9*FDEC_STRIDE] );
ALIGNED_ARRAY_16( pixel, pix1,[9*FDEC_STRIDE] );
pixel *pix2 = pix1+8;
x264_me_t m[2];
int i_bcost = COST_MAX;
......
......@@ -536,7 +536,7 @@ static int check_dct( int cpu_ref, int cpu_new )
ALIGNED_16( dctcoef dct2[16][16] );
ALIGNED_16( dctcoef dct4[16][16] );
ALIGNED_16( dctcoef dct8[4][64] );
ALIGNED_8( dctcoef dctdc[2][4] );
ALIGNED_16( dctcoef dctdc[2][4] );
x264_t h_buf;
x264_t *h = &h_buf;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment