Commit d17e81e2 authored by Fiona Glaser's avatar Fiona Glaser

Some minor optimizations in RD refinement

Don't write b subpartition in CABAC RDO
Calculate nonzero count in i4x4 CAVLC RDO
parent 91522693
...@@ -1047,7 +1047,6 @@ static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int ...@@ -1047,7 +1047,6 @@ static void x264_partition_size_cabac( x264_t *h, x264_cabac_t *cb, int i8, int
} }
else if( i_mb_type == B_8x8 ) else if( i_mb_type == B_8x8 )
{ {
x264_cabac_mb_sub_b_partition( cb, h->mb.i_sub_partition[i8] );
x264_cabac_mb8x8_mvd( h, cb, 0, i8 ); x264_cabac_mb8x8_mvd( h, cb, 0, i8 );
x264_cabac_mb8x8_mvd( h, cb, 1, i8 ); x264_cabac_mb8x8_mvd( h, cb, 1, i8 );
} }
......
...@@ -701,8 +701,7 @@ static int x264_partition_i8x8_size_cavlc( x264_t *h, int i8, int i_mode ) ...@@ -701,8 +701,7 @@ static int x264_partition_i8x8_size_cavlc( x264_t *h, int i8, int i_mode )
{ {
for( i = 0; i < 16; i++ ) for( i = 0; i < 16; i++ )
h->dct.luma4x4[i4+i8*4][i] = h->dct.luma8x8[i8][i4+i*4]; h->dct.luma4x4[i4+i8*4][i] = h->dct.luma8x8[i8][i4+i*4];
h->mb.cache.non_zero_count[x264_scan8[i4+i8*4]] = h->mb.cache.non_zero_count[x264_scan8[i4+i8*4]] = array_non_zero_count( h->dct.luma4x4[i4+i8*4] );
array_non_zero_count( h->dct.luma4x4[i4+i8*4] );
block_residual_write_cavlc( h, &h->out.bs, i4+i8*4, h->dct.luma4x4[i4+i8*4], 16 ); block_residual_write_cavlc( h, &h->out.bs, i4+i8*4, h->dct.luma4x4[i4+i8*4], 16 );
} }
return h->out.bs.i_bits_encoded; return h->out.bs.i_bits_encoded;
...@@ -711,6 +710,7 @@ static int x264_partition_i8x8_size_cavlc( x264_t *h, int i8, int i_mode ) ...@@ -711,6 +710,7 @@ static int x264_partition_i8x8_size_cavlc( x264_t *h, int i8, int i_mode )
static int x264_partition_i4x4_size_cavlc( x264_t *h, int i4, int i_mode ) static int x264_partition_i4x4_size_cavlc( x264_t *h, int i4, int i_mode )
{ {
h->out.bs.i_bits_encoded = cavlc_intra4x4_pred_size( h, i4, i_mode ); h->out.bs.i_bits_encoded = cavlc_intra4x4_pred_size( h, i4, i_mode );
h->mb.cache.non_zero_count[x264_scan8[i4]] = array_non_zero_count( h->dct.luma4x4[i4] );
block_residual_write_cavlc( h, &h->out.bs, i4, h->dct.luma4x4[i4], 16 ); block_residual_write_cavlc( h, &h->out.bs, i4, h->dct.luma4x4[i4], 16 );
return h->out.bs.i_bits_encoded; return h->out.bs.i_bits_encoded;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment