[MPlayer-cvslog] r35393 - trunk/libmpcodecs/vf_remove_logo.c

reimar subversion at mplayerhq.hu
Sat Nov 10 14:13:29 CET 2012


Author: reimar
Date: Sat Nov 10 14:13:29 2012
New Revision: 35393

Log:
Remove useless casts.

Modified:
   trunk/libmpcodecs/vf_remove_logo.c

Modified: trunk/libmpcodecs/vf_remove_logo.c
==============================================================================
--- trunk/libmpcodecs/vf_remove_logo.c	Sat Nov 10 14:11:49 2012	(r35392)
+++ trunk/libmpcodecs/vf_remove_logo.c	Sat Nov 10 14:13:29 2012	(r35393)
@@ -306,13 +306,13 @@ static void initialize_masks(vf_instance
 
   /* Create a circular mask for each size up to max_mask_size. When the filter is applied, the mask size is
      determined on a pixel by pixel basis, with pixels nearer the edge of the logo getting smaller mask sizes. */
-  mask = (int * * *) safe_malloc(sizeof(int * *) * (max_mask_size + 1));
+  mask = safe_malloc(sizeof(int * *) * (max_mask_size + 1));
   for (a = 0; a <= max_mask_size; a++)
   {
-    mask[a] = (int * *) safe_malloc(sizeof(int *) * ((a * 2) + 1));
+    mask[a] = safe_malloc(sizeof(int *) * ((a * 2) + 1));
     for (b = -a; b <= a; b++)
     {
-      mask[a][b + a] = (int *) safe_malloc(sizeof(int) * ((a * 2) + 1));
+      mask[a][b + a] = safe_malloc(sizeof(int) * ((a * 2) + 1));
       for (c = -a; c <= a; c++)
       {
         if ((b * b) + (c * c) <= (a * a)) /* Circular 0/1 mask. */
@@ -533,7 +533,7 @@ static pgm_structure * load_pgm(const ch
   int maximum_greyscale_value;
   FILE * input;
   int pnm_number;
-  pgm_structure * new_pgm = (pgm_structure *) safe_malloc (sizeof(pgm_structure));
+  pgm_structure * new_pgm = safe_malloc (sizeof(pgm_structure));
   char * write_position;
   char * end_position;
   int image_size; /* width * height */
@@ -553,7 +553,7 @@ static pgm_structure * load_pgm(const ch
   if (maximum_greyscale_value >= 256) REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE("[vf]remove_logo: Only 1 byte per pixel (pgm) or 1 byte per color value (ppm) are supported.\n");
   load_pgm_skip(input);
 
-  new_pgm->pixel = (unsigned char *) safe_malloc (sizeof(unsigned char) * new_pgm->width * new_pgm->height);
+  new_pgm->pixel = safe_malloc (sizeof(unsigned char) * new_pgm->width * new_pgm->height);
 
   /* Load the pixels. */
   /* Note: I am aware that fgetc(input) isn't the fastest way of doing things, but it is quite compact and the code only runs once when the filter is initialized.*/
@@ -599,7 +599,7 @@ err_out:
 static pgm_structure * generate_half_size_image(vf_instance_t * vf, pgm_structure * input_image)
 {
   int x, y;
-  pgm_structure * new_pgm = (pgm_structure *) safe_malloc (sizeof(pgm_structure));
+  pgm_structure * new_pgm = safe_malloc (sizeof(pgm_structure));
   int has_anything_changed = 1;
   int current_pass;
   int max_mask_size;
@@ -607,7 +607,7 @@ static pgm_structure * generate_half_siz
 
   new_pgm->width = input_image->width / 2;
   new_pgm->height = input_image->height / 2;
-  new_pgm->pixel = (unsigned char *) safe_malloc (sizeof(unsigned char) * new_pgm->width * new_pgm->height);
+  new_pgm->pixel = safe_malloc (sizeof(unsigned char) * new_pgm->width * new_pgm->height);
 
   /* Copy over the image data, using the average of 4 pixels for to calculate each downsampled pixel. */
   for (y = 0; y < new_pgm->height; y++)


More information about the MPlayer-cvslog mailing list