Commit e3465a63 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

make DC_PRED for i4x4 to use real pixels only

Wherever there are real pixels available before falling back to use
assumed values 127 and 129.

This also make DC_PRED for i4x4 consistent with DC_PRED for larger
blocks.

Change-Id: I54372924826118da023f402c802ac6ce0caa70c3
parent 421ad3f1
...@@ -258,15 +258,22 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd, ...@@ -258,15 +258,22 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
switch (b_mode) { switch (b_mode) {
case B_DC_PRED: { case B_DC_PRED: {
int expected_dc = 0; int expected_dc = 128;
if (have_top || have_left) {
for (i = 0; i < 4; i++) { int average = 0;
expected_dc += above[i]; int count = 0;
expected_dc += left[i]; if (have_top) {
for (i = 0; i < 4; i++)
average += above[i];
count += 4;
}
if (have_left) {
for (i = 0; i < 4; i++)
average += left[i];
count += 4;
}
expected_dc = (average + (count >> 1)) / count;
} }
expected_dc = ROUND_POWER_OF_TWO(expected_dc, 3);
for (r = 0; r < 4; r++) { for (r = 0; r < 4; r++) {
for (c = 0; c < 4; c++) for (c = 0; c < 4; c++)
predictor[c] = expected_dc; predictor[c] = expected_dc;
......
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