[FFmpeg-soc] [soc]: r5596 - in indeo5: ivi_common.c ivi_dsp.c

kostya subversion at mplayerhq.hu
Wed Jan 27 16:28:20 CET 2010


Author: kostya
Date: Wed Jan 27 16:28:20 2010
New Revision: 5596

Log:
use sizeof(destination[0]) instead of sizeof(type) where possible

Modified:
   indeo5/ivi_common.c
   indeo5/ivi_dsp.c

Modified: indeo5/ivi_common.c
==============================================================================
--- indeo5/ivi_common.c	Wed Jan 27 16:24:44 2010	(r5595)
+++ indeo5/ivi_common.c	Wed Jan 27 16:28:20 2010	(r5596)
@@ -329,7 +329,7 @@ int ff_ivi_decode_blocks(GetBitContext *
 
             if (cbp & 1) { /* block coded ? */
                 scan_pos = -1;
-                memset(trvec, 0, num_coeffs*sizeof(int32_t)); /* zero transform vector */
+                memset(trvec, 0, num_coeffs*sizeof(trvec[0])); /* zero transform vector */
                 memset(col_flags, 0, sizeof(col_flags));      /* zero column flags */
 
                 while (scan_pos <= num_coeffs) {
@@ -501,7 +501,7 @@ void ff_ivi_process_empty_tile(AVCodecCo
         src = &band->ref_buf[tile->ypos * band->pitch + tile->xpos];
         dst = &band->buf[tile->ypos * band->pitch + tile->xpos];
         for (y = 0; y < tile->height; y++) {
-            memcpy(dst, src, tile->width*sizeof(int16_t));
+            memcpy(dst, src, tile->width*sizeof(band->buf[0]));
             src += band->pitch;
             dst += band->pitch;
         }

Modified: indeo5/ivi_dsp.c
==============================================================================
--- indeo5/ivi_dsp.c	Wed Jan 27 16:24:44 2010	(r5595)
+++ indeo5/ivi_dsp.c	Wed Jan 27 16:28:20 2010	(r5596)
@@ -243,7 +243,7 @@ void ff_ivi_inverse_slant_8x8(int32_t *i
     src = tmp;
     for (i = 0; i < 8; i++) {
         if (!src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) {
-            memset(out, 0, 8*sizeof(int16_t));
+            memset(out, 0, 8*sizeof(out[0]));
         } else {
             IVI_INV_SLANT8(src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7],
                            out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7]);
@@ -311,7 +311,7 @@ void ff_ivi_row_slant8(int32_t *in, int1
 #define COMPENSATE(x) ((x + 1)>>1)
     for (i = 0; i < 8; i++) {
         if (!in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) {
-            memset(out, 0, 8*sizeof(int16_t));
+            memset(out, 0, 8*sizeof(out[0]));
         } else {
             IVI_INV_SLANT8( in[0],  in[1],  in[2],  in[3],  in[4],  in[5],  in[6],  in[7],
                            out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7]);
@@ -397,11 +397,11 @@ void ff_ivi_put_dc_pixel_8x8(int32_t *in
     int     y;
 
     out[0] = in[0];
-    memset(&out[1], 0, 7*sizeof(int16_t));
+    memset(&out[1], 0, 7*sizeof(out[0]));
     out += pitch;
 
     for (y = 1; y < 8; out += pitch, y++)
-        memset(out, 0, 8*sizeof(int16_t));
+        memset(out, 0, 8*sizeof(out[0]));
 }
 
 void ff_ivi_mc_8x8_delta(int16_t *buf, int16_t *ref_buf, uint32_t pitch, int mc_type)


More information about the FFmpeg-soc mailing list