Commit bad82f1f authored by Luc Trudeau's avatar Luc Trudeau Committed by Luc Trudeau

[CFL] Compute prediction block DC_PRED as double

The prediction block level DC_PRED is stored and computed as double
instead of int.

Change-Id: I22766c102a7b62d4b5e7621438185808cc0ea8f4
parent 2c317905
......@@ -47,7 +47,7 @@ void cfl_dc_pred(MACROBLOCKD *xd, BLOCK_SIZE plane_bsize, TX_SIZE tx_size) {
: tx_size_high[tx_size];
// Number of pixel on the top and left borders.
const int num_pel = block_width + block_height;
const double num_pel = block_width + block_height;
int sum_u = 0;
int sum_v = 0;
......@@ -83,8 +83,8 @@ void cfl_dc_pred(MACROBLOCKD *xd, BLOCK_SIZE plane_bsize, TX_SIZE tx_size) {
sum_v += block_height * 129;
}
xd->cfl->dc_pred[CFL_PRED_U] = (sum_u + (num_pel >> 1)) / num_pel;
xd->cfl->dc_pred[CFL_PRED_V] = (sum_v + (num_pel >> 1)) / num_pel;
xd->cfl->dc_pred[CFL_PRED_U] = sum_u / num_pel;
xd->cfl->dc_pred[CFL_PRED_V] = sum_v / num_pel;
}
double cfl_ind_to_alpha(const MB_MODE_INFO *const mbmi,
......@@ -100,7 +100,7 @@ double cfl_ind_to_alpha(const MB_MODE_INFO *const mbmi,
// Predict the current transform block using CfL.
void cfl_predict_block(const CFL_CTX *cfl, uint8_t *dst, int dst_stride,
int row, int col, TX_SIZE tx_size, int dc_pred,
int row, int col, TX_SIZE tx_size, double dc_pred,
double alpha) {
const int width = tx_size_wide[tx_size];
const int height = tx_size_high[tx_size];
......
......@@ -37,7 +37,7 @@ typedef struct {
int subsampling_x, subsampling_y;
// CfL Performs its own block level DC_PRED for each chromatic plane
int dc_pred[CFL_PRED_PLANES];
double dc_pred[CFL_PRED_PLANES];
// Count the number of TX blocks in a predicted block to know when you are at
// the last one, so you can check for skips.
......@@ -61,7 +61,7 @@ void cfl_dc_pred(MACROBLOCKD *xd, BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
double cfl_ind_to_alpha(const MB_MODE_INFO *mbmi, CFL_PRED_TYPE pred_type);
void cfl_predict_block(const CFL_CTX *cfl, uint8_t *dst, int dst_stride,
int row, int col, TX_SIZE tx_size, int dc_pred,
int row, int col, TX_SIZE tx_size, double dc_pred,
double alpha);
void cfl_store(CFL_CTX *cfl, const uint8_t *input, int input_stride, int row,
......
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