shithub: libvpx

Download patch

ref: 5a72620de96d2e2eafb353123ffad0d7122efcbc
parent: 48c84d138f4a5f66e982c49d4972f85aaae532a8
author: Guillermo Ballester Valor <gbvalor@gmail.com>
date: Fri Jun 11 10:33:49 EDT 2010

Fix compiler warnings

Change-Id: I2a97f08cc3c7808ce5be39e910cc5147ecf03a1d

--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -1232,6 +1232,8 @@
 
     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);
 
@@ -2037,6 +2039,8 @@
     double kf_group_intra_err = 0.0;
     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;
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -811,7 +811,7 @@
         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 @@
             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 @@
             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;
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -454,6 +454,7 @@
     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.
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -1125,6 +1125,9 @@
     MV bmvs[16];
     int beobs[16];
 
+    vpx_memset(beobs, 0, sizeof(beobs));
+
+
     for (segmentation = 0; segmentation < VP8_NUMMBSPLITS; segmentation++)
     {
         int label_count;
@@ -1458,6 +1461,8 @@
     int force_no_skip = 0;
 
     *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
 
--- a/vp8/vp8_cx_iface.c
+++ b/vp8/vp8_cx_iface.c
@@ -109,7 +109,7 @@
     } 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)