Commit 2e8eaddd authored by Peng Bin's avatar Peng Bin Committed by Bin Peng

Move if statement outside for loops

By avoiding break CPU's pipeline,
this patch achieves a small encoder
speedup at the range of 0.2%~0.71%.

Change-Id: I398cb09f8eb91695e3258091ff2f82f06ab74145
parent 85e8c797
......@@ -1050,18 +1050,17 @@ void aom_comp_mask_upsampled_pred_c(uint8_t *comp_pred, const uint8_t *pred,
int ref_stride, const uint8_t *mask,
int mask_stride, int invert_mask) {
int i, j;
const uint8_t *src0 = invert_mask ? pred : comp_pred;
const uint8_t *src1 = invert_mask ? comp_pred : pred;
aom_upsampled_pred(comp_pred, width, height, subpel_x_q3, subpel_y_q3, ref,
for (i = 0; i < height; i++) {
for (j = 0; j < width; j++) {
if (!invert_mask)
comp_pred[j] = AOM_BLEND_A64(mask[j], comp_pred[j], pred[j]);
comp_pred[j] = AOM_BLEND_A64(mask[j], pred[j], comp_pred[j]);
comp_pred[j] = AOM_BLEND_A64(mask[j], src0[j], src1[j]);
comp_pred += width;
pred += width;
src0 += width;
src1 += width;
mask += mask_stride;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment