diff options
author | Diego Biurrun <diego@biurrun.de> | 2011-06-06 14:13:02 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2012-03-28 09:38:33 +0200 |
commit | a92be9b856bd11b081041c43c25d442028fe9a63 (patch) | |
tree | 32f852fdf904a30238c789e57510be710eaa7826 /libavcodec/cook.c | |
parent | 856c8e0a049dc7069b7504d3aaa48549c75852de (diff) | |
download | ffmpeg-a92be9b856bd11b081041c43c25d442028fe9a63.tar.gz |
Replace memset(0) by zero initializations.
Also remove one pointless zero initialization in rangecoder.c.
Diffstat (limited to 'libavcodec/cook.c')
-rw-r--r-- | libavcodec/cook.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 74378521b3..217abcf117 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -411,10 +411,10 @@ static void categorize(COOKContext *q, COOKSubpacket *p, int *quant_index_table, int *category, int *category_index) { int exp_idx, bias, tmpbias1, tmpbias2, bits_left, num_bits, index, v, i, j; - int exp_index2[102]; - int exp_index1[102]; + int exp_index2[102] = { 0 }; + int exp_index1[102] = { 0 }; - int tmp_categorize_array[128 * 2]; + int tmp_categorize_array[128 * 2] = { 0 }; int tmp_categorize_array1_idx = p->numvector_size; int tmp_categorize_array2_idx = p->numvector_size; @@ -426,10 +426,6 @@ static void categorize(COOKContext *q, COOKSubpacket *p, int *quant_index_table, //av_log(q->avctx, AV_LOG_ERROR, "bits_left = %d\n",bits_left); } - memset(&exp_index1, 0, sizeof(exp_index1)); - memset(&exp_index2, 0, sizeof(exp_index2)); - memset(&tmp_categorize_array, 0, sizeof(tmp_categorize_array)); - bias = -32; /* Estimate bias. */ @@ -649,14 +645,11 @@ static void decode_vectors(COOKContext *q, COOKSubpacket *p, int *category, */ static int mono_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer) { - int category_index[128]; + int category_index[128] = { 0 }; + int category[128] = { 0 }; int quant_index_table[102]; - int category[128]; int res; - memset(&category, 0, sizeof(category)); - memset(&category_index, 0, sizeof(category_index)); - if ((res = decode_envelope(q, p, quant_index_table)) < 0) return res; q->num_vectors = get_bits(&q->gb, p->log2_numvector_size); @@ -818,13 +811,12 @@ static int joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1, float *mlt_buffer2) { int i, j, res; - int decouple_tab[SUBBAND_SIZE]; + int decouple_tab[SUBBAND_SIZE] = { 0 }; float *decode_buffer = q->decode_buffer_0; int idx, cpl_tmp; float f1, f2; const float *cplscale; - memset(decouple_tab, 0, sizeof(decouple_tab)); memset(decode_buffer, 0, sizeof(q->decode_buffer_0)); /* Make sure the buffers are zeroed out. */ |