From f451563f93fad8972c0e9b788b30799e777e913a Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Wed, 22 Oct 2008 00:37:00 -0700 Subject: [PATCH] Some minor optimizations in RD refinement Don't write b subpartition in CABAC RDO Calculate nonzero count in i4x4 CAVLC RDO --- encoder/cabac.c | 1 - encoder/cavlc.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/encoder/cabac.c b/encoder/cabac.c index 2f0f02a9..111b82ef 100644 --- a/encoder/cabac.c +++ b/encoder/cabac.c @@ -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 ) { - 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, 1, i8 ); } diff --git a/encoder/cavlc.c b/encoder/cavlc.c index 8e27aa23..df084e22 100644 --- a/encoder/cavlc.c +++ b/encoder/cavlc.c @@ -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++ ) 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]] = - array_non_zero_count( h->dct.luma4x4[i4+i8*4] ); + h->mb.cache.non_zero_count[x264_scan8[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 ); } 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 ) 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->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 ); return h->out.bs.i_bits_encoded; } -- 2.47.3