/* */
int i_qp; /* current qp */
+ int i_chroma_qp;
int i_last_qp; /* last qp */
int i_last_dqp; /* last delta qp */
int b_variable_qp; /* whether qp is allowed to vary per macroblock */
/* conduct the analysis using this lamda and QP */
a->i_qp = h->mb.i_qp = i_qp;
+ h->mb.i_chroma_qp = i_chroma_qp_table[x264_clip3( i_qp + h->pps->i_chroma_qp_index_offset, 0, 51 )];
a->i_lambda = i_qp0_cost_table[i_qp];
a->i_lambda2 = i_qp0_cost2_table[i_qp];
a->b_mbrd = h->param.analyse.i_subpel_refine >= 6 &&
if( i_max > 0 )
{
- int i_qp_chroma = i_chroma_qp_table[x264_clip3( h->mb.i_qp + h->pps->i_chroma_qp_index_offset, 0, 51 )];
- int i_chroma_lambda = i_qp0_cost2_table[i_qp_chroma];
+ int i_chroma_lambda = i_qp0_cost2_table[h->mb.i_chroma_qp];
/* the previous thing encoded was x264_intra_rd(), so the pixels and
* coefs for the current chroma mode are still around, so we only
* have to recount the bits. */
}
/* encode chroma */
- i_qp = i_chroma_qp_table[x264_clip3( i_qp + h->pps->i_chroma_qp_index_offset, 0, 51 )];
if( IS_INTRA( h->mb.i_type ) )
{
const int i_mode = h->mb.i_chroma_pred_mode;
}
/* encode the 8x8 blocks */
- x264_mb_encode_8x8_chroma( h, !IS_INTRA( h->mb.i_type ), i_qp );
+ x264_mb_encode_8x8_chroma( h, !IS_INTRA( h->mb.i_type ), h->mb.i_chroma_qp );
/* coded block pattern and non_zero_count */
h->mb.i_cbp_luma = 0x00;
}
/* encode chroma */
- i_qp = i_chroma_qp_table[x264_clip3( i_qp + h->pps->i_chroma_qp_index_offset, 0, 51 )];
+ i_qp = h->mb.i_chroma_qp;
for( ch = 0; ch < 2; ch++ )
{
}
}
- i_qp = i_chroma_qp_table[x264_clip3( i_qp + h->pps->i_chroma_qp_index_offset, 0, 51 )];
+ i_qp = h->mb.i_chroma_qp;
for( ch = 0; ch < 2; ch++ )
{
int i_ssd, i_bits;
if( b_dct )
- x264_mb_encode_8x8_chroma( h, 0, h->mb.i_qp );
+ x264_mb_encode_8x8_chroma( h, 0, h->mb.i_chroma_qp );
i_ssd = ssd_plane( h, PIXEL_8x8, 1, 0, 0 ) +
ssd_plane( h, PIXEL_8x8, 2, 0, 0 );