]> granicus.if.org Git - libvpx/commitdiff
Fix compiler warnings
authorGuillermo Ballester Valor <gbvalor@gmail.com>
Fri, 11 Jun 2010 18:33:49 +0000 (14:33 -0400)
committerJohn Koleszar <jkoleszar@google.com>
Mon, 14 Jun 2010 21:23:49 +0000 (17:23 -0400)
Change-Id: I2a97f08cc3c7808ce5be39e910cc5147ecf03a1d

vp8/encoder/firstpass.c
vp8/encoder/onyx_if.c
vp8/encoder/pickinter.c
vp8/encoder/rdopt.c
vp8/vp8_cx_iface.c

index f0ddbf2d500fd283dc90c7cbd81e64f1c731ebf9..ced2d7c66c77459efdba9acf430b0ab878f9abe3 100644 (file)
@@ -1232,6 +1232,8 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
 
     start_pos = cpi->stats_in;
 
+    vpx_memset(&next_frame, 0, sizeof(next_frame)); // assure clean
+
     // Preload the stats for the next frame.
     mod_frame_err = calculate_modified_err(cpi, this_frame);
 
@@ -2038,6 +2040,8 @@ void vp8_find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
     double kf_group_coded_err = 0.0;
     double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth * cpi->oxcf.two_pass_vbrmin_section / 100);
 
+    vpx_memset(&next_frame, 0, sizeof(next_frame)); // assure clean
+
     vp8_clear_system_state();  //__asm emms;
     start_position = cpi->stats_in;
 
index a2a27d3ae0884e8d8a26f3b1b0096ab17cb49cef..98827f961ed239ab79a3fc8d08a90fba35d31987 100644 (file)
@@ -811,7 +811,7 @@ void vp8_set_speed_features(VP8_COMP *cpi)
         sf->full_freq[1] = 31;
         sf->search_method = NSTEP;
 
-        if (!cpi->ref_frame_flags & VP8_LAST_FLAG)
+        if (!(cpi->ref_frame_flags & VP8_LAST_FLAG))
         {
             sf->thresh_mult[THR_NEWMV    ] = INT_MAX;
             sf->thresh_mult[THR_NEARESTMV] = INT_MAX;
@@ -820,7 +820,7 @@ void vp8_set_speed_features(VP8_COMP *cpi)
             sf->thresh_mult[THR_SPLITMV  ] = INT_MAX;
         }
 
-        if (!cpi->ref_frame_flags & VP8_GOLD_FLAG)
+        if (!(cpi->ref_frame_flags & VP8_GOLD_FLAG))
         {
             sf->thresh_mult[THR_NEARESTG ] = INT_MAX;
             sf->thresh_mult[THR_ZEROG    ] = INT_MAX;
@@ -829,7 +829,7 @@ void vp8_set_speed_features(VP8_COMP *cpi)
             sf->thresh_mult[THR_SPLITG   ] = INT_MAX;
         }
 
-        if (!cpi->ref_frame_flags & VP8_ALT_FLAG)
+        if (!(cpi->ref_frame_flags & VP8_ALT_FLAG))
         {
             sf->thresh_mult[THR_NEARESTA ] = INT_MAX;
             sf->thresh_mult[THR_ZEROA    ] = INT_MAX;
index 3746bebc9fe35e5cc890c29f0ac5fa8536bea248..a50f99bf32e57f466c9b3897f9d34b824cb5c404 100644 (file)
@@ -454,6 +454,7 @@ int vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int rec
     vpx_memset(mode_mv, 0, sizeof(mode_mv));
     vpx_memset(nearest_mv, 0, sizeof(nearest_mv));
     vpx_memset(near_mv, 0, sizeof(near_mv));
+    vpx_memset(&best_mbmode, 0, sizeof(best_mbmode));
 
 
     // set up all the refframe dependent pointers.
index 4aedbd9255b088ca5bddd385dc9e1316a94d4ef7..9a772a706f65777df028e5c0277aca375b1a46b4 100644 (file)
@@ -1125,6 +1125,9 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x, MV *bes
     MV bmvs[16];
     int beobs[16];
 
+    vpx_memset(beobs, 0, sizeof(beobs));
+
+
     for (segmentation = 0; segmentation < VP8_NUMMBSPLITS; segmentation++)
     {
         int label_count;
@@ -1459,6 +1462,8 @@ int vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
 
     *returnintra = INT_MAX;
 
+    vpx_memset(&best_mbmode, 0, sizeof(best_mbmode)); // clean
+
     cpi->mbs_tested_so_far++;          // Count of the number of MBs tested so far this frame
 
     x->skip = 0;
index 9c05a642adcf089c15c7f1edd6ee7b11f5807564..69d95d86f31f54191400c5f5ac42d360b486e82f 100644 (file)
@@ -109,7 +109,7 @@ update_error_state(vpx_codec_alg_priv_t                 *ctx,
     } while(0)
 
 #define RANGE_CHECK(p,memb,lo,hi) do {\
-        if(!((p)->memb >= (lo) && (p)->memb <= hi)) \
+        if(!(((p)->memb == lo || (p)->memb > (lo)) && (p)->memb <= hi)) \
             ERROR(#memb " out of range ["#lo".."#hi"]");\
     } while(0)