While I'm here, fix some chroma sub-sampling bugs.
RE4's brightness screen is actually very good for spotting these. Bug 1: Colors at the end of the scanlines are clamped, instead of a black border Bug 2: U and V color channels share coordinates, instead of being offset by a pixel.
This commit is contained in:
parent
fc96479f12
commit
a192a3bb30
|
@ -599,7 +599,7 @@ void EncodeXFB(u8* xfb_in_ram, u32 memory_stride, const EFBRectangle& source_rec
|
|||
src_ptr[x + 1].Y = scanline[i + 1].Y + 16;
|
||||
// V[i] = 1/4 * V[i-1] + 1/2 * V[i] + 1/4 * V[i+1]
|
||||
src_ptr[x + 1].UV =
|
||||
128 + ((scanline[i].V + (scanline[i + 1].V << 1) + scanline[i + 2].V) >> 2);
|
||||
128 + ((scanline[i - 1].V + (scanline[i].V << 1) + scanline[i + 1].V) >> 2);
|
||||
}
|
||||
src_ptr += memory_stride;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue