Index: encoder/macroblock.c
===================================================================
--- encoder/macroblock.c	(revision 551)
+++ encoder/macroblock.c	(working copy)
@@ -603,7 +603,7 @@
     /* encode the 8x8 blocks */
     x264_mb_encode_8x8_chroma( h, !IS_INTRA( h->mb.i_type ), i_qp );
 
-    /* Calculate the Luma/Chroma patern and non_zero_count */
+    /* Calculate the Luma/Chroma pattern and non_zero_count */
     h->mb.i_cbp_luma = 0x00;
     if( h->mb.i_type == I_16x16 )
     {
@@ -640,7 +640,7 @@
         }
     }
 
-    /* Calculate the chroma patern */
+    /* Calculate the chroma pattern */
     h->mb.i_cbp_chroma = 0x00;
     for( i = 0; i < 8; i++ )
     {
Index: encoder/encoder.c
===================================================================
--- encoder/encoder.c	(revision 551)
+++ encoder/encoder.c	(working copy)
@@ -979,7 +979,7 @@
         x264_macroblock_analyse( h );
         TIMER_STOP( i_mtime_analyse );
 
-        /* encode this macrobock -> be carefull it can change the mb type to P_SKIP if needed */
+        /* encode this macrobock -> be careful it can change the mb type to P_SKIP if needed */
         TIMER_START( i_mtime_encode );
         x264_macroblock_encode( h );
         TIMER_STOP( i_mtime_encode );
@@ -1538,7 +1538,7 @@
     h->stat.i_slice_size[i_slice_type] += i_frame_size + NALU_OVERHEAD;
     h->stat.i_slice_qp[i_slice_type] += i_global_qp;
 
-    for( i = 0; i < 19; i++ )
+    for( i = 0; i < X264_MBTYPE_MAX; i++ )
         h->stat.i_mb_count[h->sh.i_type][i] += h->stat.frame.i_mb_count[i];
     for( i = 0; i < 2; i++ )
         h->stat.i_mb_count_8x8dct[i] += h->stat.frame.i_mb_count_8x8dct[i];
@@ -1613,7 +1613,7 @@
     int mb_xy;
     for( mb_xy = 0; mb_xy < h->sps->i_mb_width * h->sps->i_mb_height; mb_xy++ )
     {
-        if( h->mb.type[mb_xy] < 19 && h->mb.type[mb_xy] >= 0 )
+        if( h->mb.type[mb_xy] < X264_MBTYPE_MAX && h->mb.type[mb_xy] >= 0 )
             fprintf( stderr, "%c ", mb_chars[ h->mb.type[mb_xy] ] );
         else
             fprintf( stderr, "? " );
@@ -1827,4 +1827,3 @@
         x264_free( h->thread[i] );
     x264_free( h );
 }
-
Index: encoder/analyse.c
===================================================================
--- encoder/analyse.c	(revision 551)
+++ encoder/analyse.c	(working copy)
@@ -57,7 +57,7 @@
 
     /* Sub 4x8 */
     int       i_cost4x8[4]; /* cost per 8x8 partition */
-    x264_me_t me4x8[4][4];
+    x264_me_t me4x8[2][4];
 
     /* 16x8 */
     int       i_cost16x8;
@@ -150,7 +150,7 @@
 };
 
 /* TODO: calculate CABAC costs */
-static const int i_mb_b_cost_table[19] = {
+static const int i_mb_b_cost_table[X264_MBTYPE_MAX] = {
     9, 9, 9, 9, 0, 0, 0, 1, 3, 7, 7, 7, 3, 7, 7, 7, 5, 9, 0
 };
 static const int i_mb_b16x8_cost_table[17] = {
Index: common/macroblock.h
===================================================================
--- common/macroblock.h	(revision 551)
+++ common/macroblock.h	(working copy)
@@ -81,14 +81,14 @@
     B_8x8           = 17,
     B_SKIP          = 18,
 };
-static const int x264_mb_type_fix[19] =
+static const int x264_mb_type_fix[X264_MBTYPE_MAX] =
 {
     I_4x4, I_4x4, I_16x16, I_PCM,
     P_L0, P_8x8, P_SKIP,
     B_DIRECT, B_L0_L0, B_L0_L1, B_L0_BI, B_L1_L0, B_L1_L1,
     B_L1_BI, B_BI_L0, B_BI_L1, B_BI_BI, B_8x8, B_SKIP
 };
-static const int x264_mb_type_list0_table[19][2] =
+static const int x264_mb_type_list0_table[X264_MBTYPE_MAX][2] =
 {
     {0,0}, {0,0}, {0,0}, {0,0}, /* INTRA */
     {1,1},                  /* P_L0 */
@@ -101,7 +101,7 @@
     {0,0},                  /* B_8x8 */
     {0,0}                   /* B_SKIP */
 };
-static const int x264_mb_type_list1_table[19][2] =
+static const int x264_mb_type_list1_table[X264_MBTYPE_MAX][2] =
 {
     {0,0}, {0,0}, {0,0}, {0,0}, /* INTRA */
     {0,0},                  /* P_L0 */
Index: common/common.h
===================================================================
--- common/common.h	(revision 551)
+++ common/common.h	(working copy)
@@ -90,6 +90,7 @@
 #define X264_BFRAME_MAX 16
 #define X264_SLICE_MAX 4
 #define X264_NAL_MAX (4 + X264_SLICE_MAX)
+#define X264_MBTYPE_MAX 19
 
 /****************************************************************************
  * Includes
@@ -447,7 +448,7 @@
             /* pointer over mb of the frame to be compressed */
             uint8_t *p_fenc[3];
 
-            /* pointer over mb of the frame to be reconstrucated  */
+            /* pointer over mb of the frame to be reconstructed  */
             uint8_t *p_fdec[3];
 
             /* pointer over mb of the references */
@@ -464,13 +465,13 @@
             /* real intra4x4_pred_mode if I_4X4 or I_8X8, I_PRED_4x4_DC if mb available, -1 if not */
             int     intra4x4_pred_mode[X264_SCAN8_SIZE];
 
-            /* i_non_zero_count if availble else 0x80 */
+            /* i_non_zero_count if available else 0x80 */
             int     non_zero_count[X264_SCAN8_SIZE];
 
-            /* -1 if unused, -2 if unavaible */
+            /* -1 if unused, -2 if unavailable */
             int8_t  ref[2][X264_SCAN8_SIZE];
 
-            /* 0 if non avaible */
+            /* 0 if not available */
             int16_t mv[2][X264_SCAN8_SIZE][2];
             int16_t mvd[2][X264_SCAN8_SIZE][2];
 
@@ -519,7 +520,7 @@
             /* ? */
             int i_misc_bits;
             /* MB type counts */
-            int i_mb_count[19];
+            int i_mb_count[X264_MBTYPE_MAX];
             int i_mb_count_i;
             int i_mb_count_p;
             int i_mb_count_skip;
@@ -534,7 +535,7 @@
             int i_direct_score[2];
         } frame;
 
-        /* Cummulated stats */
+        /* Cumulated stats */
 
         /* per slice info */
         int     i_slice_count[5];
@@ -547,7 +548,7 @@
         float   f_psnr_mean_u[5];
         float   f_psnr_mean_v[5];
         /* */
-        int64_t i_mb_count[5][19];
+        int64_t i_mb_count[5][X264_MBTYPE_MAX];
         int64_t i_mb_count_8x8dct[2];
         int64_t i_mb_count_size[2][7];
         int64_t i_mb_count_ref[2][16];
