The video player: Diff based rendering
To reduce both space and update timings, we only update the pixels that were changed since last time. Last time does not mean the previous frame in this case, as we use comboimages. And note, the initial page 0 and page 1 are filled with a fullscreen image, as this is the very beginning of the video.
As we alternate between page 0 and page 1, page 0 will diff towards the previous page 0 content, and page 1 will diff towards previous page 1 content. That means that there is more than one frame between each diff, resulting in bigger diffs.
Here’s a visual explanation attempt:
Once page 0 (yellow boxes) and page 1 (green boxes) are prepared with a full image, the diffs are the only data applied hereafter to each page. Thus only the first two comboimages and the diffs are present in the ROM file, which means there are no keyframes in the current format. In turn, that means it is not possible to start the video from frame n, only from frame 0..
Below are two generated diff images, dumped for debugging purposes, and with a special 256 index palette, where most of the palette entries are a linear cyan color gradient. Because screen 5 combines every two pixels horizontally, all debug dumps are 128x192.
Black means no diff. Very dark red is a special color and means going black (erasing the current color in this area).
< Double buffering | Diff based rendering | Frame scheme >
Comments
Post a Comment