MPEG-2: Cosmetics
authorPhillip Blucas <pblucas@gmail.com>
Wed, 26 Oct 2011 00:53:01 +0000 (19:53 -0500)
committerPhillip Blucas <pblucas@gmail.com>
Wed, 26 Oct 2011 01:01:28 +0000 (20:01 -0500)
Fix file modes and remove remaining ITU-isms.

21 files changed:
Makefile [changed mode: 0755->0644]
common/bitstream.c
common/bitstream.h [changed mode: 0755->0644]
common/common.h
common/dct.c [changed mode: 0755->0644]
common/mpeg2vlc.c [changed mode: 0755->0644]
common/predict.c
common/predict.h
common/set.c
common/set.h [changed mode: 0755->0644]
encoder/analyse.c
encoder/encoder.c
encoder/macroblock.c
encoder/macroblock.h [changed mode: 0755->0644]
encoder/mpeg2vlc.c [changed mode: 0755->0644]
encoder/rdo.c [changed mode: 0755->0644]
encoder/set.c
encoder/set.h
encoder/slicetype.c
x264.c [changed mode: 0755->0644]
x264.h

old mode 100755 (executable)
new mode 100644 (file)
index 12ef751..8e4d15e 100644 (file)
@@ -56,16 +56,16 @@ void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal )
 
     if( MPEG2 )
     {
-         *dst++ = 0x00;
-         *dst++ = 0x00;
-         *dst++ = 0x01;
-         /* Write correct startcode if the structure is a slice*/
-         if( nal->i_type > 0 && nal->i_type < 0xb0 )
-             *dst++ = nal->i_type;
-         else
-             *dst++ = structure_to_start_code[nal->i_type];
-         memcpy( dst, src, nal->i_payload );
-         nal->i_payload += 4;
+        *dst++ = 0x00;
+        *dst++ = 0x00;
+        *dst++ = 0x01;
+        /* Write correct startcode if the structure is a slice*/
+        if( nal->i_type > 0 && nal->i_type < 0xb0 )
+            *dst++ = nal->i_type;
+        else
+            *dst++ = structure_to_start_code[nal->i_type];
+        memcpy( dst, src, nal->i_payload );
+        nal->i_payload += 4;
     }
     else
     {
@@ -73,9 +73,9 @@ void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal )
         {
             if( nal->b_long_startcode )
                 *dst++ = 0x00;
-             *dst++ = 0x00;
-             *dst++ = 0x00;
-             *dst++ = 0x01;
+            *dst++ = 0x00;
+            *dst++ = 0x00;
+            *dst++ = 0x01;
         }
         else /* save room for size later */
             dst += 4;
old mode 100755 (executable)
new mode 100644 (file)
index 0227b75..8322af1
@@ -67,17 +67,17 @@ extern const vlc_t x264_total_zeros_2x2_dc[3][4];
 extern const vlc_t x264_total_zeros_2x4_dc[7][8];
 extern const vlc_t x264_run_before[7][16];
 
-extern const vlc_t x262_mb_addr_inc[34];
-extern const vlc_t x262_cbp[64];
-extern const vlc_t x262_i_frame_mb_type[2];
-
-extern const vlc_t x262_i_mb_type[3][2];
-extern const vlc_t x262_p_mb_type[2][2][2];
-extern const vlc_t x262_b_mb_type[3][2][2];
-extern const vlc_large_t x262_dc_luma_code[12];
-extern const vlc_large_t x262_dc_chroma_code[12];
-extern const vlc_t x262_dmvector[3];
-extern const vlc_large_t x262_motion_code[33];
+/* MPEG-2 */
+extern const vlc_t x264_mb_addr_inc[34];
+extern const vlc_t x264_cbp[64];
+extern const vlc_t x264_i_frame_mb_type[2];
+extern const vlc_t x264_i_mb_type[3][2];
+extern const vlc_t x264_p_mb_type[2][2][2];
+extern const vlc_t x264_b_mb_type[3][2][2];
+extern const vlc_large_t x264_dc_luma_code[12];
+extern const vlc_large_t x264_dc_chroma_code[12];
+extern const vlc_t x264_dmvector[3];
+extern const vlc_large_t x264_motion_code[33];
 extern const vlc_large_t dct_vlcs[2][41][32];
 extern const uint8_t dct_vlc_largest_run[41];
 
index 8cd3c8f..034cdd9 100644 (file)
@@ -974,7 +974,7 @@ struct x264_t
     x264_predict_t      predict_8x16c[4+3];
     x264_predict_8x8_filter_t predict_8x8_filter;
 
-    x262_predict_t      predict_mpeg2_8x8;
+    x264_predict_mpeg2_t      predict_8x8_mpeg2;
 
     x264_pixel_function_t pixf;
     x264_mc_functions_t   mc;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 4bfa4f5..c93d16a
@@ -26,7 +26,7 @@
 
 #include "common.h"
 
-const vlc_t x262_mb_addr_inc[34] =
+const vlc_t x264_mb_addr_inc[34] =
 {
     { 0x1, 1 },   /* str=1 */
     { 0x3, 3 },   /* str=011 */
@@ -64,7 +64,7 @@ const vlc_t x262_mb_addr_inc[34] =
     { 0x8, 11 },  /* escape */
 };
 
-const vlc_t x262_cbp[64] =
+const vlc_t x264_cbp[64] =
 {
     { 0x1, 9 },  /* str=000000001 */
     { 0xb, 5 },  /* str=01011 */
@@ -133,7 +133,7 @@ const vlc_t x262_cbp[64] =
 };
 
 /* [frame_type][quant] */
-const vlc_t x262_i_mb_type[3][2] =
+const vlc_t x264_i_mb_type[3][2] =
 {
     {
         { 0x3, 5 }, /* str=00011 */
@@ -150,7 +150,7 @@ const vlc_t x262_i_mb_type[3][2] =
 };
 
 /* [mc][coded][quant] */
-const vlc_t x262_p_mb_type[2][2][2] =
+const vlc_t x264_p_mb_type[2][2][2] =
 {
     {
         {},
@@ -171,7 +171,7 @@ const vlc_t x262_p_mb_type[2][2][2] =
 };
 
 /* [fwd/bwd/interp][coded][quant] */
-const vlc_t x262_b_mb_type[3][2][2] =
+const vlc_t x264_b_mb_type[3][2][2] =
 {
     {
         {
@@ -203,7 +203,7 @@ const vlc_t x262_b_mb_type[3][2][2] =
 };
 
 /* [code] */
-const vlc_large_t x262_dc_luma_code[12] =
+const vlc_large_t x264_dc_luma_code[12] =
 {
     { 0x4, 3 }, /* str=100 */
     { 0x0, 2 }, /* str=00 */
@@ -220,7 +220,7 @@ const vlc_large_t x262_dc_luma_code[12] =
 };
 
 /* [code] */
-const vlc_large_t x262_dc_chroma_code[12] =
+const vlc_large_t x264_dc_chroma_code[12] =
 {
     { 0x0, 2 }, /* str=00 */
     { 0x1, 2 }, /* str=01 */
@@ -237,7 +237,7 @@ const vlc_large_t x262_dc_chroma_code[12] =
 };
 
 /* [motion_code+16] */
-const vlc_large_t x262_motion_code[33] =
+const vlc_large_t x264_motion_code[33] =
 {
     { 0x19, 11 }, /* str=00000011001 */
     { 0x1b, 11 }, /* str=00000011011 */
@@ -275,7 +275,7 @@ const vlc_large_t x262_motion_code[33] =
 };
 
 /* [dmvector+1] */
-const vlc_t x262_dmvector[3] =
+const vlc_t x264_dmvector[3] =
 {
     { 0x3, 2 }, /* str=11 */
     { 0x0, 1 }, /* str=0 */
index 435370b..14abf67 100644 (file)
@@ -150,6 +150,7 @@ void x264_predict_16x16_p_c( pixel *src )
     }
 }
 
+
 /****************************************************************************
  * 8x8 prediction for intra chroma block (4:2:0)
  ****************************************************************************/
@@ -874,9 +875,9 @@ static void x264_predict_8x8_hu_c( pixel *src, pixel edge[36] )
 }
 
 /****************************************************************************
- * MPEG-2 Intra Prediction:
+ * MPEG-2 Prediction:
  ****************************************************************************/
-void x262_predict_8x8_c( pixel *src, int predicted_dc )
+void x264_predict_8x8_mpeg2_c( pixel *src, int predicted_dc )
 {
     for( int y = 0; y < 8; y++ )
     {
@@ -886,6 +887,18 @@ void x262_predict_8x8_c( pixel *src, int predicted_dc )
     }
 }
 
+void x264_reset_intra_dc_mpeg2( x264_t *h )
+{
+    int dc_predictor = 1<<(h->param.i_intra_dc_precision+7);
+    for( int i = 0; i < 8; i++ )
+        h->mb.i_intra_dc_predictor[i] = dc_predictor;
+}
+
+void x264_reset_mv_predictor_mpeg2( x264_t *h )
+{
+    memset( h->mb.mvp, 0, sizeof(h->mb.mvp) );
+}
+
 /****************************************************************************
  * Exported functions:
  ****************************************************************************/
@@ -1001,19 +1014,7 @@ void x264_predict_4x4_init( int cpu, x264_predict_t pf[12] )
 #endif
 }
 
-void x262_predict_8x8_init ( int cpu, x262_predict_t *pf )
+void x264_predict_8x8_mpeg2_init( int cpu, x264_predict_mpeg2_t *pf )
 {
-    pf[0] = x262_predict_8x8_c;
-}
-
-void x262_reset_intra_dc_predictor( x264_t *h )
-{
-    int dc_predictor = 1<<(h->param.i_intra_dc_precision+7);
-    for( int i = 0; i < 8; i++ )
-        h->mb.i_intra_dc_predictor[i] = dc_predictor;
-}
-
-void x262_reset_mv_predictor( x264_t *h )
-{
-    memset( h->mb.mvp, 0, sizeof(h->mb.mvp) );
+    pf[0] = x264_predict_8x8_mpeg2_c;
 }
index db6aa88..fb59c5a 100644 (file)
@@ -30,7 +30,7 @@
 typedef void (*x264_predict_t)( pixel *src );
 typedef void (*x264_predict8x8_t)( pixel *src, pixel edge[36] );
 typedef void (*x264_predict_8x8_filter_t) ( pixel *src, pixel edge[36], int i_neighbor, int i_filters );
-typedef void (*x262_predict_t)( pixel* src, int predicted_dc );
+typedef void (*x264_predict_mpeg2_t)( pixel* src, int predicted_dc );
 
 enum intra_chroma_pred_e
 {
@@ -135,8 +135,9 @@ void x264_predict_8x16c_init ( int cpu, x264_predict_t pf[7] );
 void x264_predict_4x4_init   ( int cpu, x264_predict_t pf[12] );
 void x264_predict_8x8_init   ( int cpu, x264_predict8x8_t pf[12], x264_predict_8x8_filter_t *predict_filter );
 
-void x262_predict_8x8_init ( int cpu, x262_predict_t *pf );
-void x262_reset_intra_dc_predictor( x264_t *h );
-void x262_reset_mv_predictor( x264_t *h );
+/* MPEG-2 */
+void x264_predict_8x8_mpeg2_init( int cpu, x264_predict_mpeg2_t *pf );
+void x264_reset_intra_dc_mpeg2( x264_t *h );
+void x264_reset_mv_predictor_mpeg2( x264_t *h );
 
 #endif
index da5be73..f8733b4 100644 (file)
@@ -71,23 +71,24 @@ static const uint16_t quant8_scale[6][6] =
     {  7282,  6428, 11570,  6830,  9118,  8640 }
 };
 
-static const uint8_t x262_qscale_linear[32] =
+/* MPEG-2 */
+static const uint8_t qscale_linear_mpeg2[32] =
 {
       0,   2,   4,   6,   8,  10,  12,  14,
      16,  18,  20,  22,  24,  26,  28,  30,
      32,  34,  36,  38,  40,  42,  44,  46,
      48,  50,  52,  54,  56,  58,  60,  62
 };
-static const uint8_t x262_qscale_nonlinear[32] =
+static const uint8_t qscale_nonlinear_mpeg2[32] =
 {
       0,   1,   2,   3,   4,   5,   6,   7,
       8,  10,  12,  14,  16,  18,  20,  22,
      24,  28,  32,  36,  40,  44,  48,  52,
      56,  64,  72,  80,  88,  96, 104, 112
 };
-static const uint8_t * x262_qscale[2] =
+static const uint8_t * x264_qscale_mpeg2[2] =
 {
-    x262_qscale_linear, x262_qscale_nonlinear
+    qscale_linear_mpeg2, qscale_nonlinear_mpeg2
 };
 
 int x264_cqm_init( x264_t *h )
@@ -274,9 +275,9 @@ fail:
     return -1;
 }
 
-int x262_cqm_init( x264_t *h )
+int x264_cqm_init_mpeg2( x264_t *h )
 {
-    const uint8_t *qscale = x262_qscale[h->param.b_nonlinear_quant];
+    const uint8_t *qscale = x264_qscale_mpeg2[h->param.b_nonlinear_quant];
 
     for( int i = 0; i < 2; i++ )
     {
old mode 100755 (executable)
new mode 100644 (file)
index 0becb0b..1f2eac2
@@ -254,7 +254,7 @@ static const uint8_t * const x264_cqm_jvt[8] =
 };
 
 /* matrix is transposed */
-static const uint8_t x262_cqm_intra[64] =
+static const uint8_t x264_cqm_intra_mpeg2[64] =
 {
      8,16,19,22,22,26,26,27,
     16,16,22,22,26,27,27,29,
@@ -267,7 +267,7 @@ static const uint8_t x262_cqm_intra[64] =
 };
 
 int  x264_cqm_init( x264_t *h );
-int  x262_cqm_init( x264_t *h );
+int  x264_cqm_init_mpeg2( x264_t *h );
 void x264_cqm_delete( x264_t *h );
 int  x264_cqm_parse_file( x264_t *h, const char *filename );
 
@@ -276,6 +276,6 @@ typedef struct
     int fps_code;
     int fps_num;
     int fps_den;
-} x262_fps_t;
+} x264_fps_mpeg2_t;
 
 #endif
index 0282d50..d3bdaa6 100644 (file)
@@ -170,7 +170,7 @@ const int x264_lambda2_tab[QP_MAX_MAX+1] =
 };
 
 /* lambda = pow(2,qp/8+1) */
-const uint16_t x262_lambda_tab_exp[QP_MAX_MAX+1] = {
+const uint16_t x264_lambda_tab_exp_mpeg2[QP_MAX_MAX+1] = {
     0,    2,    2,    3,    3,    3,    3,    4, /*  0- 7 */
     4,    4,    5,    5,    6,    6,    7,    7, /*  8-15 */
     8,    9,   10,   10,   11,   12,   13,   15, /* 16-23 */
@@ -185,7 +185,7 @@ const uint16_t x262_lambda_tab_exp[QP_MAX_MAX+1] = {
 };
 
 /* lambda2 = pow(lambda,2) * .9 * 256 */
-const int x262_lambda2_tab_exp[QP_MAX_MAX+1] = {
+const int x264_lambda2_tab_exp_mpeg2[QP_MAX_MAX+1] = {
         0,     1095,     1303,     1549,     1843,     2191,    2606,    3099, /*  0- 7 */
      3686,     4383,     5213,     6199,     7372,     8767,   10426,   12399, /*  8-15 */
     14745,    17535,    20853,    24799,    29491,    35071,   41706,   49598, /* 16-23 */
@@ -200,7 +200,7 @@ const int x262_lambda2_tab_exp[QP_MAX_MAX+1] = {
 };
 
 /* lambda = qp/2+2 */
-const uint16_t x262_lambda_tab_lin[QP_MAX_MAX+1] = {
+const uint16_t x264_lambda_tab_lin_mpeg2[QP_MAX_MAX+1] = {
   0,   3,   3,   4,   4,   5,   5,   6, /*  0- 7 */
   6,   7,   7,   8,   8,   9,   9,  10, /*  8-15 */
  10,  11,  11,  12,  12,  13,  13,  14, /* 16-23 */
@@ -215,7 +215,7 @@ const uint16_t x262_lambda_tab_lin[QP_MAX_MAX+1] = {
 };
 
 /* lambda2 = pow(lambda,2) * .9 * 256 */
-const int x262_lambda2_tab_lin[QP_MAX_MAX+1] = {
+const int x264_lambda2_tab_lin_mpeg2[QP_MAX_MAX+1] = {
       0,   1440,   2073,   2822,   3686,   4665,   5760,   6969, /*  0- 7 */
    8294,   9734,  11289,  12960,  14745,  16646,  18662,  20793, /*  8-15 */
   23040,  25401,  27878,  30470,  33177,  36000,  38937,  41990, /* 16-23 */
@@ -353,7 +353,8 @@ int x264_analyse_init_costs( x264_t *h, float *logs, int qp )
 {
     const uint16_t *lambda_tab;
     if( MPEG2 )
-        lambda_tab = h->param.b_nonlinear_quant ? x262_lambda_tab_exp : x262_lambda_tab_lin;
+        lambda_tab = h->param.b_nonlinear_quant ? x264_lambda_tab_exp_mpeg2 :
+                                                  x264_lambda_tab_lin_mpeg2;
     else
         lambda_tab = x264_lambda_tab;
     int lambda = lambda_tab[qp];
@@ -453,12 +454,14 @@ static void x264_mb_analyse_init_qp( x264_t *h, x264_mb_analysis_t *a, int qp )
     const int *lambda2_tab;
     if( MPEG2 )
     {
-        lambda_tab = h->param.b_nonlinear_quant ? x262_lambda_tab_exp : x262_lambda_tab_lin;
-        lambda2_tab = h->param.b_nonlinear_quant ? x262_lambda2_tab_exp : x262_lambda2_tab_lin;
+        lambda_tab  = h->param.b_nonlinear_quant ? x264_lambda_tab_exp_mpeg2 :
+                                                   x264_lambda_tab_lin_mpeg2;
+        lambda2_tab = h->param.b_nonlinear_quant ? x264_lambda2_tab_exp_mpeg2 :
+                                                   x264_lambda2_tab_lin_mpeg2;
     }
     else
     {
-        lambda_tab = x264_lambda_tab;
+        lambda_tab  = x264_lambda_tab;
         lambda2_tab = x264_lambda2_tab;
     }
 
@@ -783,14 +786,14 @@ static void x264_mb_analyse_intra_chroma( x264_t *h, x264_mb_analysis_t *a )
 
     if( MPEG2 )
     {
-        h->predict_mpeg2_8x8( h->mb.pic.p_fdec[1], 0 );
-        h->predict_mpeg2_8x8( h->mb.pic.p_fdec[2], 0 );
+        h->predict_8x8_mpeg2( h->mb.pic.p_fdec[1], 0 );
+        h->predict_8x8_mpeg2( h->mb.pic.p_fdec[2], 0 );
         a->i_satd_chroma = h->pixf.mbcmp[PIXEL_8x8]( h->mb.pic.p_fdec[1], FDEC_STRIDE, h->mb.pic.p_fenc[1], FENC_STRIDE ) +
                            h->pixf.mbcmp[PIXEL_8x8]( h->mb.pic.p_fdec[2], FDEC_STRIDE, h->mb.pic.p_fenc[2], FENC_STRIDE );
         if( CHROMA_FORMAT == CHROMA_422 )
         {
-            h->predict_mpeg2_8x8( &h->mb.pic.p_fdec[1][8*FDEC_STRIDE], 0 );
-            h->predict_mpeg2_8x8( &h->mb.pic.p_fdec[2][8*FDEC_STRIDE], 0 );
+            h->predict_8x8_mpeg2( &h->mb.pic.p_fdec[1][8*FDEC_STRIDE], 0 );
+            h->predict_8x8_mpeg2( &h->mb.pic.p_fdec[2][8*FDEC_STRIDE], 0 );
             a->i_satd_chroma += h->pixf.mbcmp[PIXEL_8x8]( &h->mb.pic.p_fdec[1][8*FDEC_STRIDE], FDEC_STRIDE, &h->mb.pic.p_fenc[1][8*FDEC_STRIDE], FENC_STRIDE ) +
                                 h->pixf.mbcmp[PIXEL_8x8]( &h->mb.pic.p_fdec[2][8*FDEC_STRIDE], FDEC_STRIDE, &h->mb.pic.p_fenc[2][8*FDEC_STRIDE], FENC_STRIDE );
         }
@@ -901,7 +904,7 @@ static void x264_mb_analyse_intra( x264_t *h, x264_mb_analysis_t *a, int i_satd_
         {
             p_src = &h->mb.pic.p_fenc[0][8 * (i&1) + 8 * (i>>1) * FENC_STRIDE];
             p_dst = &h->mb.pic.p_fdec[0][8 * (i&1) + 8 * (i>>1) * FDEC_STRIDE];
-            h->predict_mpeg2_8x8( p_dst, 0 );
+            h->predict_8x8_mpeg2( p_dst, 0 );
             i_satd += h->pixf.mbcmp[PIXEL_8x8]( p_dst, FDEC_STRIDE, p_src, FENC_STRIDE );
         }
 
index f337b6c..d5e2452 100644 (file)
@@ -329,7 +329,7 @@ static void x264_slice_header_write( bs_t *s, x264_slice_header_t *sh, int i_nal
     }
 }
 
-static void x262_slice_header_write( x264_t *h, bs_t *s, int i_mb_y )
+static void x264_slice_header_write_mpeg2( x264_t *h, bs_t *s, int i_mb_y )
 {
     if( h->param.i_height > 2800 )
        bs_write( s, 3, 0 ); // FIXME
@@ -872,7 +872,7 @@ static int x264_validate_parameters( x264_t *h, int b_open )
 
     {
         const x264_level_t *l = x264_levels;
-        const x262_level_t *m = x262_levels;
+        const x264_level_mpeg2_t *m = x264_levels_mpeg2;
 
         if( h->param.i_level_idc < 0 )
         {
@@ -950,7 +950,7 @@ static int x264_validate_parameters( x264_t *h, int b_open )
 
         x264_reduce_fraction( &h->param.i_fps_num, &h->param.i_fps_den );
 
-        const x262_fps_t *f = x262_allowed_fps;
+        const x264_fps_mpeg2_t *f = x264_allowed_fps_mpeg2;
         if( !h->param.i_frame_rate_code )
         {
             while( f->fps_code != 0 && ( h->param.i_fps_num != f->fps_num || h->param.i_fps_den != f->fps_den ) )
@@ -1261,7 +1261,7 @@ x264_t *x264_encoder_open( x264_param_t *param )
 
     if( MPEG2 )
     {
-        if( x262_cqm_init( h ) < 0 )
+        if( x264_cqm_init_mpeg2( h ) < 0 )
             goto fail;
     }
     else
@@ -1333,7 +1333,7 @@ x264_t *x264_encoder_open( x264_param_t *param )
     x264_predict_8x16c_init( h->param.cpu, h->predict_8x16c );
     x264_predict_8x8_init( h->param.cpu, h->predict_8x8, &h->predict_8x8_filter );
     x264_predict_4x4_init( h->param.cpu, h->predict_4x4 );
-    x262_predict_8x8_init( h->param.cpu, &h->predict_mpeg2_8x8 );
+    x264_predict_8x8_mpeg2_init( h->param.cpu, &h->predict_8x8_mpeg2 );
     if( h->param.b_cabac )
         x264_cabac_init( h );
     else
@@ -2326,12 +2326,12 @@ static int x264_slice_write( x264_t *h )
             x264_fdec_filter_row( h, i_mb_y, 1 );
 
         if( MPEG2 && ( i_skip || i_mb_x == 0 || !IS_INTRA( h->mb.i_type ) ) )
-            x262_reset_intra_dc_predictor( h );
+            x264_reset_intra_dc_mpeg2( h );
 
         if( MPEG2 && i_mb_x == 0 )
         {
             i_skip = 0;
-            x262_reset_mv_predictor( h );
+            x264_reset_mv_predictor_mpeg2( h );
         }
 
         if( PARAM_INTERLACED )
@@ -2361,7 +2361,7 @@ static int x264_slice_write( x264_t *h )
         if( MPEG2 && i_mb_x == 0 )
         {
             x264_nal_start( h, (i_mb_y % 175) + 1, h->i_nal_ref_idc );
-            x262_slice_header_write( h, &h->out.bs, i_mb_y );
+            x264_slice_header_write_mpeg2( h, &h->out.bs, i_mb_y );
         }
 
         /* encode this macroblock -> be careful it can change the mb type to P_SKIP if needed */
@@ -2389,19 +2389,19 @@ reencode:
             {
                 i_skip++;
                 if( h->mb.i_type != B_SKIP )
-                    x262_reset_mv_predictor( h );
+                    x264_reset_mv_predictor_mpeg2( h );
             }
             else
             {
                 while( i_skip > 32 )
                 {
-                    bs_write_vlc( &h->out.bs, x262_mb_addr_inc[33] ); // macroblock_escape
+                    bs_write_vlc( &h->out.bs, x264_mb_addr_inc[33] ); // macroblock_escape
                     i_skip -= 33;
                 }
-                bs_write_vlc( &h->out.bs, x262_mb_addr_inc[i_skip] ); // macroblock_address_increment
+                bs_write_vlc( &h->out.bs, x264_mb_addr_inc[i_skip] ); // macroblock_address_increment
                 i_skip = 0;
 
-                x262_macroblock_write_vlc( h );
+                x264_macroblock_write_vlc_mpeg2( h );
            }
 #undef bs_write_vlc
         }
@@ -3152,14 +3152,14 @@ int     x264_encoder_encode( x264_t *h,
         {
             /* generate sequence header */
             x264_nal_start( h, MPEG2_SEQ_HEADER, NAL_PRIORITY_HIGHEST );
-            x262_seq_header_write( h, &h->out.bs );
+            x264_seq_header_write_mpeg2( h, &h->out.bs );
             if( x264_nal_end( h ) )
                 return -1;
             overhead += h->out.nal[h->out.i_nal-1].i_payload + STRUCTURE_OVERHEAD;
 
             /* generate sequence extension */
             x264_nal_start( h, MPEG2_SEQ_EXT, NAL_PRIORITY_HIGHEST );
-            x262_seq_extension_write( h, &h->out.bs );
+            x264_seq_extension_write_mpeg2( h, &h->out.bs );
             if( x264_nal_end( h ) )
                 return -1;
             overhead += h->out.nal[h->out.i_nal-1].i_payload + STRUCTURE_OVERHEAD;
@@ -3170,7 +3170,7 @@ int     x264_encoder_encode( x264_t *h,
                 h->param.crop_rect.i_top || h->param.crop_rect.i_bottom )
             {
                 x264_nal_start( h, MPEG2_SEQ_DISPLAY_EXT, NAL_PRIORITY_HIGHEST );
-                x262_seq_disp_extension_write( h, &h->out.bs );
+                x264_seq_disp_extension_write_mpeg2( h, &h->out.bs );
                 if( x264_nal_end( h ) )
                     return -1;
                 overhead += h->out.nal[h->out.i_nal-1].i_payload + STRUCTURE_OVERHEAD;
@@ -3189,7 +3189,7 @@ int     x264_encoder_encode( x264_t *h,
 
             /* generate gop header */
             x264_nal_start( h, MPEG2_GOP_HEADER, NAL_PRIORITY_HIGHEST );
-            x262_gop_header_write( h, &h->out.bs );
+            x264_gop_header_write_mpeg2( h, &h->out.bs );
             if( x264_nal_end( h ) )
                 return -1;
             overhead += h->out.nal[h->out.i_nal-1].i_payload + STRUCTURE_OVERHEAD;
@@ -3197,14 +3197,14 @@ int     x264_encoder_encode( x264_t *h,
 
         /* generate picture header */
         x264_nal_start( h, MPEG2_PICTURE_HEADER, NAL_PRIORITY_HIGHEST );
-        x262_pic_header_write( h, &h->out.bs );
+        x264_pic_header_write_mpeg2( h, &h->out.bs );
         if( x264_nal_end( h ) )
             return -1;
         overhead += h->out.nal[h->out.i_nal-1].i_payload + STRUCTURE_OVERHEAD;
 
         /* generate picture coding extension */
         x264_nal_start( h, MPEG2_PICTURE_CODING_EXT, NAL_PRIORITY_HIGHEST );
-        x262_pic_coding_extension_write( h, &h->out.bs );
+        x264_pic_coding_extension_write_mpeg2( h, &h->out.bs );
         if( x264_nal_end( h ) )
             return -1;
         overhead += h->out.nal[h->out.i_nal-1].i_payload + STRUCTURE_OVERHEAD;
@@ -3214,7 +3214,7 @@ int     x264_encoder_encode( x264_t *h,
             h->param.crop_rect.i_top || h->param.crop_rect.i_bottom )
         {
             x264_nal_start( h, MPEG2_PICTURE_DISPLAY_EXT, NAL_PRIORITY_HIGHEST );
-            x262_pic_display_extension_write( h, &h->out.bs );
+            x264_pic_display_extension_write_mpeg2( h, &h->out.bs );
             if( x264_nal_end( h ) )
                 return -1;
             overhead += h->out.nal[h->out.i_nal-1].i_payload + STRUCTURE_OVERHEAD;
@@ -3257,7 +3257,7 @@ int     x264_encoder_encode( x264_t *h,
     {
         x264_nal_start( h, MPEG2 ? MPEG2_USER_DATA : NAL_SEI, NAL_PRIORITY_DISPOSABLE );
         if( MPEG2 )
-            x262_user_data_write( &h->out.bs, h->fenc->extra_sei.payloads[i].payload, h->fenc->extra_sei.payloads[i].payload_size );
+            x264_user_data_write_mpeg2( &h->out.bs, h->fenc->extra_sei.payloads[i].payload, h->fenc->extra_sei.payloads[i].payload_size );
         else
             x264_sei_write( &h->out.bs, h->fenc->extra_sei.payloads[i].payload, h->fenc->extra_sei.payloads[i].payload_size,
                             h->fenc->extra_sei.payloads[i].payload_type );
index 9e10c40..08a02fa 100644 (file)
@@ -219,7 +219,7 @@ static void x264_mb_encode_i16x16( x264_t *h, int p, int i_qp )
 
 }
 
-static void x262_mb_encode_intra_block( x264_t *h, int idx, int i_qp )
+static void x264_mb_encode_intra_block_mpeg2( x264_t *h, int idx, int i_qp )
 {
     pixel *p_src;
     pixel *p_dst;
@@ -286,7 +286,7 @@ static void x262_mb_encode_intra_block( x264_t *h, int idx, int i_qp )
     h->mb.i_intra_dc_predictor[idx] = dcb;
 }
 
-static void x262_mb_encode_inter_block( x264_t *h, int idx, int i_qp )
+static void x264_mb_encode_inter_block_mpeg2( x264_t *h, int idx, int i_qp )
 {
     pixel *p_src;
     pixel *p_dst;
@@ -588,7 +588,7 @@ static void x264_macroblock_encode_skip( x264_t *h )
     h->mb.i_cbp_chroma = 0;
     h->mb.i_cbp_chroma422 = 0;
     h->mb.cbp[h->mb.i_mb_xy] = 0;
-    x262_reset_mv_predictor( h );
+    x264_reset_mv_predictor_mpeg2( h );
 }
 
 /*****************************************************************************
@@ -780,19 +780,19 @@ static ALWAYS_INLINE void x264_macroblock_encode_internal( x264_t *h, int plane_
             for( int i = 0; i < 4; i++ )
             {
                 pixel *p_dst = &h->mb.pic.p_fdec[0][8 * (i&1) + 8 * (i>>1) * FDEC_STRIDE];
-                h->predict_mpeg2_8x8( p_dst, 0 );
-                x262_mb_encode_intra_block( h, i, i_qp );
+                h->predict_8x8_mpeg2( p_dst, 0 );
+                x264_mb_encode_intra_block_mpeg2( h, i, i_qp );
             }
             /* chroma */
             int blockcount = CHROMA_FORMAT == CHROMA_422 ? 4 : 2;
             for( int i = 0; i < blockcount; i++ )
             {
-                h->predict_mpeg2_8x8( &h->mb.pic.p_fdec[1 + (i&1)][8 * (i>>1) * FDEC_STRIDE], 0 );
-                x262_mb_encode_intra_block( h, i+4, i_qp );
+                h->predict_8x8_mpeg2( &h->mb.pic.p_fdec[1 + (i&1)][8 * (i>>1) * FDEC_STRIDE], 0 );
+                x264_mb_encode_intra_block_mpeg2( h, i+4, i_qp );
             }
             /* reset mvp */
             if( h->sh.i_type == SLICE_TYPE_P || h->sh.i_type == SLICE_TYPE_B )
-                x262_reset_mv_predictor( h );
+                x264_reset_mv_predictor_mpeg2( h );
         }
         else
         {
@@ -875,7 +875,7 @@ static ALWAYS_INLINE void x264_macroblock_encode_internal( x264_t *h, int plane_
             h->mb.i_cbp_chroma = 0;
             h->mb.i_cbp_chroma422 = 0;
             for( int i = 0; i < blockcount; i++ )
-                x262_mb_encode_inter_block( h, i, i_qp );
+                x264_mb_encode_inter_block_mpeg2( h, i, i_qp );
         }
         else if( h->mb.b_lossless )
         {
old mode 100755 (executable)
new mode 100644 (file)
index 5d905bf..eaa4f83
 extern const int x264_lambda2_tab[QP_MAX_MAX+1];
 extern const uint16_t x264_lambda_tab[QP_MAX_MAX+1];
 
-extern const int x262_lambda2_tab_exp[QP_MAX_MAX+1];
-extern const uint16_t x262_lambda_tab_exp[QP_MAX_MAX+1];
-extern const int x262_lambda2_tab_lin[QP_MAX_MAX+1];
-extern const uint16_t x262_lambda_tab_lin[QP_MAX_MAX+1];
-
+/* MPEG-2 */
+extern const int x264_lambda2_tab_exp_mpeg2[QP_MAX_MAX+1];
+extern const uint16_t x264_lambda_tab_exp_mpeg2[QP_MAX_MAX+1];
+extern const int x264_lambda2_tab_lin_mpeg2[QP_MAX_MAX+1];
+extern const uint16_t x264_lambda_tab_lin_mpeg2[QP_MAX_MAX+1];
 
 void x264_rdo_init( void );
 
@@ -57,7 +57,7 @@ void x264_macroblock_encode      ( x264_t *h );
 void x264_macroblock_write_cabac ( x264_t *h, x264_cabac_t *cb );
 void x264_macroblock_write_cavlc ( x264_t *h );
 
-void x262_macroblock_write_vlc ( x264_t *h );
+void x264_macroblock_write_vlc_mpeg2( x264_t *h );
 
 void x264_macroblock_encode_p8x8( x264_t *h, int i8 );
 void x264_macroblock_encode_p4x4( x264_t *h, int i4 );
old mode 100755 (executable)
new mode 100644 (file)
index 0278c80..0952df8
@@ -32,7 +32,7 @@
 
 #define bs_write_vlc(s,v) bs_write( s, (v).i_size, (v).i_bits )
 
-static void x262_write_dct_vlcs( x264_t *h, dctcoef *l, int intra_tab )
+static void x264_write_dct_vlc_mpeg2( x264_t *h, dctcoef *l, int intra_tab )
 {
     bs_t *s = &h->out.bs;
     x264_run_level_t runlevel;
@@ -64,7 +64,7 @@ static void x262_write_dct_vlcs( x264_t *h, dctcoef *l, int intra_tab )
     }
 }
 
-static void x262_write_mv_vlcs( x264_t *h, int mvd, int f_code )
+static void x264_write_mv_vlc_mpeg2( x264_t *h, int mvd, int f_code )
 {
     bs_t *s = &h->out.bs;
     int r_size = f_code - 1;
@@ -82,15 +82,12 @@ static void x262_write_mv_vlcs( x264_t *h, int mvd, int f_code )
     int m_code = m_residual >> r_size;
     if( mvd < 0 )
         m_code = -m_code;
-    bs_write_vlc( s, x262_motion_code[m_code + 16] ); // motion_code
+    bs_write_vlc( s, x264_motion_code[m_code + 16] ); // motion_code
     if( r_size && m_code )
         bs_write( s, r_size, m_residual & (f - 1) ); // motion_residual
 }
 
-/*****************************************************************************
- * x262_macroblock_write:
- *****************************************************************************/
-void x262_macroblock_write_vlc( x264_t *h )
+void x264_macroblock_write_vlc_mpeg2( x264_t *h )
 {
     bs_t *s = &h->out.bs;
     const int i_mb_type = h->mb.i_type;
@@ -122,12 +119,12 @@ void x262_macroblock_write_vlc( x264_t *h )
 
     // macroblock modes
     if( i_mb_type == I_16x16 )
-        bs_write_vlc( s, x262_i_mb_type[h->sh.i_type][quant] );
+        bs_write_vlc( s, x264_i_mb_type[h->sh.i_type][quant] );
     else if( i_mb_type == P_L0 )
     {
-        bs_write_vlc( s, x262_p_mb_type[mcoded][!!cbp][quant] );
+        bs_write_vlc( s, x264_p_mb_type[mcoded][!!cbp][quant] );
         if( !mcoded )
-            x262_reset_mv_predictor( h );
+            x264_reset_mv_predictor_mpeg2( h );
     }
     else
     {
@@ -135,7 +132,7 @@ void x262_macroblock_write_vlc( x264_t *h )
             mv_type = 1;
         else if( i_mb_type == B_BI_BI )
             mv_type = 2;
-        bs_write_vlc( s, x262_b_mb_type[mv_type][!!cbp][quant] );
+        bs_write_vlc( s, x264_b_mb_type[mv_type][!!cbp][quant] );
     }
 
     if( quant )
@@ -153,8 +150,8 @@ void x262_macroblock_write_vlc( x264_t *h )
         for( int j = 0; j < mvcount; j++, mv_type++ )
             for( int i = 0; i < 2; i++ )
             {
-                x262_write_mv_vlcs( h, ( h->mb.cache.mv[mv_type][x264_scan8[0]][i] - h->mb.mvp[mv_type][i] ) >> 1,
-                                    h->fenc->mv_fcode[mv_type][i] );
+                x264_write_mv_vlc_mpeg2( h, ( h->mb.cache.mv[mv_type][x264_scan8[0]][i] - h->mb.mvp[mv_type][i] ) >> 1,
+                                         h->fenc->mv_fcode[mv_type][i] );
                 // update predictors
                 h->mb.mvp[mv_type][i] = h->mb.cache.mv[mv_type][x264_scan8[0]][i];
             }
@@ -173,19 +170,19 @@ void x262_macroblock_write_vlc( x264_t *h )
         {
             h->dct.mpeg2_8x8[i][0] = 0;
             if( i < 4 )
-                bs_write_vlc( s, x262_dc_luma_code[h->mb.i_dct_dc_size[i]] );
+                bs_write_vlc( s, x264_dc_luma_code[h->mb.i_dct_dc_size[i]] );
             else
-                bs_write_vlc( s, x262_dc_chroma_code[h->mb.i_dct_dc_size[i]] );
+                bs_write_vlc( s, x264_dc_chroma_code[h->mb.i_dct_dc_size[i]] );
 
             if( h->mb.i_dct_dc_size[i] )
                 bs_write( s, h->mb.i_dct_dc_size[i], h->mb.i_dct_dc_diff[i] ); // DC
-            x262_write_dct_vlcs( h, h->dct.mpeg2_8x8[i], h->param.b_alt_intra_vlc ); // AC
+            x264_write_dct_vlc_mpeg2( h, h->dct.mpeg2_8x8[i], h->param.b_alt_intra_vlc ); // AC
             bs_write_vlc( s, dct_vlcs[h->param.b_alt_intra_vlc][0][0] ); // end of block
         }
     }
     else if( cbp )
     {
-        bs_write_vlc( s, x262_cbp[cbp420] ); // coded_block_pattern_420
+        bs_write_vlc( s, x264_cbp[cbp420] ); // coded_block_pattern_420
         if( CHROMA_FORMAT == CHROMA_422 )
             bs_write( s, 2, cbp & 0x3 );     // coded_block_pattern_1
 
@@ -193,7 +190,7 @@ void x262_macroblock_write_vlc( x264_t *h )
         {
             if( cbp & (1<<(7-i)) )
             {
-                x262_write_dct_vlcs( h, h->dct.mpeg2_8x8[i], 0 ); // DC and AC
+                x264_write_dct_vlc_mpeg2( h, h->dct.mpeg2_8x8[i], 0 ); // DC and AC
                 bs_write_vlc( s, dct_vlcs[0][0][0] ); // end of block
             }
         }
old mode 100755 (executable)
new mode 100644 (file)
index ce4fe11..1fbc96d
@@ -68,8 +68,8 @@ static uint16_t cabac_size_5ones[128];
 #define COPY_CABAC_PART( pos, size )\
         memcpy( &cb->state[pos], &h->cabac.state[pos], size )
 
-/* MPEG2-VLC: */
-#define x262_macroblock_write_vlc  static x262_macroblock_size_vlc
+/* MPEG-2 */
+#define x264_macroblock_write_vlc_mpeg2  static x264_macroblock_size_vlc_mpeg2
 #include "mpeg2vlc.c"
 
 static ALWAYS_INLINE uint64_t cached_hadamard( x264_t *h, int size, int x, int y )
@@ -187,7 +187,7 @@ static int x264_rd_cost_mb( x264_t *h, int i_lambda2 )
         }
         else
         {
-            x262_macroblock_size_vlc( h );
+            x264_macroblock_size_vlc_mpeg2( h );
             i_bits = ( h->out.bs.i_bits_encoded * i_lambda2 + 128 ) >> 8; // FIXME
         }
         memcpy( h->mb.i_intra_dc_predictor, i_intra_dc_predictor_bak, sizeof(i_intra_dc_predictor_bak) );
index ec10e57..46c9b8a 100644 (file)
@@ -470,7 +470,7 @@ void x264_pps_init( x264_t *h, x264_pps_t *pps, int i_id, x264_param_t *param, x
     case X264_CQM_FLAT:
         if( MPEG2 )
         {
-            pps->scaling_list[CQM_8IY] = x262_cqm_intra;
+            pps->scaling_list[CQM_8IY] = x264_cqm_intra_mpeg2;
             pps->scaling_list[CQM_8PY] = x264_cqm_flat16;
         }
         else
@@ -607,8 +607,8 @@ int x264_sei_version_write( x264_t *h, bs_t *s )
              "Copy%s 2003-2011 - http://www.videolan.org/x264.html - options: %s",
              X264_BUILD, X264_VERSION, HAVE_GPL?"left":"right", opts );
     length = strlen(payload)+1;
-    MPEG2 ? x262_user_data_write( s, (uint8_t *)payload, length ) :
-                  x264_sei_write( s, (uint8_t *)payload, length, SEI_USER_DATA_UNREGISTERED );
+    MPEG2 ? x264_user_data_write_mpeg2( s, (uint8_t *)payload, length ) :
+            x264_sei_write( s, (uint8_t *)payload, length, SEI_USER_DATA_UNREGISTERED );
 
     x264_free( opts );
     x264_free( payload );
@@ -754,7 +754,8 @@ void x264_sei_dec_ref_pic_marking_write( x264_t *h, bs_t *s )
     x264_sei_write( s, tmp_buf, bs_pos( &q ) / 8, SEI_DEC_REF_PIC_MARKING );
 }
 
-void x262_seq_header_write( x264_t *h, bs_t *s )
+/* MPEG-2 */
+void x264_seq_header_write_mpeg2( x264_t *h, bs_t *s )
 {
     int i;
     bs_realign( s );
@@ -791,7 +792,7 @@ void x262_seq_header_write( x264_t *h, bs_t *s )
     bs_flush( s );
 }
 
-void x262_seq_extension_write( x264_t *h, bs_t *s )
+void x264_seq_extension_write_mpeg2( x264_t *h, bs_t *s )
 {
     x264_sps_t *sps = h->sps;
     bs_realign( s );
@@ -815,7 +816,7 @@ void x262_seq_extension_write( x264_t *h, bs_t *s )
     bs_flush( s );
 }
 
-void x262_seq_disp_extension_write( x264_t *h, bs_t *s )
+void x264_seq_disp_extension_write_mpeg2( x264_t *h, bs_t *s )
 {
     x264_sps_t *sps = h->sps;
     bs_realign( s );
@@ -837,7 +838,7 @@ void x262_seq_disp_extension_write( x264_t *h, bs_t *s )
     bs_flush( s );
 }
 
-void x262_gop_header_write( x264_t *h, bs_t *s )
+void x264_gop_header_write_mpeg2( x264_t *h, bs_t *s )
 {
     bs_realign( s );
 
@@ -867,7 +868,7 @@ void x262_gop_header_write( x264_t *h, bs_t *s )
     bs_flush( s );
 }
 
-void x262_pic_header_write( x264_t *h, bs_t *s )
+void x264_pic_header_write_mpeg2( x264_t *h, bs_t *s )
 {
     bs_realign( s );
 
@@ -896,7 +897,7 @@ void x262_pic_header_write( x264_t *h, bs_t *s )
     bs_flush( s );
 }
 
-void x262_pic_coding_extension_write( x264_t *h, bs_t *s )
+void x264_pic_coding_extension_write_mpeg2( x264_t *h, bs_t *s )
 {
     x264_param_t *param = &h->param;
 
@@ -955,7 +956,7 @@ void x262_pic_coding_extension_write( x264_t *h, bs_t *s )
     bs_flush( s );
 }
 
-void x262_pic_display_extension_write( x264_t *h, bs_t *s )
+void x264_pic_display_extension_write_mpeg2( x264_t *h, bs_t *s )
 {
     int offsets = !h->param.b_interlaced ? h->fenc->b_rff ? h->param.b_tff ? 3 : 2 : 1 :
                    h->param.b_interlaced ? 1 : h->fenc->b_rff ? 3 : 2;
@@ -977,7 +978,7 @@ void x262_pic_display_extension_write( x264_t *h, bs_t *s )
     bs_flush( s );
 }
 
-void x262_user_data_write( bs_t *s, uint8_t *payload, int payload_size )
+void x264_user_data_write_mpeg2( bs_t *s, uint8_t *payload, int payload_size )
 {
     bs_realign( s );
 
@@ -1009,7 +1010,7 @@ const x264_level_t x264_levels[] =
     { 0 }
 };
 
-const x262_level_t x262_levels[] =
+const x264_level_mpeg2_t x264_levels_mpeg2[] =
 {
     { 10,   3041280,        0,  352,  288, 5,  4000,      0,  475136,        0,  512,  64 },
     {  8,  10368000, 14745600,  720,  576, 5, 15000,  20000, 1835008,  2441216, 1024, 128 },
@@ -1019,7 +1020,7 @@ const x262_level_t x262_levels[] =
     { 0 }
 };
 
-const x262_fps_t x262_allowed_fps[14] =
+const x264_fps_mpeg2_t x264_allowed_fps_mpeg2[14] =
 {
     { 1, 24000, 1001 },
     { 2, 24, 1 },
@@ -1054,7 +1055,7 @@ int x264_validate_levels( x264_t *h, int verbose )
 
     if( MPEG2 )
     {
-        const x262_level_t *l = x262_levels;
+        const x264_level_mpeg2_t *l = x264_levels_mpeg2;
         while( l->level_idc != 0 && l->level_idc != h->param.i_level_idc )
             l++;
         CHECK( "framerate", l->fps_code, h->sps->i_frame_rate_code );
index 7ad249e..6b6a011 100644 (file)
@@ -41,15 +41,16 @@ void x264_sei_frame_packing_write( x264_t *h, bs_t *s );
 void x264_sei_write( bs_t *s, uint8_t *payload, int payload_size, int payload_type );
 void x264_filler_write( x264_t *h, bs_t *s, int filler );
 
-void x262_seq_header_write( x264_t *h, bs_t *s );
-void x262_seq_extension_write( x264_t *h, bs_t *s );
-void x262_seq_disp_extension_write( x264_t *h, bs_t *s );
-void x262_gop_header_write( x264_t *h, bs_t *s );
-void x262_pic_header_write( x264_t *h, bs_t *s );
-void x262_pic_coding_extension_write( x264_t *h, bs_t *s );
-void x262_pic_display_extension_write( x264_t *h, bs_t *s );
-void x262_user_data_write( bs_t *s, uint8_t *payload, int payload_size );
+/* MPEG-2 */
+void x264_seq_header_write_mpeg2( x264_t *h, bs_t *s );
+void x264_seq_extension_write_mpeg2( x264_t *h, bs_t *s );
+void x264_seq_disp_extension_write_mpeg2( x264_t *h, bs_t *s );
+void x264_gop_header_write_mpeg2( x264_t *h, bs_t *s );
+void x264_pic_header_write_mpeg2( x264_t *h, bs_t *s );
+void x264_pic_coding_extension_write_mpeg2( x264_t *h, bs_t *s );
+void x264_pic_display_extension_write_mpeg2( x264_t *h, bs_t *s );
+void x264_user_data_write_mpeg2( bs_t *s, uint8_t *payload, int payload_size );
 
-const x262_fps_t x262_allowed_fps[14];
+const x264_fps_mpeg2_t x264_allowed_fps_mpeg2[14];
 
 #endif
index 9eaef17..f9bad30 100644 (file)
@@ -40,7 +40,8 @@ static void x264_lowres_context_init( x264_t *h, x264_mb_analysis_t *a )
 {
     const uint16_t *lambda_tab;
     if( MPEG2 )
-        lambda_tab = h->param.b_nonlinear_quant ? x262_lambda_tab_exp : x262_lambda_tab_lin;
+        lambda_tab = h->param.b_nonlinear_quant ? x264_lambda_tab_exp_mpeg2 :
+                                                  x264_lambda_tab_lin_mpeg2;
     else
         lambda_tab = x264_lambda_tab;
     a->i_qp = X264_LOOKAHEAD_QP;
diff --git a/x264.c b/x264.c
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/x264.h b/x264.h
index e11c01c..35de58d 100644 (file)
--- a/x264.h
+++ b/x264.h
@@ -585,10 +585,10 @@ typedef struct {
     int vbv_buf_high; /* max vbv buffer for high profile (bit/sec) */
     int mv_max_h;     /* max horizontal motion vector range (pixels) */
     int mv_max_v;     /* max vertical motion vector range (pixels) */
-} x262_level_t;
+} x264_level_mpeg2_t;
 
 /* all of the levels defined in the standard, terminated by .level_idc=0 */
-extern const x262_level_t x262_levels[];
+extern const x264_level_mpeg2_t x264_levels_mpeg2[];
 
 /****************************************************************************
  * Basic parameter handling functions