[x264-devel] commit: Cosmetics: use sizeof() where appropriate (Henrik Gramner )
git at videolan.org
git at videolan.org
Sun Mar 28 04:44:31 CEST 2010
x264 | branch: master | Henrik Gramner <hengar-6 at student.ltu.se> | Tue Mar 16 01:46:00 2010 +0100| [8a919f81065cccb65ff7c989fffec9258362900b] | committer: Jason Garrett-Glaser
Cosmetics: use sizeof() where appropriate
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=8a919f81065cccb65ff7c989fffec9258362900b
---
common/common.c | 12 ++++++------
common/macroblock.c | 7 +++----
encoder/macroblock.c | 2 +-
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/common/common.c b/common/common.c
index 73a848a..6ef9767 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 d2e92db..f2bc31f 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 8bfdf84..3bfe38c 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;
}
More information about the x264-devel
mailing list