From: Henrik Gramner Date: Tue, 16 Mar 2010 00:46:00 +0000 (+0100) Subject: Cosmetics: use sizeof() where appropriate X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=8a919f81065cccb65ff7c989fffec9258362900b;p=x264.git Cosmetics: use sizeof() where appropriate --- diff --git a/common/common.c b/common/common.c index 73a848a2..6ef9767c 100644 --- a/common/common.c +++ b/common/common.c @@ -146,12 +146,12 @@ void x264_param_default( x264_param_t *param ) param->analyse.b_ssim = 0; param->i_cqm_preset = X264_CQM_FLAT; - memset( param->cqm_4iy, 16, 16 ); - memset( param->cqm_4ic, 16, 16 ); - memset( param->cqm_4py, 16, 16 ); - memset( param->cqm_4pc, 16, 16 ); - memset( param->cqm_8iy, 16, 64 ); - memset( param->cqm_8py, 16, 64 ); + memset( param->cqm_4iy, 16, sizeof( param->cqm_4iy ) ); + memset( param->cqm_4ic, 16, sizeof( param->cqm_4ic ) ); + memset( param->cqm_4py, 16, sizeof( param->cqm_4py ) ); + memset( param->cqm_4pc, 16, sizeof( param->cqm_4pc ) ); + memset( param->cqm_8iy, 16, sizeof( param->cqm_8iy ) ); + memset( param->cqm_8py, 16, sizeof( param->cqm_8py ) ); param->b_repeat_headers = 1; param->b_annexb = 1; diff --git a/common/macroblock.c b/common/macroblock.c index d2e92db0..f2bc31f4 100644 --- a/common/macroblock.c +++ b/common/macroblock.c @@ -838,11 +838,10 @@ void x264_macroblock_slice_init( x264_t *h ) } } if( h->sh.i_type == SLICE_TYPE_P ) - memset( h->mb.cache.skip, 0, X264_SCAN8_SIZE * sizeof( int8_t ) ); + memset( h->mb.cache.skip, 0, sizeof( h->mb.cache.skip ) ); /* init with not available (for top right idx=7,15) */ - memset( h->mb.cache.ref[0], -2, X264_SCAN8_SIZE * sizeof( int8_t ) ); - memset( h->mb.cache.ref[1], -2, X264_SCAN8_SIZE * sizeof( int8_t ) ); + memset( h->mb.cache.ref, -2, sizeof( h->mb.cache.ref ) ); setup_inverse_delta_pocs( h ); @@ -1333,7 +1332,7 @@ void x264_macroblock_cache_save( x264_t *h ) h->mb.i_cbp_luma = 0xf; h->mb.cbp[i_mb_xy] = 0x72f; /* all set */ h->mb.b_transform_8x8 = 0; - memset( non_zero_count, 16, 24 ); + memset( non_zero_count, 16, sizeof( *h->mb.non_zero_count ) ); } else { diff --git a/encoder/macroblock.c b/encoder/macroblock.c index 8bfdf84c..3bfe38c6 100644 --- a/encoder/macroblock.c +++ b/encoder/macroblock.c @@ -464,7 +464,7 @@ static void x264_macroblock_encode_skip( x264_t *h ) { h->mb.i_cbp_luma = 0x00; h->mb.i_cbp_chroma = 0x00; - memset( h->mb.cache.non_zero_count, 0, X264_SCAN8_SIZE ); + memset( h->mb.cache.non_zero_count, 0, sizeof( h->mb.cache.non_zero_count ) ); /* store cbp */ h->mb.cbp[h->mb.i_mb_xy] = 0; }