shithub: libvpx

Download patch

ref: c4d7e5e67ecfcd9730bd512483390369fc9982db
parent: 2b4913eb0d5722e38d9e28ef458e7e3318e87920
author: Timothy B. Terriberry <tterribe@xiph.org>
date: Wed Oct 27 12:04:02 EDT 2010

Eliminate more warnings.

This eliminates a large set of warnings exposed by the Mozilla build
 system (Use of C++ comments in ISO C90 source, commas at the end of
 enum lists, a couple incomplete initializers, and signed/unsigned
 comparisons).
It also eliminates many (but not all) of the warnings expose by newer
 GCC versions and _FORTIFY_SOURCE (e.g., calling fread and fwrite
 without checking the return values).
There are a few spurious warnings left on my system:

../vp8/encoder/encodemb.c:274:9: warning: 'sz' may be used
 uninitialized in this function
gcc seems to be unable to figure out that the value shortcut doesn't
 change between the two if blocks that test it here.

../vp8/encoder/onyx_if.c:5314:5: warning: comparison of unsigned
 expression >= 0 is always true
../vp8/encoder/onyx_if.c:5319:5: warning: comparison of unsigned
 expression >= 0 is always true
This is true, so far as it goes, but it's comparing against an enum, and the C
 standard does not mandate that enums be unsigned, so the checks can't be
 removed.

Change-Id: Iaf689ae3e3d0ddc5ade00faa474debe73b8d3395

--- a/examples/decoder_tmpl.c
+++ b/examples/decoder_tmpl.c
@@ -61,8 +61,8 @@
         die("Failed to open %s for writing", argv[2]);
 
     /* Read file header */
-    fread(file_hdr, 1, IVF_FILE_HDR_SZ, infile);
-    if(!(file_hdr[0]=='D' && file_hdr[1]=='K' && file_hdr[2]=='I'
+    if(!(fread(file_hdr, 1, IVF_FILE_HDR_SZ, infile) == IVF_FILE_HDR_SZ
+         && file_hdr[0]=='D' && file_hdr[1]=='K' && file_hdr[2]=='I'
          && file_hdr[3]=='F'))
         die("%s is not an IVF file.", argv[1]);
 
--- a/examples/decoder_tmpl.txt
+++ b/examples/decoder_tmpl.txt
@@ -48,7 +48,7 @@
     unsigned char *buf =img->planes[plane];
 
     for(y=0; y<img->d_h >> (plane?1:0); y++) {
-        fwrite(buf, 1, img->d_w >> (plane?1:0), outfile);
+        if(fwrite(buf, 1, img->d_w >> (plane?1:0), outfile));
         buf += img->stride[plane];
     }
 }
--- a/examples/encoder_tmpl.c
+++ b/examples/encoder_tmpl.c
@@ -85,7 +85,7 @@
     mem_put_le32(header+24, frame_cnt);           /* length */
     mem_put_le32(header+28, 0);                   /* unused */
 
-    fwrite(header, 1, 32, outfile);
+    if(fwrite(header, 1, 32, outfile));
 }
 
 
@@ -103,7 +103,7 @@
     mem_put_le32(header+4, pts&0xFFFFFFFF);
     mem_put_le32(header+8, pts >> 32);
 
-    fwrite(header, 1, 12, outfile);
+    if(fwrite(header, 1, 12, outfile));
 }
 
 int main(int argc, char **argv) {
--- a/examples/encoder_tmpl.txt
+++ b/examples/encoder_tmpl.txt
@@ -61,8 +61,8 @@
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
 case VPX_CODEC_CX_FRAME_PKT:
     write_ivf_frame_header(outfile, pkt);
-    fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
-           outfile);
+    if(fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
+              outfile));
     break;
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
 
--- a/libmkv/EbmlIDs.h
+++ b/libmkv/EbmlIDs.h
@@ -228,4 +228,4 @@
 //  TagString = 0x4487,
 //  TagBinary = 0x4485,
 };
-#endif
\ No newline at end of file
+#endif
--- a/vp8/common/alloccommon.c
+++ b/vp8/common/alloccommon.c
@@ -56,7 +56,7 @@
 
     vp8_de_alloc_frame_buffers(oci);
 
-    // our internal buffers are always multiples of 16
+    /* our internal buffers are always multiples of 16 */
     if ((width & 0xf) != 0)
         width += 16 - (width & 0xf);
 
@@ -153,7 +153,7 @@
         cm->full_pixel = 1;
         break;
     default:
-        //4,5,6,7 are reserved for future use
+        /*4,5,6,7 are reserved for future use*/
         cm->no_lpf = 0;
         cm->simpler_lpf = 0;
         cm->use_bilinear_mc_filter = 0;
@@ -177,10 +177,10 @@
     oci->clr_type = REG_YUV;
     oci->clamp_type = RECON_CLAMP_REQUIRED;
 
-    // Initialise reference frame sign bias structure to defaults
+    /* Initialise reference frame sign bias structure to defaults */
     vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias));
 
-    // Default disable buffer to buffer copying
+    /* Default disable buffer to buffer copying */
     oci->copy_buffer_to_gf = 0;
     oci->copy_buffer_to_arf = 0;
 }
--- a/vp8/common/arm/bilinearfilter_arm.c
+++ b/vp8/common/arm/bilinearfilter_arm.c
@@ -49,7 +49,7 @@
     const short *vp8_filter
 );
 
-/*
+#if 0
 void vp8_filter_block2d_bil_first_pass_6
 (
     unsigned char *src_ptr,
@@ -66,7 +66,7 @@
     {
         for ( j=0; j<output_width; j++ )
         {
-            // Apply bilinear filter
+            /* Apply bilinear filter */
             output_ptr[j] = ( ( (int)src_ptr[0]          * vp8_filter[0]) +
                                ((int)src_ptr[1] * vp8_filter[1]) +
                                 (VP8_FILTER_WEIGHT/2) ) >> VP8_FILTER_SHIFT;
@@ -73,7 +73,7 @@
             src_ptr++;
         }
 
-        // Next row...
+        /* Next row... */
         src_ptr    += src_pixels_per_line - output_width;
         output_ptr += output_width;
     }
@@ -96,7 +96,7 @@
     {
         for ( j=0; j<output_width; j++ )
         {
-            // Apply filter
+            /* Apply filter */
             Temp =  ((int)src_ptr[0]         * vp8_filter[0]) +
                     ((int)src_ptr[output_width] * vp8_filter[1]) +
                     (VP8_FILTER_WEIGHT/2);
@@ -104,12 +104,12 @@
             src_ptr++;
         }
 
-        // Next row...
-        //src_ptr    += src_pixels_per_line - output_width;
+        /* Next row... */
+        /*src_ptr    += src_pixels_per_line - output_width;*/
         output_ptr += output_pitch;
     }
 }
-*/
+#endif
 
 void vp8_filter_block2d_bil_armv6
 (
@@ -124,13 +124,13 @@
 )
 {
 
-    unsigned short FData[36*16]; // Temp data bufffer used in filtering
+    unsigned short FData[36*16]; /* Temp data bufffer used in filtering */
 
-    // First filter 1-D horizontally...
-    // pixel_step = 1;
+    /* First filter 1-D horizontally... */
+    /* pixel_step = 1; */
     vp8_filter_block2d_bil_first_pass_armv6(src_ptr, FData, src_pixels_per_line, Height + 1, Width, HFilter);
 
-    // then 1-D vertically...
+    /* then 1-D vertically... */
     vp8_filter_block2d_bil_second_pass_armv6(FData, output_ptr, dst_pitch, Height, Width, VFilter);
 }
 
--- a/vp8/common/arm/filter_arm.c
+++ b/vp8/common/arm/filter_arm.c
@@ -20,13 +20,13 @@
 
 DECLARE_ALIGNED(16, static const short, sub_pel_filters[8][6]) =
 {
-    { 0,  0,  128,    0,   0,  0 },         // note that 1/8 pel positions are just as per alpha -0.5 bicubic
+    { 0,  0,  128,    0,   0,  0 },         /* note that 1/8 pel positions are just as per alpha -0.5 bicubic */
     { 0, -6,  123,   12,  -1,  0 },
-    { 2, -11, 108,   36,  -8,  1 },         // New 1/4 pel 6 tap filter
+    { 2, -11, 108,   36,  -8,  1 },         /* New 1/4 pel 6 tap filter */
     { 0, -9,   93,   50,  -6,  0 },
-    { 3, -16,  77,   77, -16,  3 },         // New 1/2 pel 6 tap filter
+    { 3, -16,  77,   77, -16,  3 },         /* New 1/2 pel 6 tap filter */
     { 0, -6,   50,   93,  -9,  0 },
-    { 1, -8,   36,  108, -11,  2 },         // New 1/4 pel 6 tap filter
+    { 1, -8,   36,  108, -11,  2 },         /* New 1/4 pel 6 tap filter */
     { 0, -1,   12,  123,  -6,  0 },
 };
 
@@ -93,21 +93,21 @@
 {
     const short  *HFilter;
     const short  *VFilter;
-    DECLARE_ALIGNED_ARRAY(4, short, FData, 12*4); // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(4, short, FData, 12*4); /* Temp data bufffer used in filtering */
 
 
-    HFilter = sub_pel_filters[xoffset];   // 6 tap
-    VFilter = sub_pel_filters[yoffset];       // 6 tap
+    HFilter = sub_pel_filters[xoffset];   /* 6 tap */
+    VFilter = sub_pel_filters[yoffset];       /* 6 tap */
 
-    // Vfilter is null. First pass only
+    /* Vfilter is null. First pass only */
     if (xoffset && !yoffset)
     {
-        //vp8_filter_block2d_first_pass_armv6 ( src_ptr, FData+2, src_pixels_per_line, 4, 4, HFilter );
-        //vp8_filter_block2d_second_pass_armv6 ( FData+2, dst_ptr, dst_pitch, 4, VFilter );
+        /*vp8_filter_block2d_first_pass_armv6 ( src_ptr, FData+2, src_pixels_per_line, 4, 4, HFilter );
+        vp8_filter_block2d_second_pass_armv6 ( FData+2, dst_ptr, dst_pitch, 4, VFilter );*/
 
         vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 4, dst_pitch, HFilter);
     }
-    // Hfilter is null. Second pass only
+    /* Hfilter is null. Second pass only */
     else if (!xoffset && yoffset)
     {
         vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 4, dst_pitch, VFilter);
@@ -114,13 +114,13 @@
     }
     else
     {
-        // Vfilter is a 4 tap filter
+        /* Vfilter is a 4 tap filter */
         if (yoffset & 0x1)
         {
             vp8_filter_block2d_first_pass_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 4, 7, HFilter);
             vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 4, VFilter);
         }
-        // Vfilter is 6 tap filter
+        /* Vfilter is 6 tap filter */
         else
         {
             vp8_filter_block2d_first_pass_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 4, 9, HFilter);
@@ -129,7 +129,7 @@
     }
 }
 
-/*
+#if 0
 void vp8_sixtap_predict8x4_armv6
 (
     unsigned char  *src_ptr,
@@ -142,33 +142,33 @@
 {
     const short  *HFilter;
     const short  *VFilter;
-    DECLARE_ALIGNED_ARRAY(4, short, FData, 16*8); // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(4, short, FData, 16*8); /* Temp data bufffer used in filtering */
 
-    HFilter = sub_pel_filters[xoffset];   // 6 tap
-    VFilter = sub_pel_filters[yoffset];       // 6 tap
+    HFilter = sub_pel_filters[xoffset];   /* 6 tap */
+    VFilter = sub_pel_filters[yoffset];       /* 6 tap */
 
 
-//  if (xoffset && !yoffset)
-//  {
-//      vp8_filter_block2d_first_pass_only_armv6 (  src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, HFilter );
-//  }
-    // Hfilter is null. Second pass only
-//  else if (!xoffset && yoffset)
-//  {
-//      vp8_filter_block2d_second_pass_only_armv6 ( src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, VFilter );
-//  }
-//  else
-//  {
-//      if (yoffset & 0x1)
-    //      vp8_filter_block2d_first_pass_armv6 ( src_ptr-src_pixels_per_line, FData+1, src_pixels_per_line, 8, 7, HFilter );
-    //  else
+    /*if (xoffset && !yoffset)
+    {
+        vp8_filter_block2d_first_pass_only_armv6 (  src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, HFilter );
+    }*/
+    /* Hfilter is null. Second pass only */
+    /*else if (!xoffset && yoffset)
+    {
+        vp8_filter_block2d_second_pass_only_armv6 ( src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, VFilter );
+    }
+    else
+    {
+        if (yoffset & 0x1)
+            vp8_filter_block2d_first_pass_armv6 ( src_ptr-src_pixels_per_line, FData+1, src_pixels_per_line, 8, 7, HFilter );
+        else*/
 
         vp8_filter_block2d_first_pass_armv6 ( src_ptr-(2*src_pixels_per_line), FData, src_pixels_per_line, 8, 9, HFilter );
 
         vp8_filter_block2d_second_pass_armv6 ( FData+2, dst_ptr, dst_pitch, 4, 8, VFilter );
-//  }
+    /*}*/
 }
-*/
+#endif
 
 void vp8_sixtap_predict8x8_armv6
 (
@@ -182,16 +182,16 @@
 {
     const short  *HFilter;
     const short  *VFilter;
-    DECLARE_ALIGNED_ARRAY(4, short, FData, 16*8); // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(4, short, FData, 16*8); /* Temp data bufffer used in filtering */
 
-    HFilter = sub_pel_filters[xoffset];   // 6 tap
-    VFilter = sub_pel_filters[yoffset];       // 6 tap
+    HFilter = sub_pel_filters[xoffset];   /* 6 tap */
+    VFilter = sub_pel_filters[yoffset];       /* 6 tap */
 
     if (xoffset && !yoffset)
     {
         vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, HFilter);
     }
-    // Hfilter is null. Second pass only
+    /* Hfilter is null. Second pass only */
     else if (!xoffset && yoffset)
     {
         vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, VFilter);
@@ -224,16 +224,16 @@
 {
     const short  *HFilter;
     const short  *VFilter;
-    DECLARE_ALIGNED_ARRAY(4, short, FData, 24*16);    // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(4, short, FData, 24*16);    /* Temp data bufffer used in filtering */
 
-    HFilter = sub_pel_filters[xoffset];   // 6 tap
-    VFilter = sub_pel_filters[yoffset];       // 6 tap
+    HFilter = sub_pel_filters[xoffset];   /* 6 tap */
+    VFilter = sub_pel_filters[yoffset];       /* 6 tap */
 
     if (xoffset && !yoffset)
     {
         vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 16, dst_pitch, HFilter);
     }
-    // Hfilter is null. Second pass only
+    /* Hfilter is null. Second pass only */
     else if (!xoffset && yoffset)
     {
         vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 16, dst_pitch, VFilter);
--- a/vp8/common/arm/loopfilter_arm.c
+++ b/vp8/common/arm/loopfilter_arm.c
@@ -35,8 +35,8 @@
 
 
 #if HAVE_ARMV6
-//ARMV6 loopfilter functions
-// Horizontal MB filtering
+/*ARMV6 loopfilter functions*/
+/* Horizontal MB filtering */
 void vp8_loop_filter_mbh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                                int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -60,7 +60,7 @@
     vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->mbthr, 2);
 }
 
-// Vertical MB Filtering
+/* Vertical MB Filtering */
 void vp8_loop_filter_mbv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                                int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -84,7 +84,7 @@
     vp8_loop_filter_simple_vertical_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->mbthr, 2);
 }
 
-// Horizontal B Filtering
+/* Horizontal B Filtering */
 void vp8_loop_filter_bh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                               int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -112,7 +112,7 @@
     vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
 }
 
-// Vertical B Filtering
+/* Vertical B Filtering */
 void vp8_loop_filter_bv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                               int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -142,8 +142,8 @@
 #endif
 
 #if HAVE_ARMV7
-// NEON loopfilter functions
-// Horizontal MB filtering
+/* NEON loopfilter functions */
+/* Horizontal MB filtering */
 void vp8_loop_filter_mbh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                               int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -164,7 +164,7 @@
     vp8_loop_filter_simple_horizontal_edge_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->mbthr, 2);
 }
 
-// Vertical MB Filtering
+/* Vertical MB Filtering */
 void vp8_loop_filter_mbv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                               int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -185,7 +185,7 @@
     vp8_loop_filter_simple_vertical_edge_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->mbthr, 2);
 }
 
-// Horizontal B Filtering
+/* Horizontal B Filtering */
 void vp8_loop_filter_bh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                              int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -210,7 +210,7 @@
     vp8_loop_filter_simple_horizontal_edge_neon(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
 }
 
-// Vertical B Filtering
+/* Vertical B Filtering */
 void vp8_loop_filter_bv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                              int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
--- a/vp8/common/arm/neon/recon_neon.c
+++ b/vp8/common/arm/neon/recon_neon.c
@@ -23,7 +23,7 @@
     unsigned char *udst_ptr = x->dst.u_buffer;
     unsigned char *vdst_ptr = x->dst.v_buffer;
     int ystride = x->dst.y_stride;
-    //int uv_stride = x->dst.uv_stride;
+    /*int uv_stride = x->dst.uv_stride;*/
 
     vp8_recon16x16mb_neon(pred_ptr, diff_ptr, dst_ptr, ystride, udst_ptr, vdst_ptr);
 }
--- a/vp8/common/blockd.h
+++ b/vp8/common/blockd.h
@@ -24,7 +24,7 @@
 #define TRUE    1
 #define FALSE   0
 
-//#define DCPRED 1
+/*#define DCPRED 1*/
 #define DCPREDSIMTHRESH 0
 #define DCPREDCNTTHRESH 3
 
@@ -39,7 +39,7 @@
 #define MAX_REF_LF_DELTAS       4
 #define MAX_MODE_LF_DELTAS      4
 
-// Segment Feature Masks
+/* Segment Feature Masks */
 #define SEGMENT_DELTADATA   0
 #define SEGMENT_ABSDATA     1
 
@@ -75,11 +75,11 @@
 
 typedef enum
 {
-    DC_PRED,            // average of above and left pixels
-    V_PRED,             // vertical prediction
-    H_PRED,             // horizontal prediction
-    TM_PRED,            // Truemotion prediction
-    B_PRED,             // block based prediction, each block has its own prediction mode
+    DC_PRED,            /* average of above and left pixels */
+    V_PRED,             /* vertical prediction */
+    H_PRED,             /* horizontal prediction */
+    TM_PRED,            /* Truemotion prediction */
+    B_PRED,             /* block based prediction, each block has its own prediction mode */
 
     NEARESTMV,
     NEARMV,
@@ -90,16 +90,16 @@
     MB_MODE_COUNT
 } MB_PREDICTION_MODE;
 
-// Macroblock level features
+/* Macroblock level features */
 typedef enum
 {
-    MB_LVL_ALT_Q = 0,               // Use alternate Quantizer ....
-    MB_LVL_ALT_LF = 1,              // Use alternate loop filter value...
-    MB_LVL_MAX = 2,                 // Number of MB level features supported
+    MB_LVL_ALT_Q = 0,               /* Use alternate Quantizer .... */
+    MB_LVL_ALT_LF = 1,              /* Use alternate loop filter value... */
+    MB_LVL_MAX = 2                  /* Number of MB level features supported */
 
 } MB_LVL_FEATURES;
 
-// Segment Feature Masks
+/* Segment Feature Masks */
 #define SEGMENT_ALTQ    0x01
 #define SEGMENT_ALT_LF  0x02
 
@@ -110,11 +110,11 @@
 
 typedef enum
 {
-    B_DC_PRED,          // average of above and left pixels
+    B_DC_PRED,          /* average of above and left pixels */
     B_TM_PRED,
 
-    B_VE_PRED,           // vertical prediction
-    B_HE_PRED,           // horizontal prediction
+    B_VE_PRED,           /* vertical prediction */
+    B_HE_PRED,           /* horizontal prediction */
 
     B_LD_PRED,
     B_RD_PRED,
@@ -170,13 +170,13 @@
     } mv;
 
     unsigned char partitioning;
-    unsigned char mb_skip_coeff;                                //does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens
+    unsigned char mb_skip_coeff;                                /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
     unsigned char dc_diff;
     unsigned char need_to_clamp_mvs;
 
-    unsigned char segment_id;                  // Which set of segmentation parameters should be used for this MB
+    unsigned char segment_id;                  /* Which set of segmentation parameters should be used for this MB */
 
-    unsigned char force_no_skip; //encoder only
+    unsigned char force_no_skip; /* encoder only */
 } MB_MODE_INFO;
 
 
@@ -197,7 +197,7 @@
 
     short *dequant;
 
-    // 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries
+    /* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */
     unsigned char **base_pre;
     int pre;
     int pre_stride;
@@ -214,17 +214,17 @@
 
 typedef struct
 {
-    DECLARE_ALIGNED(16, short, diff[400]);      // from idct diff
+    DECLARE_ALIGNED(16, short, diff[400]);      /* from idct diff */
     DECLARE_ALIGNED(16, unsigned char,  predictor[384]);
-//not used    DECLARE_ALIGNED(16, short, reference[384]);
+/* not used    DECLARE_ALIGNED(16, short, reference[384]); */
     DECLARE_ALIGNED(16, short, qcoeff[400]);
     DECLARE_ALIGNED(16, short, dqcoeff[400]);
     DECLARE_ALIGNED(16, char,  eobs[25]);
 
-    // 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries.
+    /* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */
     BLOCKD block[25];
 
-    YV12_BUFFER_CONFIG pre; // Filtered copy of previous frame reconstruction
+    YV12_BUFFER_CONFIG pre; /* Filtered copy of previous frame reconstruction */
     YV12_BUFFER_CONFIG dst;
 
     MODE_INFO *mode_info_context;
@@ -235,39 +235,39 @@
     int up_available;
     int left_available;
 
-    // Y,U,V,Y2
+    /* Y,U,V,Y2 */
     ENTROPY_CONTEXT_PLANES *above_context;
     ENTROPY_CONTEXT_PLANES *left_context;
 
-    // 0 indicates segmentation at MB level is not enabled. Otherwise the individual bits indicate which features are active.
+    /* 0 indicates segmentation at MB level is not enabled. Otherwise the individual bits indicate which features are active. */
     unsigned char segmentation_enabled;
 
-    // 0 (do not update) 1 (update) the macroblock segmentation map.
+    /* 0 (do not update) 1 (update) the macroblock segmentation map. */
     unsigned char update_mb_segmentation_map;
 
-    // 0 (do not update) 1 (update) the macroblock segmentation feature data.
+    /* 0 (do not update) 1 (update) the macroblock segmentation feature data. */
     unsigned char update_mb_segmentation_data;
 
-    // 0 (do not update) 1 (update) the macroblock segmentation feature data.
+    /* 0 (do not update) 1 (update) the macroblock segmentation feature data. */
     unsigned char mb_segement_abs_delta;
 
-    // Per frame flags that define which MB level features (such as quantizer or loop filter level)
-    // are enabled and when enabled the proabilities used to decode the per MB flags in MB_MODE_INFO
-    vp8_prob mb_segment_tree_probs[MB_FEATURE_TREE_PROBS];         // Probability Tree used to code Segment number
+    /* Per frame flags that define which MB level features (such as quantizer or loop filter level) */
+    /* are enabled and when enabled the proabilities used to decode the per MB flags in MB_MODE_INFO */
+    vp8_prob mb_segment_tree_probs[MB_FEATURE_TREE_PROBS];         /* Probability Tree used to code Segment number */
 
-    signed char segment_feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS];            // Segment parameters
+    signed char segment_feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS];            /* Segment parameters */
 
-    // mode_based Loop filter adjustment
+    /* mode_based Loop filter adjustment */
     unsigned char mode_ref_lf_delta_enabled;
     unsigned char mode_ref_lf_delta_update;
 
-    // Delta values have the range +/- MAX_LOOP_FILTER
-    signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS];                // 0 = Intra, Last, GF, ARF
-    signed char ref_lf_deltas[MAX_REF_LF_DELTAS];                     // 0 = Intra, Last, GF, ARF
-    signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];                      // 0 = BPRED, ZERO_MV, MV, SPLIT
-    signed char mode_lf_deltas[MAX_MODE_LF_DELTAS];                           // 0 = BPRED, ZERO_MV, MV, SPLIT
+    /* Delta values have the range +/- MAX_LOOP_FILTER */
+    signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS];                /* 0 = Intra, Last, GF, ARF */
+    signed char ref_lf_deltas[MAX_REF_LF_DELTAS];                     /* 0 = Intra, Last, GF, ARF */
+    signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];                      /* 0 = BPRED, ZERO_MV, MV, SPLIT */
+    signed char mode_lf_deltas[MAX_MODE_LF_DELTAS];                           /* 0 = BPRED, ZERO_MV, MV, SPLIT */
 
-    // Distance of MB away from frame edges
+    /* Distance of MB away from frame edges */
     int mb_to_left_edge;
     int mb_to_right_edge;
     int mb_to_top_edge;
--- a/vp8/common/debugmodes.c
+++ b/vp8/common/debugmodes.c
@@ -21,7 +21,7 @@
     int mb_index = 0;
     FILE *mvs = fopen("mvs.stt", "a");
 
-    // print out the macroblock Y modes
+    /* print out the macroblock Y modes */
     mb_index = 0;
     fprintf(mvs, "Mb Modes for Frame %d\n", frame);
 
@@ -60,7 +60,7 @@
 
     fprintf(mvs, "\n");
 
-    // print out the macroblock UV modes
+    /* print out the macroblock UV modes */
     mb_index = 0;
     fprintf(mvs, "UV Modes for Frame %d\n", frame);
 
@@ -80,7 +80,7 @@
 
     fprintf(mvs, "\n");
 
-    // print out the block modes
+    /* print out the block modes */
     mb_index = 0;
     fprintf(mvs, "Mbs for Frame %d\n", frame);
     {
@@ -108,7 +108,7 @@
     }
     fprintf(mvs, "\n");
 
-    // print out the macroblock mvs
+    /* print out the macroblock mvs */
     mb_index = 0;
     fprintf(mvs, "MVs for Frame %d\n", frame);
 
@@ -128,7 +128,7 @@
     fprintf(mvs, "\n");
 
 
-    // print out the block modes
+    /* print out the block modes */
     mb_index = 0;
     fprintf(mvs, "MVs for Frame %d\n", frame);
     {
--- a/vp8/common/defaultcoefcounts.h
+++ b/vp8/common/defaultcoefcounts.h
@@ -15,51 +15,51 @@
 {
 
     {
-        // Block Type ( 0 )
+        /* Block Type ( 0 ) */
         {
-            // Coeff Band ( 0 )
+            /* Coeff Band ( 0 ) */
             {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
         },
         {
-            // Coeff Band ( 1 )
+            /* Coeff Band ( 1 ) */
             {30190, 26544, 225,  24,   4,   0,   0,   0,   0,   0,   0, 4171593,},
             {26846, 25157, 1241, 130,  26,   6,   1,   0,   0,   0,   0, 149987,},
             {10484, 9538, 1006, 160,  36,  18,   0,   0,   0,   0,   0, 15104,},
         },
         {
-            // Coeff Band ( 2 )
+            /* Coeff Band ( 2 ) */
             {25842, 40456, 1126,  83,  11,   2,   0,   0,   0,   0,   0,   0,},
             {9338, 8010, 512,  73,   7,   3,   2,   0,   0,   0,   0, 43294,},
             {1047, 751, 149,  31,  13,   6,   1,   0,   0,   0,   0, 879,},
         },
         {
-            // Coeff Band ( 3 )
+            /* Coeff Band ( 3 ) */
             {26136, 9826, 252,  13,   0,   0,   0,   0,   0,   0,   0,   0,},
             {8134, 5574, 191,  14,   2,   0,   0,   0,   0,   0,   0, 35302,},
             { 605, 677, 116,   9,   1,   0,   0,   0,   0,   0,   0, 611,},
         },
         {
-            // Coeff Band ( 4 )
+            /* Coeff Band ( 4 ) */
             {10263, 15463, 283,  17,   0,   0,   0,   0,   0,   0,   0,   0,},
             {2773, 2191, 128,   9,   2,   2,   0,   0,   0,   0,   0, 10073,},
             { 134, 125,  32,   4,   0,   2,   0,   0,   0,   0,   0,  50,},
         },
         {
-            // Coeff Band ( 5 )
+            /* Coeff Band ( 5 ) */
             {10483, 2663,  23,   1,   0,   0,   0,   0,   0,   0,   0,   0,},
             {2137, 1251,  27,   1,   1,   0,   0,   0,   0,   0,   0, 14362,},
             { 116, 156,  14,   2,   1,   0,   0,   0,   0,   0,   0, 190,},
         },
         {
-            // Coeff Band ( 6 )
+            /* Coeff Band ( 6 ) */
             {40977, 27614, 412,  28,   0,   0,   0,   0,   0,   0,   0,   0,},
             {6113, 5213, 261,  22,   3,   0,   0,   0,   0,   0,   0, 26164,},
             { 382, 312,  50,  14,   2,   0,   0,   0,   0,   0,   0, 345,},
         },
         {
-            // Coeff Band ( 7 )
+            /* Coeff Band ( 7 ) */
             {   0,  26,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             {   0,  13,   0,   0,   0,   0,   0,   0,   0,   0,   0, 319,},
             {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   8,},
@@ -66,51 +66,51 @@
         },
     },
     {
-        // Block Type ( 1 )
+        /* Block Type ( 1 ) */
         {
-            // Coeff Band ( 0 )
+            /* Coeff Band ( 0 ) */
             {3268, 19382, 1043, 250,  93,  82,  49,  26,  17,   8,  25, 82289,},
             {8758, 32110, 5436, 1832, 827, 668, 420, 153,  24,   0,   3, 52914,},
             {9337, 23725, 8487, 3954, 2107, 1836, 1069, 399,  59,   0,   0, 18620,},
         },
         {
-            // Coeff Band ( 1 )
+            /* Coeff Band ( 1 ) */
             {12419, 8420, 452,  62,   9,   1,   0,   0,   0,   0,   0,   0,},
             {11715, 8705, 693,  92,  15,   7,   2,   0,   0,   0,   0, 53988,},
             {7603, 8585, 2306, 778, 270, 145,  39,   5,   0,   0,   0, 9136,},
         },
         {
-            // Coeff Band ( 2 )
+            /* Coeff Band ( 2 ) */
             {15938, 14335, 1207, 184,  55,  13,   4,   1,   0,   0,   0,   0,},
             {7415, 6829, 1138, 244,  71,  26,   7,   0,   0,   0,   0, 9980,},
             {1580, 1824, 655, 241,  89,  46,  10,   2,   0,   0,   0, 429,},
         },
         {
-            // Coeff Band ( 3 )
+            /* Coeff Band ( 3 ) */
             {19453, 5260, 201,  19,   0,   0,   0,   0,   0,   0,   0,   0,},
             {9173, 3758, 213,  22,   1,   1,   0,   0,   0,   0,   0, 9820,},
             {1689, 1277, 276,  51,  17,   4,   0,   0,   0,   0,   0, 679,},
         },
         {
-            // Coeff Band ( 4 )
+            /* Coeff Band ( 4 ) */
             {12076, 10667, 620,  85,  19,   9,   5,   0,   0,   0,   0,   0,},
             {4665, 3625, 423,  55,  19,   9,   0,   0,   0,   0,   0, 5127,},
             { 415, 440, 143,  34,  20,   7,   2,   0,   0,   0,   0, 101,},
         },
         {
-            // Coeff Band ( 5 )
+            /* Coeff Band ( 5 ) */
             {12183, 4846, 115,  11,   1,   0,   0,   0,   0,   0,   0,   0,},
             {4226, 3149, 177,  21,   2,   0,   0,   0,   0,   0,   0, 7157,},
             { 375, 621, 189,  51,  11,   4,   1,   0,   0,   0,   0, 198,},
         },
         {
-            // Coeff Band ( 6 )
+            /* Coeff Band ( 6 ) */
             {61658, 37743, 1203,  94,  10,   3,   0,   0,   0,   0,   0,   0,},
             {15514, 11563, 903, 111,  14,   5,   0,   0,   0,   0,   0, 25195,},
             { 929, 1077, 291,  78,  14,   7,   1,   0,   0,   0,   0, 507,},
         },
         {
-            // Coeff Band ( 7 )
+            /* Coeff Band ( 7 ) */
             {   0, 990,  15,   3,   0,   0,   0,   0,   0,   0,   0,   0,},
             {   0, 412,  13,   0,   0,   0,   0,   0,   0,   0,   0, 1641,},
             {   0,  18,   7,   1,   0,   0,   0,   0,   0,   0,   0,  30,},
@@ -117,51 +117,51 @@
         },
     },
     {
-        // Block Type ( 2 )
+        /* Block Type ( 2 ) */
         {
-            // Coeff Band ( 0 )
+            /* Coeff Band ( 0 ) */
             { 953, 24519, 628, 120,  28,  12,   4,   0,   0,   0,   0, 2248798,},
             {1525, 25654, 2647, 617, 239, 143,  42,   5,   0,   0,   0, 66837,},
             {1180, 11011, 3001, 1237, 532, 448, 239,  54,   5,   0,   0, 7122,},
         },
         {
-            // Coeff Band ( 1 )
+            /* Coeff Band ( 1 ) */
             {1356, 2220,  67,  10,   4,   1,   0,   0,   0,   0,   0,   0,},
             {1450, 2544, 102,  18,   4,   3,   0,   0,   0,   0,   0, 57063,},
             {1182, 2110, 470, 130,  41,  21,   0,   0,   0,   0,   0, 6047,},
         },
         {
-            // Coeff Band ( 2 )
+            /* Coeff Band ( 2 ) */
             { 370, 3378, 200,  30,   5,   4,   1,   0,   0,   0,   0,   0,},
             { 293, 1006, 131,  29,  11,   0,   0,   0,   0,   0,   0, 5404,},
             { 114, 387,  98,  23,   4,   8,   1,   0,   0,   0,   0, 236,},
         },
         {
-            // Coeff Band ( 3 )
+            /* Coeff Band ( 3 ) */
             { 579, 194,   4,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             { 395, 213,   5,   1,   0,   0,   0,   0,   0,   0,   0, 4157,},
             { 119, 122,   4,   0,   0,   0,   0,   0,   0,   0,   0, 300,},
         },
         {
-            // Coeff Band ( 4 )
+            /* Coeff Band ( 4 ) */
             {  38, 557,  19,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             {  21, 114,  12,   1,   0,   0,   0,   0,   0,   0,   0, 427,},
             {   0,   5,   0,   0,   0,   0,   0,   0,   0,   0,   0,   7,},
         },
         {
-            // Coeff Band ( 5 )
+            /* Coeff Band ( 5 ) */
             {  52,   7,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             {  18,   6,   0,   0,   0,   0,   0,   0,   0,   0,   0, 652,},
             {   1,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,  30,},
         },
         {
-            // Coeff Band ( 6 )
+            /* Coeff Band ( 6 ) */
             { 640, 569,  10,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             {  25,  77,   2,   0,   0,   0,   0,   0,   0,   0,   0, 517,},
             {   4,   7,   0,   0,   0,   0,   0,   0,   0,   0,   0,   3,},
         },
         {
-            // Coeff Band ( 7 )
+            /* Coeff Band ( 7 ) */
             {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
@@ -168,51 +168,51 @@
         },
     },
     {
-        // Block Type ( 3 )
+        /* Block Type ( 3 ) */
         {
-            // Coeff Band ( 0 )
+            /* Coeff Band ( 0 ) */
             {2506, 20161, 2707, 767, 261, 178, 107,  30,  14,   3,   0, 100694,},
             {8806, 36478, 8817, 3268, 1280, 850, 401, 114,  42,   0,   0, 58572,},
             {11003, 27214, 11798, 5716, 2482, 2072, 1048, 175,  32,   0,   0, 19284,},
         },
         {
-            // Coeff Band ( 1 )
+            /* Coeff Band ( 1 ) */
             {9738, 11313, 959, 205,  70,  18,  11,   1,   0,   0,   0,   0,},
             {12628, 15085, 1507, 273,  52,  19,   9,   0,   0,   0,   0, 54280,},
             {10701, 15846, 5561, 1926, 813, 570, 249,  36,   0,   0,   0, 6460,},
         },
         {
-            // Coeff Band ( 2 )
+            /* Coeff Band ( 2 ) */
             {6781, 22539, 2784, 634, 182, 123,  20,   4,   0,   0,   0,   0,},
             {6263, 11544, 2649, 790, 259, 168,  27,   5,   0,   0,   0, 20539,},
             {3109, 4075, 2031, 896, 457, 386, 158,  29,   0,   0,   0, 1138,},
         },
         {
-            // Coeff Band ( 3 )
+            /* Coeff Band ( 3 ) */
             {11515, 4079, 465,  73,   5,  14,   2,   0,   0,   0,   0,   0,},
             {9361, 5834, 650,  96,  24,   8,   4,   0,   0,   0,   0, 22181,},
             {4343, 3974, 1360, 415, 132,  96,  14,   1,   0,   0,   0, 1267,},
         },
         {
-            // Coeff Band ( 4 )
+            /* Coeff Band ( 4 ) */
             {4787, 9297, 823, 168,  44,  12,   4,   0,   0,   0,   0,   0,},
             {3619, 4472, 719, 198,  60,  31,   3,   0,   0,   0,   0, 8401,},
             {1157, 1175, 483, 182,  88,  31,   8,   0,   0,   0,   0, 268,},
         },
         {
-            // Coeff Band ( 5 )
+            /* Coeff Band ( 5 ) */
             {8299, 1226,  32,   5,   1,   0,   0,   0,   0,   0,   0,   0,},
             {3502, 1568,  57,   4,   1,   1,   0,   0,   0,   0,   0, 9811,},
             {1055, 1070, 166,  29,   6,   1,   0,   0,   0,   0,   0, 527,},
         },
         {
-            // Coeff Band ( 6 )
+            /* Coeff Band ( 6 ) */
             {27414, 27927, 1989, 347,  69,  26,   0,   0,   0,   0,   0,   0,},
             {5876, 10074, 1574, 341,  91,  24,   4,   0,   0,   0,   0, 21954,},
             {1571, 2171, 778, 324, 124,  65,  16,   0,   0,   0,   0, 979,},
         },
         {
-            // Coeff Band ( 7 )
+            /* Coeff Band ( 7 ) */
             {   0,  29,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},
             {   0,  23,   0,   0,   0,   0,   0,   0,   0,   0,   0, 459,},
             {   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,  13,},
--- a/vp8/common/entropy.h
+++ b/vp8/common/entropy.h
@@ -17,18 +17,18 @@
 
 /* Coefficient token alphabet */
 
-#define ZERO_TOKEN              0       //0         Extra Bits 0+0
-#define ONE_TOKEN               1       //1         Extra Bits 0+1
-#define TWO_TOKEN               2       //2         Extra Bits 0+1
-#define THREE_TOKEN             3       //3         Extra Bits 0+1
-#define FOUR_TOKEN              4       //4         Extra Bits 0+1
-#define DCT_VAL_CATEGORY1       5       //5-6       Extra Bits 1+1
-#define DCT_VAL_CATEGORY2       6       //7-10      Extra Bits 2+1
-#define DCT_VAL_CATEGORY3       7       //11-26     Extra Bits 4+1
-#define DCT_VAL_CATEGORY4       8       //11-26     Extra Bits 5+1
-#define DCT_VAL_CATEGORY5       9       //27-58     Extra Bits 5+1
-#define DCT_VAL_CATEGORY6       10      //59+       Extra Bits 11+1
-#define DCT_EOB_TOKEN           11      //EOB       Extra Bits 0+0
+#define ZERO_TOKEN              0       /* 0         Extra Bits 0+0 */
+#define ONE_TOKEN               1       /* 1         Extra Bits 0+1 */
+#define TWO_TOKEN               2       /* 2         Extra Bits 0+1 */
+#define THREE_TOKEN             3       /* 3         Extra Bits 0+1 */
+#define FOUR_TOKEN              4       /* 4         Extra Bits 0+1 */
+#define DCT_VAL_CATEGORY1       5       /* 5-6       Extra Bits 1+1 */
+#define DCT_VAL_CATEGORY2       6       /* 7-10      Extra Bits 2+1 */
+#define DCT_VAL_CATEGORY3       7       /* 11-26     Extra Bits 4+1 */
+#define DCT_VAL_CATEGORY4       8       /* 11-26     Extra Bits 5+1 */
+#define DCT_VAL_CATEGORY5       9       /* 27-58     Extra Bits 5+1 */
+#define DCT_VAL_CATEGORY6       10      /* 59+       Extra Bits 11+1 */
+#define DCT_EOB_TOKEN           11      /* EOB       Extra Bits 0+0 */
 
 #define vp8_coef_tokens 12
 #define MAX_ENTROPY_TOKENS vp8_coef_tokens
@@ -83,7 +83,7 @@
    coefficient band (and since zigzag positions 0, 1, and 2 are in
    distinct bands). */
 
-/*# define DC_TOKEN_CONTEXTS        3 // 00, 0!0, !0!0 */
+/*# define DC_TOKEN_CONTEXTS        3*/ /* 00, 0!0, !0!0 */
 #   define PREV_COEF_CONTEXTS       3
 
 extern DECLARE_ALIGNED(16, const unsigned char, vp8_prev_token_class[vp8_coef_tokens]);
--- a/vp8/common/entropymv.c
+++ b/vp8/common/entropymv.c
@@ -29,21 +29,21 @@
 const MV_CONTEXT vp8_default_mv_context[2] =
 {
     {{
-        // row
-        162,                                        // is short
-        128,                                        // sign
-        225, 146, 172, 147, 214,  39, 156,          // short tree
-        128, 129, 132,  75, 145, 178, 206, 239, 254, 254 // long bits
+        /* row */
+        162,                                        /* is short */
+        128,                                        /* sign */
+        225, 146, 172, 147, 214,  39, 156,          /* short tree */
+        128, 129, 132,  75, 145, 178, 206, 239, 254, 254 /* long bits */
     }},
 
 
 
     {{
-        // same for column
-        164,                                        // is short
+        /* same for column */
+        164,                                        /* is short */
         128,
         204, 170, 119, 235, 140, 230, 228,
-        128, 130, 130,  74, 148, 180, 203, 236, 254, 254 // long bits
+        128, 130, 130,  74, 148, 180, 203, 236, 254, 254 /* long bits */
 
     }}
 };
--- a/vp8/common/extend.c
+++ b/vp8/common/extend.c
@@ -15,14 +15,14 @@
 
 static void extend_plane_borders
 (
-    unsigned char *s, // source
-    int sp,           // pitch
-    int h,            // height
-    int w,            // width
-    int et,           // extend top border
-    int el,           // extend left border
-    int eb,           // extend bottom border
-    int er            // extend right border
+    unsigned char *s, /* source */
+    int sp,           /* pitch */
+    int h,            /* height */
+    int w,            /* width */
+    int et,           /* extend top border */
+    int el,           /* extend left border */
+    int eb,           /* extend bottom border */
+    int er            /* extend right border */
 )
 {
 
@@ -31,7 +31,7 @@
     unsigned char *dest_ptr1, *dest_ptr2;
     int linesize;
 
-    // copy the left and right most columns out
+    /* copy the left and right most columns out */
     src_ptr1 = s;
     src_ptr2 = s + w - 1;
     dest_ptr1 = s - el;
@@ -39,8 +39,9 @@
 
     for (i = 0; i < h - 0 + 1; i++)
     {
-        // Some linkers will complain if we call vpx_memset with el set to a
-        // constant 0.
+        /* Some linkers will complain if we call vpx_memset with el set to a
+         * constant 0.
+         */
         if (el)
             vpx_memset(dest_ptr1, src_ptr1[0], el);
         vpx_memset(dest_ptr2, src_ptr2[0], er);
@@ -50,7 +51,7 @@
         dest_ptr2 += sp;
     }
 
-    // Now copy the top and bottom source lines into each line of the respective borders
+    /* Now copy the top and bottom source lines into each line of the respective borders */
     src_ptr1 = s - el;
     src_ptr2 = s + sp * (h - 1) - el;
     dest_ptr1 = s + sp * (-et) - el;
@@ -76,12 +77,12 @@
     int er = 0xf & (16 - (width & 0xf));
     int eb = 0xf & (16 - (height & 0xf));
 
-    // check for non multiples of 16
+    /* check for non multiples of 16 */
     if (er != 0 || eb != 0)
     {
         extend_plane_borders(ybf->y_buffer, ybf->y_stride, height, width, 0, 0, eb, er);
 
-        //adjust for uv
+        /* adjust for uv */
         height = (height + 1) >> 1;
         width  = (width  + 1) >> 1;
         er = 0x7 & (8 - (width  & 0x7));
@@ -95,7 +96,7 @@
     }
 }
 
-// note the extension is only for the last row, for intra prediction purpose
+/* note the extension is only for the last row, for intra prediction purpose */
 void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf, unsigned char *YPtr, unsigned char *UPtr, unsigned char *VPtr)
 {
     int i;
--- a/vp8/common/filter_c.c
+++ b/vp8/common/filter_c.c
@@ -32,13 +32,13 @@
 static const short sub_pel_filters[8][6] =
 {
 
-    { 0,  0,  128,    0,   0,  0 },         // note that 1/8 pel positions are just as per alpha -0.5 bicubic
+    { 0,  0,  128,    0,   0,  0 },         /* note that 1/8 pel positions are just as per alpha -0.5 bicubic */
     { 0, -6,  123,   12,  -1,  0 },
-    { 2, -11, 108,   36,  -8,  1 },         // New 1/4 pel 6 tap filter
+    { 2, -11, 108,   36,  -8,  1 },         /* New 1/4 pel 6 tap filter */
     { 0, -9,   93,   50,  -6,  0 },
-    { 3, -16,  77,   77, -16,  3 },         // New 1/2 pel 6 tap filter
+    { 3, -16,  77,   77, -16,  3 },         /* New 1/2 pel 6 tap filter */
     { 0, -6,   50,   93,  -9,  0 },
-    { 1, -8,   36,  108, -11,  2 },         // New 1/4 pel 6 tap filter
+    { 1, -8,   36,  108, -11,  2 },         /* New 1/4 pel 6 tap filter */
     { 0, -1,   12,  123,  -6,  0 },
 
 
@@ -69,9 +69,9 @@
                    ((int)src_ptr[pixel_step]         * vp8_filter[3]) +
                    ((int)src_ptr[2*pixel_step]       * vp8_filter[4]) +
                    ((int)src_ptr[3*pixel_step]       * vp8_filter[5]) +
-                   (VP8_FILTER_WEIGHT >> 1);      // Rounding
+                   (VP8_FILTER_WEIGHT >> 1);      /* Rounding */
 
-            // Normalize back to 0-255
+            /* Normalize back to 0-255 */
             Temp = Temp >> VP8_FILTER_SHIFT;
 
             if (Temp < 0)
@@ -83,7 +83,7 @@
             src_ptr++;
         }
 
-        // Next row...
+        /* Next row... */
         src_ptr    += src_pixels_per_line - output_width;
         output_ptr += output_width;
     }
@@ -108,7 +108,7 @@
     {
         for (j = 0; j < output_width; j++)
         {
-            // Apply filter
+            /* Apply filter */
             Temp = ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[0]) +
                    ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[1]) +
                    ((int)src_ptr[0]                 * vp8_filter[2]) +
@@ -115,9 +115,9 @@
                    ((int)src_ptr[pixel_step]         * vp8_filter[3]) +
                    ((int)src_ptr[2*pixel_step]       * vp8_filter[4]) +
                    ((int)src_ptr[3*pixel_step]       * vp8_filter[5]) +
-                   (VP8_FILTER_WEIGHT >> 1);   // Rounding
+                   (VP8_FILTER_WEIGHT >> 1);   /* Rounding */
 
-            // Normalize back to 0-255
+            /* Normalize back to 0-255 */
             Temp = Temp >> VP8_FILTER_SHIFT;
 
             if (Temp < 0)
@@ -129,7 +129,7 @@
             src_ptr++;
         }
 
-        // Start next row
+        /* Start next row */
         src_ptr    += src_pixels_per_line - output_width;
         output_ptr += output_pitch;
     }
@@ -146,12 +146,12 @@
     const short  *VFilter
 )
 {
-    int FData[9*4]; // Temp data bufffer used in filtering
+    int FData[9*4]; /* Temp data bufffer used in filtering */
 
-    // First filter 1-D horizontally...
+    /* First filter 1-D horizontally... */
     vp8_filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 9, 4, HFilter);
 
-    // then filter verticaly...
+    /* then filter verticaly... */
     vp8_filter_block2d_second_pass(FData + 8, output_ptr, output_pitch, 4, 4, 4, 4, VFilter);
 }
 
@@ -195,8 +195,8 @@
     const short  *HFilter;
     const short  *VFilter;
 
-    HFilter = sub_pel_filters[xoffset];   // 6 tap
-    VFilter = sub_pel_filters[yoffset];   // 6 tap
+    HFilter = sub_pel_filters[xoffset];   /* 6 tap */
+    VFilter = sub_pel_filters[yoffset];   /* 6 tap */
 
     vp8_filter_block2d(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter);
 }
@@ -212,16 +212,16 @@
 {
     const short  *HFilter;
     const short  *VFilter;
-    int FData[13*16];   // Temp data bufffer used in filtering
+    int FData[13*16];   /* Temp data bufffer used in filtering */
 
-    HFilter = sub_pel_filters[xoffset];   // 6 tap
-    VFilter = sub_pel_filters[yoffset];   // 6 tap
+    HFilter = sub_pel_filters[xoffset];   /* 6 tap */
+    VFilter = sub_pel_filters[yoffset];   /* 6 tap */
 
-    // First filter 1-D horizontally...
+    /* First filter 1-D horizontally... */
     vp8_filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 13, 8, HFilter);
 
 
-    // then filter verticaly...
+    /* then filter verticaly... */
     vp8_filter_block2d_second_pass(FData + 16, dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter);
 
 }
@@ -238,16 +238,16 @@
 {
     const short  *HFilter;
     const short  *VFilter;
-    int FData[13*16];   // Temp data bufffer used in filtering
+    int FData[13*16];   /* Temp data bufffer used in filtering */
 
-    HFilter = sub_pel_filters[xoffset];   // 6 tap
-    VFilter = sub_pel_filters[yoffset];   // 6 tap
+    HFilter = sub_pel_filters[xoffset];   /* 6 tap */
+    VFilter = sub_pel_filters[yoffset];   /* 6 tap */
 
-    // First filter 1-D horizontally...
+    /* First filter 1-D horizontally... */
     vp8_filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 9, 8, HFilter);
 
 
-    // then filter verticaly...
+    /* then filter verticaly... */
     vp8_filter_block2d_second_pass(FData + 16, dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter);
 
 }
@@ -264,16 +264,16 @@
 {
     const short  *HFilter;
     const short  *VFilter;
-    int FData[21*24];   // Temp data bufffer used in filtering
+    int FData[21*24];   /* Temp data bufffer used in filtering */
 
 
-    HFilter = sub_pel_filters[xoffset];   // 6 tap
-    VFilter = sub_pel_filters[yoffset];   // 6 tap
+    HFilter = sub_pel_filters[xoffset];   /* 6 tap */
+    VFilter = sub_pel_filters[yoffset];   /* 6 tap */
 
-    // First filter 1-D horizontally...
+    /* First filter 1-D horizontally... */
     vp8_filter_block2d_first_pass(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 1, 21, 16, HFilter);
 
-    // then filter verticaly...
+    /* then filter verticaly... */
     vp8_filter_block2d_second_pass(FData + 32, dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter);
 
 }
@@ -324,7 +324,7 @@
     {
         for (j = 0; j < output_width; j++)
         {
-            // Apply bilinear filter
+            /* Apply bilinear filter */
             output_ptr[j] = (((int)src_ptr[0]          * vp8_filter[0]) +
                              ((int)src_ptr[pixel_step] * vp8_filter[1]) +
                              (VP8_FILTER_WEIGHT / 2)) >> VP8_FILTER_SHIFT;
@@ -331,7 +331,7 @@
             src_ptr++;
         }
 
-        // Next row...
+        /* Next row... */
         src_ptr    += src_pixels_per_line - output_width;
         output_ptr += output_width;
     }
@@ -384,7 +384,7 @@
     {
         for (j = 0; j < output_width; j++)
         {
-            // Apply filter
+            /* Apply filter */
             Temp = ((int)src_ptr[0]         * vp8_filter[0]) +
                    ((int)src_ptr[pixel_step] * vp8_filter[1]) +
                    (VP8_FILTER_WEIGHT / 2);
@@ -392,7 +392,7 @@
             src_ptr++;
         }
 
-        // Next row...
+        /* Next row... */
         src_ptr    += src_pixels_per_line - output_width;
         output_ptr += output_pitch;
     }
@@ -432,12 +432,12 @@
 )
 {
 
-    unsigned short FData[17*16];    // Temp data bufffer used in filtering
+    unsigned short FData[17*16];    /* Temp data bufffer used in filtering */
 
-    // First filter 1-D horizontally...
+    /* First filter 1-D horizontally... */
     vp8_filter_block2d_bil_first_pass(src_ptr, FData, src_pixels_per_line, 1, Height + 1, Width, HFilter);
 
-    // then 1-D vertically...
+    /* then 1-D vertically... */
     vp8_filter_block2d_bil_second_pass(FData, output_ptr, dst_pitch, Width, Width, Height, Width, VFilter);
 }
 
--- a/vp8/common/findnearmv.c
+++ b/vp8/common/findnearmv.c
@@ -168,7 +168,7 @@
 
     vp8_clamp_mv(nearest, xd);
     vp8_clamp_mv(nearby, xd);
-    vp8_clamp_mv(best_mv, xd); //TODO: move this up before the copy
+    vp8_clamp_mv(best_mv, xd); /*TODO: move this up before the copy*/
 }
 
 vp8_prob *vp8_mv_ref_probs(
@@ -179,7 +179,7 @@
     p[1] = vp8_mode_contexts [near_mv_ref_ct[1]] [1];
     p[2] = vp8_mode_contexts [near_mv_ref_ct[2]] [2];
     p[3] = vp8_mode_contexts [near_mv_ref_ct[3]] [3];
-    //p[3] = vp8_mode_contexts [near_mv_ref_ct[1] + near_mv_ref_ct[2] + near_mv_ref_ct[3]] [3];
+    /*p[3] = vp8_mode_contexts [near_mv_ref_ct[1] + near_mv_ref_ct[2] + near_mv_ref_ct[3]] [3];*/
     return p;
 }
 
--- a/vp8/common/generic/systemdependent.c
+++ b/vp8/common/generic/systemdependent.c
@@ -73,7 +73,7 @@
 #endif
 
 #endif
-    // Pure C:
+    /* Pure C: */
     vp8_build_intra_predictors_mby_ptr = vp8_build_intra_predictors_mby;
     vp8_build_intra_predictors_mby_s_ptr = vp8_build_intra_predictors_mby_s;
 
--- a/vp8/common/invtrans.c
+++ b/vp8/common/invtrans.c
@@ -38,7 +38,7 @@
 {
     int i;
 
-    // do 2nd order transform on the dc block
+    /* do 2nd order transform on the dc block */
     IDCT_INVOKE(rtcd, iwalsh16)(x->block[24].dqcoeff, x->block[24].diff);
 
     recon_dcblock(x);
@@ -68,7 +68,7 @@
     if (x->mode_info_context->mbmi.mode != B_PRED &&
         x->mode_info_context->mbmi.mode != SPLITMV)
     {
-        // do 2nd order transform on the dc block
+        /* do 2nd order transform on the dc block */
 
         IDCT_INVOKE(rtcd, iwalsh16)(&x->block[24].dqcoeff[0], x->block[24].diff);
         recon_dcblock(x);
--- a/vp8/common/loopfilter.c
+++ b/vp8/common/loopfilter.c
@@ -23,7 +23,7 @@
 prototype_loopfilter(vp8_loop_filter_simple_horizontal_edge_c);
 prototype_loopfilter(vp8_loop_filter_simple_vertical_edge_c);
 
-// Horizontal MB filtering
+/* Horizontal MB filtering */
 void vp8_loop_filter_mbh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                            int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -47,7 +47,7 @@
     vp8_loop_filter_simple_horizontal_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->mbthr, 2);
 }
 
-// Vertical MB Filtering
+/* Vertical MB Filtering */
 void vp8_loop_filter_mbv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                            int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -71,7 +71,7 @@
     vp8_loop_filter_simple_vertical_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->mbthr, 2);
 }
 
-// Horizontal B Filtering
+/* Horizontal B Filtering */
 void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                           int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -99,7 +99,7 @@
     vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
 }
 
-// Vertical B Filtering
+/* Vertical B Filtering */
 void vp8_loop_filter_bv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                           int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -140,7 +140,7 @@
     const int yhedge_boost  = 2;
     const int uvhedge_boost = 2;
 
-    // For each possible value for the loop filter fill out a "loop_filter_info" entry.
+    /* For each possible value for the loop filter fill out a "loop_filter_info" entry. */
     for (i = 0; i <= MAX_LOOP_FILTER; i++)
     {
         int filt_lvl = i;
@@ -166,7 +166,7 @@
                 HEVThresh = 0;
         }
 
-        // Set loop filter paramaeters that control sharpness.
+        /* Set loop filter paramaeters that control sharpness. */
         block_inside_limit = filt_lvl >> (sharpness_lvl > 0);
         block_inside_limit = block_inside_limit >> (sharpness_lvl > 4);
 
@@ -195,7 +195,7 @@
 
     }
 
-    // Set up the function pointers depending on the type of loop filtering selected
+    /* Set up the function pointers depending on the type of loop filtering selected */
     if (lft == NORMAL_LOOPFILTER)
     {
         cm->lf_mbv = LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_v);
@@ -212,14 +212,15 @@
     }
 }
 
-// Put vp8_init_loop_filter() in vp8dx_create_decompressor(). Only call vp8_frame_init_loop_filter() while decoding
-// each frame. Check last_frame_type to skip the function most of times.
+/* Put vp8_init_loop_filter() in vp8dx_create_decompressor(). Only call vp8_frame_init_loop_filter() while decoding
+ * each frame. Check last_frame_type to skip the function most of times.
+ */
 void vp8_frame_init_loop_filter(loop_filter_info *lfi, int frame_type)
 {
     int HEVThresh;
     int i, j;
 
-    // For each possible value for the loop filter fill out a "loop_filter_info" entry.
+    /* For each possible value for the loop filter fill out a "loop_filter_info" entry. */
     for (i = 0; i <= MAX_LOOP_FILTER; i++)
     {
         int filt_lvl = i;
@@ -247,15 +248,15 @@
 
         for (j = 0; j < 16; j++)
         {
-            //lfi[i].lim[j] = block_inside_limit;
-            //lfi[i].mbflim[j] = filt_lvl+yhedge_boost;
+            /*lfi[i].lim[j] = block_inside_limit;
+            lfi[i].mbflim[j] = filt_lvl+yhedge_boost;*/
             lfi[i].mbthr[j] = HEVThresh;
-            //lfi[i].flim[j] = filt_lvl;
+            /*lfi[i].flim[j] = filt_lvl;*/
             lfi[i].thr[j] = HEVThresh;
-            //lfi[i].uvlim[j] = block_inside_limit;
-            //lfi[i].uvmbflim[j] = filt_lvl+uvhedge_boost;
+            /*lfi[i].uvlim[j] = block_inside_limit;
+            lfi[i].uvmbflim[j] = filt_lvl+uvhedge_boost;*/
             lfi[i].uvmbthr[j] = HEVThresh;
-            //lfi[i].uvflim[j] = filt_lvl;
+            /*lfi[i].uvflim[j] = filt_lvl;*/
             lfi[i].uvthr[j] = HEVThresh;
         }
     }
@@ -268,32 +269,32 @@
 
     if (mbd->mode_ref_lf_delta_enabled)
     {
-        // Aplly delta for reference frame
+        /* Apply delta for reference frame */
         *filter_level += mbd->ref_lf_deltas[mbmi->ref_frame];
 
-        // Apply delta for mode
+        /* Apply delta for mode */
         if (mbmi->ref_frame == INTRA_FRAME)
         {
-            // Only the split mode BPRED has a further special case
+            /* Only the split mode BPRED has a further special case */
             if (mbmi->mode == B_PRED)
                 *filter_level +=  mbd->mode_lf_deltas[0];
         }
         else
         {
-            // Zero motion mode
+            /* Zero motion mode */
             if (mbmi->mode == ZEROMV)
                 *filter_level +=  mbd->mode_lf_deltas[1];
 
-            // Split MB motion mode
+            /* Split MB motion mode */
             else if (mbmi->mode == SPLITMV)
                 *filter_level +=  mbd->mode_lf_deltas[3];
 
-            // All other inter motion modes (Nearest, Near, New)
+            /* All other inter motion modes (Nearest, Near, New) */
             else
                 *filter_level +=  mbd->mode_lf_deltas[2];
         }
 
-        // Range check
+        /* Range check */
         if (*filter_level > MAX_LOOP_FILTER)
             *filter_level = MAX_LOOP_FILTER;
         else if (*filter_level < 0)
@@ -311,7 +312,7 @@
 {
     YV12_BUFFER_CONFIG *post = cm->frame_to_show;
     loop_filter_info *lfi = cm->lf_info;
-    int frame_type = cm->frame_type;
+    FRAME_TYPE frame_type = cm->frame_type;
 
     int mb_row;
     int mb_col;
@@ -324,21 +325,21 @@
     int i;
     unsigned char *y_ptr, *u_ptr, *v_ptr;
 
-    mbd->mode_info_context = cm->mi;          // Point at base of Mb MODE_INFO list
+    mbd->mode_info_context = cm->mi;          /* Point at base of Mb MODE_INFO list */
 
-    // Note the baseline filter values for each segment
+    /* Note the baseline filter values for each segment */
     if (alt_flt_enabled)
     {
         for (i = 0; i < MAX_MB_SEGMENTS; i++)
         {
-            // Abs value
+            /* Abs value */
             if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA)
                 baseline_filter_level[i] = mbd->segment_feature_data[MB_LVL_ALT_LF][i];
-            // Delta Value
+            /* Delta Value */
             else
             {
                 baseline_filter_level[i] = default_filt_lvl + mbd->segment_feature_data[MB_LVL_ALT_LF][i];
-                baseline_filter_level[i] = (baseline_filter_level[i] >= 0) ? ((baseline_filter_level[i] <= MAX_LOOP_FILTER) ? baseline_filter_level[i] : MAX_LOOP_FILTER) : 0;  // Clamp to valid range
+                baseline_filter_level[i] = (baseline_filter_level[i] >= 0) ? ((baseline_filter_level[i] <= MAX_LOOP_FILTER) ? baseline_filter_level[i] : MAX_LOOP_FILTER) : 0;  /* Clamp to valid range */
             }
         }
     }
@@ -348,18 +349,18 @@
             baseline_filter_level[i] = default_filt_lvl;
     }
 
-    // Initialize the loop filter for this frame.
+    /* Initialize the loop filter for this frame. */
     if ((cm->last_filter_type != cm->filter_type) || (cm->last_sharpness_level != cm->sharpness_level))
         vp8_init_loop_filter(cm);
     else if (frame_type != cm->last_frame_type)
         vp8_frame_init_loop_filter(lfi, frame_type);
 
-    // Set up the buffer pointers
+    /* Set up the buffer pointers */
     y_ptr = post->y_buffer;
     u_ptr = post->u_buffer;
     v_ptr = post->v_buffer;
 
-    // vp8_filter each macro block
+    /* vp8_filter each macro block */
     for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
     {
         for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
@@ -368,9 +369,10 @@
 
             filter_level = baseline_filter_level[Segment];
 
-            // Distance of Mb to the various image edges.
-            // These specified to 8th pel as they are always compared to values that are in 1/8th pel units
-            // Apply any context driven MB level adjustment
+            /* Distance of Mb to the various image edges.
+             * These specified to 8th pel as they are always compared to values that are in 1/8th pel units
+             * Apply any context driven MB level adjustment
+             */
             vp8_adjust_mb_lf_value(mbd, &filter_level);
 
             if (filter_level)
@@ -381,7 +383,7 @@
                 if (mbd->mode_info_context->mbmi.dc_diff > 0)
                     cm->lf_bv(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level], cm->simpler_lpf);
 
-                // don't apply across umv border
+                /* don't apply across umv border */
                 if (mb_row > 0)
                     cm->lf_mbh(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level], cm->simpler_lpf);
 
@@ -393,7 +395,7 @@
             u_ptr += 8;
             v_ptr += 8;
 
-            mbd->mode_info_context++;     // step to next MB
+            mbd->mode_info_context++;     /* step to next MB */
         }
 
         y_ptr += post->y_stride  * 16 - post->y_width;
@@ -400,7 +402,7 @@
         u_ptr += post->uv_stride *  8 - post->uv_width;
         v_ptr += post->uv_stride *  8 - post->uv_width;
 
-        mbd->mode_info_context++;         // Skip border mb
+        mbd->mode_info_context++;         /* Skip border mb */
     }
 }
 
@@ -424,26 +426,26 @@
     int baseline_filter_level[MAX_MB_SEGMENTS];
     int filter_level;
     int alt_flt_enabled = mbd->segmentation_enabled;
-    int frame_type = cm->frame_type;
+    FRAME_TYPE frame_type = cm->frame_type;
 
     (void) sharpness_lvl;
 
-    //MODE_INFO * this_mb_mode_info = cm->mi;  // Point at base of Mb MODE_INFO list
-    mbd->mode_info_context = cm->mi;          // Point at base of Mb MODE_INFO list
+    /*MODE_INFO * this_mb_mode_info = cm->mi;*/ /* Point at base of Mb MODE_INFO list */
+    mbd->mode_info_context = cm->mi;          /* Point at base of Mb MODE_INFO list */
 
-    // Note the baseline filter values for each segment
+    /* Note the baseline filter values for each segment */
     if (alt_flt_enabled)
     {
         for (i = 0; i < MAX_MB_SEGMENTS; i++)
         {
-            // Abs value
+            /* Abs value */
             if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA)
                 baseline_filter_level[i] = mbd->segment_feature_data[MB_LVL_ALT_LF][i];
-            // Delta Value
+            /* Delta Value */
             else
             {
                 baseline_filter_level[i] = default_filt_lvl + mbd->segment_feature_data[MB_LVL_ALT_LF][i];
-                baseline_filter_level[i] = (baseline_filter_level[i] >= 0) ? ((baseline_filter_level[i] <= MAX_LOOP_FILTER) ? baseline_filter_level[i] : MAX_LOOP_FILTER) : 0;  // Clamp to valid range
+                baseline_filter_level[i] = (baseline_filter_level[i] >= 0) ? ((baseline_filter_level[i] <= MAX_LOOP_FILTER) ? baseline_filter_level[i] : MAX_LOOP_FILTER) : 0;  /* Clamp to valid range */
             }
         }
     }
@@ -453,16 +455,16 @@
             baseline_filter_level[i] = default_filt_lvl;
     }
 
-    // Initialize the loop filter for this frame.
+    /* Initialize the loop filter for this frame. */
     if ((cm->last_filter_type != cm->filter_type) || (cm->last_sharpness_level != cm->sharpness_level))
         vp8_init_loop_filter(cm);
     else if (frame_type != cm->last_frame_type)
         vp8_frame_init_loop_filter(lfi, frame_type);
 
-    // Set up the buffer pointers
+    /* Set up the buffer pointers */
     y_ptr = post->y_buffer;
 
-    // vp8_filter each macro block
+    /* vp8_filter each macro block */
     for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
     {
         for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
@@ -470,7 +472,7 @@
             int Segment = (alt_flt_enabled) ? mbd->mode_info_context->mbmi.segment_id : 0;
             filter_level = baseline_filter_level[Segment];
 
-            // Apply any context driven MB level adjustment
+            /* Apply any context driven MB level adjustment */
             vp8_adjust_mb_lf_value(mbd, &filter_level);
 
             if (filter_level)
@@ -481,7 +483,7 @@
                 if (mbd->mode_info_context->mbmi.dc_diff > 0)
                     cm->lf_bv(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0);
 
-                // don't apply across umv border
+                /* don't apply across umv border */
                 if (mb_row > 0)
                     cm->lf_mbh(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0);
 
@@ -490,12 +492,12 @@
             }
 
             y_ptr += 16;
-            mbd->mode_info_context ++;        // step to next MB
+            mbd->mode_info_context ++;        /* step to next MB */
 
         }
 
         y_ptr += post->y_stride  * 16 - post->y_width;
-        mbd->mode_info_context ++;            // Skip border mb
+        mbd->mode_info_context ++;            /* Skip border mb */
     }
 
 }
@@ -516,7 +518,7 @@
     unsigned char *y_ptr;
     int mb_row;
     int mb_col;
-    //int mb_rows = post->y_height >> 4;
+    /*int mb_rows = post->y_height >> 4;*/
     int mb_cols = post->y_width  >> 4;
 
     int linestocopy;
@@ -525,12 +527,12 @@
     int baseline_filter_level[MAX_MB_SEGMENTS];
     int filter_level;
     int alt_flt_enabled = mbd->segmentation_enabled;
-    int frame_type = cm->frame_type;
+    FRAME_TYPE frame_type = cm->frame_type;
 
     (void) sharpness_lvl;
 
-    //MODE_INFO * this_mb_mode_info = cm->mi + (post->y_height>>5) * (mb_cols + 1);  // Point at base of Mb MODE_INFO list
-    mbd->mode_info_context = cm->mi + (post->y_height >> 5) * (mb_cols + 1);        // Point at base of Mb MODE_INFO list
+    /*MODE_INFO * this_mb_mode_info = cm->mi + (post->y_height>>5) * (mb_cols + 1);*/ /* Point at base of Mb MODE_INFO list */
+    mbd->mode_info_context = cm->mi + (post->y_height >> 5) * (mb_cols + 1);        /* Point at base of Mb MODE_INFO list */
 
     linestocopy = (post->y_height >> (4 + Fraction));
 
@@ -539,19 +541,19 @@
 
     linestocopy <<= 4;
 
-    // Note the baseline filter values for each segment
+    /* Note the baseline filter values for each segment */
     if (alt_flt_enabled)
     {
         for (i = 0; i < MAX_MB_SEGMENTS; i++)
         {
-            // Abs value
+            /* Abs value */
             if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA)
                 baseline_filter_level[i] = mbd->segment_feature_data[MB_LVL_ALT_LF][i];
-            // Delta Value
+            /* Delta Value */
             else
             {
                 baseline_filter_level[i] = default_filt_lvl + mbd->segment_feature_data[MB_LVL_ALT_LF][i];
-                baseline_filter_level[i] = (baseline_filter_level[i] >= 0) ? ((baseline_filter_level[i] <= MAX_LOOP_FILTER) ? baseline_filter_level[i] : MAX_LOOP_FILTER) : 0;  // Clamp to valid range
+                baseline_filter_level[i] = (baseline_filter_level[i] >= 0) ? ((baseline_filter_level[i] <= MAX_LOOP_FILTER) ? baseline_filter_level[i] : MAX_LOOP_FILTER) : 0;  /* Clamp to valid range */
             }
         }
     }
@@ -561,16 +563,16 @@
             baseline_filter_level[i] = default_filt_lvl;
     }
 
-    // Initialize the loop filter for this frame.
+    /* Initialize the loop filter for this frame. */
     if ((cm->last_filter_type != cm->filter_type) || (cm->last_sharpness_level != cm->sharpness_level))
         vp8_init_loop_filter(cm);
     else if (frame_type != cm->last_frame_type)
         vp8_frame_init_loop_filter(lfi, frame_type);
 
-    // Set up the buffer pointers
+    /* Set up the buffer pointers */
     y_ptr = post->y_buffer + (post->y_height >> 5) * 16 * post->y_stride;
 
-    // vp8_filter each macro block
+    /* vp8_filter each macro block */
     for (mb_row = 0; mb_row<(linestocopy >> 4); mb_row++)
     {
         for (mb_col = 0; mb_col < mb_cols; mb_col++)
@@ -593,10 +595,10 @@
             }
 
             y_ptr += 16;
-            mbd->mode_info_context += 1;      // step to next MB
+            mbd->mode_info_context += 1;      /* step to next MB */
         }
 
         y_ptr += post->y_stride  * 16 - post->y_width;
-        mbd->mode_info_context += 1;          // Skip border mb
+        mbd->mode_info_context += 1;          /* Skip border mb */
     }
 }
--- a/vp8/common/loopfilter.h
+++ b/vp8/common/loopfilter.h
@@ -22,10 +22,10 @@
     SIMPLE_LOOPFILTER = 1
 } LOOPFILTERTYPE;
 
-// FRK
-// Need to align this structure so when it is declared and
-// passed it can be loaded into vector registers.
-// FRK
+/* FRK
+ * Need to align this structure so when it is declared and
+ * passed it can be loaded into vector registers.
+ */
 typedef struct
 {
     DECLARE_ALIGNED(16, signed char, lim[16]);
@@ -119,8 +119,8 @@
 
 typedef void loop_filter_uvfunction
 (
-    unsigned char *u,   // source pointer
-    int p,              // pitch
+    unsigned char *u,   /* source pointer */
+    int p,              /* pitch */
     const signed char *flimit,
     const signed char *limit,
     const signed char *thresh,
--- a/vp8/common/loopfilter_filters.c
+++ b/vp8/common/loopfilter_filters.c
@@ -23,7 +23,7 @@
 }
 
 
-// should we apply any filter at all ( 11111111 yes, 00000000 no)
+/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
 static __inline signed char vp8_filter_mask(signed char limit, signed char flimit,
                                      uc p3, uc p2, uc p1, uc p0, uc q0, uc q1, uc q2, uc q3)
 {
@@ -39,7 +39,7 @@
     return mask;
 }
 
-// is there high variance internal edge ( 11111111 yes, 00000000 no)
+/* is there high variance internal edge ( 11111111 yes, 00000000 no) */
 static __inline signed char vp8_hevmask(signed char thresh, uc p1, uc p0, uc q0, uc q1)
 {
     signed char hev = 0;
@@ -61,17 +61,18 @@
     qs0 = (signed char) * oq0 ^ 0x80;
     qs1 = (signed char) * oq1 ^ 0x80;
 
-    // add outer taps if we have high edge variance
+    /* add outer taps if we have high edge variance */
     vp8_filter = vp8_signed_char_clamp(ps1 - qs1);
     vp8_filter &= hev;
 
-    // inner taps
+    /* inner taps */
     vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0));
     vp8_filter &= mask;
 
-    // save bottom 3 bits so that we round one side +4 and the other +3
-    // if it equals 4 we'll set to adjust by -1 to account for the fact
-    // we'd round 3 the other way
+    /* save bottom 3 bits so that we round one side +4 and the other +3
+     * if it equals 4 we'll set to adjust by -1 to account for the fact
+     * we'd round 3 the other way
+     */
     Filter1 = vp8_signed_char_clamp(vp8_filter + 4);
     Filter2 = vp8_signed_char_clamp(vp8_filter + 3);
     Filter1 >>= 3;
@@ -82,7 +83,7 @@
     *op0 = u ^ 0x80;
     vp8_filter = Filter1;
 
-    // outer tap adjustments
+    /* outer tap adjustments */
     vp8_filter += 1;
     vp8_filter >>= 1;
     vp8_filter &= ~hev;
@@ -96,7 +97,7 @@
 void vp8_loop_filter_horizontal_edge_c
 (
     unsigned char *s,
-    int p, //pitch
+    int p, /* pitch */
     const signed char *flimit,
     const signed char *limit,
     const signed char *thresh,
@@ -103,12 +104,13 @@
     int count
 )
 {
-    int  hev = 0; // high edge variance
+    int  hev = 0; /* high edge variance */
     signed char mask = 0;
     int i = 0;
 
-    // loop filter designed to work using chars so that we can make maximum use
-    // of 8 bit simd instructions.
+    /* loop filter designed to work using chars so that we can make maximum use
+     * of 8 bit simd instructions.
+     */
     do
     {
         mask = vp8_filter_mask(limit[i], flimit[i],
@@ -134,12 +136,13 @@
     int count
 )
 {
-    int  hev = 0; // high edge variance
+    int  hev = 0; /* high edge variance */
     signed char mask = 0;
     int i = 0;
 
-    // loop filter designed to work using chars so that we can make maximum use
-    // of 8 bit simd instructions.
+    /* loop filter designed to work using chars so that we can make maximum use
+     * of 8 bit simd instructions.
+     */
     do
     {
         mask = vp8_filter_mask(limit[i], flimit[i],
@@ -166,7 +169,7 @@
     signed char qs1 = (signed char) * oq1 ^ 0x80;
     signed char qs2 = (signed char) * oq2 ^ 0x80;
 
-    // add outer taps if we have high edge variance
+    /* add outer taps if we have high edge variance */
     vp8_filter = vp8_signed_char_clamp(ps1 - qs1);
     vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0));
     vp8_filter &= mask;
@@ -174,7 +177,7 @@
     Filter2 = vp8_filter;
     Filter2 &= hev;
 
-    // save bottom 3 bits so that we round one side +4 and the other +3
+    /* save bottom 3 bits so that we round one side +4 and the other +3 */
     Filter1 = vp8_signed_char_clamp(Filter2 + 4);
     Filter2 = vp8_signed_char_clamp(Filter2 + 3);
     Filter1 >>= 3;
@@ -183,11 +186,11 @@
     ps0 = vp8_signed_char_clamp(ps0 + Filter2);
 
 
-    // only apply wider filter if not high edge variance
+    /* only apply wider filter if not high edge variance */
     vp8_filter &= ~hev;
     Filter2 = vp8_filter;
 
-    // roughly 3/7th difference across boundary
+    /* roughly 3/7th difference across boundary */
     u = vp8_signed_char_clamp((63 + Filter2 * 27) >> 7);
     s = vp8_signed_char_clamp(qs0 - u);
     *oq0 = s ^ 0x80;
@@ -194,7 +197,7 @@
     s = vp8_signed_char_clamp(ps0 + u);
     *op0 = s ^ 0x80;
 
-    // roughly 2/7th difference across boundary
+    /* roughly 2/7th difference across boundary */
     u = vp8_signed_char_clamp((63 + Filter2 * 18) >> 7);
     s = vp8_signed_char_clamp(qs1 - u);
     *oq1 = s ^ 0x80;
@@ -201,7 +204,7 @@
     s = vp8_signed_char_clamp(ps1 + u);
     *op1 = s ^ 0x80;
 
-    // roughly 1/7th difference across boundary
+    /* roughly 1/7th difference across boundary */
     u = vp8_signed_char_clamp((63 + Filter2 * 9) >> 7);
     s = vp8_signed_char_clamp(qs2 - u);
     *oq2 = s ^ 0x80;
@@ -219,12 +222,13 @@
     int count
 )
 {
-    signed char hev = 0; // high edge variance
+    signed char hev = 0; /* high edge variance */
     signed char mask = 0;
     int i = 0;
 
-    // loop filter designed to work using chars so that we can make maximum use
-    // of 8 bit simd instructions.
+    /* loop filter designed to work using chars so that we can make maximum use
+     * of 8 bit simd instructions.
+     */
     do
     {
 
@@ -253,7 +257,7 @@
     int count
 )
 {
-    signed char hev = 0; // high edge variance
+    signed char hev = 0; /* high edge variance */
     signed char mask = 0;
     int i = 0;
 
@@ -273,12 +277,13 @@
 
 }
 
-// should we apply any filter at all ( 11111111 yes, 00000000 no)
+/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
 static __inline signed char vp8_simple_filter_mask(signed char limit, signed char flimit, uc p1, uc p0, uc q0, uc q1)
 {
-// Why does this cause problems for win32?
-// error C2143: syntax error : missing ';' before 'type'
-//  (void) limit;
+/* Why does this cause problems for win32?
+ * error C2143: syntax error : missing ';' before 'type'
+ *  (void) limit;
+ */
     signed char mask = (abs(p0 - q0) * 2 + abs(p1 - q1) / 2  <= flimit * 2 + limit) * -1;
     return mask;
 }
@@ -296,7 +301,7 @@
     vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (q0 - p0));
     vp8_filter &= mask;
 
-    // save bottom 3 bits so that we round one side +4 and the other +3
+    /* save bottom 3 bits so that we round one side +4 and the other +3 */
     Filter1 = vp8_signed_char_clamp(vp8_filter + 4);
     Filter1 >>= 3;
     u = vp8_signed_char_clamp(q0 - Filter1);
@@ -324,7 +329,7 @@
 
     do
     {
-        //mask = vp8_simple_filter_mask( limit[i], flimit[i],s[-1*p],s[0*p]);
+        /*mask = vp8_simple_filter_mask( limit[i], flimit[i],s[-1*p],s[0*p]);*/
         mask = vp8_simple_filter_mask(limit[i], flimit[i], s[-2*p], s[-1*p], s[0*p], s[1*p]);
         vp8_simple_filter(mask, s - 2 * p, s - 1 * p, s, s + 1 * p);
         ++s;
@@ -348,7 +353,7 @@
 
     do
     {
-        //mask = vp8_simple_filter_mask( limit[i], flimit[i],s[-1],s[0]);
+        /*mask = vp8_simple_filter_mask( limit[i], flimit[i],s[-1],s[0]);*/
         mask = vp8_simple_filter_mask(limit[i], flimit[i], s[-2], s[-1], s[0], s[1]);
         vp8_simple_filter(mask, s - 2, s - 1, s, s + 1);
         s += p;
--- a/vp8/common/mbpitch.c
+++ b/vp8/common/mbpitch.c
@@ -14,7 +14,7 @@
 typedef enum
 {
     PRED = 0,
-    DEST = 1,
+    DEST = 1
 } BLOCKSET;
 
 void vp8_setup_block
@@ -62,13 +62,13 @@
         v = &x->pre.v_buffer;
     }
 
-    for (block = 0; block < 16; block++) // y blocks
+    for (block = 0; block < 16; block++) /* y blocks */
     {
         vp8_setup_block(&x->block[block], x->dst.y_stride, y, x->dst.y_stride,
                         (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4, bs);
     }
 
-    for (block = 16; block < 20; block++) // U and V blocks
+    for (block = 16; block < 20; block++) /* U and V blocks */
     {
         vp8_setup_block(&x->block[block], x->dst.uv_stride, u, x->dst.uv_stride,
                         ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4, bs);
@@ -123,7 +123,7 @@
 void vp8_build_block_doffsets(MACROBLOCKD *x)
 {
 
-    // handle the destination pitch features
+    /* handle the destination pitch features */
     vp8_setup_macroblock(x, DEST);
     vp8_setup_macroblock(x, PRED);
 }
--- a/vp8/common/modecont.c
+++ b/vp8/common/modecont.c
@@ -14,27 +14,27 @@
 const int vp8_mode_contexts[6][4] =
 {
     {
-        // 0
+        /* 0 */
         7,     1,     1,   143,
     },
     {
-        // 1
+        /* 1 */
         14,    18,    14,   107,
     },
     {
-        // 2
+        /* 2 */
         135,    64,    57,    68,
     },
     {
-        // 3
+        /* 3 */
         60,    56,   128,    65,
     },
     {
-        // 4
+        /* 4 */
         159,   134,   128,    34,
     },
     {
-        // 5
+        /* 5 */
         234,   188,   128,    28,
     },
 };
--- a/vp8/common/modecontext.c
+++ b/vp8/common/modecontext.c
@@ -14,133 +14,133 @@
 const unsigned int vp8_kf_default_bmode_counts [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES] =
 {
     {
-        //Above Mode :  0
-        { 43438,   2195,    470,    316,    615,    171,    217,    412,    124,    160, }, // left_mode 0
-        {  5722,   2751,    296,    291,     81,     68,     80,    101,    100,    170, }, // left_mode 1
-        {  1629,    201,    307,     25,     47,     16,     34,     72,     19,     28, }, // left_mode 2
-        {   332,    266,     36,    500,     20,     65,     23,     14,    154,    106, }, // left_mode 3
-        {   450,     97,     10,     24,    117,     10,      2,     12,      8,     71, }, // left_mode 4
-        {   384,     49,     29,     44,     12,    162,     51,      5,     87,     42, }, // left_mode 5
-        {   495,     53,    157,     27,     14,     57,    180,     17,     17,     34, }, // left_mode 6
-        {   695,     64,     62,      9,     27,      5,      3,    147,     10,     26, }, // left_mode 7
-        {   230,     54,     20,    124,     16,    125,     29,     12,    283,     37, }, // left_mode 8
-        {   260,     87,     21,    120,     32,     16,     33,     16,     33,    203, }, // left_mode 9
+        /*Above Mode :  0*/
+        { 43438,   2195,    470,    316,    615,    171,    217,    412,    124,    160, }, /* left_mode 0 */
+        {  5722,   2751,    296,    291,     81,     68,     80,    101,    100,    170, }, /* left_mode 1 */
+        {  1629,    201,    307,     25,     47,     16,     34,     72,     19,     28, }, /* left_mode 2 */
+        {   332,    266,     36,    500,     20,     65,     23,     14,    154,    106, }, /* left_mode 3 */
+        {   450,     97,     10,     24,    117,     10,      2,     12,      8,     71, }, /* left_mode 4 */
+        {   384,     49,     29,     44,     12,    162,     51,      5,     87,     42, }, /* left_mode 5 */
+        {   495,     53,    157,     27,     14,     57,    180,     17,     17,     34, }, /* left_mode 6 */
+        {   695,     64,     62,      9,     27,      5,      3,    147,     10,     26, }, /* left_mode 7 */
+        {   230,     54,     20,    124,     16,    125,     29,     12,    283,     37, }, /* left_mode 8 */
+        {   260,     87,     21,    120,     32,     16,     33,     16,     33,    203, }, /* left_mode 9 */
     },
     {
-        //Above Mode :  1
-        {  3934,   2573,    355,    137,    128,     87,    133,    117,     37,     27, }, // left_mode 0
-        {  1036,   1929,    278,    135,     27,     37,     48,     55,     41,     91, }, // left_mode 1
-        {   223,    256,    253,     15,     13,      9,     28,     64,      3,      3, }, // left_mode 2
-        {   120,    129,     17,    316,     15,     11,      9,      4,     53,     74, }, // left_mode 3
-        {   129,     58,      6,     11,     38,      2,      0,      5,      2,     67, }, // left_mode 4
-        {    53,     22,     11,     16,      8,     26,     14,      3,     19,     12, }, // left_mode 5
-        {    59,     26,     61,     11,      4,      9,     35,     13,      8,      8, }, // left_mode 6
-        {   101,     52,     40,      8,      5,      2,      8,     59,      2,     20, }, // left_mode 7
-        {    48,     34,     10,     52,      8,     15,      6,      6,     63,     20, }, // left_mode 8
-        {    96,     48,     22,     63,     11,     14,      5,      8,      9,     96, }, // left_mode 9
+        /*Above Mode :  1*/
+        {  3934,   2573,    355,    137,    128,     87,    133,    117,     37,     27, }, /* left_mode 0 */
+        {  1036,   1929,    278,    135,     27,     37,     48,     55,     41,     91, }, /* left_mode 1 */
+        {   223,    256,    253,     15,     13,      9,     28,     64,      3,      3, }, /* left_mode 2 */
+        {   120,    129,     17,    316,     15,     11,      9,      4,     53,     74, }, /* left_mode 3 */
+        {   129,     58,      6,     11,     38,      2,      0,      5,      2,     67, }, /* left_mode 4 */
+        {    53,     22,     11,     16,      8,     26,     14,      3,     19,     12, }, /* left_mode 5 */
+        {    59,     26,     61,     11,      4,      9,     35,     13,      8,      8, }, /* left_mode 6 */
+        {   101,     52,     40,      8,      5,      2,      8,     59,      2,     20, }, /* left_mode 7 */
+        {    48,     34,     10,     52,      8,     15,      6,      6,     63,     20, }, /* left_mode 8 */
+        {    96,     48,     22,     63,     11,     14,      5,      8,      9,     96, }, /* left_mode 9 */
     },
     {
-        //Above Mode :  2
-        {   709,    461,    506,     36,     27,     33,    151,     98,     24,      6, }, // left_mode 0
-        {   201,    375,    442,     27,     13,      8,     46,     58,      6,     19, }, // left_mode 1
-        {   122,    140,    417,      4,     13,      3,     33,     59,      4,      2, }, // left_mode 2
-        {    36,     17,     22,     16,      6,      8,     12,     17,      9,     21, }, // left_mode 3
-        {    51,     15,      7,      1,     14,      0,      4,      5,      3,     22, }, // left_mode 4
-        {    18,     11,     30,      9,      7,     20,     11,      5,      2,      6, }, // left_mode 5
-        {    38,     21,    103,      9,      4,     12,     79,     13,      2,      5, }, // left_mode 6
-        {    64,     17,     66,      2,     12,      4,      2,     65,      4,      5, }, // left_mode 7
-        {    14,      7,      7,     16,      3,     11,      4,     13,     15,     16, }, // left_mode 8
-        {    36,      8,     32,      9,      9,      4,     14,      7,      6,     24, }, // left_mode 9
+        /*Above Mode :  2*/
+        {   709,    461,    506,     36,     27,     33,    151,     98,     24,      6, }, /* left_mode 0 */
+        {   201,    375,    442,     27,     13,      8,     46,     58,      6,     19, }, /* left_mode 1 */
+        {   122,    140,    417,      4,     13,      3,     33,     59,      4,      2, }, /* left_mode 2 */
+        {    36,     17,     22,     16,      6,      8,     12,     17,      9,     21, }, /* left_mode 3 */
+        {    51,     15,      7,      1,     14,      0,      4,      5,      3,     22, }, /* left_mode 4 */
+        {    18,     11,     30,      9,      7,     20,     11,      5,      2,      6, }, /* left_mode 5 */
+        {    38,     21,    103,      9,      4,     12,     79,     13,      2,      5, }, /* left_mode 6 */
+        {    64,     17,     66,      2,     12,      4,      2,     65,      4,      5, }, /* left_mode 7 */
+        {    14,      7,      7,     16,      3,     11,      4,     13,     15,     16, }, /* left_mode 8 */
+        {    36,      8,     32,      9,      9,      4,     14,      7,      6,     24, }, /* left_mode 9 */
     },
     {
-        //Above Mode :  3
-        {  1340,    173,     36,    119,     30,     10,     13,     10,     20,     26, }, // left_mode 0
-        {   156,    293,     26,    108,      5,     16,      2,      4,     23,     30, }, // left_mode 1
-        {    60,     34,     13,      7,      3,      3,      0,      8,      4,      5, }, // left_mode 2
-        {    72,     64,      1,    235,      3,      9,      2,      7,     28,     38, }, // left_mode 3
-        {    29,     14,      1,      3,      5,      0,      2,      2,      5,     13, }, // left_mode 4
-        {    22,      7,      4,     11,      2,      5,      1,      2,      6,      4, }, // left_mode 5
-        {    18,     14,      5,      6,      4,      3,     14,      0,      9,      2, }, // left_mode 6
-        {    41,     10,      7,      1,      2,      0,      0,     10,      2,      1, }, // left_mode 7
-        {    23,     19,      2,     33,      1,      5,      2,      0,     51,      8, }, // left_mode 8
-        {    33,     26,      7,     53,      3,      9,      3,      3,      9,     19, }, // left_mode 9
+        /*Above Mode :  3*/
+        {  1340,    173,     36,    119,     30,     10,     13,     10,     20,     26, }, /* left_mode 0 */
+        {   156,    293,     26,    108,      5,     16,      2,      4,     23,     30, }, /* left_mode 1 */
+        {    60,     34,     13,      7,      3,      3,      0,      8,      4,      5, }, /* left_mode 2 */
+        {    72,     64,      1,    235,      3,      9,      2,      7,     28,     38, }, /* left_mode 3 */
+        {    29,     14,      1,      3,      5,      0,      2,      2,      5,     13, }, /* left_mode 4 */
+        {    22,      7,      4,     11,      2,      5,      1,      2,      6,      4, }, /* left_mode 5 */
+        {    18,     14,      5,      6,      4,      3,     14,      0,      9,      2, }, /* left_mode 6 */
+        {    41,     10,      7,      1,      2,      0,      0,     10,      2,      1, }, /* left_mode 7 */
+        {    23,     19,      2,     33,      1,      5,      2,      0,     51,      8, }, /* left_mode 8 */
+        {    33,     26,      7,     53,      3,      9,      3,      3,      9,     19, }, /* left_mode 9 */
     },
     {
-        //Above Mode :  4
-        {   410,    165,     43,     31,     66,     15,     30,     54,      8,     17, }, // left_mode 0
-        {   115,     64,     27,     18,     30,      7,     11,     15,      4,     19, }, // left_mode 1
-        {    31,     23,     25,      1,      7,      2,      2,     10,      0,      5, }, // left_mode 2
-        {    17,      4,      1,      6,      8,      2,      7,      5,      5,     21, }, // left_mode 3
-        {   120,     12,      1,      2,     83,      3,      0,      4,      1,     40, }, // left_mode 4
-        {     4,      3,      1,      2,      1,      2,      5,      0,      3,      6, }, // left_mode 5
-        {    10,      2,     13,      6,      6,      6,      8,      2,      4,      5, }, // left_mode 6
-        {    58,     10,      5,      1,     28,      1,      1,     33,      1,      9, }, // left_mode 7
-        {     8,      2,      1,      4,      2,      5,      1,      1,      2,     10, }, // left_mode 8
-        {    76,      7,      5,      7,     18,      2,      2,      0,      5,     45, }, // left_mode 9
+        /*Above Mode :  4*/
+        {   410,    165,     43,     31,     66,     15,     30,     54,      8,     17, }, /* left_mode 0 */
+        {   115,     64,     27,     18,     30,      7,     11,     15,      4,     19, }, /* left_mode 1 */
+        {    31,     23,     25,      1,      7,      2,      2,     10,      0,      5, }, /* left_mode 2 */
+        {    17,      4,      1,      6,      8,      2,      7,      5,      5,     21, }, /* left_mode 3 */
+        {   120,     12,      1,      2,     83,      3,      0,      4,      1,     40, }, /* left_mode 4 */
+        {     4,      3,      1,      2,      1,      2,      5,      0,      3,      6, }, /* left_mode 5 */
+        {    10,      2,     13,      6,      6,      6,      8,      2,      4,      5, }, /* left_mode 6 */
+        {    58,     10,      5,      1,     28,      1,      1,     33,      1,      9, }, /* left_mode 7 */
+        {     8,      2,      1,      4,      2,      5,      1,      1,      2,     10, }, /* left_mode 8 */
+        {    76,      7,      5,      7,     18,      2,      2,      0,      5,     45, }, /* left_mode 9 */
     },
     {
-        //Above Mode :  5
-        {   444,     46,     47,     20,     14,    110,     60,     14,     60,      7, }, // left_mode 0
-        {    59,     57,     25,     18,      3,     17,     21,      6,     14,      6, }, // left_mode 1
-        {    24,     17,     20,      6,      4,     13,      7,      2,      3,      2, }, // left_mode 2
-        {    13,     11,      5,     14,      4,      9,      2,      4,     15,      7, }, // left_mode 3
-        {     8,      5,      2,      1,      4,      0,      1,      1,      2,     12, }, // left_mode 4
-        {    19,      5,      5,      7,      4,     40,      6,      3,     10,      4, }, // left_mode 5
-        {    16,      5,      9,      1,      1,     16,     26,      2,     10,      4, }, // left_mode 6
-        {    11,      4,      8,      1,      1,      4,      4,      5,      4,      1, }, // left_mode 7
-        {    15,      1,      3,      7,      3,     21,      7,      1,     34,      5, }, // left_mode 8
-        {    18,      5,      1,      3,      4,      3,      7,      1,      2,      9, }, // left_mode 9
+        /*Above Mode :  5*/
+        {   444,     46,     47,     20,     14,    110,     60,     14,     60,      7, }, /* left_mode 0 */
+        {    59,     57,     25,     18,      3,     17,     21,      6,     14,      6, }, /* left_mode 1 */
+        {    24,     17,     20,      6,      4,     13,      7,      2,      3,      2, }, /* left_mode 2 */
+        {    13,     11,      5,     14,      4,      9,      2,      4,     15,      7, }, /* left_mode 3 */
+        {     8,      5,      2,      1,      4,      0,      1,      1,      2,     12, }, /* left_mode 4 */
+        {    19,      5,      5,      7,      4,     40,      6,      3,     10,      4, }, /* left_mode 5 */
+        {    16,      5,      9,      1,      1,     16,     26,      2,     10,      4, }, /* left_mode 6 */
+        {    11,      4,      8,      1,      1,      4,      4,      5,      4,      1, }, /* left_mode 7 */
+        {    15,      1,      3,      7,      3,     21,      7,      1,     34,      5, }, /* left_mode 8 */
+        {    18,      5,      1,      3,      4,      3,      7,      1,      2,      9, }, /* left_mode 9 */
     },
     {
-        //Above Mode :  6
-        {   476,    149,     94,     13,     14,     77,    291,     27,     23,      3, }, // left_mode 0
-        {    79,     83,     42,     14,      2,     12,     63,      2,      4,     14, }, // left_mode 1
-        {    43,     36,     55,      1,      3,      8,     42,     11,      5,      1, }, // left_mode 2
-        {     9,      9,      6,     16,      1,      5,      6,      3,     11,     10, }, // left_mode 3
-        {    10,      3,      1,      3,     10,      1,      0,      1,      1,      4, }, // left_mode 4
-        {    14,      6,     15,      5,      1,     20,     25,      2,      5,      0, }, // left_mode 5
-        {    28,      7,     51,      1,      0,      8,    127,      6,      2,      5, }, // left_mode 6
-        {    13,      3,      3,      2,      3,      1,      2,      8,      1,      2, }, // left_mode 7
-        {    10,      3,      3,      3,      3,      8,      2,      2,      9,      3, }, // left_mode 8
-        {    13,      7,     11,      4,      0,      4,      6,      2,      5,      8, }, // left_mode 9
+        /*Above Mode :  6*/
+        {   476,    149,     94,     13,     14,     77,    291,     27,     23,      3, }, /* left_mode 0 */
+        {    79,     83,     42,     14,      2,     12,     63,      2,      4,     14, }, /* left_mode 1 */
+        {    43,     36,     55,      1,      3,      8,     42,     11,      5,      1, }, /* left_mode 2 */
+        {     9,      9,      6,     16,      1,      5,      6,      3,     11,     10, }, /* left_mode 3 */
+        {    10,      3,      1,      3,     10,      1,      0,      1,      1,      4, }, /* left_mode 4 */
+        {    14,      6,     15,      5,      1,     20,     25,      2,      5,      0, }, /* left_mode 5 */
+        {    28,      7,     51,      1,      0,      8,    127,      6,      2,      5, }, /* left_mode 6 */
+        {    13,      3,      3,      2,      3,      1,      2,      8,      1,      2, }, /* left_mode 7 */
+        {    10,      3,      3,      3,      3,      8,      2,      2,      9,      3, }, /* left_mode 8 */
+        {    13,      7,     11,      4,      0,      4,      6,      2,      5,      8, }, /* left_mode 9 */
     },
     {
-        //Above Mode :  7
-        {   376,    135,    119,      6,     32,      8,     31,    224,      9,      3, }, // left_mode 0
-        {    93,     60,     54,      6,     13,      7,      8,     92,      2,     12, }, // left_mode 1
-        {    74,     36,     84,      0,      3,      2,      9,     67,      2,      1, }, // left_mode 2
-        {    19,      4,      4,      8,      8,      2,      4,      7,      6,     16, }, // left_mode 3
-        {    51,      7,      4,      1,     77,      3,      0,     14,      1,     15, }, // left_mode 4
-        {     7,      7,      5,      7,      4,      7,      4,      5,      0,      3, }, // left_mode 5
-        {    18,      2,     19,      2,      2,      4,     12,     11,      1,      2, }, // left_mode 6
-        {   129,      6,     27,      1,     21,      3,      0,    189,      0,      6, }, // left_mode 7
-        {     9,      1,      2,      8,      3,      7,      0,      5,      3,      3, }, // left_mode 8
-        {    20,      4,      5,     10,      4,      2,      7,     17,      3,     16, }, // left_mode 9
+        /*Above Mode :  7*/
+        {   376,    135,    119,      6,     32,      8,     31,    224,      9,      3, }, /* left_mode 0 */
+        {    93,     60,     54,      6,     13,      7,      8,     92,      2,     12, }, /* left_mode 1 */
+        {    74,     36,     84,      0,      3,      2,      9,     67,      2,      1, }, /* left_mode 2 */
+        {    19,      4,      4,      8,      8,      2,      4,      7,      6,     16, }, /* left_mode 3 */
+        {    51,      7,      4,      1,     77,      3,      0,     14,      1,     15, }, /* left_mode 4 */
+        {     7,      7,      5,      7,      4,      7,      4,      5,      0,      3, }, /* left_mode 5 */
+        {    18,      2,     19,      2,      2,      4,     12,     11,      1,      2, }, /* left_mode 6 */
+        {   129,      6,     27,      1,     21,      3,      0,    189,      0,      6, }, /* left_mode 7 */
+        {     9,      1,      2,      8,      3,      7,      0,      5,      3,      3, }, /* left_mode 8 */
+        {    20,      4,      5,     10,      4,      2,      7,     17,      3,     16, }, /* left_mode 9 */
     },
     {
-        //Above Mode :  8
-        {   617,     68,     34,     79,     11,     27,     25,     14,     75,     13, }, // left_mode 0
-        {    51,     82,     21,     26,      6,     12,     13,      1,     26,     16, }, // left_mode 1
-        {    29,      9,     12,     11,      3,      7,      1,     10,      2,      2, }, // left_mode 2
-        {    17,     19,     11,     74,      4,      3,      2,      0,     58,     13, }, // left_mode 3
-        {    10,      1,      1,      3,      4,      1,      0,      2,      1,      8, }, // left_mode 4
-        {    14,      4,      5,      5,      1,     13,      2,      0,     27,      8, }, // left_mode 5
-        {    10,      3,      5,      4,      1,      7,      6,      4,      5,      1, }, // left_mode 6
-        {    10,      2,      6,      2,      1,      1,      1,      4,      2,      1, }, // left_mode 7
-        {    14,      8,      5,     23,      2,     12,      6,      2,    117,      5, }, // left_mode 8
-        {     9,      6,      2,     19,      1,      6,      3,      2,      9,      9, }, // left_mode 9
+        /*Above Mode :  8*/
+        {   617,     68,     34,     79,     11,     27,     25,     14,     75,     13, }, /* left_mode 0 */
+        {    51,     82,     21,     26,      6,     12,     13,      1,     26,     16, }, /* left_mode 1 */
+        {    29,      9,     12,     11,      3,      7,      1,     10,      2,      2, }, /* left_mode 2 */
+        {    17,     19,     11,     74,      4,      3,      2,      0,     58,     13, }, /* left_mode 3 */
+        {    10,      1,      1,      3,      4,      1,      0,      2,      1,      8, }, /* left_mode 4 */
+        {    14,      4,      5,      5,      1,     13,      2,      0,     27,      8, }, /* left_mode 5 */
+        {    10,      3,      5,      4,      1,      7,      6,      4,      5,      1, }, /* left_mode 6 */
+        {    10,      2,      6,      2,      1,      1,      1,      4,      2,      1, }, /* left_mode 7 */
+        {    14,      8,      5,     23,      2,     12,      6,      2,    117,      5, }, /* left_mode 8 */
+        {     9,      6,      2,     19,      1,      6,      3,      2,      9,      9, }, /* left_mode 9 */
     },
     {
-        //Above Mode :  9
-        {   680,     73,     22,     38,     42,      5,     11,      9,      6,     28, }, // left_mode 0
-        {   113,    112,     21,     22,     10,      2,      8,      4,      6,     42, }, // left_mode 1
-        {    44,     20,     24,      6,      5,      4,      3,      3,      1,      2, }, // left_mode 2
-        {    40,     23,      7,     71,      5,      2,      4,      1,      7,     22, }, // left_mode 3
-        {    85,      9,      4,      4,     17,      2,      0,      3,      2,     23, }, // left_mode 4
-        {    13,      4,      2,      6,      1,      7,      0,      1,      7,      6, }, // left_mode 5
-        {    26,      6,      8,      3,      2,      3,      8,      1,      5,      4, }, // left_mode 6
-        {    54,      8,      9,      6,      7,      0,      1,     11,      1,      3, }, // left_mode 7
-        {     9,     10,      4,     13,      2,      5,      4,      2,     14,      8, }, // left_mode 8
-        {    92,      9,      5,     19,     15,      3,      3,      1,      6,     58, }, // left_mode 9
+        /*Above Mode :  9*/
+        {   680,     73,     22,     38,     42,      5,     11,      9,      6,     28, }, /* left_mode 0 */
+        {   113,    112,     21,     22,     10,      2,      8,      4,      6,     42, }, /* left_mode 1 */
+        {    44,     20,     24,      6,      5,      4,      3,      3,      1,      2, }, /* left_mode 2 */
+        {    40,     23,      7,     71,      5,      2,      4,      1,      7,     22, }, /* left_mode 3 */
+        {    85,      9,      4,      4,     17,      2,      0,      3,      2,     23, }, /* left_mode 4 */
+        {    13,      4,      2,      6,      1,      7,      0,      1,      7,      6, }, /* left_mode 5 */
+        {    26,      6,      8,      3,      2,      3,      8,      1,      5,      4, }, /* left_mode 6 */
+        {    54,      8,      9,      6,      7,      0,      1,     11,      1,      3, }, /* left_mode 7 */
+        {     9,     10,      4,     13,      2,      5,      4,      2,     14,      8, }, /* left_mode 8 */
+        {    92,      9,      5,     19,     15,      3,      3,      1,      6,     58, }, /* left_mode 9 */
     },
 };
--- a/vp8/common/onyxc_int.h
+++ b/vp8/common/onyxc_int.h
@@ -21,9 +21,9 @@
 #include "recon.h"
 #include "postproc.h"
 
-//#ifdef PACKET_TESTING
+/*#ifdef PACKET_TESTING*/
 #include "header.h"
-//#endif
+/*#endif*/
 
 /* Create/destroy static data structures. */
 
@@ -43,7 +43,7 @@
     vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1];
     vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [vp8_coef_tokens-1];
     MV_CONTEXT mvc[2];
-    MV_CONTEXT pre_mvc[2];  //not to caculate the mvcost for the frame if mvc doesn't change.
+    MV_CONTEXT pre_mvc[2];  /* not to caculate the mvcost for the frame if mvc doesn't change. */
 } FRAME_CONTEXT;
 
 typedef enum
@@ -105,7 +105,7 @@
     YV12_BUFFER_CONFIG post_proc_buffer;
     YV12_BUFFER_CONFIG temp_scale_frame;
 
-    FRAME_TYPE last_frame_type;  //Add to check if vp8_frame_init_loop_filter() can be skipped.
+    FRAME_TYPE last_frame_type;  /* Add to check if vp8_frame_init_loop_filter() can be skipped. */
     FRAME_TYPE frame_type;
 
     int show_frame;
@@ -116,7 +116,7 @@
     int mb_cols;
     int mode_info_stride;
 
-    // prfile settings
+    /* profile settings */
     int mb_no_coeff_skip;
     int no_lpf;
     int simpler_lpf;
@@ -124,7 +124,7 @@
     int full_pixel;
 
     int base_qindex;
-    int last_kf_gf_q;  // Q used on the last GF or KF
+    int last_kf_gf_q;  /* Q used on the last GF or KF */
 
     int y1dc_delta_q;
     int y2dc_delta_q;
@@ -154,23 +154,23 @@
     int last_sharpness_level;
     int sharpness_level;
 
-    int refresh_last_frame;       // Two state 0 = NO, 1 = YES
-    int refresh_golden_frame;     // Two state 0 = NO, 1 = YES
-    int refresh_alt_ref_frame;     // Two state 0 = NO, 1 = YES
+    int refresh_last_frame;       /* Two state 0 = NO, 1 = YES */
+    int refresh_golden_frame;     /* Two state 0 = NO, 1 = YES */
+    int refresh_alt_ref_frame;     /* Two state 0 = NO, 1 = YES */
 
-    int copy_buffer_to_gf;         // 0 none, 1 Last to GF, 2 ARF to GF
-    int copy_buffer_to_arf;        // 0 none, 1 Last to ARF, 2 GF to ARF
+    int copy_buffer_to_gf;         /* 0 none, 1 Last to GF, 2 ARF to GF */
+    int copy_buffer_to_arf;        /* 0 none, 1 Last to ARF, 2 GF to ARF */
 
-    int refresh_entropy_probs;    // Two state 0 = NO, 1 = YES
+    int refresh_entropy_probs;    /* Two state 0 = NO, 1 = YES */
 
-    int ref_frame_sign_bias[MAX_REF_FRAMES];    // Two state 0, 1
+    int ref_frame_sign_bias[MAX_REF_FRAMES];    /* Two state 0, 1 */
 
-    // Y,U,V,Y2
-    ENTROPY_CONTEXT_PLANES *above_context;   // row of context for each plane
-    ENTROPY_CONTEXT_PLANES left_context;  // (up to) 4 contexts ""
+    /* Y,U,V,Y2 */
+    ENTROPY_CONTEXT_PLANES *above_context;   /* row of context for each plane */
+    ENTROPY_CONTEXT_PLANES left_context;  /* (up to) 4 contexts "" */
 
 
-    // keyframe block modes are predicted by their above, left neighbors
+    /* keyframe block modes are predicted by their above, left neighbors */
 
     vp8_prob kf_bmode_prob [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1];
     vp8_prob kf_ymode_prob [VP8_YMODES-1];  /* keyframe "" */
@@ -177,8 +177,8 @@
     vp8_prob kf_uv_mode_prob [VP8_UV_MODES-1];
 
 
-    FRAME_CONTEXT lfc; // last frame entropy
-    FRAME_CONTEXT fc;  // this frame entropy
+    FRAME_CONTEXT lfc; /* last frame entropy */
+    FRAME_CONTEXT fc;  /* this frame entropy */
 
     unsigned int current_video_frame;
 
--- a/vp8/common/postproc.c
+++ b/vp8/common/postproc.c
@@ -25,28 +25,28 @@
     (-(0.148*(float)(t>>16)) - (0.291*(float)(t>>8&0xff)) + (0.439*(float)(t&0xff)) + 128), \
     ( (0.439*(float)(t>>16)) - (0.368*(float)(t>>8&0xff)) - (0.071*(float)(t&0xff)) + 128)
 
-// global constants
+/* global constants */
 
 static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] =
 {
-    { RGB_TO_YUV(0x98FB98) },   // PaleGreen
-    { RGB_TO_YUV(0x00FF00) },   // Green
-    { RGB_TO_YUV(0xADFF2F) },   // GreenYellow
-    { RGB_TO_YUV(0x228B22) },   // ForestGreen
-    { RGB_TO_YUV(0x006400) },   // DarkGreen
-    { RGB_TO_YUV(0x98F5FF) },   // Cadet Blue
-    { RGB_TO_YUV(0x6CA6CD) },   // Sky Blue
-    { RGB_TO_YUV(0x00008B) },   // Dark blue
-    { RGB_TO_YUV(0x551A8B) },   // Purple
-    { RGB_TO_YUV(0xFF0000) }    // Red
+    { RGB_TO_YUV(0x98FB98) },   /* PaleGreen */
+    { RGB_TO_YUV(0x00FF00) },   /* Green */
+    { RGB_TO_YUV(0xADFF2F) },   /* GreenYellow */
+    { RGB_TO_YUV(0x228B22) },   /* ForestGreen */
+    { RGB_TO_YUV(0x006400) },   /* DarkGreen */
+    { RGB_TO_YUV(0x98F5FF) },   /* Cadet Blue */
+    { RGB_TO_YUV(0x6CA6CD) },   /* Sky Blue */
+    { RGB_TO_YUV(0x00008B) },   /* Dark blue */
+    { RGB_TO_YUV(0x551A8B) },   /* Purple */
+    { RGB_TO_YUV(0xFF0000) }    /* Red */
 };
 
 static const unsigned char MV_REFERENCE_FRAME_colors[MB_MODE_COUNT][3] =
 {
-    { RGB_TO_YUV(0x00ff00) },   // Blue
-    { RGB_TO_YUV(0x0000ff) },   // Green
-    { RGB_TO_YUV(0xffff00) },   // Yellow
-    { RGB_TO_YUV(0xff0000) },   // Red
+    { RGB_TO_YUV(0x00ff00) },   /* Blue */
+    { RGB_TO_YUV(0x0000ff) },   /* Green */
+    { RGB_TO_YUV(0xffff00) },   /* Yellow */
+    { RGB_TO_YUV(0xff0000) },   /* Red */
 };
 
 static const short kernel5[] =
@@ -129,7 +129,7 @@
 
     for (row = 0; row < rows; row++)
     {
-        // post_proc_down for one row
+        /* post_proc_down for one row */
         p_src = src_ptr;
         p_dst = dst_ptr;
 
@@ -152,7 +152,7 @@
             p_dst[col] = v;
         }
 
-        // now post_proc_across
+        /* now post_proc_across */
         p_src = dst_ptr;
         p_dst = dst_ptr;
 
@@ -181,12 +181,12 @@
                 p_dst[col-2] = d[(col-2)&7];
         }
 
-        //handle the last two pixels
+        /* handle the last two pixels */
         p_dst[col-2] = d[(col-2)&7];
         p_dst[col-1] = d[(col-1)&7];
 
 
-        //next row
+        /* next row */
         src_ptr += pitch;
         dst_ptr += pitch;
     }
@@ -379,9 +379,9 @@
 
     sigma = ai + .5 + .6 * (63 - qi) / 63.0;
 
-    // set up a lookup table of 256 entries that matches
-    // a gaussian distribution with sigma determined by q.
-    //
+    /* set up a lookup table of 256 entries that matches
+     * a gaussian distribution with sigma determined by q.
+     */
     {
         double i;
         int next, j;
@@ -472,9 +472,10 @@
     }
 }
 
-// Blend the macro block with a solid colored square.  Leave the
-// edges unblended to give distinction to macro blocks in areas
-// filled with the same color block.
+/* Blend the macro block with a solid colored square.  Leave the
+ * edges unblended to give distinction to macro blocks in areas
+ * filled with the same color block.
+ */
 void vp8_blend_mb_c (unsigned char *y, unsigned char *u, unsigned char *v,
                         int y1, int u1, int v1, int alpha, int stride)
 {
@@ -575,7 +576,7 @@
     {
         *dest = *oci->frame_to_show;
 
-        // handle problem with extending borders
+        /* handle problem with extending borders */
         dest->y_width = oci->Width;
         dest->y_height = oci->Height;
         dest->uv_height = dest->y_height / 2;
@@ -644,7 +645,7 @@
 
         y_ptr = post->y_buffer + 4 * post->y_stride + 4;
 
-        // vp8_filter each macro block
+        /* vp8_filter each macro block */
         for (i = 0; i < mb_rows; i++)
         {
             for (j = 0; j < mb_cols; j++)
@@ -658,7 +659,7 @@
                 y_ptr += 16;
             }
 
-            mb_index ++; //border
+            mb_index ++; /* border */
             y_ptr += post->y_stride  * 16 - post->y_width;
 
         }
@@ -676,7 +677,7 @@
 
         y_ptr = post->y_buffer + 4 * post->y_stride + 4;
 
-        // vp8_filter each macro block
+        /* vp8_filter each macro block */
         for (i = 0; i < mb_rows; i++)
         {
             for (j = 0; j < mb_cols; j++)
@@ -693,7 +694,7 @@
                 y_ptr += 16;
             }
 
-            mb_index ++; //border
+            mb_index ++; /* border */
             y_ptr += post->y_stride  * 16 - post->y_width;
 
         }
@@ -714,7 +715,7 @@
 
         y_ptr = post->y_buffer + 4 * post->y_stride + 4;
 
-        // vp8_filter each macro block
+        /* vp8_filter each macro block */
         for (i = 0; i < mb_rows; i++)
         {
             for (j = 0; j < mb_cols; j++)
@@ -727,7 +728,7 @@
                 y_ptr += 16;
             }
 
-            mb_index ++; //border
+            mb_index ++; /* border */
             y_ptr += post->y_stride  * 16 - post->y_width;
 
         }
@@ -736,7 +737,7 @@
 
     }
 
-    // Draw motion vectors
+    /* Draw motion vectors */
     if (flags & VP8D_DEBUG_LEVEL5)
     {
         YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
@@ -777,7 +778,7 @@
         }
     }
 
-    // Color in block modes
+    /* Color in block modes */
     if (flags & VP8D_DEBUG_LEVEL6)
     {
         int i, j;
@@ -813,7 +814,7 @@
         }
     }
 
-    // Color in frame reference blocks
+    /* Color in frame reference blocks */
     if (flags & VP8D_DEBUG_LEVEL7)
     {
         int i, j;
@@ -851,7 +852,7 @@
 
     *dest = oci->post_proc_buffer;
 
-    // handle problem with extending borders
+    /* handle problem with extending borders */
     dest->y_width = oci->Width;
     dest->y_height = oci->Height;
     dest->uv_height = dest->y_height / 2;
--- a/vp8/common/ppflags.h
+++ b/vp8/common/ppflags.h
@@ -23,7 +23,7 @@
     VP8D_DEBUG_LEVEL4   = 1<<6,
     VP8D_DEBUG_LEVEL5   = 1<<7,
     VP8D_DEBUG_LEVEL6   = 1<<8,
-    VP8D_DEBUG_LEVEL7   = 1<<9,
+    VP8D_DEBUG_LEVEL7   = 1<<9
 };
 
 #endif
--- a/vp8/common/recon.c
+++ b/vp8/common/recon.c
@@ -112,15 +112,15 @@
     BLOCKD *b = &x->block[0];
     RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
 
-    //b = &x->block[4];
+    /*b = &x->block[4];*/
     b += 4;
     RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
 
-    //b = &x->block[8];
+    /*b = &x->block[8];*/
     b += 4;
     RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
 
-    //b = &x->block[12];
+    /*b = &x->block[12];*/
     b += 4;
     RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
 #else
@@ -149,7 +149,7 @@
     RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
     b += 4;
 
-    //b = &x->block[16];
+    /*b = &x->block[16];*/
 
     RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
     b++;
--- a/vp8/common/recon.h
+++ b/vp8/common/recon.h
@@ -18,10 +18,10 @@
     void sym(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch)
 
 #define prototype_recon_block(sym) \
-    void sym(unsigned char *pred, short *diff, unsigned char *dst, int pitch);
+    void sym(unsigned char *pred, short *diff, unsigned char *dst, int pitch)
 
 #define prototype_recon_macroblock(sym) \
-    void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x);
+    void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x)
 
 struct vp8_recon_rtcd_vtable;
 
--- a/vp8/common/reconinter.c
+++ b/vp8/common/reconinter.c
@@ -18,9 +18,10 @@
 #include "onyxc_int.h"
 #endif
 
-// use this define on systems where unaligned int reads and writes are
-// not allowed, i.e. ARM architectures
-//#define MUST_BE_ALIGNED
+/* use this define on systems where unaligned int reads and writes are
+ * not allowed, i.e. ARM architectures
+ */
+/*#define MUST_BE_ALIGNED*/
 
 
 static const int bbb[4] = {0, 2, 8, 10};
@@ -255,7 +256,7 @@
     }
 }
 
-//encoder only
+/*encoder only*/
 void vp8_build_inter_predictors_mby(MACROBLOCKD *x)
 {
 
@@ -491,15 +492,16 @@
 }
 
 
-// The following functions are wriiten for skip_recon_mb() to call. Since there is no recon in this
-// situation, we can write the result directly to dst buffer instead of writing it to predictor
-// buffer and then copying it to dst buffer.
+/* The following functions are wriiten for skip_recon_mb() to call. Since there is no recon in this
+ * situation, we can write the result directly to dst buffer instead of writing it to predictor
+ * buffer and then copying it to dst buffer.
+ */
 static void vp8_build_inter_predictors_b_s(BLOCKD *d, unsigned char *dst_ptr, vp8_subpix_fn_t sppf)
 {
     int r;
     unsigned char *ptr_base;
     unsigned char *ptr;
-    //unsigned char *pred_ptr = d->predictor;
+    /*unsigned char *pred_ptr = d->predictor;*/
     int dst_stride = d->dst_stride;
     int pre_stride = d->pre_stride;
 
@@ -535,8 +537,8 @@
 
 void vp8_build_inter_predictors_mb_s(MACROBLOCKD *x)
 {
-    //unsigned char *pred_ptr = x->block[0].predictor;
-    //unsigned char *dst_ptr = *(x->block[0].base_dst) + x->block[0].dst;
+    /*unsigned char *pred_ptr = x->block[0].predictor;
+    unsigned char *dst_ptr = *(x->block[0].base_dst) + x->block[0].dst;*/
     unsigned char *pred_ptr = x->predictor;
     unsigned char *dst_ptr = x->dst.y_buffer;
 
@@ -546,15 +548,15 @@
         unsigned char *ptr_base;
         unsigned char *ptr;
         unsigned char *uptr, *vptr;
-        //unsigned char *pred_ptr = x->predictor;
-        //unsigned char *upred_ptr = &x->predictor[256];
-        //unsigned char *vpred_ptr = &x->predictor[320];
+        /*unsigned char *pred_ptr = x->predictor;
+        unsigned char *upred_ptr = &x->predictor[256];
+        unsigned char *vpred_ptr = &x->predictor[320];*/
         unsigned char *udst_ptr = x->dst.u_buffer;
         unsigned char *vdst_ptr = x->dst.v_buffer;
 
         int mv_row = x->mode_info_context->mbmi.mv.as_mv.row;
         int mv_col = x->mode_info_context->mbmi.mv.as_mv.col;
-        int pre_stride = x->dst.y_stride; //x->block[0].pre_stride;
+        int pre_stride = x->dst.y_stride; /*x->block[0].pre_stride;*/
 
         ptr_base = x->pre.y_buffer;
         ptr = ptr_base + (mv_row >> 3) * pre_stride + (mv_col >> 3);
@@ -561,11 +563,11 @@
 
         if ((mv_row | mv_col) & 7)
         {
-            x->subpixel_predict16x16(ptr, pre_stride, mv_col & 7, mv_row & 7, dst_ptr, x->dst.y_stride); //x->block[0].dst_stride);
+            x->subpixel_predict16x16(ptr, pre_stride, mv_col & 7, mv_row & 7, dst_ptr, x->dst.y_stride); /*x->block[0].dst_stride);*/
         }
         else
         {
-            RECON_INVOKE(&x->rtcd->recon, copy16x16)(ptr, pre_stride, dst_ptr, x->dst.y_stride); //x->block[0].dst_stride);
+            RECON_INVOKE(&x->rtcd->recon, copy16x16)(ptr, pre_stride, dst_ptr, x->dst.y_stride); /*x->block[0].dst_stride);*/
         }
 
         mv_row = x->block[16].bmi.mv.as_mv.row;
@@ -588,8 +590,9 @@
     }
     else
     {
-        //note: this whole ELSE part is not executed at all. So, no way to test the correctness of my modification. Later,
-        //if sth is wrong, go back to what it is in build_inter_predictors_mb.
+        /* note: this whole ELSE part is not executed at all. So, no way to test the correctness of my modification. Later,
+         * if sth is wrong, go back to what it is in build_inter_predictors_mb.
+         */
         int i;
 
         if (x->mode_info_context->mbmi.partitioning < 3)
@@ -597,7 +600,7 @@
             for (i = 0; i < 4; i++)
             {
                 BLOCKD *d = &x->block[bbb[i]];
-                //vp8_build_inter_predictors4b(x, d, 16);
+                /*vp8_build_inter_predictors4b(x, d, 16);*/
 
                 {
                     unsigned char *ptr_base;
@@ -609,11 +612,11 @@
 
                     if (d->bmi.mv.as_mv.row & 7 || d->bmi.mv.as_mv.col & 7)
                     {
-                        x->subpixel_predict8x8(ptr, d->pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst_ptr, x->dst.y_stride); //x->block[0].dst_stride);
+                        x->subpixel_predict8x8(ptr, d->pre_stride, d->bmi.mv.as_mv.col & 7, d->bmi.mv.as_mv.row & 7, dst_ptr, x->dst.y_stride); /*x->block[0].dst_stride);*/
                     }
                     else
                     {
-                        RECON_INVOKE(&x->rtcd->recon, copy8x8)(ptr, d->pre_stride, dst_ptr, x->dst.y_stride); //x->block[0].dst_stride);
+                        RECON_INVOKE(&x->rtcd->recon, copy8x8)(ptr, d->pre_stride, dst_ptr, x->dst.y_stride); /*x->block[0].dst_stride);*/
                     }
                 }
             }
@@ -627,7 +630,7 @@
 
                 if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
                 {
-                    //vp8_build_inter_predictors2b(x, d0, 16);
+                    /*vp8_build_inter_predictors2b(x, d0, 16);*/
                     unsigned char *ptr_base;
                     unsigned char *ptr;
                     unsigned char *pred_ptr = d0->predictor;
@@ -659,7 +662,7 @@
 
             if (d0->bmi.mv.as_int == d1->bmi.mv.as_int)
             {
-                //vp8_build_inter_predictors2b(x, d0, 8);
+                /*vp8_build_inter_predictors2b(x, d0, 8);*/
                 unsigned char *ptr_base;
                 unsigned char *ptr;
                 unsigned char *pred_ptr = d0->predictor;
--- a/vp8/common/reconintra.c
+++ b/vp8/common/reconintra.c
@@ -14,9 +14,9 @@
 #include "reconintra.h"
 #include "vpx_mem/vpx_mem.h"
 
-// For skip_recon_mb(), add vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) and
-// vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x).
-
+/* For skip_recon_mb(), add vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) and
+ * vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x).
+ */
 void vp8_recon_intra_mbuv(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x)
 {
     int i;
@@ -42,7 +42,7 @@
         yleft_col[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
     }
 
-    // for Y
+    /* for Y */
     switch (x->mode_info_context->mbmi.mode)
     {
     case DC_PRED:
@@ -156,7 +156,7 @@
     int r, c, i;
 
     int y_stride = x->dst.y_stride;
-    ypred_ptr = x->dst.y_buffer; //x->predictor;
+    ypred_ptr = x->dst.y_buffer; /*x->predictor;*/
 
     for (i = 0; i < 16; i++)
     {
@@ -163,7 +163,7 @@
         yleft_col[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
     }
 
-    // for Y
+    /* for Y */
     switch (x->mode_info_context->mbmi.mode)
     {
     case DC_PRED:
@@ -204,11 +204,11 @@
             expected_dc = 128;
         }
 
-        //vpx_memset(ypred_ptr, expected_dc, 256);
+        /*vpx_memset(ypred_ptr, expected_dc, 256);*/
         for (r = 0; r < 16; r++)
         {
             vpx_memset(ypred_ptr, expected_dc, 16);
-            ypred_ptr += y_stride; //16;
+            ypred_ptr += y_stride; /*16;*/
         }
     }
     break;
@@ -222,7 +222,7 @@
             ((int *)ypred_ptr)[1] = ((int *)yabove_row)[1];
             ((int *)ypred_ptr)[2] = ((int *)yabove_row)[2];
             ((int *)ypred_ptr)[3] = ((int *)yabove_row)[3];
-            ypred_ptr += y_stride; //16;
+            ypred_ptr += y_stride; /*16;*/
         }
     }
     break;
@@ -233,7 +233,7 @@
         {
 
             vpx_memset(ypred_ptr, yleft_col[r], 16);
-            ypred_ptr += y_stride;  //16;
+            ypred_ptr += y_stride;  /*16;*/
         }
 
     }
@@ -256,7 +256,7 @@
                 ypred_ptr[c] = pred;
             }
 
-            ypred_ptr += y_stride;  //16;
+            ypred_ptr += y_stride;  /*16;*/
         }
 
     }
@@ -418,8 +418,8 @@
     unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride;
     unsigned char vleft_col[20];
     unsigned char vtop_left = vabove_row[-1];
-    unsigned char *upred_ptr = x->dst.u_buffer; //&x->predictor[256];
-    unsigned char *vpred_ptr = x->dst.v_buffer; //&x->predictor[320];
+    unsigned char *upred_ptr = x->dst.u_buffer; /*&x->predictor[256];*/
+    unsigned char *vpred_ptr = x->dst.v_buffer; /*&x->predictor[320];*/
     int uv_stride = x->dst.uv_stride;
 
     int i, j;
@@ -472,14 +472,14 @@
         }
 
 
-        //vpx_memset(upred_ptr,expected_udc,64);
-        //vpx_memset(vpred_ptr,expected_vdc,64);
+        /*vpx_memset(upred_ptr,expected_udc,64);*/
+        /*vpx_memset(vpred_ptr,expected_vdc,64);*/
         for (i = 0; i < 8; i++)
         {
             vpx_memset(upred_ptr, expected_udc, 8);
             vpx_memset(vpred_ptr, expected_vdc, 8);
-            upred_ptr += uv_stride; //8;
-            vpred_ptr += uv_stride; //8;
+            upred_ptr += uv_stride; /*8;*/
+            vpred_ptr += uv_stride; /*8;*/
         }
     }
     break;
@@ -491,8 +491,8 @@
         {
             vpx_memcpy(upred_ptr, uabove_row, 8);
             vpx_memcpy(vpred_ptr, vabove_row, 8);
-            upred_ptr += uv_stride; //8;
-            vpred_ptr += uv_stride; //8;
+            upred_ptr += uv_stride; /*8;*/
+            vpred_ptr += uv_stride; /*8;*/
         }
 
     }
@@ -505,8 +505,8 @@
         {
             vpx_memset(upred_ptr, uleft_col[i], 8);
             vpx_memset(vpred_ptr, vleft_col[i], 8);
-            upred_ptr += uv_stride; //8;
-            vpred_ptr += uv_stride; //8;
+            upred_ptr += uv_stride; /*8;*/
+            vpred_ptr += uv_stride; /*8;*/
         }
     }
 
@@ -538,8 +538,8 @@
                 vpred_ptr[j] = predv;
             }
 
-            upred_ptr += uv_stride; //8;
-            vpred_ptr += uv_stride; //8;
+            upred_ptr += uv_stride; /*8;*/
+            vpred_ptr += uv_stride; /*8;*/
         }
 
     }
--- a/vp8/common/reconintra4x4.c
+++ b/vp8/common/reconintra4x4.c
@@ -56,7 +56,7 @@
     break;
     case B_TM_PRED:
     {
-        // prediction similar to true_motion prediction
+        /* prediction similar to true_motion prediction */
         for (r = 0; r < 4; r++)
         {
             for (c = 0; c < 4; c++)
@@ -295,8 +295,9 @@
 
     }
 }
-// copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
-// to the right prediction have filled in pixels to use.
+/* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
+ * to the right prediction have filled in pixels to use.
+ */
 void vp8_intra_prediction_down_copy(MACROBLOCKD *x)
 {
     unsigned char *above_right = *(x->block[0].base_dst) + x->block[0].dst - x->block[0].dst_stride + 16;
--- a/vp8/common/setupintrarecon.c
+++ b/vp8/common/setupintrarecon.c
@@ -16,7 +16,7 @@
 {
     int i;
 
-    // set up frame new frame for intra coded blocks
+    /* set up frame new frame for intra coded blocks */
     vpx_memset(ybf->y_buffer - 1 - ybf->y_stride, 127, ybf->y_width + 5);
     for (i = 0; i < ybf->y_height; i++)
         ybf->y_buffer[ybf->y_stride *i - 1] = (unsigned char) 129;
--- a/vp8/common/textblit.c
+++ b/vp8/common/textblit.c
@@ -57,7 +57,7 @@
     image [x+y*pitch] ^= 255;
 }
 
-// Bresenham line algorithm
+/* Bresenham line algorithm */
 void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch)
 {
     int steep = abs(y1 - y0) > abs(x1 - x0);
--- a/vp8/common/threading.h
+++ b/vp8/common/threading.h
@@ -12,7 +12,7 @@
 #ifndef _PTHREAD_EMULATION
 #define _PTHREAD_EMULATION
 
-#define VPXINFINITE 10000       //10second.
+#define VPXINFINITE 10000       /* 10second. */
 
 /* Thread management macros */
 #ifdef _WIN32
@@ -72,11 +72,11 @@
 #define sem_wait(sem) (semaphore_wait(*sem) )
 #define sem_post(sem) semaphore_signal(*sem)
 #define sem_destroy(sem) semaphore_destroy(mach_task_self(),*sem)
-#define thread_sleep(nms) // { struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);}
+#define thread_sleep(nms) /* { struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} */
 #else
 #include <unistd.h>
 #include <sched.h>
-#define thread_sleep(nms) sched_yield();// {struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);}
+#define thread_sleep(nms) sched_yield();/* {struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} */
 #endif
 /* Not Windows. Assume pthreads */
 
--- a/vp8/common/treecoder.h
+++ b/vp8/common/treecoder.h
@@ -12,7 +12,7 @@
 #ifndef __INC_TREECODER_H
 #define __INC_TREECODER_H
 
-typedef unsigned char vp8bc_index_t; // probability index
+typedef unsigned char vp8bc_index_t; /* probability index */
 
 
 typedef unsigned char vp8_prob;
--- a/vp8/common/type_aliases.h
+++ b/vp8/common/type_aliases.h
@@ -64,32 +64,32 @@
 #endif
 
 #ifndef TYPE_INT16
-//#define TYPE_INT16
+/*#define TYPE_INT16*/
 typedef signed short    INT16;
 #endif
 
 #ifndef TYPE_INT32
-//#define TYPE_INT32
+/*#define TYPE_INT32*/
 typedef signed int      INT32;
 #endif
 
 #ifndef TYPE_UINT8
-//#define TYPE_UINT8
+/*#define TYPE_UINT8*/
 typedef unsigned char   UINT8;
 #endif
 
 #ifndef TYPE_UINT32
-//#define TYPE_UINT32
+/*#define TYPE_UINT32*/
 typedef unsigned int    UINT32;
 #endif
 
 #ifndef TYPE_UINT16
-//#define TYPE_UINT16
+/*#define TYPE_UINT16*/
 typedef unsigned short  UINT16;
 #endif
 
 #ifndef TYPE_BOOL
-//#define TYPE_BOOL
+/*#define TYPE_BOOL*/
 typedef int             BOOL;
 #endif
 
@@ -101,7 +101,7 @@
 
 #ifndef TYPE_INT64
 #ifdef _TMS320C6X
-//for now we only have 40bits
+/* for now we only have 40bits */
 typedef long INT64;
 #else
 typedef long long INT64;
--- a/vp8/common/x86/loopfilter_x86.c
+++ b/vp8/common/x86/loopfilter_x86.c
@@ -40,7 +40,7 @@
 extern loop_filter_uvfunction vp8_mbloop_filter_vertical_edge_uv_sse2;
 
 #if HAVE_MMX
-// Horizontal MB filtering
+/* Horizontal MB filtering */
 void vp8_loop_filter_mbh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                              int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -66,7 +66,7 @@
 }
 
 
-// Vertical MB Filtering
+/* Vertical MB Filtering */
 void vp8_loop_filter_mbv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                              int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -92,7 +92,7 @@
 }
 
 
-// Horizontal B Filtering
+/* Horizontal B Filtering */
 void vp8_loop_filter_bh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                             int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -122,7 +122,7 @@
 }
 
 
-// Vertical B Filtering
+/* Vertical B Filtering */
 void vp8_loop_filter_bv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                             int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -153,7 +153,7 @@
 #endif
 
 
-// Horizontal MB filtering
+/* Horizontal MB filtering */
 #if HAVE_SSE2
 void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                               int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
@@ -177,7 +177,7 @@
 }
 
 
-// Vertical MB Filtering
+/* Vertical MB Filtering */
 void vp8_loop_filter_mbv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                               int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -200,7 +200,7 @@
 }
 
 
-// Horizontal B Filtering
+/* Horizontal B Filtering */
 void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                              int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
@@ -227,7 +227,7 @@
 }
 
 
-// Vertical B Filtering
+/* Vertical B Filtering */
 void vp8_loop_filter_bv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
                              int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf)
 {
--- a/vp8/common/x86/vp8_asm_stubs.c
+++ b/vp8/common/x86/vp8_asm_stubs.c
@@ -128,7 +128,7 @@
     int dst_pitch
 )
 {
-    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 16*16);  // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 16*16);  /* Temp data bufffer used in filtering */
     const short *HFilter, *VFilter;
     HFilter = vp8_six_tap_mmx[xoffset];
     vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 8, HFilter);
@@ -149,7 +149,7 @@
 )
 {
 
-    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24);  // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24);  /* Temp data bufffer used in filtering */
 
     const short *HFilter, *VFilter;
 
@@ -181,7 +181,7 @@
 )
 {
 
-    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256);    // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256);    /* Temp data bufffer used in filtering */
 
     const short *HFilter, *VFilter;
 
@@ -207,7 +207,7 @@
 )
 {
 
-    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256);    // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256);    /* Temp data bufffer used in filtering */
 
     const short *HFilter, *VFilter;
 
@@ -253,7 +253,7 @@
 
 )
 {
-    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24);    // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24);    /* Temp data bufffer used in filtering */
 
     const short *HFilter, *VFilter;
 
@@ -268,7 +268,7 @@
         }
         else
         {
-            // First-pass only
+            /* First-pass only */
             HFilter = vp8_six_tap_mmx[xoffset];
             vp8_filter_block1d16_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 16, HFilter);
         }
@@ -275,7 +275,7 @@
     }
     else
     {
-        // Second-pass only
+        /* Second-pass only */
         VFilter = vp8_six_tap_mmx[yoffset];
         vp8_unpack_block1d16_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2,   src_pixels_per_line, 21, 32);
         vp8_filter_block1d16_v6_sse2(FData2 + 32, dst_ptr,   dst_pitch, 32, 16 , 16, dst_pitch, VFilter);
@@ -293,7 +293,7 @@
     int dst_pitch
 )
 {
-    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256);  // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256);  /* Temp data bufffer used in filtering */
     const short *HFilter, *VFilter;
 
     if (xoffset)
@@ -307,7 +307,7 @@
         }
         else
         {
-            // First-pass only
+            /* First-pass only */
             HFilter = vp8_six_tap_mmx[xoffset];
             vp8_filter_block1d8_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 8, HFilter);
         }
@@ -314,7 +314,7 @@
     }
     else
     {
-        // Second-pass only
+        /* Second-pass only */
         VFilter = vp8_six_tap_mmx[yoffset];
         vp8_filter_block1d8_v6_only_sse2(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 8, VFilter);
     }
@@ -331,7 +331,7 @@
     int dst_pitch
 )
 {
-    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256);  // Temp data bufffer used in filtering
+    DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256);  /* Temp data bufffer used in filtering */
     const short *HFilter, *VFilter;
 
     if (xoffset)
@@ -345,7 +345,7 @@
         }
         else
         {
-            // First-pass only
+            /* First-pass only */
             HFilter = vp8_six_tap_mmx[xoffset];
             vp8_filter_block1d8_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 4, HFilter);
         }
@@ -352,7 +352,7 @@
     }
     else
     {
-        // Second-pass only
+        /* Second-pass only */
         VFilter = vp8_six_tap_mmx[yoffset];
         vp8_filter_block1d8_v6_only_sse2(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 4, VFilter);
     }
@@ -444,13 +444,13 @@
         }
         else
         {
-            // First-pass only
+            /* First-pass only */
             vp8_filter_block1d16_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 16, xoffset);
         }
     }
     else
     {
-        // Second-pass only
+        /* Second-pass only */
         vp8_filter_block1d16_v6_ssse3(src_ptr - (2 * src_pixels_per_line) , src_pixels_per_line, dst_ptr, dst_pitch, 16, yoffset);
     }
 }
@@ -481,7 +481,7 @@
     }
     else
     {
-        // Second-pass only
+        /* Second-pass only */
         vp8_filter_block1d8_v6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 8, yoffset);
     }
 }
@@ -508,13 +508,13 @@
         }
         else
         {
-            // First-pass only
+            /* First-pass only */
             vp8_filter_block1d8_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 4, xoffset);
         }
     }
     else
     {
-        // Second-pass only
+        /* Second-pass only */
         vp8_filter_block1d8_v6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 4, yoffset);
     }
 }
--- a/vp8/common/x86/x86_systemdependent.c
+++ b/vp8/common/x86/x86_systemdependent.c
@@ -74,7 +74,7 @@
 
 #if CONFIG_POSTPROC
         rtcd->postproc.down        = vp8_mbpost_proc_down_mmx;
-        //rtcd->postproc.across      = vp8_mbpost_proc_across_ip_c;
+        /*rtcd->postproc.across      = vp8_mbpost_proc_across_ip_c;*/
         rtcd->postproc.downacross  = vp8_post_proc_down_and_across_mmx;
         rtcd->postproc.addnoise    = vp8_plane_add_noise_mmx;
 #endif
--- a/vp8/decoder/arm/arm_dsystemdependent.c
+++ b/vp8/decoder/arm/arm_dsystemdependent.c
@@ -35,7 +35,7 @@
         pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_v6;
         pbi->dequant.idct_add_y_block    = vp8_dequant_idct_add_y_block_v6;
         pbi->dequant.idct_add_uv_block   = vp8_dequant_idct_add_uv_block_v6;
-#if 0 //For use with RTCD, when implemented
+#if 0 /*For use with RTCD, when implemented*/
         pbi->dboolhuff.start             = vp8dx_start_decode_c;
         pbi->dboolhuff.fill              = vp8dx_bool_decoder_fill_c;
         pbi->dboolhuff.debool            = vp8dx_decode_bool_c;
@@ -54,7 +54,7 @@
         pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_neon;
         pbi->dequant.idct_add_y_block    = vp8_dequant_idct_add_y_block_neon;
         pbi->dequant.idct_add_uv_block   = vp8_dequant_idct_add_uv_block_neon;
-#if 0 //For use with RTCD, when implemented
+#if 0 /*For use with RTCD, when implemented*/
         pbi->dboolhuff.start             = vp8dx_start_decode_c;
         pbi->dboolhuff.fill              = vp8dx_bool_decoder_fill_c;
         pbi->dboolhuff.debool            = vp8dx_decode_bool_c;
--- a/vp8/decoder/arm/dboolhuff_arm.h
+++ b/vp8/decoder/arm/dboolhuff_arm.h
@@ -11,7 +11,7 @@
  * to be useless. However, its been left (for now)
  * for reference.
  */
-/*
+#if 0
 #if HAVE_ARMV6
 #undef vp8_dbool_start
 #define vp8_dbool_start vp8dx_start_decode_v6
@@ -24,7 +24,7 @@
 
 #undef vp8_dbool_devalue
 #define vp8_dbool_devalue vp8_decode_value_v6
-#endif // HAVE_ARMV6
+#endif /* HAVE_ARMV6 */
 
 #if HAVE_ARMV7
 #undef vp8_dbool_start
@@ -38,6 +38,6 @@
 
 #undef vp8_dbool_devalue
 #define vp8_dbool_devalue vp8_decode_value_neon
-#endif // HAVE_ARMV7
-*/
-#endif // DBOOLHUFF_ARM_H
+#endif /* HAVE_ARMV7 */
+#endif
+#endif /* DBOOLHUFF_ARM_H */
--- a/vp8/decoder/dboolhuff.h
+++ b/vp8/decoder/dboolhuff.h
@@ -45,7 +45,7 @@
     const unsigned char *source, unsigned int source_sz)
 #define prototype_dbool_fill(sym) void sym(BOOL_DECODER *br)
 #define prototype_dbool_debool(sym) int sym(BOOL_DECODER *br, int probability)
-#define prototype_dbool_devalue(sym) int sym(BOOL_DECODER *br, int bits);
+#define prototype_dbool_devalue(sym) int sym(BOOL_DECODER *br, int bits)
 
 #if ARCH_ARM
 #include "arm/dboolhuff_arm.h"
@@ -84,16 +84,17 @@
     vp8_dbool_devalue_fn_t devalue;
 } vp8_dboolhuff_rtcd_vtable_t;
 
-// There are no processor-specific versions of these
-// functions right now. Disable RTCD to avoid using
-// function pointers which gives a speed boost
-//#ifdef ENABLE_RUNTIME_CPU_DETECT
-//#define DBOOLHUFF_INVOKE(ctx,fn) (ctx)->fn
-//#define IF_RTCD(x) (x)
-//#else
+/* There are no processor-specific versions of these
+ * functions right now. Disable RTCD to avoid using
+ * function pointers which gives a speed boost
+ */
+/*#ifdef ENABLE_RUNTIME_CPU_DETECT
+#define DBOOLHUFF_INVOKE(ctx,fn) (ctx)->fn
+#define IF_RTCD(x) (x)
+#else*/
 #define DBOOLHUFF_INVOKE(ctx,fn) vp8_dbool_##fn
 #define IF_RTCD(x) NULL
-//#endif
+/*#endif*/
 
 DECLARE_ALIGNED(16, extern const unsigned char, vp8dx_bitreader_norm[256]);
 
--- a/vp8/decoder/decodemv.c
+++ b/vp8/decoder/decodemv.c
@@ -51,10 +51,10 @@
 
 static void vp8_read_mb_features(vp8_reader *r, MB_MODE_INFO *mi, MACROBLOCKD *x)
 {
-    // Is segmentation enabled
+    /* Is segmentation enabled */
     if (x->segmentation_enabled && x->update_mb_segmentation_map)
     {
-        // If so then read the segment id.
+        /* If so then read the segment id. */
         if (vp8_read(r, x->mb_segment_tree_probs[0]))
             mi->segment_id = (unsigned char)(2 + vp8_read(r, x->mb_segment_tree_probs[2]));
         else
@@ -70,14 +70,15 @@
         {
             MB_PREDICTION_MODE y_mode;
 
-            // Read the Macroblock segmentation map if it is being updated explicitly this frame (reset to 0 above by default)
-            // By default on a key frame reset all MBs to segment 0
+            /* Read the Macroblock segmentation map if it is being updated explicitly this frame (reset to 0 above by default)
+             * By default on a key frame reset all MBs to segment 0
+             */
             m->mbmi.segment_id = 0;
 
             if (pbi->mb.update_mb_segmentation_map)
                 vp8_read_mb_features(bc, &m->mbmi, &pbi->mb);
 
-            // Read the macroblock coeff skip flag if this feature is in use, else default to 0
+            /* Read the macroblock coeff skip flag if this feature is in use, else default to 0 */
             if (pbi->common.mb_no_coeff_skip)
                 m->mbmi.mb_skip_coeff = vp8_read(bc, pbi->prob_skip_false);
             else
@@ -306,8 +307,9 @@
     mb_to_bottom_edge += RIGHT_BOTTOM_MARGIN;
 
     mbmi->need_to_clamp_mvs = 0;
-    // Distance of Mb to the various image edges.
-    // These specified to 8th pel as they are always compared to MV values that are in 1/8th pel units
+    /* Distance of Mb to the various image edges.
+     * These specified to 8th pel as they are always compared to MV values that are in 1/8th pel units
+     */
     pbi->mb.mb_to_left_edge =
     mb_to_left_edge = -((mb_col * 16) << 3);
     mb_to_left_edge -= LEFT_TOP_MARGIN;
@@ -316,11 +318,11 @@
     mb_to_right_edge = ((pbi->common.mb_cols - 1 - mb_col) * 16) << 3;
     mb_to_right_edge += RIGHT_BOTTOM_MARGIN;
 
-    // If required read in new segmentation data for this MB
+    /* If required read in new segmentation data for this MB */
     if (pbi->mb.update_mb_segmentation_map)
         vp8_read_mb_features(bc, mbmi, &pbi->mb);
 
-    // Read the macroblock coeff skip flag if this feature is in use, else default to 0
+    /* Read the macroblock coeff skip flag if this feature is in use, else default to 0 */
     if (pbi->common.mb_no_coeff_skip)
         mbmi->mb_skip_coeff = vp8_read(bc, pbi->prob_skip_false);
     else
@@ -362,7 +364,7 @@
 
                 mv_contz = vp8_mv_cont(&(vp8_left_bmi(mi, k)->mv.as_mv), &(vp8_above_bmi(mi, k, mis)->mv.as_mv));
 
-                switch (bmi.mode = (B_PREDICTION_MODE) sub_mv_ref(bc, vp8_sub_mv_ref_prob2 [mv_contz])) //pc->fc.sub_mv_ref_prob))
+                switch (bmi.mode = (B_PREDICTION_MODE) sub_mv_ref(bc, vp8_sub_mv_ref_prob2 [mv_contz])) /*pc->fc.sub_mv_ref_prob))*/
                 {
                 case NEW4X4:
                     read_mv(bc, mv, (const MV_CONTEXT *) mvc);
@@ -425,7 +427,7 @@
 
         case NEARMV:
             *mv = nearby;
-            // Clip "next_nearest" so that it does not extend to far out of image
+            /* Clip "next_nearest" so that it does not extend to far out of image */
             mv->col = (mv->col < mb_to_left_edge) ? mb_to_left_edge : mv->col;
             mv->col = (mv->col > mb_to_right_edge) ? mb_to_right_edge : mv->col;
             mv->row = (mv->row < mb_to_top_edge) ? mb_to_top_edge : mv->row;
@@ -434,7 +436,7 @@
 
         case NEARESTMV:
             *mv = nearest;
-            // Clip "next_nearest" so that it does not extend to far out of image
+            /* Clip "next_nearest" so that it does not extend to far out of image */
             mv->col = (mv->col < mb_to_left_edge) ? mb_to_left_edge : mv->col;
             mv->col = (mv->col > mb_to_right_edge) ? mb_to_right_edge : mv->col;
             mv->row = (mv->row < mb_to_top_edge) ? mb_to_top_edge : mv->row;
@@ -462,12 +464,12 @@
 
         propagate_mv:  /* same MV throughout */
             {
-                //int i=0;
-                //do
-                //{
-                //  mi->bmi[i].mv.as_mv = *mv;
-                //}
-                //while( ++i < 16);
+                /*int i=0;
+                do
+                {
+                  mi->bmi[i].mv.as_mv = *mv;
+                }
+                while( ++i < 16);*/
 
                 mi->bmi[0].mv.as_mv = *mv;
                 mi->bmi[1].mv.as_mv = *mv;
@@ -541,16 +543,16 @@
 
         while (++mb_col < pbi->common.mb_cols)
         {
-//          vp8_read_mb_modes_mv(pbi, xd->mode_info_context, &xd->mode_info_context->mbmi, mb_row, mb_col);
+            /*vp8_read_mb_modes_mv(pbi, xd->mode_info_context, &xd->mode_info_context->mbmi, mb_row, mb_col);*/
             if(pbi->common.frame_type == KEY_FRAME)
                 vp8_kfread_modes(pbi, mi, mb_row, mb_col);
             else
                 vp8_read_mb_modes_mv(pbi, mi, &mi->mbmi, mb_row, mb_col);
 
-            mi++;       // next macroblock
+            mi++;       /* next macroblock */
         }
 
-        mi++;           // skip left predictor each row
+        mi++;           /* skip left predictor each row */
     }
 }
 
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -50,7 +50,7 @@
         pc->Y2dequant[Q][0] = (short)vp8_dc2quant(Q, pc->y2dc_delta_q);
         pc->UVdequant[Q][0] = (short)vp8_dc_uv_quant(Q, pc->uvdc_delta_q);
 
-        // all the ac values = ;
+        /* all the ac values = ; */
         for (i = 1; i < 16; i++)
         {
             int rc = vp8_default_zig_zag1d[i];
@@ -69,24 +69,24 @@
     MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
     VP8_COMMON *const pc = & pbi->common;
 
-    // Decide whether to use the default or alternate baseline Q value.
+    /* Decide whether to use the default or alternate baseline Q value. */
     if (xd->segmentation_enabled)
     {
-        // Abs Value
+        /* Abs Value */
         if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA)
             QIndex = xd->segment_feature_data[MB_LVL_ALT_Q][mbmi->segment_id];
 
-        // Delta Value
+        /* Delta Value */
         else
         {
             QIndex = pc->base_qindex + xd->segment_feature_data[MB_LVL_ALT_Q][mbmi->segment_id];
-            QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0;    // Clamp to valid range
+            QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0;    /* Clamp to valid range */
         }
     }
     else
         QIndex = pc->base_qindex;
 
-    // Set up the block level dequant pointers
+    /* Set up the block level dequant pointers */
     for (i = 0; i < 16; i++)
     {
         xd->block[i].dequant = pc->Y1dequant[QIndex];
@@ -107,8 +107,9 @@
 #define RTCD_VTABLE(x) NULL
 #endif
 
-//skip_recon_mb() is Modified: Instead of writing the result to predictor buffer and then copying it
-// to dst buffer, we can write the result directly to dst buffer. This eliminates unnecessary copy.
+/* skip_recon_mb() is Modified: Instead of writing the result to predictor buffer and then copying it
+ *  to dst buffer, we can write the result directly to dst buffer. This eliminates unnecessary copy.
+ */
 static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd)
 {
     if (xd->frame_type == KEY_FRAME  ||  xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
@@ -207,7 +208,7 @@
     if (xd->segmentation_enabled)
         mb_init_dequantizer(pbi, xd);
 
-    // do prediction
+    /* do prediction */
     if (xd->frame_type == KEY_FRAME  ||  xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
     {
         vp8_build_intra_predictors_mbuv(xd);
@@ -224,13 +225,13 @@
         vp8_build_inter_predictors_mb(xd);
     }
 
-    // dequantization and idct
+    /* dequantization and idct */
     if (xd->mode_info_context->mbmi.mode != B_PRED && xd->mode_info_context->mbmi.mode != SPLITMV)
     {
         BLOCKD *b = &xd->block[24];
         DEQUANT_INVOKE(&pbi->dequant, block)(b);
 
-        // do 2nd order transform on the dc block
+        /* do 2nd order transform on the dc block */
         if (xd->eobs[24] > 1)
         {
             IDCT_INVOKE(RTCD_VTABLE(idct), iwalsh16)(&b->dqcoeff[0], b->diff);
@@ -336,7 +337,7 @@
     vpx_memset(&pc->left_context, 0, sizeof(pc->left_context));
     recon_yoffset = mb_row * recon_y_stride * 16;
     recon_uvoffset = mb_row * recon_uv_stride * 8;
-    // reset above block coeffs
+    /* reset above block coeffs */
 
     xd->above_context = pc->above_context;
     xd->up_available = (mb_row != 0);
@@ -356,8 +357,9 @@
             }
         }
 
-        // Distance of Mb to the various image edges.
-        // These specified to 8th pel as they are always compared to values that are in 1/8th pel units
+        /* Distance of Mb to the various image edges.
+         * These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
+         */
         xd->mb_to_left_edge = -((mb_col * 16) << 3);
         xd->mb_to_right_edge = ((pc->mb_cols - 1 - mb_col) * 16) << 3;
 
@@ -367,7 +369,7 @@
 
         xd->left_available = (mb_col != 0);
 
-        // Select the appropriate reference frame for this MB
+        /* Select the appropriate reference frame for this MB */
         if (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME)
             ref_fb_idx = pc->lst_fb_idx;
         else if (xd->mode_info_context->mbmi.ref_frame == GOLDEN_FRAME)
@@ -399,7 +401,7 @@
 
     }
 
-    // adjust to the next row of mbs
+    /* adjust to the next row of mbs */
     vp8_extend_mb_row(
         &pc->yv12_fb[dst_fb_idx],
         xd->dst.y_buffer + 16, xd->dst.u_buffer + 8, xd->dst.v_buffer + 8
@@ -445,7 +447,7 @@
     for (i = 0; i < num_part; i++)
     {
         const unsigned char *partition_size_ptr = cx_data + i * 3;
-        unsigned int         partition_size;
+        ptrdiff_t            partition_size;
 
         /* Calculate the length of this partition. The last partition
          * size is implicit.
@@ -496,7 +498,7 @@
 
     if (pc->frame_type == KEY_FRAME)
     {
-        // Various keyframe initializations
+        /* Various keyframe initializations */
         vpx_memcpy(pc->fc.mvc, vp8_default_mv_context, sizeof(vp8_default_mv_context));
 
         vp8_init_mbmode_probs(pc);
@@ -504,22 +506,23 @@
         vp8_default_coef_probs(pc);
         vp8_kf_default_bmode_probs(pc->kf_bmode_prob);
 
-        // reset the segment feature data to 0 with delta coding (Default state).
+        /* reset the segment feature data to 0 with delta coding (Default state). */
         vpx_memset(xd->segment_feature_data, 0, sizeof(xd->segment_feature_data));
         xd->mb_segement_abs_delta = SEGMENT_DELTADATA;
 
-       // reset the mode ref deltasa for loop filter
+        /* reset the mode ref deltasa for loop filter */
         vpx_memset(xd->ref_lf_deltas, 0, sizeof(xd->ref_lf_deltas));
         vpx_memset(xd->mode_lf_deltas, 0, sizeof(xd->mode_lf_deltas));
 
-        // All buffers are implicitly updated on key frames.
+        /* All buffers are implicitly updated on key frames. */
         pc->refresh_golden_frame = 1;
         pc->refresh_alt_ref_frame = 1;
         pc->copy_buffer_to_gf = 0;
         pc->copy_buffer_to_arf = 0;
 
-        // Note that Golden and Altref modes cannot be used on a key frame so
-        // ref_frame_sign_bias[] is undefined and meaningless
+        /* Note that Golden and Altref modes cannot be used on a key frame so
+         * ref_frame_sign_bias[] is undefined and meaningless
+         */
         pc->ref_frame_sign_bias[GOLDEN_FRAME] = 0;
         pc->ref_frame_sign_bias[ALTREF_FRAME] = 0;
     }
@@ -530,7 +533,7 @@
         else
             pc->mcomp_filter_type = BILINEAR;
 
-        // To enable choice of different interploation filters
+        /* To enable choice of different interploation filters */
         if (pc->mcomp_filter_type == SIXTAP)
         {
             xd->subpixel_predict      = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap4x4);
@@ -561,7 +564,7 @@
     MACROBLOCKD *const xd  = & pbi->mb;
     const unsigned char *data = (const unsigned char *)pbi->Source;
     const unsigned char *const data_end = data + pbi->source_sz;
-    unsigned int first_partition_length_in_bytes;
+    ptrdiff_t first_partition_length_in_bytes;
 
     int mb_row;
     int i, j, k, l;
@@ -587,7 +590,7 @@
         const int Width = pc->Width;
         const int Height = pc->Height;
 
-        // vet via sync code
+        /* vet via sync code */
         if (data[0] != 0x9d || data[1] != 0x01 || data[2] != 0x2a)
             vpx_internal_error(&pc->error, VPX_CODEC_UNSUP_BITSTREAM,
                                "Invalid frame sync code");
@@ -643,12 +646,12 @@
         pc->clamp_type  = (CLAMP_TYPE)vp8_read_bit(bc);
     }
 
-    // Is segmentation enabled
+    /* Is segmentation enabled */
     xd->segmentation_enabled = (unsigned char)vp8_read_bit(bc);
 
     if (xd->segmentation_enabled)
     {
-        // Signal whether or not the segmentation map is being explicitly updated this frame.
+        /* Signal whether or not the segmentation map is being explicitly updated this frame. */
         xd->update_mb_segmentation_map = (unsigned char)vp8_read_bit(bc);
         xd->update_mb_segmentation_data = (unsigned char)vp8_read_bit(bc);
 
@@ -658,12 +661,12 @@
 
             vpx_memset(xd->segment_feature_data, 0, sizeof(xd->segment_feature_data));
 
-            // For each segmentation feature (Quant and loop filter level)
+            /* For each segmentation feature (Quant and loop filter level) */
             for (i = 0; i < MB_LVL_MAX; i++)
             {
                 for (j = 0; j < MAX_MB_SEGMENTS; j++)
                 {
-                    // Frame level data
+                    /* Frame level data */
                     if (vp8_read_bit(bc))
                     {
                         xd->segment_feature_data[i][j] = (signed char)vp8_read_literal(bc, mb_feature_data_bits[i]);
@@ -679,13 +682,13 @@
 
         if (xd->update_mb_segmentation_map)
         {
-            // Which macro block level features are enabled
+            /* Which macro block level features are enabled */
             vpx_memset(xd->mb_segment_tree_probs, 255, sizeof(xd->mb_segment_tree_probs));
 
-            // Read the probs used to decode the segment id for each macro block.
+            /* Read the probs used to decode the segment id for each macro block. */
             for (i = 0; i < MB_FEATURE_TREE_PROBS; i++)
             {
-                // If not explicitly set value is defaulted to 255 by memset above
+                /* If not explicitly set value is defaulted to 255 by memset above */
                 if (vp8_read_bit(bc))
                     xd->mb_segment_tree_probs[i] = (vp8_prob)vp8_read_literal(bc, 8);
             }
@@ -692,44 +695,44 @@
         }
     }
 
-    // Read the loop filter level and type
+    /* Read the loop filter level and type */
     pc->filter_type = (LOOPFILTERTYPE) vp8_read_bit(bc);
     pc->filter_level = vp8_read_literal(bc, 6);
     pc->sharpness_level = vp8_read_literal(bc, 3);
 
-    // Read in loop filter deltas applied at the MB level based on mode or ref frame.
+    /* Read in loop filter deltas applied at the MB level based on mode or ref frame. */
     xd->mode_ref_lf_delta_update = 0;
     xd->mode_ref_lf_delta_enabled = (unsigned char)vp8_read_bit(bc);
 
     if (xd->mode_ref_lf_delta_enabled)
     {
-        // Do the deltas need to be updated
+        /* Do the deltas need to be updated */
         xd->mode_ref_lf_delta_update = (unsigned char)vp8_read_bit(bc);
 
         if (xd->mode_ref_lf_delta_update)
         {
-            // Send update
+            /* Send update */
             for (i = 0; i < MAX_REF_LF_DELTAS; i++)
             {
                 if (vp8_read_bit(bc))
                 {
-                    //sign = vp8_read_bit( bc );
+                    /*sign = vp8_read_bit( bc );*/
                     xd->ref_lf_deltas[i] = (signed char)vp8_read_literal(bc, 6);
 
-                    if (vp8_read_bit(bc))        // Apply sign
+                    if (vp8_read_bit(bc))        /* Apply sign */
                         xd->ref_lf_deltas[i] = xd->ref_lf_deltas[i] * -1;
                 }
             }
 
-            // Send update
+            /* Send update */
             for (i = 0; i < MAX_MODE_LF_DELTAS; i++)
             {
                 if (vp8_read_bit(bc))
                 {
-                    //sign = vp8_read_bit( bc );
+                    /*sign = vp8_read_bit( bc );*/
                     xd->mode_lf_deltas[i] = (signed char)vp8_read_literal(bc, 6);
 
-                    if (vp8_read_bit(bc))        // Apply sign
+                    if (vp8_read_bit(bc))        /* Apply sign */
                         xd->mode_lf_deltas[i] = xd->mode_lf_deltas[i] * -1;
                 }
             }
@@ -739,11 +742,11 @@
     setup_token_decoder(pbi, data + first_partition_length_in_bytes);
     xd->current_bc = &pbi->bc2;
 
-    // Read the default quantizers.
+    /* Read the default quantizers. */
     {
         int Q, q_update;
 
-        Q = vp8_read_literal(bc, 7);  // AC 1st order Q = default
+        Q = vp8_read_literal(bc, 7);  /* AC 1st order Q = default */
         pc->base_qindex = Q;
         q_update = 0;
         pc->y1dc_delta_q = get_delta_q(bc, pc->y1dc_delta_q, &q_update);
@@ -755,20 +758,21 @@
         if (q_update)
             vp8cx_init_de_quantizer(pbi);
 
-        // MB level dequantizer setup
+        /* MB level dequantizer setup */
         mb_init_dequantizer(pbi, &pbi->mb);
     }
 
-    // Determine if the golden frame or ARF buffer should be updated and how.
-    // For all non key frames the GF and ARF refresh flags and sign bias
-    // flags must be set explicitly.
+    /* Determine if the golden frame or ARF buffer should be updated and how.
+     * For all non key frames the GF and ARF refresh flags and sign bias
+     * flags must be set explicitly.
+     */
     if (pc->frame_type != KEY_FRAME)
     {
-        // Should the GF or ARF be updated from the current frame
+        /* Should the GF or ARF be updated from the current frame */
         pc->refresh_golden_frame = vp8_read_bit(bc);
         pc->refresh_alt_ref_frame = vp8_read_bit(bc);
 
-        // Buffer to buffer copy flags.
+        /* Buffer to buffer copy flags. */
         pc->copy_buffer_to_gf = 0;
 
         if (!pc->refresh_golden_frame)
@@ -806,7 +810,7 @@
 
 
     {
-        // read coef probability tree
+        /* read coef probability tree */
 
         for (i = 0; i < BLOCK_TYPES; i++)
             for (j = 0; j < COEF_BANDS; j++)
@@ -827,7 +831,7 @@
     vpx_memcpy(&xd->pre, &pc->yv12_fb[pc->lst_fb_idx], sizeof(YV12_BUFFER_CONFIG));
     vpx_memcpy(&xd->dst, &pc->yv12_fb[pc->new_fb_idx], sizeof(YV12_BUFFER_CONFIG));
 
-    // set up frame new frame for intra coded blocks
+    /* set up frame new frame for intra coded blocks */
     if (!(pbi->b_multithreaded_rd) || pc->multi_token_partition == ONE_PARTITION || !(pc->filter_level))
         vp8_setup_intra_recon(&pc->yv12_fb[pc->new_fb_idx]);
 
@@ -835,10 +839,10 @@
 
     vp8_build_block_doffsets(xd);
 
-    // clear out the coeff buffer
+    /* clear out the coeff buffer */
     vpx_memset(xd->qcoeff, 0, sizeof(xd->qcoeff));
 
-    // Read the mb_no_coeff_skip flag
+    /* Read the mb_no_coeff_skip flag */
     pc->mb_no_coeff_skip = (int)vp8_read_bit(bc);
 
 
@@ -853,13 +857,13 @@
         vp8mt_decode_mb_rows(pbi, xd);
         if(pbi->common.filter_level)
         {
-            //vp8_mt_loop_filter_frame(pbi);   //cm, &pbi->mb, cm->filter_level);
+            /*vp8_mt_loop_filter_frame(pbi);*/ /*cm, &pbi->mb, cm->filter_level);*/
 
             pc->last_frame_type = pc->frame_type;
             pc->last_filter_type = pc->filter_type;
             pc->last_sharpness_level = pc->sharpness_level;
         }
-        vp8_yv12_extend_frame_borders_ptr(&pc->yv12_fb[pc->new_fb_idx]);    //cm->frame_to_show);
+        vp8_yv12_extend_frame_borders_ptr(&pc->yv12_fb[pc->new_fb_idx]);    /*cm->frame_to_show);*/
     }
     else
     {
@@ -866,7 +870,7 @@
         int ibc = 0;
         int num_part = 1 << pc->multi_token_partition;
 
-        // Decode the individual macro block
+        /* Decode the individual macro block */
         for (mb_row = 0; mb_row < pc->mb_rows; mb_row++)
         {
 
@@ -886,9 +890,9 @@
 
     stop_token_decoder(pbi);
 
-    // vpx_log("Decoder: Frame Decoded, Size Roughly:%d bytes  \n",bc->pos+pbi->bc2.pos);
+    /* vpx_log("Decoder: Frame Decoded, Size Roughly:%d bytes  \n",bc->pos+pbi->bc2.pos); */
 
-    // If this was a kf or Gf note the Q used
+    /* If this was a kf or Gf note the Q used */
     if ((pc->frame_type == KEY_FRAME) ||
          pc->refresh_golden_frame || pc->refresh_alt_ref_frame)
     {
--- a/vp8/decoder/dequantize.c
+++ b/vp8/decoder/dequantize.c
@@ -45,7 +45,7 @@
         input[i] = dq[i] * input[i];
     }
 
-    // the idct halves ( >> 1) the pitch
+    /* the idct halves ( >> 1) the pitch */
     vp8_short_idct4x4llm_c(input, output, 4 << 1);
 
     vpx_memset(input, 0, 32);
@@ -87,7 +87,7 @@
         input[i] = dq[i] * input[i];
     }
 
-    // the idct halves ( >> 1) the pitch
+    /* the idct halves ( >> 1) the pitch */
     vp8_short_idct4x4llm_c(input, output, 4 << 1);
 
     vpx_memset(input, 0, 32);
--- a/vp8/decoder/detokenize.c
+++ b/vp8/decoder/detokenize.c
@@ -44,18 +44,18 @@
 
 DECLARE_ALIGNED(16, static const TOKENEXTRABITS, vp8d_token_extra_bits2[MAX_ENTROPY_TOKENS]) =
 {
-    {  0, -1, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },  //ZERO_TOKEN
-    {  1, 0, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },   //ONE_TOKEN
-    {  2, 0, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },   //TWO_TOKEN
-    {  3, 0, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },   //THREE_TOKEN
-    {  4, 0, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },   //FOUR_TOKEN
-    {  5, 0, { 159, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },  //DCT_VAL_CATEGORY1
-    {  7, 1, { 145, 165, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } }, //DCT_VAL_CATEGORY2
-    { 11, 2, { 140, 148, 173, 0,  0,  0,  0,  0,  0,  0,  0,  0   } }, //DCT_VAL_CATEGORY3
-    { 19, 3, { 135, 140, 155, 176, 0,  0,  0,  0,  0,  0,  0,  0   } }, //DCT_VAL_CATEGORY4
-    { 35, 4, { 130, 134, 141, 157, 180, 0,  0,  0,  0,  0,  0,  0   } }, //DCT_VAL_CATEGORY5
-    { 67, 10, { 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254, 0   } }, //DCT_VAL_CATEGORY6
-    {  0, -1, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },  // EOB TOKEN
+    {  0, -1, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },  /* ZERO_TOKEN */
+    {  1, 0, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },   /* ONE_TOKEN */
+    {  2, 0, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },   /* TWO_TOKEN */
+    {  3, 0, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },   /* THREE_TOKEN */
+    {  4, 0, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },   /* FOUR_TOKEN */
+    {  5, 0, { 159, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },  /* DCT_VAL_CATEGORY1 */
+    {  7, 1, { 145, 165, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } }, /* DCT_VAL_CATEGORY2 */
+    { 11, 2, { 140, 148, 173, 0,  0,  0,  0,  0,  0,  0,  0,  0   } }, /* DCT_VAL_CATEGORY3 */
+    { 19, 3, { 135, 140, 155, 176, 0,  0,  0,  0,  0,  0,  0,  0   } }, /* DCT_VAL_CATEGORY4 */
+    { 35, 4, { 130, 134, 141, 157, 180, 0,  0,  0,  0,  0,  0,  0   } }, /* DCT_VAL_CATEGORY5 */
+    { 67, 10, { 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254, 0   } }, /* DCT_VAL_CATEGORY6 */
+    {  0, -1, { 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   } },  /*  EOB TOKEN */
 };
 
 
@@ -75,13 +75,14 @@
 }
 
 #if CONFIG_ARM_ASM_DETOK
-// mashup of vp8_block2left and vp8_block2above so we only need one pointer
-// for the assembly version.
+/* mashup of vp8_block2left and vp8_block2above so we only need one pointer
+ * for the assembly version.
+ */
 DECLARE_ALIGNED(16, const UINT8, vp8_block2leftabove[25*2]) =
 {
-    //vp8_block2left
+    /* vp8_block2left */
     0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8,
-    //vp8_block2above
+    /* vp8_block2above */
     0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8
 };
 
@@ -297,7 +298,7 @@
 
     c = (INT16)(!type);
 
-//    Dest = ((A)!=0) + ((B)!=0);
+    /*Dest = ((A)!=0) + ((B)!=0);*/
     VP8_COMBINEENTROPYCONTEXTS(v, *a, *l);
     Prob = coef_probs;
     Prob += v * ENTROPY_NODES;
@@ -387,7 +388,7 @@
 
     qcoeff_ptr [ scan[15] ] = (INT16) v;
 BLOCK_FINISHED:
-    *a = *l = ((eobs[i] = c) != !type);   // any nonzero data?
+    *a = *l = ((eobs[i] = c) != !type);   /* any nonzero data? */
     eobtotal += c;
     qcoeff_ptr += 16;
 
@@ -422,4 +423,4 @@
     return eobtotal;
 
 }
-#endif //!CONFIG_ASM_DETOK
+#endif /*!CONFIG_ASM_DETOK*/
--- a/vp8/decoder/generic/dsystemdependent.c
+++ b/vp8/decoder/generic/dsystemdependent.c
@@ -18,7 +18,7 @@
 
 void vp8_dmachine_specific_config(VP8D_COMP *pbi)
 {
-    // Pure C:
+    /* Pure C: */
 #if CONFIG_RUNTIME_CPU_DETECT
     pbi->mb.rtcd                     = &pbi->common.rtcd;
     pbi->dequant.block               = vp8_dequantize_b_c;
@@ -29,7 +29,7 @@
     pbi->dequant.idct_add_uv_block   = vp8_dequant_idct_add_uv_block_c;
     pbi->dboolhuff.start             = vp8dx_start_decode_c;
     pbi->dboolhuff.fill              = vp8dx_bool_decoder_fill_c;
-#if 0 //For use with RTCD, when implemented
+#if 0 /*For use with RTCD, when implemented*/
     pbi->dboolhuff.debool = vp8dx_decode_bool_c;
     pbi->dboolhuff.devalue = vp8dx_decode_value_c;
 #endif
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -113,12 +113,13 @@
     pbi->common.current_video_frame = 0;
     pbi->ready_for_new_data = 1;
 
-    pbi->CPUFreq = 0; //vp8_get_processor_freq();
+    pbi->CPUFreq = 0; /*vp8_get_processor_freq();*/
     pbi->max_threads = oxcf->max_threads;
     vp8_decoder_create_threads(pbi);
 
-    //vp8cx_init_de_quantizer() is first called here. Add check in frame_init_dequantizer() to avoid
-    // unnecessary calling of vp8cx_init_de_quantizer() for every frame.
+    /* vp8cx_init_de_quantizer() is first called here. Add check in frame_init_dequantizer() to avoid
+     *  unnecessary calling of vp8cx_init_de_quantizer() for every frame.
+     */
     vp8cx_init_de_quantizer(pbi);
 
     {
@@ -223,7 +224,7 @@
     return 0;
 }
 
-//For ARM NEON, d8-d15 are callee-saved registers, and need to be saved by us.
+/*For ARM NEON, d8-d15 are callee-saved registers, and need to be saved by us.*/
 #if HAVE_ARMV7
 extern void vp8_push_neon(INT64 *store);
 extern void vp8_pop_neon(INT64 *store);
@@ -250,7 +251,7 @@
     buf[new_idx]++;
 }
 
-// If any buffer copy / swapping is signalled it should be done here.
+/* If any buffer copy / swapping is signalled it should be done here. */
 static int swap_frame_buffers (VP8_COMMON *cm)
 {
     int fb_to_update_with, err = 0;
@@ -260,10 +261,11 @@
     else
         fb_to_update_with = cm->new_fb_idx;
 
-    // The alternate reference frame or golden frame can be updated
-    //  using the new, last, or golden/alt ref frame.  If it
-    //  is updated using the newly decoded frame it is a refresh.
-    //  An update using the last or golden/alt ref frame is a copy.
+    /* The alternate reference frame or golden frame can be updated
+     *  using the new, last, or golden/alt ref frame.  If it
+     *  is updated using the newly decoded frame it is a refresh.
+     *  An update using the last or golden/alt ref frame is a copy.
+     */
     if (cm->copy_buffer_to_arf)
     {
         int new_fb = 0;
@@ -322,8 +324,8 @@
     int retcode = 0;
     struct vpx_usec_timer timer;
 
-//  if(pbi->ready_for_new_data == 0)
-//      return -1;
+    /*if(pbi->ready_for_new_data == 0)
+        return -1;*/
 
     if (ptr == 0)
     {
@@ -363,7 +365,7 @@
 
     vpx_usec_timer_start(&timer);
 
-    //cm->current_video_frame++;
+    /*cm->current_video_frame++;*/
     pbi->Source = source;
     pbi->source_sz = size;
 
@@ -423,7 +425,7 @@
         {
             struct vpx_usec_timer lpftimer;
             vpx_usec_timer_start(&lpftimer);
-            // Apply the loop filter if appropriate.
+            /* Apply the loop filter if appropriate. */
 
             vp8_loop_filter_frame(cm, &pbi->mb, cm->filter_level);
 
@@ -438,8 +440,8 @@
     }
 
 #if 0
-    // DEBUG code
-    //vp8_recon_write_yuv_frame("recon.yuv", cm->frame_to_show);
+    /* DEBUG code */
+    /*vp8_recon_write_yuv_frame("recon.yuv", cm->frame_to_show);*/
     if (cm->current_video_frame <= 5)
         write_dx_frame_to_file(cm->frame_to_show, cm->current_video_frame);
 #endif
@@ -451,7 +453,7 @@
 
     pbi->time_decoding += pbi->decode_microseconds;
 
-//  vp8_print_modes_and_motion_vectors( cm->mi, cm->mb_rows,cm->mb_cols, cm->current_video_frame);
+    /*vp8_print_modes_and_motion_vectors( cm->mi, cm->mb_rows,cm->mb_cols, cm->current_video_frame);*/
 
     if (cm->show_frame)
         cm->current_video_frame++;
@@ -512,7 +514,7 @@
     if (pbi->ready_for_new_data == 1)
         return ret;
 
-    // ie no raw frame to show!!!
+    /* ie no raw frame to show!!! */
     if (pbi->common.show_frame == 0)
         return ret;
 
@@ -538,7 +540,7 @@
         ret = -1;
     }
 
-#endif //!CONFIG_POSTPROC
+#endif /*!CONFIG_POSTPROC*/
     vp8_clear_system_state();
     return ret;
 }
--- a/vp8/decoder/onyxd_int.h
+++ b/vp8/decoder/onyxd_int.h
@@ -93,18 +93,18 @@
     int decoding_thread_count;
     int allocated_decoding_thread_count;
 
-    // variable for threading
+    /* variable for threading */
 #if CONFIG_MULTITHREAD
     int mt_baseline_filter_level[MAX_MB_SEGMENTS];
     int sync_range;
-    int *mt_current_mb_col;                  // Each row remembers its already decoded column.
+    int *mt_current_mb_col;                  /* Each row remembers its already decoded column. */
 
-    unsigned char **mt_yabove_row;           // mb_rows x width
+    unsigned char **mt_yabove_row;           /* mb_rows x width */
     unsigned char **mt_uabove_row;
     unsigned char **mt_vabove_row;
-    unsigned char **mt_yleft_col;            // mb_rows x 16
-    unsigned char **mt_uleft_col;            // mb_rows x 8
-    unsigned char **mt_vleft_col;            // mb_rows x 8
+    unsigned char **mt_yleft_col;            /* mb_rows x 16 */
+    unsigned char **mt_uleft_col;            /* mb_rows x 8 */
+    unsigned char **mt_vleft_col;            /* mb_rows x 8 */
 
     MB_ROW_DEC           *mb_row_di;
     DECODETHREAD_DATA    *de_thread_data;
@@ -112,7 +112,7 @@
     pthread_t           *h_decoding_thread;
     sem_t               *h_event_start_decoding;
     sem_t                h_event_end_decoding;
-    // end of threading data
+    /* end of threading data */
 #endif
 
     vp8_reader *mbc;
--- a/vp8/decoder/reconintra_mt.c
+++ b/vp8/decoder/reconintra_mt.c
@@ -15,16 +15,17 @@
 #include "vpx_mem/vpx_mem.h"
 #include "onyxd_int.h"
 
-// For skip_recon_mb(), add vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) and
-// vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x).
+/* For skip_recon_mb(), add vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) and
+ * vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x).
+ */
 
 void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
 {
 #if CONFIG_MULTITHREAD
-    unsigned char *yabove_row;    // = x->dst.y_buffer - x->dst.y_stride;
+    unsigned char *yabove_row;    /* = x->dst.y_buffer - x->dst.y_stride; */
     unsigned char *yleft_col;
     unsigned char yleft_buf[16];
-    unsigned char ytop_left;      // = yabove_row[-1];
+    unsigned char ytop_left;      /* = yabove_row[-1]; */
     unsigned char *ypred_ptr = x->predictor;
     int r, c, i;
 
@@ -43,7 +44,7 @@
 
     ytop_left = yabove_row[-1];
 
-    // for Y
+    /* for Y */
     switch (x->mode_info_context->mbmi.mode)
     {
     case DC_PRED:
@@ -156,15 +157,15 @@
 void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
 {
 #if CONFIG_MULTITHREAD
-    unsigned char *yabove_row;    // = x->dst.y_buffer - x->dst.y_stride;
+    unsigned char *yabove_row;    /* = x->dst.y_buffer - x->dst.y_stride; */
     unsigned char *yleft_col;
     unsigned char yleft_buf[16];
-    unsigned char ytop_left;      // = yabove_row[-1];
+    unsigned char ytop_left;      /* = yabove_row[-1]; */
     unsigned char *ypred_ptr = x->predictor;
     int r, c, i;
 
     int y_stride = x->dst.y_stride;
-    ypred_ptr = x->dst.y_buffer; //x->predictor;
+    ypred_ptr = x->dst.y_buffer; /*x->predictor;*/
 
     if (pbi->common.filter_level)
     {
@@ -181,7 +182,7 @@
 
     ytop_left = yabove_row[-1];
 
-    // for Y
+    /* for Y */
     switch (x->mode_info_context->mbmi.mode)
     {
     case DC_PRED:
@@ -222,11 +223,11 @@
             expected_dc = 128;
         }
 
-        //vpx_memset(ypred_ptr, expected_dc, 256);
+        /*vpx_memset(ypred_ptr, expected_dc, 256);*/
         for (r = 0; r < 16; r++)
         {
             vpx_memset(ypred_ptr, expected_dc, 16);
-            ypred_ptr += y_stride; //16;
+            ypred_ptr += y_stride; /*16;*/
         }
     }
     break;
@@ -240,7 +241,7 @@
             ((int *)ypred_ptr)[1] = ((int *)yabove_row)[1];
             ((int *)ypred_ptr)[2] = ((int *)yabove_row)[2];
             ((int *)ypred_ptr)[3] = ((int *)yabove_row)[3];
-            ypred_ptr += y_stride; //16;
+            ypred_ptr += y_stride; /*16;*/
         }
     }
     break;
@@ -251,7 +252,7 @@
         {
 
             vpx_memset(ypred_ptr, yleft_col[r], 16);
-            ypred_ptr += y_stride;  //16;
+            ypred_ptr += y_stride;  /*16;*/
         }
 
     }
@@ -274,7 +275,7 @@
                 ypred_ptr[c] = pred;
             }
 
-            ypred_ptr += y_stride;  //16;
+            ypred_ptr += y_stride;  /*16;*/
         }
 
     }
@@ -299,14 +300,14 @@
 void vp8mt_build_intra_predictors_mbuv(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
 {
 #if CONFIG_MULTITHREAD
-    unsigned char *uabove_row;   // = x->dst.u_buffer - x->dst.uv_stride;
-    unsigned char *uleft_col;    //[16];
+    unsigned char *uabove_row;   /* = x->dst.u_buffer - x->dst.uv_stride; */
+    unsigned char *uleft_col;    /*[16];*/
     unsigned char uleft_buf[8];
-    unsigned char utop_left;     // = uabove_row[-1];
-    unsigned char *vabove_row;   // = x->dst.v_buffer - x->dst.uv_stride;
-    unsigned char *vleft_col;    //[20];
+    unsigned char utop_left;     /* = uabove_row[-1]; */
+    unsigned char *vabove_row;   /* = x->dst.v_buffer - x->dst.uv_stride; */
+    unsigned char *vleft_col;    /*[20];*/
     unsigned char vleft_buf[8];
-    unsigned char vtop_left;     // = vabove_row[-1];
+    unsigned char vtop_left;     /* = vabove_row[-1]; */
     unsigned char *upred_ptr = &x->predictor[256];
     unsigned char *vpred_ptr = &x->predictor[320];
     int i, j;
@@ -462,16 +463,16 @@
 void vp8mt_build_intra_predictors_mbuv_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
 {
 #if CONFIG_MULTITHREAD
-    unsigned char *uabove_row;  // = x->dst.u_buffer - x->dst.uv_stride;
-    unsigned char *uleft_col;   //[16];
+    unsigned char *uabove_row;  /* = x->dst.u_buffer - x->dst.uv_stride; */
+    unsigned char *uleft_col;   /*[16];*/
     unsigned char uleft_buf[8];
-    unsigned char utop_left;    // = uabove_row[-1];
-    unsigned char *vabove_row;  // = x->dst.v_buffer - x->dst.uv_stride;
-    unsigned char *vleft_col;   //[20];
+    unsigned char utop_left;    /* = uabove_row[-1]; */
+    unsigned char *vabove_row;  /* = x->dst.v_buffer - x->dst.uv_stride; */
+    unsigned char *vleft_col;   /*[20];*/
     unsigned char vleft_buf[8];
-    unsigned char vtop_left;    // = vabove_row[-1];
-    unsigned char *upred_ptr = x->dst.u_buffer; //&x->predictor[256];
-    unsigned char *vpred_ptr = x->dst.v_buffer; //&x->predictor[320];
+    unsigned char vtop_left;    /* = vabove_row[-1]; */
+    unsigned char *upred_ptr = x->dst.u_buffer; /*&x->predictor[256];*/
+    unsigned char *vpred_ptr = x->dst.v_buffer; /*&x->predictor[320];*/
     int uv_stride = x->dst.uv_stride;
     int i, j;
 
@@ -539,14 +540,14 @@
         }
 
 
-        //vpx_memset(upred_ptr,expected_udc,64);
-        //vpx_memset(vpred_ptr,expected_vdc,64);
+        /*vpx_memset(upred_ptr,expected_udc,64);
+        vpx_memset(vpred_ptr,expected_vdc,64);*/
         for (i = 0; i < 8; i++)
         {
             vpx_memset(upred_ptr, expected_udc, 8);
             vpx_memset(vpred_ptr, expected_vdc, 8);
-            upred_ptr += uv_stride; //8;
-            vpred_ptr += uv_stride; //8;
+            upred_ptr += uv_stride; /*8;*/
+            vpred_ptr += uv_stride; /*8;*/
         }
     }
     break;
@@ -558,8 +559,8 @@
         {
             vpx_memcpy(upred_ptr, uabove_row, 8);
             vpx_memcpy(vpred_ptr, vabove_row, 8);
-            upred_ptr += uv_stride; //8;
-            vpred_ptr += uv_stride; //8;
+            upred_ptr += uv_stride; /*8;*/
+            vpred_ptr += uv_stride; /*8;*/
         }
 
     }
@@ -572,8 +573,8 @@
         {
             vpx_memset(upred_ptr, uleft_col[i], 8);
             vpx_memset(vpred_ptr, vleft_col[i], 8);
-            upred_ptr += uv_stride; //8;
-            vpred_ptr += uv_stride; //8;
+            upred_ptr += uv_stride; /*8;*/
+            vpred_ptr += uv_stride; /*8;*/
         }
     }
 
@@ -605,8 +606,8 @@
                 vpred_ptr[j] = predv;
             }
 
-            upred_ptr += uv_stride; //8;
-            vpred_ptr += uv_stride; //8;
+            upred_ptr += uv_stride; /*8;*/
+            vpred_ptr += uv_stride; /*8;*/
         }
 
     }
@@ -640,13 +641,13 @@
 #if CONFIG_MULTITHREAD
     int i, r, c;
 
-    unsigned char *Above;   // = *(x->base_dst) + x->dst - x->dst_stride;
+    unsigned char *Above;   /* = *(x->base_dst) + x->dst - x->dst_stride; */
     unsigned char Left[4];
-    unsigned char top_left; // = Above[-1];
+    unsigned char top_left; /* = Above[-1]; */
 
     BLOCKD *x = &xd->block[num];
 
-    //Caution: For some b_mode, it needs 8 pixels (4 above + 4 above-right).
+    /*Caution: For some b_mode, it needs 8 pixels (4 above + 4 above-right).*/
     if (num < 4 && pbi->common.filter_level)
         Above = pbi->mt_yabove_row[mb_row] + mb_col*16 + num*4 + 32;
     else
@@ -696,7 +697,7 @@
     break;
     case B_TM_PRED:
     {
-        // prediction similar to true_motion prediction
+        /* prediction similar to true_motion prediction */
         for (r = 0; r < 4; r++)
         {
             for (c = 0; c < 4; c++)
@@ -945,12 +946,13 @@
 #endif
 }
 
-// copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
-// to the right prediction have filled in pixels to use.
+/* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
+ * to the right prediction have filled in pixels to use.
+ */
 void vp8mt_intra_prediction_down_copy(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
 {
 #if CONFIG_MULTITHREAD
-    unsigned char *above_right;   // = *(x->block[0].base_dst) + x->block[0].dst - x->block[0].dst_stride + 16;
+    unsigned char *above_right;   /* = *(x->block[0].base_dst) + x->block[0].dst - x->block[0].dst_stride + 16; */
     unsigned int *src_ptr;
     unsigned int *dst_ptr0;
     unsigned int *dst_ptr1;
@@ -962,9 +964,9 @@
         above_right = *(x->block[0].base_dst) + x->block[0].dst - x->block[0].dst_stride + 16;
 
     src_ptr = (unsigned int *)above_right;
-    //dst_ptr0 = (unsigned int *)(above_right + 4 * x->block[0].dst_stride);
-    //dst_ptr1 = (unsigned int *)(above_right + 8 * x->block[0].dst_stride);
-    //dst_ptr2 = (unsigned int *)(above_right + 12 * x->block[0].dst_stride);
+    /*dst_ptr0 = (unsigned int *)(above_right + 4 * x->block[0].dst_stride);
+    dst_ptr1 = (unsigned int *)(above_right + 8 * x->block[0].dst_stride);
+    dst_ptr2 = (unsigned int *)(above_right + 12 * x->block[0].dst_stride);*/
     dst_ptr0 = (unsigned int *)(*(x->block[0].base_dst) + x->block[0].dst + 16 + 3 * x->block[0].dst_stride);
     dst_ptr1 = (unsigned int *)(*(x->block[0].base_dst) + x->block[0].dst + 16 + 7 * x->block[0].dst_stride);
     dst_ptr2 = (unsigned int *)(*(x->block[0].base_dst) + x->block[0].dst + 16 + 11 * x->block[0].dst_stride);
--- a/vp8/decoder/reconintra_mt.h
+++ b/vp8/decoder/reconintra_mt.h
@@ -12,7 +12,7 @@
 #ifndef __INC_RECONINTRA_MT_H
 #define __INC_RECONINTRA_MT_H
 
-// reconintra functions used in multi-threaded decoder
+/* reconintra functions used in multi-threaded decoder */
 #if CONFIG_MULTITHREAD
 extern void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col);
 extern void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col);
--- a/vp8/decoder/threading.c
+++ b/vp8/decoder/threading.c
@@ -69,12 +69,12 @@
         mbd->mb_segement_abs_delta     = xd->mb_segement_abs_delta;
         vpx_memcpy(mbd->segment_feature_data, xd->segment_feature_data, sizeof(xd->segment_feature_data));
 
-        //signed char ref_lf_deltas[MAX_REF_LF_DELTAS];
+        /*signed char ref_lf_deltas[MAX_REF_LF_DELTAS];*/
         vpx_memcpy(mbd->ref_lf_deltas, xd->ref_lf_deltas, sizeof(xd->ref_lf_deltas));
-        //signed char mode_lf_deltas[MAX_MODE_LF_DELTAS];
+        /*signed char mode_lf_deltas[MAX_MODE_LF_DELTAS];*/
         vpx_memcpy(mbd->mode_lf_deltas, xd->mode_lf_deltas, sizeof(xd->mode_lf_deltas));
-        //unsigned char mode_ref_lf_delta_enabled;
-        //unsigned char mode_ref_lf_delta_update;
+        /*unsigned char mode_ref_lf_delta_enabled;
+        unsigned char mode_ref_lf_delta_update;*/
         mbd->mode_ref_lf_delta_enabled    = xd->mode_ref_lf_delta_enabled;
         mbd->mode_ref_lf_delta_update    = xd->mode_ref_lf_delta_update;
 
@@ -113,7 +113,7 @@
         eobtotal = vp8_decode_mb_tokens(pbi, xd);
     }
 
-    // Perform temporary clamping of the MV to be used for prediction
+    /* Perform temporary clamping of the MV to be used for prediction */
     if (do_clamp)
     {
         clamp_mvs(xd);
@@ -125,7 +125,7 @@
     {
         xd->mode_info_context->mbmi.dc_diff = 0;
 
-        //mt_skip_recon_mb(pbi, xd, mb_row, mb_col);
+        /*mt_skip_recon_mb(pbi, xd, mb_row, mb_col);*/
         if (xd->frame_type == KEY_FRAME  ||  xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
         {
             vp8mt_build_intra_predictors_mbuv_s(pbi, xd, mb_row, mb_col);
@@ -141,7 +141,7 @@
     if (xd->segmentation_enabled)
         mb_init_dequantizer(pbi, xd);
 
-    // do prediction
+    /* do prediction */
     if (xd->frame_type == KEY_FRAME  ||  xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
     {
         vp8mt_build_intra_predictors_mbuv(pbi, xd, mb_row, mb_col);
@@ -158,13 +158,13 @@
         vp8_build_inter_predictors_mb(xd);
     }
 
-    // dequantization and idct
+    /* dequantization and idct */
     if (xd->mode_info_context->mbmi.mode != B_PRED && xd->mode_info_context->mbmi.mode != SPLITMV)
     {
         BLOCKD *b = &xd->block[24];
         DEQUANT_INVOKE(&pbi->dequant, block)(b);
 
-        // do 2nd order transform on the dc block
+        /* do 2nd order transform on the dc block */
         if (xd->eobs[24] > 1)
         {
             IDCT_INVOKE(RTCD_VTABLE(idct), iwalsh16)(&b->dqcoeff[0], b->diff);
@@ -244,7 +244,7 @@
         if (pbi->b_multithreaded_rd == 0)
             break;
 
-        //if(WaitForSingleObject(pbi->h_event_start_decoding[ithread], INFINITE) == WAIT_OBJECT_0)
+        /*if(WaitForSingleObject(pbi->h_event_start_decoding[ithread], INFINITE) == WAIT_OBJECT_0)*/
         if (sem_wait(&pbi->h_event_start_decoding[ithread]) == 0)
         {
             if (pbi->b_multithreaded_rd == 0)
@@ -281,7 +281,7 @@
 
                     recon_yoffset = mb_row * recon_y_stride * 16;
                     recon_uvoffset = mb_row * recon_uv_stride * 8;
-                    // reset above block coeffs
+                    /* reset above block coeffs */
 
                     xd->above_context = pc->above_context;
                     xd->left_context = &mb_row_left_context;
@@ -313,17 +313,19 @@
 
                         if(pbi->common.filter_level)
                         {
-                            //update loopfilter info
+                            /*update loopfilter info*/
                             Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0;
                             filter_level = pbi->mt_baseline_filter_level[Segment];
-                            // Distance of Mb to the various image edges.
-                            // These specified to 8th pel as they are always compared to values that are in 1/8th pel units
-                            // Apply any context driven MB level adjustment
+                            /* Distance of Mb to the various image edges.
+                             * These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
+                             * Apply any context driven MB level adjustment
+                             */
                             vp8_adjust_mb_lf_value(xd, &filter_level);
                         }
 
-                        // Distance of Mb to the various image edges.
-                        // These specified to 8th pel as they are always compared to values that are in 1/8th pel units
+                        /* Distance of Mb to the various image edges.
+                         * These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
+                         */
                         xd->mb_to_left_edge = -((mb_col * 16) << 3);
                         xd->mb_to_right_edge = ((pc->mb_cols - 1 - mb_col) * 16) << 3;
 
@@ -333,7 +335,7 @@
 
                         xd->left_available = (mb_col != 0);
 
-                        // Select the appropriate reference frame for this MB
+                        /* Select the appropriate reference frame for this MB */
                         if (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME)
                             ref_fb_idx = pc->lst_fb_idx;
                         else if (xd->mode_info_context->mbmi.ref_frame == GOLDEN_FRAME)
@@ -352,13 +354,13 @@
                         {
                             if( mb_row != pc->mb_rows-1 )
                             {
-                                //Save decoded MB last row data for next-row decoding
+                                /* Save decoded MB last row data for next-row decoding */
                                 vpx_memcpy((pbi->mt_yabove_row[mb_row + 1] + 32 + mb_col*16), (xd->dst.y_buffer + 15 * recon_y_stride), 16);
                                 vpx_memcpy((pbi->mt_uabove_row[mb_row + 1] + 16 + mb_col*8), (xd->dst.u_buffer + 7 * recon_uv_stride), 8);
                                 vpx_memcpy((pbi->mt_vabove_row[mb_row + 1] + 16 + mb_col*8), (xd->dst.v_buffer + 7 * recon_uv_stride), 8);
                             }
 
-                            //save left_col for next MB decoding
+                            /* save left_col for next MB decoding */
                             if(mb_col != pc->mb_cols-1)
                             {
                                 MODE_INFO *next = xd->mode_info_context +1;
@@ -375,7 +377,7 @@
                                 }
                             }
 
-                          // loopfilter on this macroblock.
+                          /* loopfilter on this macroblock. */
                             if (filter_level)
                             {
                                 if (mb_col > 0)
@@ -384,7 +386,7 @@
                                 if (xd->mode_info_context->mbmi.dc_diff > 0)
                                     pc->lf_bv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf);
 
-                                // don't apply across umv border
+                                /* don't apply across umv border */
                                 if (mb_row > 0)
                                     pc->lf_mbh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf);
 
@@ -400,11 +402,11 @@
 
                         xd->above_context++;
 
-                        //pbi->mb_row_di[ithread].current_mb_col = mb_col;
+                        /*pbi->mb_row_di[ithread].current_mb_col = mb_col;*/
                         pbi->mt_current_mb_col[mb_row] = mb_col;
                     }
 
-                    // adjust to the next row of mbs
+                    /* adjust to the next row of mbs */
                     if (pbi->common.filter_level)
                     {
                         if(mb_row != pc->mb_rows-1)
@@ -424,15 +426,15 @@
 
                     ++xd->mode_info_context;      /* skip prediction column */
 
-                    // since we have multithread
+                    /* since we have multithread */
                     xd->mode_info_context += xd->mode_info_stride * pbi->decoding_thread_count;
                 }
             }
         }
-        //  add this to each frame
+        /*  add this to each frame */
         if ((mbrd->mb_row == pbi->common.mb_rows-1) || ((mbrd->mb_row == pbi->common.mb_rows-2) && (pbi->common.mb_rows % (pbi->decoding_thread_count+1))==1))
         {
-            //SetEvent(pbi->h_event_end_decoding);
+            /*SetEvent(pbi->h_event_end_decoding);*/
             sem_post(&pbi->h_event_end_decoding);
         }
     }
@@ -502,7 +504,7 @@
             pbi->mt_current_mb_col = NULL ;
         }
 
-        // Free above_row buffers.
+        /* Free above_row buffers. */
         if (pbi->mt_yabove_row)
         {
             for (i=0; i< mb_rows; i++)
@@ -545,7 +547,7 @@
             pbi->mt_vabove_row = NULL ;
         }
 
-        // Free left_col buffers.
+        /* Free left_col buffers. */
         if (pbi->mt_yleft_col)
         {
             for (i=0; i< mb_rows; i++)
@@ -605,7 +607,7 @@
     {
         vp8mt_de_alloc_temp_buffers(pbi, prev_mb_rows);
 
-        // our internal buffers are always multiples of 16
+        /* our internal buffers are always multiples of 16 */
         if ((width & 0xf) != 0)
             width += 16 - (width & 0xf);
 
@@ -616,10 +618,10 @@
 
         uv_width = width >>1;
 
-        // Allocate an int for each mb row.
+        /* Allocate an int for each mb row. */
         CHECK_MEM_ERROR(pbi->mt_current_mb_col, vpx_malloc(sizeof(int) * pc->mb_rows));
 
-        // Allocate memory for above_row buffers.
+        /* Allocate memory for above_row buffers. */
         CHECK_MEM_ERROR(pbi->mt_yabove_row, vpx_malloc(sizeof(unsigned char *) * pc->mb_rows));
         for (i=0; i< pc->mb_rows; i++)
             CHECK_MEM_ERROR(pbi->mt_yabove_row[i], vpx_calloc(sizeof(unsigned char) * (width + (VP8BORDERINPIXELS<<1)), 1));
@@ -632,7 +634,7 @@
         for (i=0; i< pc->mb_rows; i++)
             CHECK_MEM_ERROR(pbi->mt_vabove_row[i], vpx_calloc(sizeof(unsigned char) * (uv_width + VP8BORDERINPIXELS), 1));
 
-        // Allocate memory for left_col buffers.
+        /* Allocate memory for left_col buffers. */
         CHECK_MEM_ERROR(pbi->mt_yleft_col, vpx_malloc(sizeof(unsigned char *) * pc->mb_rows));
         for (i=0; i< pc->mb_rows; i++)
             CHECK_MEM_ERROR(pbi->mt_yleft_col[i], vpx_calloc(sizeof(unsigned char) * 16, 1));
@@ -657,7 +659,7 @@
 {
 #if CONFIG_MULTITHREAD
 
-    //shutdown MB Decoding thread;
+    /* shutdown MB Decoding thread; */
     if (pbi->b_multithreaded_rd)
     {
         int i;
@@ -664,7 +666,7 @@
 
         pbi->b_multithreaded_rd = 0;
 
-        // allow all threads to exit
+        /* allow all threads to exit */
         for (i = 0; i < pbi->allocated_decoding_thread_count; i++)
         {
             sem_post(&pbi->h_event_start_decoding[i]);
@@ -713,32 +715,32 @@
 #if CONFIG_MULTITHREAD
     VP8_COMMON *cm  = &pbi->common;
     MACROBLOCKD *mbd = &pbi->mb;
-    //YV12_BUFFER_CONFIG *post = &cm->new_frame;  //frame_to_show;
+    /*YV12_BUFFER_CONFIG *post = &cm->new_frame;*/  /*frame_to_show;*/
     loop_filter_info *lfi = cm->lf_info;
-    int frame_type = cm->frame_type;
+    FRAME_TYPE frame_type = cm->frame_type;
 
-    //int mb_row;
-    //int mb_col;
-    //int baseline_filter_level[MAX_MB_SEGMENTS];
+    /*int mb_row;
+    int mb_col;
+    int baseline_filter_level[MAX_MB_SEGMENTS];*/
     int filter_level;
     int alt_flt_enabled = mbd->segmentation_enabled;
 
     int i;
-    //unsigned char *y_ptr, *u_ptr, *v_ptr;
+    /*unsigned char *y_ptr, *u_ptr, *v_ptr;*/
 
-    // Note the baseline filter values for each segment
+    /* Note the baseline filter values for each segment */
     if (alt_flt_enabled)
     {
         for (i = 0; i < MAX_MB_SEGMENTS; i++)
         {
-            // Abs value
+            /* Abs value */
             if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA)
                 pbi->mt_baseline_filter_level[i] = mbd->segment_feature_data[MB_LVL_ALT_LF][i];
-            // Delta Value
+            /* Delta Value */
             else
             {
                 pbi->mt_baseline_filter_level[i] = default_filt_lvl + mbd->segment_feature_data[MB_LVL_ALT_LF][i];
-                pbi->mt_baseline_filter_level[i] = (pbi->mt_baseline_filter_level[i] >= 0) ? ((pbi->mt_baseline_filter_level[i] <= MAX_LOOP_FILTER) ? pbi->mt_baseline_filter_level[i] : MAX_LOOP_FILTER) : 0;  // Clamp to valid range
+                pbi->mt_baseline_filter_level[i] = (pbi->mt_baseline_filter_level[i] >= 0) ? ((pbi->mt_baseline_filter_level[i] <= MAX_LOOP_FILTER) ? pbi->mt_baseline_filter_level[i] : MAX_LOOP_FILTER) : 0;  /* Clamp to valid range */
             }
         }
     }
@@ -748,7 +750,7 @@
             pbi->mt_baseline_filter_level[i] = default_filt_lvl;
     }
 
-    // Initialize the loop filter for this frame.
+    /* Initialize the loop filter for this frame. */
     if ((cm->last_filter_type != cm->filter_type) || (cm->last_sharpness_level != cm->sharpness_level))
         vp8_init_loop_filter(cm);
     else if (frame_type != cm->last_frame_type)
@@ -779,7 +781,7 @@
 
     if(pbi->common.filter_level)
     {
-        //Set above_row buffer to 127 for decoding first MB row
+        /* Set above_row buffer to 127 for decoding first MB row */
         vpx_memset(pbi->mt_yabove_row[0] + VP8BORDERINPIXELS-1, 127, pc->yv12_fb[pc->lst_fb_idx].y_width + 5);
         vpx_memset(pbi->mt_uabove_row[0] + (VP8BORDERINPIXELS>>1)-1, 127, (pc->yv12_fb[pc->lst_fb_idx].y_width>>1) +5);
         vpx_memset(pbi->mt_vabove_row[0] + (VP8BORDERINPIXELS>>1)-1, 127, (pc->yv12_fb[pc->lst_fb_idx].y_width>>1) +5);
@@ -791,7 +793,7 @@
             vpx_memset(pbi->mt_vabove_row[i] + (VP8BORDERINPIXELS>>1)-1, (unsigned char)129, 1);
         }
 
-        //Set left_col to 129 initially
+        /* Set left_col to 129 initially */
         for (i=0; i<pc->mb_rows; i++)
         {
             vpx_memset(pbi->mt_yleft_col[i], (unsigned char)129, 16);
@@ -812,7 +814,7 @@
 
         xd->current_bc = &pbi->mbc[mb_row%num_part];
 
-        //vp8_decode_mb_row(pbi, pc, mb_row, xd);
+        /* vp8_decode_mb_row(pbi, pc, mb_row, xd); */
         {
             int i;
             int recon_yoffset, recon_uvoffset;
@@ -822,7 +824,7 @@
             int recon_y_stride = pc->yv12_fb[ref_fb_idx].y_stride;
             int recon_uv_stride = pc->yv12_fb[ref_fb_idx].uv_stride;
 
-           // volatile int *last_row_current_mb_col = NULL;
+           /* volatile int *last_row_current_mb_col = NULL; */
             if (mb_row > 0)
                 last_row_current_mb_col = &pbi->mt_current_mb_col[mb_row -1];
 
@@ -829,7 +831,7 @@
             vpx_memset(&pc->left_context, 0, sizeof(pc->left_context));
             recon_yoffset = mb_row * recon_y_stride * 16;
             recon_uvoffset = mb_row * recon_uv_stride * 8;
-            // reset above block coeffs
+            /* reset above block coeffs */
 
             xd->above_context = pc->above_context;
             xd->up_available = (mb_row != 0);
@@ -858,17 +860,19 @@
 
                 if(pbi->common.filter_level)
                 {
-                    //update loopfilter info
+                    /* update loopfilter info */
                     Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0;
                     filter_level = pbi->mt_baseline_filter_level[Segment];
-                    // Distance of Mb to the various image edges.
-                    // These specified to 8th pel as they are always compared to values that are in 1/8th pel units
-                    // Apply any context driven MB level adjustment
+                    /* Distance of Mb to the various image edges.
+                     * These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
+                     * Apply any context driven MB level adjustment
+                     */
                     vp8_adjust_mb_lf_value(xd, &filter_level);
                 }
 
-                // Distance of Mb to the various image edges.
-                // These specified to 8th pel as they are always compared to values that are in 1/8th pel units
+                /* Distance of Mb to the various image edges.
+                 * These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
+                 */
                 xd->mb_to_left_edge = -((mb_col * 16) << 3);
                 xd->mb_to_right_edge = ((pc->mb_cols - 1 - mb_col) * 16) << 3;
 
@@ -878,7 +882,7 @@
 
                 xd->left_available = (mb_col != 0);
 
-                // Select the appropriate reference frame for this MB
+                /* Select the appropriate reference frame for this MB */
                 if (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME)
                     ref_fb_idx = pc->lst_fb_idx;
                 else if (xd->mode_info_context->mbmi.ref_frame == GOLDEN_FRAME)
@@ -895,7 +899,7 @@
 
                 if (pbi->common.filter_level)
                 {
-                    //Save decoded MB last row data for next-row decoding
+                    /* Save decoded MB last row data for next-row decoding */
                     if(mb_row != pc->mb_rows-1)
                     {
                         vpx_memcpy((pbi->mt_yabove_row[mb_row +1] + 32 + mb_col*16), (xd->dst.y_buffer + 15 * recon_y_stride), 16);
@@ -903,7 +907,7 @@
                         vpx_memcpy((pbi->mt_vabove_row[mb_row +1] + 16 + mb_col*8), (xd->dst.v_buffer + 7 * recon_uv_stride), 8);
                     }
 
-                    //save left_col for next MB decoding
+                    /* save left_col for next MB decoding */
                     if(mb_col != pc->mb_cols-1)
                     {
                         MODE_INFO *next = xd->mode_info_context +1;
@@ -920,7 +924,7 @@
                         }
                     }
 
-                    // loopfilter on this macroblock.
+                    /* loopfilter on this macroblock. */
                     if (filter_level)
                     {
                         if (mb_col > 0)
@@ -929,7 +933,7 @@
                         if (xd->mode_info_context->mbmi.dc_diff > 0)
                             pc->lf_bv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf);
 
-                        // don't apply across umv border
+                        /* don't apply across umv border */
                         if (mb_row > 0)
                             pc->lf_mbh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf);
 
@@ -948,7 +952,7 @@
                 pbi->mt_current_mb_col[mb_row] = mb_col;
             }
 
-            // adjust to the next row of mbs
+            /* adjust to the next row of mbs */
             if (pbi->common.filter_level)
             {
                 if(mb_row != pc->mb_rows-1)
@@ -971,7 +975,7 @@
         xd->mode_info_context += xd->mode_info_stride * pbi->decoding_thread_count;
     }
 
-    sem_wait(&pbi->h_event_end_decoding);   // add back for each frame
+    sem_wait(&pbi->h_event_end_decoding);   /* add back for each frame */
 #else
     (void) pbi;
     (void) xd;
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -291,7 +291,7 @@
 
 
         fpfile = fopen("fpmotionmap.stt", "a");
-        fwrite(cpi->fp_motion_map, 1, cpi->common.MBs, fpfile);
+        if(fwrite(cpi->fp_motion_map, 1, cpi->common.MBs, fpfile));
         fclose(fpfile);
     }
 #endif
@@ -879,7 +879,7 @@
         else
             recon_file = fopen(filename, "ab");
 
-        fwrite(lst_yv12->buffer_alloc, lst_yv12->frame_size, 1, recon_file);
+        if(fwrite(lst_yv12->buffer_alloc, lst_yv12->frame_size, 1, recon_file));
         fclose(recon_file);
     }
 
@@ -2586,7 +2586,7 @@
         if (0)
         {
             FILE *f = fopen("Subsamle.stt", "a");
-            fprintf(f, " %8d %8d %8d %8d %12.0f %8d %8d %8d\n",  cpi->common.current_video_frame, kf_q, cpi->common.horiz_scale, cpi->common.vert_scale,  kf_group_err / cpi->frames_to_key, cpi->kf_group_bits / cpi->frames_to_key, new_height, new_width);
+            fprintf(f, " %8d %8d %8d %8d %12.0f %8d %8d %8d\n",  cpi->common.current_video_frame, kf_q, cpi->common.horiz_scale, cpi->common.vert_scale,  kf_group_err / cpi->frames_to_key, (int)(cpi->kf_group_bits / cpi->frames_to_key), new_height, new_width);
             fclose(f);
         }
 
@@ -2644,7 +2644,7 @@
                 if (0)
                 {
                     FILE *f = fopen("Subsamle.stt", "a");
-                    fprintf(f, "******** %8d %8d %8d %12.0f %8d %8d %8d\n",  kf_q, cpi->common.horiz_scale, cpi->common.vert_scale,  kf_group_err / cpi->frames_to_key, cpi->kf_group_bits / cpi->frames_to_key, new_height, new_width);
+                    fprintf(f, "******** %8d %8d %8d %12.0f %8d %8d %8d\n",  kf_q, cpi->common.horiz_scale, cpi->common.vert_scale,  kf_group_err / cpi->frames_to_key, (int)(cpi->kf_group_bits / cpi->frames_to_key), new_height, new_width);
                     fclose(f);
                 }
             }
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -41,7 +41,7 @@
     VP8_SEG_ALG_PRIV     = 256,
     VP8_SEG_MAX
 } mem_seg_id_t;
-#define NELEMENTS(x) (sizeof(x)/sizeof(x[0]))
+#define NELEMENTS(x) ((int)(sizeof(x)/sizeof(x[0])))
 
 static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t);
 
@@ -170,7 +170,7 @@
     }
 }
 
-static void *mmap_lkup(vpx_codec_alg_priv_t *ctx, int id)
+static void *mmap_lkup(vpx_codec_alg_priv_t *ctx, unsigned int id)
 {
     int i;
 
@@ -269,7 +269,7 @@
             const uint8_t *c = data + 3;
             si->is_kf = 1;
 
-            // vet via sync code
+            /* vet via sync code */
             if (c[0] != 0x9d || c[1] != 0x01 || c[2] != 0x2a)
                 res = VPX_CODEC_UNSUP_BITSTREAM;
 
@@ -276,7 +276,7 @@
             si->w = swap2(*(const unsigned short *)(c + 3)) & 0x3fff;
             si->h = swap2(*(const unsigned short *)(c + 5)) & 0x3fff;
 
-            //printf("w=%d, h=%d\n", si->w, si->h);
+            /*printf("w=%d, h=%d\n", si->w, si->h);*/
             if (!(si->h | si->w))
                 res = VPX_CODEC_UNSUP_BITSTREAM;
         }
@@ -670,7 +670,14 @@
         vp8_decode,       /* vpx_codec_decode_fn_t     decode; */
         vp8_get_frame,    /* vpx_codec_frame_get_fn_t  frame_get; */
     },
-    {NOT_IMPLEMENTED} /* encoder functions */
+    { /* encoder functions */
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED
+    }
 };
 
 /*
@@ -693,5 +700,12 @@
         vp8_decode,       /* vpx_codec_decode_fn_t     decode; */
         vp8_get_frame,    /* vpx_codec_frame_get_fn_t  frame_get; */
     },
-    {NOT_IMPLEMENTED} /* encoder functions */
+    { /* encoder functions */
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED,
+        NOT_IMPLEMENTED
+    }
 };
--- a/vpx/src/vpx_encoder.c
+++ b/vpx/src/vpx_encoder.c
@@ -303,7 +303,7 @@
 
     pkt = (const void *) * iter;
 
-    if (pkt - list->pkts < list->cnt)
+    if ((size_t)(pkt - list->pkts) < list->cnt)
         *iter = pkt + 1;
     else
         pkt = NULL;
--- a/vpx/vp8.h
+++ b/vpx/vp8.h
@@ -53,7 +53,7 @@
     VP8_NOFILTERING    = 0,
     VP8_DEBLOCK        = 1,
     VP8_DEMACROBLOCK   = 2,
-    VP8_ADDNOISE       = 4,
+    VP8_ADDNOISE       = 4
 };
 
 /*!\brief post process flags
--- a/vpx/vpx_codec.h
+++ b/vpx/vpx_codec.h
@@ -62,7 +62,7 @@
     /*!\brief Decorator indicating a function is potentially unused */
 #ifdef UNUSED
 #elif __GNUC__
-#define UNUSED __attribute__ ((unused));
+#define UNUSED __attribute__ ((unused))
 #else
 #define UNUSED
 #endif
@@ -128,7 +128,7 @@
         /*!\brief An iterator reached the end of list.
          *
          */
-        VPX_CODEC_LIST_END,
+        VPX_CODEC_LIST_END
 
     }
     vpx_codec_err_t;
--- a/vpx/vpx_decoder_compat.h
+++ b/vpx/vpx_decoder_compat.h
@@ -78,7 +78,7 @@
         /*!\brief An iterator reached the end of list.
          *
          */
-        VPX_DEC_LIST_END = VPX_CODEC_LIST_END,
+        VPX_DEC_LIST_END = VPX_CODEC_LIST_END
 
     }
     vpx_dec_err_t;
--- a/vpx/vpx_encoder.h
+++ b/vpx/vpx_encoder.h
@@ -171,7 +171,7 @@
     {
         VPX_RC_ONE_PASS,   /**< Single pass mode */
         VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */
-        VPX_RC_LAST_PASS,  /**< Final pass of multi-pass mode */
+        VPX_RC_LAST_PASS   /**< Final pass of multi-pass mode */
     };
 
 
--- a/vpx/vpx_image.h
+++ b/vpx/vpx_image.h
@@ -55,7 +55,7 @@
         VPX_IMG_FMT_YV12    = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**< planar YVU */
         VPX_IMG_FMT_I420    = VPX_IMG_FMT_PLANAR | 2,
         VPX_IMG_FMT_VPXYV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 3, /** < planar 4:2:0 format with vpx color space */
-        VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4,  /** < planar 4:2:0 format with vpx color space */
+        VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4   /** < planar 4:2:0 format with vpx color space */
     }
     vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */
 
--- a/vpx_mem/include/vpx_mem_intrnl.h
+++ b/vpx_mem/include/vpx_mem_intrnl.h
@@ -15,24 +15,24 @@
 
 #ifndef CONFIG_MEM_MANAGER
 # if defined(VXWORKS)
-#  define CONFIG_MEM_MANAGER  1 //include heap manager functionality,
-//default: enabled on vxworks
+#  define CONFIG_MEM_MANAGER  1 /*include heap manager functionality,*/
+/*default: enabled on vxworks*/
 # else
-#  define CONFIG_MEM_MANAGER  0 //include heap manager functionality
+#  define CONFIG_MEM_MANAGER  0 /*include heap manager functionality*/
 # endif
 #endif /*CONFIG_MEM_MANAGER*/
 
 #ifndef CONFIG_MEM_TRACKER
-# define CONFIG_MEM_TRACKER     1 //include xvpx_* calls in the lib
+# define CONFIG_MEM_TRACKER     1 /*include xvpx_* calls in the lib*/
 #endif
 
 #ifndef CONFIG_MEM_CHECKS
-# define CONFIG_MEM_CHECKS      0 //include some basic safety checks in
-//vpx_memcpy, _memset, and _memmove
+# define CONFIG_MEM_CHECKS      0 /*include some basic safety checks in
+vpx_memcpy, _memset, and _memmove*/
 #endif
 
 #ifndef USE_GLOBAL_FUNCTION_POINTERS
-# define USE_GLOBAL_FUNCTION_POINTERS   0  //use function pointers instead of compiled functions.
+# define USE_GLOBAL_FUNCTION_POINTERS   0  /*use function pointers instead of compiled functions.*/
 #endif
 
 #if CONFIG_MEM_TRACKER
@@ -46,9 +46,9 @@
 
 #ifndef DEFAULT_ALIGNMENT
 # if defined(VXWORKS)
-#  define DEFAULT_ALIGNMENT        32        //default addr alignment to use in
-//calls to vpx_* functions other
-//than vpx_memalign
+#  define DEFAULT_ALIGNMENT        32        /*default addr alignment to use in
+                                               calls to vpx_* functions other
+                                               than vpx_memalign*/
 # else
 #  define DEFAULT_ALIGNMENT        1
 # endif
@@ -59,24 +59,24 @@
 #endif
 
 #if CONFIG_MEM_TRACKER
-# define TRY_BOUNDS_CHECK         1         //when set to 1 pads each allocation,
-//integrity can be checked using
-//vpx_memory_tracker_check_integrity
-//or on free by defining
-//TRY_BOUNDS_CHECK_ON_FREE
+# define TRY_BOUNDS_CHECK         1        /*when set to 1 pads each allocation,
+                                             integrity can be checked using
+                                             vpx_memory_tracker_check_integrity
+                                             or on free by defining*/
+/*TRY_BOUNDS_CHECK_ON_FREE*/
 #else
 # define TRY_BOUNDS_CHECK         0
 #endif /*CONFIG_MEM_TRACKER*/
 
 #if TRY_BOUNDS_CHECK
-# define TRY_BOUNDS_CHECK_ON_FREE 0          //checks mem integrity on every
-//free, very expensive
-# define BOUNDS_CHECK_VALUE       0xdeadbeef //value stored before/after ea.
-//mem addr for bounds checking
-# define BOUNDS_CHECK_PAD_SIZE    32         //size of the padding before and
-//after ea allocation to be filled
-//with BOUNDS_CHECK_VALUE.
-//this should be a multiple of 4
+# define TRY_BOUNDS_CHECK_ON_FREE 0          /*checks mem integrity on every
+                                               free, very expensive*/
+# define BOUNDS_CHECK_VALUE       0xdeadbeef /*value stored before/after ea.
+                                               mem addr for bounds checking*/
+# define BOUNDS_CHECK_PAD_SIZE    32         /*size of the padding before and
+                                               after ea allocation to be filled
+                                               with BOUNDS_CHECK_VALUE.
+                                               this should be a multiple of 4*/
 #else
 # define BOUNDS_CHECK_VALUE       0
 # define BOUNDS_CHECK_PAD_SIZE    0
--- a/vpx_mem/vpx_mem.c
+++ b/vpx_mem/vpx_mem.c
@@ -31,7 +31,7 @@
 # include "hmm_intrnl.h"
 
 # define SHIFT_HMM_ADDR_ALIGN_UNIT 5
-# define TOTAL_MEMORY_TO_ALLOCATE  20971520 // 20 * 1024 * 1024
+# define TOTAL_MEMORY_TO_ALLOCATE  20971520 /* 20 * 1024 * 1024 */
 
 # define MM_DYNAMIC_MEMORY 1
 # if MM_DYNAMIC_MEMORY
@@ -48,7 +48,7 @@
 
 static int vpx_mm_create_heap_memory();
 static void *vpx_mm_realloc(void *memblk, size_t size);
-#endif //CONFIG_MEM_MANAGER
+#endif /*CONFIG_MEM_MANAGER*/
 
 #if USE_GLOBAL_FUNCTION_POINTERS
 struct GLOBAL_FUNC_POINTERS
@@ -75,7 +75,7 @@
 # define VPX_MEMCPY_L  memcpy
 # define VPX_MEMSET_L  memset
 # define VPX_MEMMOVE_L memmove
-#endif // USE_GLOBAL_FUNCTION_POINTERS
+#endif /* USE_GLOBAL_FUNCTION_POINTERS */
 
 unsigned int vpx_mem_get_version()
 {
@@ -130,7 +130,7 @@
     addr = hmm_alloc(&hmm_d, number_aau);
 #else
     addr = VPX_MALLOC_L(size + align - 1 + ADDRESS_STORAGE_SIZE);
-#endif //CONFIG_MEM_MANAGER
+#endif /*CONFIG_MEM_MANAGER*/
 
     if (addr)
     {
@@ -269,7 +269,7 @@
     }
 #else
     x = vpx_memalign(align, size);
-#endif //TRY_BOUNDS_CHECK
+#endif /*TRY_BOUNDS_CHECK*/
 
     g_alloc_count++;
 
@@ -332,9 +332,10 @@
     vpx_memory_tracker_check_integrity(file, line);
 #endif
 
-    //have to do this regardless of success, because
-    //the memory that does get realloc'd may change
-    //the bounds values of this block
+    /* have to do this regardless of success, because
+     * the memory that does get realloc'd may change
+     * the bounds values of this block
+     */
     vpx_memory_tracker_remove((size_t)memblk);
 
 #if TRY_BOUNDS_CHECK
@@ -364,7 +365,7 @@
     }
 #else
     x = vpx_realloc(memblk, size);
-#endif //TRY_BOUNDS_CHECK
+#endif /*TRY_BOUNDS_CHECK*/
 
     if (!memblk) ++g_alloc_count;
 
@@ -380,7 +381,7 @@
 {
 #if TRY_BOUNDS_CHECK
     unsigned char *p_bounds_address = (unsigned char *)p_address;
-    //p_bounds_address -= BOUNDS_CHECK_PAD_SIZE;
+    /*p_bounds_address -= BOUNDS_CHECK_PAD_SIZE;*/
 #endif
 
 #if !TRY_BOUNDS_CHECK_ON_FREE
@@ -394,8 +395,9 @@
         vpx_memory_tracker_check_integrity(file, line);
 #endif
 
-        //if the addr isn't found in the list, assume it was allocated via
-        //vpx_ calls not xvpx_, therefore it does not contain any padding
+        /* if the addr isn't found in the list, assume it was allocated via
+         * vpx_ calls not xvpx_, therefore it does not contain any padding
+         */
         if (vpx_memory_tracker_remove((size_t)p_address) == -2)
         {
             p_bounds_address = p_address;
@@ -421,7 +423,7 @@
 
 #if CONFIG_MEM_CHECKS
 #if defined(VXWORKS)
-#include <task_lib.h> //for task_delay()
+#include <task_lib.h> /*for task_delay()*/
 /* This function is only used to get a stack trace of the player
 object so we can se where we are having a problem. */
 static int get_my_tt(int task)
@@ -627,7 +629,7 @@
 
     return p_ret;
 }
-#endif //CONFIG_MEM_MANAGER
+#endif /*CONFIG_MEM_MANAGER*/
 
 #if USE_GLOBAL_FUNCTION_POINTERS
 # if CONFIG_MEM_TRACKER
@@ -639,7 +641,7 @@
         , g_memset_func g_memset_l
         , g_memmove_func g_memmove_l);
 # endif
-#endif //USE_GLOBAL_FUNCTION_POINTERS
+#endif /*USE_GLOBAL_FUNCTION_POINTERS*/
 int vpx_mem_set_functions(g_malloc_func g_malloc_l
                           , g_calloc_func g_calloc_l
                           , g_realloc_func g_realloc_l
--- a/vpx_mem/vpx_mem.h
+++ b/vpx_mem/vpx_mem.h
@@ -26,15 +26,15 @@
 /* end - vpx_mem version info */
 
 #ifndef VPX_TRACK_MEM_USAGE
-# define VPX_TRACK_MEM_USAGE       0  //enable memory tracking/integrity checks
+# define VPX_TRACK_MEM_USAGE       0  /* enable memory tracking/integrity checks */
 #endif
 #ifndef VPX_CHECK_MEM_FUNCTIONS
-# define VPX_CHECK_MEM_FUNCTIONS   0  //enable basic safety checks in _memcpy,
-//_memset, and _memmove
+# define VPX_CHECK_MEM_FUNCTIONS   0  /* enable basic safety checks in _memcpy,
+                                         _memset, and _memmove */
 #endif
 #ifndef REPLACE_BUILTIN_FUNCTIONS
-# define REPLACE_BUILTIN_FUNCTIONS 0  //replace builtin functions with their
-//vpx_ equivalents
+# define REPLACE_BUILTIN_FUNCTIONS 0  /* replace builtin functions with their
+                                         vpx_ equivalents */
 #endif
 
 #include <stdlib.h>
@@ -74,7 +74,7 @@
     void *vpx_memset(void *dest, int val, size_t length);
     void *vpx_memmove(void *dest, const void *src, size_t count);
 
-// special memory functions
+    /* special memory functions */
     void *vpx_mem_alloc(int id, size_t size, size_t align);
     void vpx_mem_free(int id, void *mem, size_t size);
 
--- a/vpx_scale/generic/gen_scalers.c
+++ b/vpx_scale/generic/gen_scalers.c
@@ -116,7 +116,7 @@
         des [dest_pitch*2] = (unsigned char)((b * 102 + c + 128) >> 8);
         des [dest_pitch*3] = (unsigned char)((c + 102 * d + 128) >> 8);
 
-        // First line in next band
+        /* First line in next band */
         a = des [dest_pitch * 5];
         des [dest_pitch * 4] = (unsigned char)((d * 205 + 51 * a + 128) >> 8);
 
@@ -163,7 +163,7 @@
         des [dest_pitch*2] = (unsigned char)((b * 102 + c + 128) >> 8);
         des [dest_pitch*3] = (unsigned char)((c + 102 * d + 128) >> 8);
 
-        // No other line for interplation of this line, so ..
+        /* No other line for interplation of this line, so .. */
         des[dest_pitch*4] = (unsigned char) d;
 
         des++;
@@ -401,7 +401,7 @@
         des [dest_pitch*2] = (unsigned char)((b * 205 + c * 51 + 128) >> 8);
         des [dest_pitch*3] = (unsigned char)((b * 51 + c * 205 + 128) >> 8);
 
-        // First line in next band...
+        /* First line in next band... */
         a = des [dest_pitch * 5];
         des [dest_pitch * 4] = (unsigned char)((c * 154 + a * 102 + 128) >> 8);
 
@@ -446,7 +446,7 @@
         des [dest_pitch*2] = (unsigned char)((b * 205 + c * 51 + 128) >> 8);
         des [dest_pitch*3] = (unsigned char)((b * 51 + c * 205 + 128) >> 8);
 
-        // No other line for interplation of this line, so ..
+        /* No other line for interplation of this line, so .. */
         des [ dest_pitch * 4 ] = (unsigned char)(c) ;
 
         des++;
@@ -549,7 +549,7 @@
         c = des[dest_pitch*2];
         des [dest_pitch*2] = (unsigned char)((b + c + 1) >> 1);
 
-        // First line in next band...
+        /* First line in next band... */
         a = des [dest_pitch*4];
         des [dest_pitch*3] = (unsigned char)((c * 192 + a * 64 + 128) >> 8);
 
@@ -593,7 +593,7 @@
         c = des[dest_pitch*2];
         des [dest_pitch*2] = (unsigned char)((b + c + 1) >> 1);
 
-        // No other line for interplation of this line, so ..
+        /* No other line for interplation of this line, so .. */
         des [dest_pitch*3] = (unsigned char)(c);
 
         des++;
--- a/vpx_scale/generic/vpxscale.c
+++ b/vpx_scale/generic/vpxscale.c
@@ -279,9 +279,9 @@
 
     (void) source_length;
 
-    // These asserts are needed if there are boundary issues...
-    //assert ( dest_scale > source_scale );
-    //assert ( (source_length-1) * dest_scale >= (dest_length-1) * source_scale );
+    /* These asserts are needed if there are boundary issues... */
+    /*assert ( dest_scale > source_scale );*/
+    /*assert ( (source_length-1) * dest_scale >= (dest_length-1) * source_scale );*/
 
     for (i = 0; i < dest_length * dest_step; i += dest_step)
     {
@@ -334,7 +334,7 @@
 static
 void Scale2D
 (
-    //const
+    /*const*/
     unsigned char *source,
     int source_pitch,
     unsigned int source_width,
@@ -352,7 +352,7 @@
     unsigned int interlaced
 )
 {
-    //unsigned
+    /*unsigned*/
     int i, j, k;
     int bands;
     int dest_band_height;
@@ -370,7 +370,7 @@
     int ratio_scalable = 1;
     int interpolation = 0;
 
-    unsigned char *source_base; // = (unsigned char *) ((source_pitch >= 0) ? source : (source + ((source_height-1) * source_pitch)));
+    unsigned char *source_base; /* = (unsigned char *) ((source_pitch >= 0) ? source : (source + ((source_height-1) * source_pitch))); */
     unsigned char *line_src;
 
 
@@ -386,24 +386,24 @@
         source_base += offset;
     }
 
-    // find out the ratio for each direction
+    /* find out the ratio for each direction */
     switch (hratio * 10 / hscale)
     {
     case 8:
-        // 4-5 Scale in Width direction
+        /* 4-5 Scale in Width direction */
         horiz_line_scale = vp8_horizontal_line_5_4_scale;
         break;
     case 6:
-        // 3-5 Scale in Width direction
+        /* 3-5 Scale in Width direction */
         horiz_line_scale = vp8_horizontal_line_5_3_scale;
         break;
     case 5:
-        // 1-2 Scale in Width direction
+        /* 1-2 Scale in Width direction */
         horiz_line_scale = vp8_horizontal_line_2_1_scale;
         break;
     default:
-        // The ratio is not acceptable now
-        // throw("The ratio is not acceptable for now!");
+        /* The ratio is not acceptable now */
+        /* throw("The ratio is not acceptable for now!"); */
         ratio_scalable = 0;
         break;
     }
@@ -411,23 +411,23 @@
     switch (vratio * 10 / vscale)
     {
     case 8:
-        // 4-5 Scale in vertical direction
+        /* 4-5 Scale in vertical direction */
         vert_band_scale     = vp8_vertical_band_5_4_scale;
         source_band_height  = 5;
         dest_band_height    = 4;
         break;
     case 6:
-        // 3-5 Scale in vertical direction
+        /* 3-5 Scale in vertical direction */
         vert_band_scale     = vp8_vertical_band_5_3_scale;
         source_band_height  = 5;
         dest_band_height    = 3;
         break;
     case 5:
-        // 1-2 Scale in vertical direction
+        /* 1-2 Scale in vertical direction */
 
         if (interlaced)
         {
-            //if the content is interlaced, point sampling is used
+            /* if the content is interlaced, point sampling is used */
             vert_band_scale     = vp8_vertical_band_2_1_scale;
         }
         else
@@ -434,7 +434,7 @@
         {
 
             interpolation = 1;
-            //if the content is progressive, interplo
+            /* if the content is progressive, interplo */
             vert_band_scale     = vp8_vertical_band_2_1_scale_i;
 
         }
@@ -443,8 +443,8 @@
         dest_band_height    = 1;
         break;
     default:
-        // The ratio is not acceptable now
-        // throw("The ratio is not acceptable for now!");
+        /* The ratio is not acceptable now */
+        /* throw("The ratio is not acceptable for now!"); */
         ratio_scalable = 0;
         break;
     }
@@ -453,7 +453,7 @@
     {
         if (source_height == dest_height)
         {
-            // for each band of the image
+            /* for each band of the image */
             for (k = 0; k < (int)dest_height; k++)
             {
                 horiz_line_scale(source, source_width, dest, dest_width);
@@ -474,10 +474,10 @@
 
         for (k = 0; k < (int)(dest_height + dest_band_height - 1) / dest_band_height; k++)
         {
-            // scale one band horizontally
+            /* scale one band horizontally */
             for (i = 0; i < source_band_height; i++)
             {
-                // Trap case where we could read off the base of the source buffer
+                /* Trap case where we could read off the base of the source buffer */
 
                 line_src = (unsigned char *)source + i * source_pitch;
 
@@ -488,13 +488,13 @@
                                  temp_area + (i + 1)*dest_pitch, dest_width);
             }
 
-            // Vertical scaling is in place
+            /* Vertical scaling is in place */
             vert_band_scale(temp_area + dest_pitch, dest_pitch, dest, dest_pitch, dest_width);
 
             if (interpolation)
                 vpx_memcpy(temp_area, temp_area + source_band_height * dest_pitch, dest_width);
 
-            // Next band...
+            /* Next band... */
             source += (unsigned long) source_band_height  * source_pitch;
             dest   += (unsigned long) dest_band_height * dest_pitch;
         }
@@ -515,7 +515,7 @@
 
     if (source_height == dest_height)
     {
-        // for each band of the image
+        /* for each band of the image */
         for (k = 0; k < (int)dest_height; k++)
         {
             Scale1Dh(source, 1, hscale, source_width + 1, dest, 1, hratio, dest_width);
@@ -537,15 +537,15 @@
         dest_band_height   = source_band_height * vratio / vscale;
     }
 
-    // first row needs to be done so that we can stay one row ahead for vertical zoom
+    /* first row needs to be done so that we can stay one row ahead for vertical zoom */
     Scale1Dh(source, 1, hscale, source_width + 1, temp_area, 1, hratio, dest_width);
 
-    // for each band of the image
+    /* for each band of the image */
     bands = (dest_height + dest_band_height - 1) / dest_band_height;
 
     for (k = 0; k < bands; k++)
     {
-        // scale one band horizontally
+        /* scale one band horizontally */
         for (i = 1; i < source_band_height + 1; i++)
         {
             if (k * source_band_height + i < (int) source_height)
@@ -553,14 +553,14 @@
                 Scale1Dh(source + i * source_pitch, 1, hscale, source_width + 1,
                          temp_area + i * dest_pitch, 1, hratio, dest_width);
             }
-            else  //  Duplicate the last row
+            else  /*  Duplicate the last row */
             {
-                // copy temp_area row 0 over from last row in the past
+                /* copy temp_area row 0 over from last row in the past */
                 duck_memcpy(temp_area + i * dest_pitch, temp_area + (i - 1)*dest_pitch, dest_pitch);
             }
         }
 
-        // scale one band vertically
+        /* scale one band vertically */
         for (j = 0; j < (int)dest_width; j++)
         {
             Scale1Dv(&temp_area[j], dest_pitch, vscale, source_band_height + 1,
@@ -567,10 +567,10 @@
                      &dest[j], dest_pitch, vratio, dest_band_height);
         }
 
-        // copy temp_area row 0 over from last row in the past
+        /* copy temp_area row 0 over from last row in the past */
         duck_memcpy(temp_area, temp_area + source_band_height * dest_pitch, dest_pitch);
 
-        // move to the next band
+        /* move to the next band */
         source += source_band_height * source_pitch;
         dest   += dest_band_height * dest_pitch;
     }
@@ -617,7 +617,7 @@
     int dw = (hscale - 1 + src->y_width * hratio) / hscale;
     int dh = (vscale - 1 + src->y_height * vratio) / vscale;
 
-    // call our internal scaling routines!!
+    /* call our internal scaling routines!! */
     Scale2D((unsigned char *) src->y_buffer, src->y_stride, src->y_width, src->y_height,
             (unsigned char *) dst->y_buffer, dst->y_stride, dw, dh,
             temp_area, temp_height, hscale, hratio, vscale, vratio, interlaced);
@@ -696,13 +696,13 @@
     unsigned int src_band_height  = 0;
     unsigned int dest_band_height = 0;
 
-    // suggested scale factors
+    /* suggested scale factors */
     int hs = si->HScale;
     int hr = si->HRatio;
     int vs = si->VScale;
     int vr = si->VRatio;
 
-    // assume the ratios are scalable instead of should be centered
+    /* assume the ratios are scalable instead of should be centered */
     int ratio_scalable = 1;
 
     const unsigned char *source_base = ((source_pitch >= 0) ? source : (source + ((source_height - 1) * source_pitch)));
@@ -714,37 +714,37 @@
 
     (void) si;
 
-    // find out the ratio for each direction
+    /* find out the ratio for each direction */
     switch (hr * 30 / hs)
     {
     case 24:
-        // 4-5 Scale in Width direction
+        /* 4-5 Scale in Width direction */
         horiz_line_scale = vp8_horizontal_line_4_5_scale;
         break;
     case 22:
-        // 3-4 Scale in Width direction
+        /* 3-4 Scale in Width direction */
         horiz_line_scale = vp8_horizontal_line_3_4_scale;
         break;
 
     case 20:
-        // 4-5 Scale in Width direction
+        /* 4-5 Scale in Width direction */
         horiz_line_scale = vp8_horizontal_line_2_3_scale;
         break;
     case 18:
-        // 3-5 Scale in Width direction
+        /* 3-5 Scale in Width direction */
         horiz_line_scale = vp8_horizontal_line_3_5_scale;
         break;
     case 15:
-        // 1-2 Scale in Width direction
+        /* 1-2 Scale in Width direction */
         horiz_line_scale = vp8_horizontal_line_1_2_scale;
         break;
     case 30:
-        // no scale in Width direction
+        /* no scale in Width direction */
         horiz_line_scale = horizontal_line_copy;
         break;
     default:
-        // The ratio is not acceptable now
-        // throw("The ratio is not acceptable for now!");
+        /* The ratio is not acceptable now */
+        /* throw("The ratio is not acceptable for now!"); */
         ratio_scalable = 0;
         break;
     }
@@ -752,7 +752,7 @@
     switch (vr * 30 / vs)
     {
     case 24:
-        // 4-5 Scale in vertical direction
+        /* 4-5 Scale in vertical direction */
         vert_band_scale     = vp8_vertical_band_4_5_scale;
         last_vert_band_scale = vp8_last_vertical_band_4_5_scale;
         src_band_height     = 4;
@@ -759,7 +759,7 @@
         dest_band_height    = 5;
         break;
     case 22:
-        // 3-4 Scale in vertical direction
+        /* 3-4 Scale in vertical direction */
         vert_band_scale     = vp8_vertical_band_3_4_scale;
         last_vert_band_scale = vp8_last_vertical_band_3_4_scale;
         src_band_height     = 3;
@@ -766,7 +766,7 @@
         dest_band_height    = 4;
         break;
     case 20:
-        // 2-3 Scale in vertical direction
+        /* 2-3 Scale in vertical direction */
         vert_band_scale     = vp8_vertical_band_2_3_scale;
         last_vert_band_scale = vp8_last_vertical_band_2_3_scale;
         src_band_height     = 2;
@@ -773,7 +773,7 @@
         dest_band_height    = 3;
         break;
     case 18:
-        // 3-5 Scale in vertical direction
+        /* 3-5 Scale in vertical direction */
         vert_band_scale     = vp8_vertical_band_3_5_scale;
         last_vert_band_scale = vp8_last_vertical_band_3_5_scale;
         src_band_height     = 3;
@@ -780,7 +780,7 @@
         dest_band_height    = 5;
         break;
     case 15:
-        // 1-2 Scale in vertical direction
+        /* 1-2 Scale in vertical direction */
         vert_band_scale     = vp8_vertical_band_1_2_scale;
         last_vert_band_scale = vp8_last_vertical_band_1_2_scale;
         src_band_height     = 1;
@@ -787,7 +787,7 @@
         dest_band_height    = 2;
         break;
     case 30:
-        // no scale in Width direction
+        /* no scale in Width direction */
         vert_band_scale     = null_scale;
         last_vert_band_scale = null_scale;
         src_band_height     = 4;
@@ -794,8 +794,8 @@
         dest_band_height    = 4;
         break;
     default:
-        // The ratio is not acceptable now
-        // throw("The ratio is not acceptable for now!");
+        /* The ratio is not acceptable now */
+        /* throw("The ratio is not acceptable for now!"); */
         ratio_scalable = 0;
         break;
     }
@@ -805,13 +805,13 @@
 
     horiz_line_scale(source, source_width, dest, dest_width);
 
-    // except last band
+    /* except last band */
     for (k = 0; k < (dest_height + dest_band_height - 1) / dest_band_height - 1; k++)
     {
-        // scale one band horizontally
+        /* scale one band horizontally */
         for (i = 1; i < src_band_height; i++)
         {
-            // Trap case where we could read off the base of the source buffer
+            /* Trap case where we could read off the base of the source buffer */
             line_src = source + i * source_pitch;
 
             if (line_src < source_base)
@@ -821,8 +821,8 @@
                              dest + i * dest_pitch, dest_width);
         }
 
-        // first line of next band
-        // Trap case where we could read off the base of the source buffer
+        /* first line of next band */
+        /* Trap case where we could read off the base of the source buffer */
         line_src = source + src_band_height * source_pitch;
 
         if (line_src < source_base)
@@ -832,18 +832,18 @@
                          dest + dest_band_height * dest_pitch,
                          dest_width);
 
-        // Vertical scaling is in place
+        /* Vertical scaling is in place */
         vert_band_scale(dest, dest_pitch, dest_width);
 
-        // Next band...
+        /* Next band... */
         source += src_band_height  * source_pitch;
         dest   += dest_band_height * dest_pitch;
     }
 
-    // scale one band horizontally
+    /* scale one band horizontally */
     for (i = 1; i < src_band_height; i++)
     {
-        // Trap case where we could read off the base of the source buffer
+        /* Trap case where we could read off the base of the source buffer */
         line_src = source + i * source_pitch;
 
         if (line_src < source_base)
@@ -854,7 +854,7 @@
                          dest_width);
     }
 
-    // Vertical scaling is in place
+    /* Vertical scaling is in place */
     last_vert_band_scale(dest, dest_pitch, dest_width);
 
     return ratio_scalable;
@@ -885,7 +885,7 @@
     int ew;
     int eh;
 
-    // suggested scale factors
+    /* suggested scale factors */
     int hs = scale_vars->HScale;
     int hr = scale_vars->HRatio;
     int vs = scale_vars->VScale;
@@ -968,11 +968,11 @@
     unsigned char *src_data_pointer;
     unsigned char *dst_data_pointer;
 
-    // center values
+    /* center values */
     row_offset = (dst_yuv_config->y_height - src_yuv_config->y_height) / 2;
     col_offset = (dst_yuv_config->y_width - src_yuv_config->y_width) / 2;
 
-    // Y's
+    /* Y's */
     src_data_pointer = src_yuv_config->y_buffer;
     dst_data_pointer = (unsigned char *)dst_yuv_config->y_buffer + (row_offset * dst_yuv_config->y_stride) + col_offset;
 
@@ -986,7 +986,7 @@
     row_offset /= 2;
     col_offset /= 2;
 
-    // U's
+    /* U's */
     src_data_pointer = src_yuv_config->u_buffer;
     dst_data_pointer = (unsigned char *)dst_yuv_config->u_buffer + (row_offset * dst_yuv_config->uv_stride) + col_offset;
 
@@ -997,7 +997,7 @@
         src_data_pointer += src_yuv_config->uv_stride;
     }
 
-    // V's
+    /* V's */
     src_data_pointer = src_yuv_config->v_buffer;
     dst_data_pointer = (unsigned char *)dst_yuv_config->v_buffer + (row_offset * dst_yuv_config->uv_stride) + col_offset;
 
@@ -1040,8 +1040,8 @@
     int VRatio
 )
 {
-//    if ( ppi->post_processing_level )
-    //      update_umvborder ( ppi, frame_buffer );
+    /*if ( ppi->post_processing_level )
+          update_umvborder ( ppi, frame_buffer );*/
 
 
     switch (scaling_mode)
@@ -1050,12 +1050,12 @@
     case MAINTAIN_ASPECT_RATIO:
     {
         SCALE_VARS scale_vars;
-        // center values
+        /* center values */
 #if 1
         int row = (dst_yuv_config->y_height - expanded_frame_height) / 2;
         int col = (dst_yuv_config->y_width  - expanded_frame_width) / 2;
-//        int YOffset  = row * dst_yuv_config->y_width + col;
-//        int UVOffset = (row>>1) * dst_yuv_config->uv_width + (col>>1);
+        /*int YOffset  = row * dst_yuv_config->y_width + col;
+        int UVOffset = (row>>1) * dst_yuv_config->uv_width + (col>>1);*/
         int YOffset  = row * dst_yuv_config->y_stride + col;
         int UVOffset = (row >> 1) * dst_yuv_config->uv_stride + (col >> 1);
 #else
@@ -1074,7 +1074,7 @@
         scale_vars.expanded_frame_width = expanded_frame_width;
         scale_vars.expanded_frame_height = expanded_frame_height;
 
-        // perform center and scale
+        /* perform center and scale */
         any_ratio_frame_scale(&scale_vars, YOffset, UVOffset);
 
         break;
--- a/vpx_scale/generic/yv12config.c
+++ b/vpx_scale/generic/yv12config.c
@@ -45,7 +45,7 @@
 int
 vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int border)
 {
-//NOTE:
+/*NOTE:*/
 
     int yplane_size = (height + 2 * border) * (width + 2 * border);
     int uvplane_size = ((1 + height) / 2 + border) * ((1 + width) / 2 + border);
@@ -65,9 +65,10 @@
         ybf->border = border;
         ybf->frame_size = yplane_size + 2 * uvplane_size;
 
-        // Added 2 extra lines to framebuffer so that copy12x12 doesn't fail
-        // when we have a large motion vector in V on the last v block.
-        // Note : We never use these pixels anyway so this doesn't hurt.
+        /* Added 2 extra lines to framebuffer so that copy12x12 doesn't fail
+         * when we have a large motion vector in V on the last v block.
+         * Note : We never use these pixels anyway so this doesn't hurt.
+         */
         ybf->buffer_alloc = (unsigned char *) duck_memalign(32,  ybf->frame_size + (ybf->y_stride * 2) + 32, 0);
 
         if (ybf->buffer_alloc == NULL)
--- a/vpx_scale/generic/yv12extend.c
+++ b/vpx_scale/generic/yv12extend.c
@@ -40,7 +40,7 @@
     plane_height = ybf->y_height;
     plane_width = ybf->y_width;
 
-    // copy the left and right most columns out
+    /* copy the left and right most columns out */
     src_ptr1 = ybf->y_buffer;
     src_ptr2 = src_ptr1 + plane_width - 1;
     dest_ptr1 = src_ptr1 - Border;
@@ -56,7 +56,7 @@
         dest_ptr2 += plane_stride;
     }
 
-    // Now copy the top and bottom source lines into each line of the respective borders
+    /* Now copy the top and bottom source lines into each line of the respective borders */
     src_ptr1 = ybf->y_buffer - Border;
     src_ptr2 = src_ptr1 + (plane_height * plane_stride) - plane_stride;
     dest_ptr1 = src_ptr1 - (Border * plane_stride);
@@ -79,7 +79,7 @@
     plane_width = ybf->uv_width;
     Border /= 2;
 
-    // copy the left and right most columns out
+    /* copy the left and right most columns out */
     src_ptr1 = ybf->u_buffer;
     src_ptr2 = src_ptr1 + plane_width - 1;
     dest_ptr1 = src_ptr1 - Border;
@@ -95,7 +95,7 @@
         dest_ptr2 += plane_stride;
     }
 
-    // Now copy the top and bottom source lines into each line of the respective borders
+    /* Now copy the top and bottom source lines into each line of the respective borders */
     src_ptr1 = ybf->u_buffer - Border;
     src_ptr2 = src_ptr1 + (plane_height * plane_stride) - plane_stride;
     dest_ptr1 = src_ptr1 - (Border * plane_stride);
@@ -113,7 +113,7 @@
     /* V Plane */
     /***********/
 
-    // copy the left and right most columns out
+    /* copy the left and right most columns out */
     src_ptr1 = ybf->v_buffer;
     src_ptr2 = src_ptr1 + plane_width - 1;
     dest_ptr1 = src_ptr1 - Border;
@@ -129,7 +129,7 @@
         dest_ptr2 += plane_stride;
     }
 
-    // Now copy the top and bottom source lines into each line of the respective borders
+    /* Now copy the top and bottom source lines into each line of the respective borders */
     src_ptr1 = ybf->v_buffer - Border;
     src_ptr2 = src_ptr1 + (plane_height * plane_stride) - plane_stride;
     dest_ptr1 = src_ptr1 - (Border * plane_stride);
@@ -165,7 +165,7 @@
     plane_height = ybf->y_height;
     plane_width = ybf->y_width;
 
-    // copy the left and right most columns out
+    /* copy the left and right most columns out */
     src_ptr1 = ybf->y_buffer;
     src_ptr2 = src_ptr1 + plane_width - 1;
     dest_ptr1 = src_ptr1 - Border;
@@ -181,7 +181,7 @@
         dest_ptr2 += plane_stride;
     }
 
-    // Now copy the top and bottom source lines into each line of the respective borders
+    /* Now copy the top and bottom source lines into each line of the respective borders */
     src_ptr1 = ybf->y_buffer - Border;
     src_ptr2 = src_ptr1 + (plane_height * plane_stride) - plane_stride;
     dest_ptr1 = src_ptr1 - (Border * plane_stride);
--- a/vpx_scale/yv12config.h
+++ b/vpx_scale/yv12config.h
@@ -32,8 +32,8 @@
     ************************************/
     typedef enum
     {
-        REG_YUV = 0,    // Regular yuv
-        INT_YUV = 1     // The type of yuv that can be tranfer to and from RGB through integer transform
+        REG_YUV = 0,    /* Regular yuv */
+        INT_YUV = 1     /* The type of yuv that can be tranfer to and from RGB through integer transform */
               }
               YUV_TYPE;
 
@@ -42,12 +42,12 @@
         int   y_width;
         int   y_height;
         int   y_stride;
-//    int   yinternal_width;
+/*    int   yinternal_width; */
 
         int   uv_width;
         int   uv_height;
         int   uv_stride;
-//    int   uvinternal_width;
+/*    int   uvinternal_width; */
 
         unsigned char *y_buffer;
         unsigned char *u_buffer;
@@ -68,4 +68,4 @@
 #endif
 
 
-#endif //YV12_CONFIG_H
+#endif /*YV12_CONFIG_H*/
--- a/vpxdec.c
+++ b/vpxdec.c
@@ -336,7 +336,7 @@
     }
     else
     {
-        fwrite(buf, 1, len, out);
+        if(fwrite(buf, 1, len, out));
     }
 }
 
@@ -461,11 +461,13 @@
 {
     FILE *f = userdata;
 
-    fread(buffer, 1, length, f);
-    if (ferror(f))
-        return -1;
-    if (feof(f))
-        return 0;
+    if(fread(buffer, 1, length, f) < length)
+    {
+        if (ferror(f))
+            return -1;
+        if (feof(f))
+            return 0;
+    }
     return 1;
 }
 
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -213,7 +213,7 @@
 {
     if (stats->file)
     {
-        fwrite(pkt, 1, len, stats->file);
+        if(fwrite(pkt, 1, len, stats->file));
     }
     else
     {
@@ -259,10 +259,11 @@
                       y4m_input *y4m, struct detect_buffer *detect)
 {
     int plane = 0;
+    int shortread = 0;
 
     if (file_type == FILE_TYPE_Y4M)
     {
-        if (y4m_input_fetch_frame(y4m, f, img) < 0)
+        if (y4m_input_fetch_frame(y4m, f, img) < 1)
            return 0;
     }
     else
@@ -275,7 +276,7 @@
              * write_ivf_frame_header() for documentation on the frame header
              * layout.
              */
-            fread(junk, 1, IVF_FRAME_HDR_SZ, f);
+            if(fread(junk, 1, IVF_FRAME_HDR_SZ, f));
         }
 
         for (plane = 0; plane < 3; plane++)
@@ -306,11 +307,11 @@
                 if (detect->valid)
                 {
                     memcpy(ptr, detect->buf, 4);
-                    fread(ptr+4, 1, w-4, f);
+                    shortread |= fread(ptr+4, 1, w-4, f) < w-4;
                     detect->valid = 0;
                 }
                 else
-                    fread(ptr, 1, w, f);
+                    shortread |= fread(ptr, 1, w, f) < w;
 
                 ptr += img->stride[plane];
             }
@@ -317,7 +318,7 @@
         }
     }
 
-    return !feof(f);
+    return !shortread;
 }
 
 
@@ -396,7 +397,7 @@
     mem_put_le32(header + 24, frame_cnt);         /* length */
     mem_put_le32(header + 28, 0);                 /* unused */
 
-    fwrite(header, 1, 32, outfile);
+    if(fwrite(header, 1, 32, outfile));
 }
 
 
@@ -414,7 +415,7 @@
     mem_put_le32(header + 4, pts & 0xFFFFFFFF);
     mem_put_le32(header + 8, pts >> 32);
 
-    fwrite(header, 1, 12, outfile);
+    if(fwrite(header, 1, 12, outfile));
 }
 
 
@@ -462,7 +463,7 @@
 
 void Ebml_Write(EbmlGlobal *glob, const void *buffer_in, unsigned long len)
 {
-    fwrite(buffer_in, 1, len, glob->stream);
+    if(fwrite(buffer_in, 1, len, glob->stream));
 }
 
 
@@ -1329,6 +1330,7 @@
     {
         int frames_in = 0, frames_out = 0;
         unsigned long nbytes = 0;
+        size_t detect_bytes;
         struct detect_buffer detect;
 
         /* Parse certain options from the input file, if possible */
@@ -1340,10 +1342,15 @@
             return EXIT_FAILURE;
         }
 
-        fread(detect.buf, 1, 4, infile);
+        /* For RAW input sources, these bytes will applied on the first frame
+         *  in read_frame().
+         * We can always read 4 bytes because the minimum supported frame size
+         *  is 2x2.
+         */
+        detect_bytes = fread(detect.buf, 1, 4, infile);
         detect.valid = 0;
 
-        if (file_is_y4m(infile, &y4m, detect.buf))
+        if (detect_bytes == 4 && file_is_y4m(infile, &y4m, detect.buf))
         {
             if (y4m_input_open(&y4m, infile, detect.buf, 4) >= 0)
             {
@@ -1368,7 +1375,8 @@
                 return EXIT_FAILURE;
             }
         }
-        else if (file_is_ivf(infile, &fourcc, &cfg.g_w, &cfg.g_h, detect.buf))
+        else if (detect_bytes == 4 &&
+                 file_is_ivf(infile, &fourcc, &cfg.g_w, &cfg.g_h, detect.buf))
         {
             file_type = FILE_TYPE_IVF;
             switch (fourcc)
@@ -1572,7 +1580,8 @@
                     else
                     {
                         write_ivf_frame_header(outfile, pkt);
-                        fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz, outfile);
+                        if(fwrite(pkt->data.frame.buf, 1,
+                                  pkt->data.frame.sz, outfile));
                     }
                     nbytes += pkt->data.raw.sz;
                     break;
--- a/y4minput.c
+++ b/y4minput.c
@@ -877,5 +877,5 @@
   _img->planes[PLANE_Y]=_y4m->dst_buf;
   _img->planes[PLANE_U]=_y4m->dst_buf+pic_sz;
   _img->planes[PLANE_V]=_y4m->dst_buf+pic_sz+c_sz;
-  return 0;
+  return 1;
 }