mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-28 03:34:06 +00:00
Removed unused function search_best_mode()
This commit is contained in:
parent
9563b50a34
commit
c7ee176480
41
src/search.c
41
src/search.c
|
@ -1096,47 +1096,6 @@ static void search_frame(encoder_control *encoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief
|
|
||||||
*/
|
|
||||||
uint32_t search_best_mode(encoder_control *encoder,
|
|
||||||
uint16_t x_ctb, uint16_t y_ctb, uint8_t depth)
|
|
||||||
{
|
|
||||||
cu_info *cur_cu = &encoder->in.cur_pic->cu_array[depth]
|
|
||||||
[x_ctb + y_ctb * (encoder->in.width_in_lcu << MAX_DEPTH)];
|
|
||||||
uint32_t best_intra_cost = cur_cu->intra[0].cost;
|
|
||||||
uint32_t best_inter_cost = cur_cu->inter.cost;
|
|
||||||
uint32_t lambda_cost = (int)(4.5 * g_lambda_cost[encoder->QP]); //TODO: Correct cost calculation
|
|
||||||
|
|
||||||
if (depth < MAX_INTRA_SEARCH_DEPTH && depth < MAX_INTER_SEARCH_DEPTH) {
|
|
||||||
uint32_t cost = lambda_cost;
|
|
||||||
uint8_t change = 1 << (MAX_DEPTH - 1 - depth);
|
|
||||||
cost += search_best_mode(encoder, x_ctb, y_ctb, depth + 1);
|
|
||||||
cost += search_best_mode(encoder, x_ctb + change, y_ctb, depth + 1);
|
|
||||||
cost += search_best_mode(encoder, x_ctb, y_ctb + change, depth + 1);
|
|
||||||
cost += search_best_mode(encoder, x_ctb + change, y_ctb + change, depth + 1);
|
|
||||||
|
|
||||||
if (cost < best_intra_cost && cost < best_inter_cost)
|
|
||||||
{
|
|
||||||
// Better value was found at a lower level.
|
|
||||||
return cost;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If search hasn't been peformed at all for this block, the cost will be
|
|
||||||
// max value, so it is safe to just compare costs. It just has to be made
|
|
||||||
// sure that no value overflows.
|
|
||||||
if (best_inter_cost <= best_intra_cost) {
|
|
||||||
inter_set_block(encoder->in.cur_pic, x_ctb, y_ctb, depth, cur_cu);
|
|
||||||
return best_inter_cost;
|
|
||||||
} else {
|
|
||||||
intra_set_block_mode(encoder->in.cur_pic, x_ctb, y_ctb, depth,
|
|
||||||
cur_cu->intra[0].mode, cur_cu->part_size);
|
|
||||||
return best_intra_cost;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief
|
* \brief
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -31,6 +31,5 @@
|
||||||
|
|
||||||
void search_slice_data(encoder_control *encoder);
|
void search_slice_data(encoder_control *encoder);
|
||||||
void search_tree(encoder_control *encoder, int x, int y, uint8_t depth);
|
void search_tree(encoder_control *encoder, int x, int y, uint8_t depth);
|
||||||
uint32_t search_best_mode(encoder_control* encoder,uint16_t x_cu,uint16_t y_cu, uint8_t depth);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue