Merge remote-tracking branch 'x264/master'
authorPhillip Blucas <pblucas@gmail.com>
Tue, 5 Mar 2013 05:55:46 +0000 (23:55 -0600)
committerPhillip Blucas <pblucas@gmail.com>
Tue, 5 Mar 2013 05:55:46 +0000 (23:55 -0600)
Conflicts:
configure
encoder/macroblock.c
encoder/me.c

23 files changed:
1  2 
common/arm/quant-a.S
common/arm/quant.h
common/common.c
common/common.h
common/dct.c
common/frame.c
common/pixel.c
common/quant.c
common/quant.h
common/x86/predict-a.asm
common/x86/predict.h
common/x86/quant-a.asm
configure
encoder/analyse.c
encoder/encoder.c
encoder/macroblock.c
encoder/macroblock.h
encoder/me.c
encoder/rdo.c
encoder/slicetype.c
tools/checkasm.c
x264.c
x264.h

Simple merge
Simple merge
diff --cc common/common.c
Simple merge
diff --cc common/common.h
Simple merge
diff --cc common/dct.c
Simple merge
diff --cc common/frame.c
Simple merge
diff --cc common/pixel.c
Simple merge
diff --cc common/quant.c
Simple merge
diff --cc common/quant.h
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc configure
index 41d43fc,f159602..a926efd
mode 100755,100755..100644
+++ b/configure
@@@ -1196,8 -1202,7 +1218,8 @@@ shared:        $share
  static:        $static
  asm:           $asm
  interlaced:    $interlaced
- avs:           $avs
 +mpeg2:         $mpeg2
+ avs:           $avstype
  lavf:          $lavf
  ffms:          $ffms
  gpac:          $gpac
Simple merge
Simple merge
@@@ -790,34 -690,8 +834,31 @@@ static ALWAYS_INLINE void x264_macroblo
      {
          h->mb.b_transform_8x8 = 0;
  
 -        for( int p = 0; p < plane_count; p++, i_qp = h->mb.i_chroma_qp )
 -            x264_mb_encode_i16x16( h, p, i_qp );
 +        /* encode the 16x16 macroblock */
 +        if( MPEG2 )
 +        {
 +            /* luma */
 +            for( int i = 0; i < 4; i++ )
 +            {
 +                h->predict_8x8_mpeg2( &h->mb.pic.p_fdec[0][8 * (i&1) + 8 * (i>>1) * FDEC_STRIDE], 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_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 )
 +                x264_reset_mv_predictor_mpeg2( h );
 +        }
 +        else
 +        {
-             for( int p = 0; p < plane_count; p++ )
-             {
++            for( int p = 0; p < plane_count; p++, i_qp = h->mb.i_chroma_qp )
 +                x264_mb_encode_i16x16( h, p, i_qp );
-                 i_qp = h->mb.i_chroma_qp;
-             }
 +        }
      }
      else if( h->mb.i_type == I_8x8 )
      {
Simple merge
diff --cc encoder/me.c
@@@ -915,15 -967,23 +970,23 @@@ static void refine_subpel( x264_t *h, x
          int costs[4];
          int omx = bmx, omy = bmy;
          /* We have to use mc_luma because all strides must be the same to use fpelcmp_x4 */
 -        h->mc.mc_luma( pix   , 64, m->p_fref, m->i_stride[0], omx, omy-1, bw, bh, &m->weight[0] );
 -        h->mc.mc_luma( pix+16, 64, m->p_fref, m->i_stride[0], omx, omy+1, bw, bh, &m->weight[0] );
 -        h->mc.mc_luma( pix+32, 64, m->p_fref, m->i_stride[0], omx-1, omy, bw, bh, &m->weight[0] );
 -        h->mc.mc_luma( pix+48, 64, m->p_fref, m->i_stride[0], omx+1, omy, bw, bh, &m->weight[0] );
 +        h->mc.mc_luma( pix   , 64, m->p_fref, m->i_stride[0], omx, omy-offset, bw, bh, &m->weight[0] );
 +        h->mc.mc_luma( pix+16, 64, m->p_fref, m->i_stride[0], omx, omy+offset, bw, bh, &m->weight[0] );
 +        h->mc.mc_luma( pix+32, 64, m->p_fref, m->i_stride[0], omx-offset, omy, bw, bh, &m->weight[0] );
 +        h->mc.mc_luma( pix+48, 64, m->p_fref, m->i_stride[0], omx+offset, omy, bw, bh, &m->weight[0] );
          h->pixf.fpelcmp_x4[i_pixel]( m->p_fenc[0], pix, pix+16, pix+32, pix+48, 64, costs );
-         COPY2_IF_LT( bcost, costs[0] + p_cost_mvx[omx  ] + p_cost_mvy[omy-offset], bmy, omy-offset );
-         COPY2_IF_LT( bcost, costs[1] + p_cost_mvx[omx  ] + p_cost_mvy[omy+offset], bmy, omy+offset );
-         COPY3_IF_LT( bcost, costs[2] + p_cost_mvx[omx-offset] + p_cost_mvy[omy  ], bmx, omx-offset, bmy, omy );
-         COPY3_IF_LT( bcost, costs[3] + p_cost_mvx[omx+offset] + p_cost_mvy[omy  ], bmx, omx+offset, bmy, omy );
 -        costs[0] += p_cost_mvx[omx  ] + p_cost_mvy[omy-1];
 -        costs[1] += p_cost_mvx[omx  ] + p_cost_mvy[omy+1];
 -        costs[2] += p_cost_mvx[omx-1] + p_cost_mvy[omy  ];
 -        costs[3] += p_cost_mvx[omx+1] + p_cost_mvy[omy  ];
++        costs[0] += p_cost_mvx[omx  ] + p_cost_mvy[omy-offset];
++        costs[1] += p_cost_mvx[omx  ] + p_cost_mvy[omy+offset];
++        costs[2] += p_cost_mvx[omx-offset] + p_cost_mvy[omy  ];
++        costs[3] += p_cost_mvx[omx+offset] + p_cost_mvy[omy  ];
+         bcost <<= 4;
+         COPY1_IF_LT( bcost, (costs[0]<<4)+1 );
+         COPY1_IF_LT( bcost, (costs[1]<<4)+3 );
+         COPY1_IF_LT( bcost, (costs[2]<<4)+4 );
+         COPY1_IF_LT( bcost, (costs[3]<<4)+12 );
+         bmx -= (bcost<<28)>>30;
+         bmy -= (bcost<<30)>>30;
+         bcost >>= 4;
      }
  
      m->cost = bcost;
diff --cc encoder/rdo.c
Simple merge
Simple merge
Simple merge
diff --cc x264.c
Simple merge
diff --cc x264.h
Simple merge