[Scummvm-devel] DXA file format for videos
Max Horn
max at quendi.de
Sat Apr 29 08:16:04 CEST 2006
Am 29.04.2006 um 17:03 schrieb Eugene Sandulenko:
> On Sat, 29 Apr 2006 15:21:20 +0200
> Gregory Montoir <cyx at users.sourceforge.net> wrote:
>
>> The files produced with the encode_dxa tool in the SVN repository
>> doesn't seem to allow that, though. It seems it encodes the first
>> frame as an intra frame and the others frames as difference.
> It's just the matter of adding couple lines of code, something like
> this:
>
> instead of
>
> if (_framecount == 0)
> compType = 2;
> else
> compType = 3;
>
> write
>
> if (_framecount % 120 == 0)
> compType = 2;
> else
> compType = 3;
>
> That will make a keyframe each 120 frames. compType 2 is a keyframe
> and
> compType 3 is a XOR frame.
Since we don't really need to do seeking, another approach might be
interesting, too: For each frame, compute both the result of encoding
it as an inter AND as an intra frame. Then use whichever is smaller.
Reasoning: On scenes were a lot changes, encoding the full new frame
might actually be better than encoding the XOR. E.g. when switching
from a complicated scene to an all-black screen ... :-).
Though I doubt this'll save us more than a couple 100kb at most.
Unless a lot of switches to monotone colored frames occur :-).
Cheers,
Max
More information about the Scummvm-devel
mailing list