Give correct transform depth to RDOQ.

Conflicts:
	src/search.c
This commit is contained in:
Ari Koivula 2014-05-27 12:35:51 +03:00
parent dceb3da9b8
commit e585da37e5
3 changed files with 4 additions and 4 deletions

View file

@ -120,7 +120,7 @@ int intra_rdo_cost_compare(uint32_t *rdo_costs,int8_t rdo_modes_to_check, uint32
** Only for luma
*/
uint32_t rdo_cost_intra(encoder_state * const encoder_state, pixel *pred, pixel *orig_block, int width, int8_t mode)
uint32_t rdo_cost_intra(encoder_state * const encoder_state, pixel *pred, pixel *orig_block, int width, int8_t mode, int tr_depth)
{
const encoder_control * const encoder = encoder_state->encoder_control;
coefficient pre_quant_coeff[LCU_WIDTH*LCU_WIDTH>>2];
@ -149,7 +149,7 @@ uint32_t rdo_cost_intra(encoder_state * const encoder_state, pixel *pred, pixel
}
transform2d(encoder, block,pre_quant_coeff,width,0);
if(encoder->rdoq_enable) {
rdoq(encoder_state, pre_quant_coeff, temp_coeff, width, width, 0, luma_scan_mode, CU_INTRA,0);
rdoq(encoder_state, pre_quant_coeff, temp_coeff, width, width, 0, luma_scan_mode, CU_INTRA, tr_depth);
} else {
quant(encoder_state, pre_quant_coeff, temp_coeff, width, width, 0, luma_scan_mode, CU_INTRA);
}

View file

@ -47,7 +47,7 @@ int intra_rdo_cost_compare(uint32_t *rdo_costs,int8_t rdo_modes_to_check, uint32
void rdoq(encoder_state *encoder_state, coefficient *coef, coefficient *dest_coeff, int32_t width,
int32_t height, int8_t type, int8_t scan_mode, int8_t block_type, int8_t tr_depth);
uint32_t rdo_cost_intra(encoder_state *encoder, pixel* pred, pixel* orig_block, int width, int8_t mode);
uint32_t rdo_cost_intra(encoder_state *encoder, pixel* pred, pixel* orig_block, int width, int8_t mode, int tr_depth);
int32_t get_coeff_cost(const encoder_state *encoder_state, coefficient *coeff, int32_t width, int32_t type, int8_t scan_mode);

View file

@ -918,7 +918,7 @@ static void search_intra_rdo(encoder_state * const encoder_state,
// The reconstruction is calculated again here, it could be saved from before..
intra_get_pred(encoder_state->encoder_control, ref, recstride, pred, width, modes[rdo_mode], 0);
costs[rdo_mode] = rdo_cost_intra(encoder_state,pred,orig_block,width,modes[rdo_mode]);
costs[rdo_mode] = rdo_cost_intra(encoder_state,pred,orig_block,width,modes[rdo_mode], width == 4 ? 1 : 0);
// Bitcost also calculated again for this mode
rdo_bitcost = intra_pred_ratecost(modes[rdo_mode],intra_preds);
// Add bitcost * lambda