Friday 15 February 2013

Setting VGA Frame Buffer sizes


The formula for calculating frame buffer sizing :

First of all, you need the size of one screenful:
     multiply the horizontal resolution by the vertical resolution by the colour depth : this is the size in bits (b)
then

     divide by 8  : this is now the size in Bytes (B)
then
     divide by 1024 : this is now the size in KiloBytes (KB)
then
     divide by 1024 again : this is now the size in MegaBytes (MB)

To go straight in one stage -
(horizontal resolution * vertical resolution * colour depth )  / ( 8 x 1024 x1024) = size of 1 screen in MB

Then, depending on how many frames you need to buffer to avoid flicker, you need to multiply the size in MB by the number of frames you need.

Incidentally, if you know the screen frequency - which is the same as the number of frames in one second -
then one second of video = size of 1 screen * screen frequency.

No comments: