Document:         VideoDOS.txt
File Group:       Classic Benchmarks
Creation Date:    19 December 1997
Revision Date:    22 January 1998

Title:            DOS Video Function Timing Test
Keywords:         BENCHMARK PERFORMANCE VIDEO GRAPHIC  

Abstract:         VIDEODOS measures performance of Watcom compiler
                  DOS graphics functions, results being in terms of
                  millions of pixels per second. A main purpose is
                  to provide a video test that can be used for burn-in
                  purposes in a DOS based test sequence, complementing
                  other programs in the Library.

Note:             The program is still under test and should be treated
                  as beta test software. Please submit feedback directly
                  to Roy, or as a posting in Section 12 message board.

WARNING           The program produces flashing repetitive patterns
                  which, theoretically, could cause ill effects,
                  probably dependent on the repetition frequency
                  produced by a particular video configuration. Do
                  not sit too close and stare at the screen.

                  The program is intended for use in a DOS only
                  environment. On running via Windows NT 4.0 it
                  locked out the video system, necessitating a re-
                  boot. However, limited tests show that it can run
                  via Windows 95 and in an OS/2 Warp 3 DOS window.
                  
                  USE AT YOUR OWN RISK
                              
Contributor:      Roy_Longbottom@compuserve.com (101323,2241)


Changes           Jan 1998 version 1.1 - extra parameter added to
                  enable running at 256 or 16 colours only.


DOS VIDEO FUNCTIONS TIMING TESTS


1. INTRODUCTION

VIDEODOS measures performance of various DOS graphics functions 
provided in the Watcom 11 C/C++ compiler. It should normally be run 
in a DOS only environment. In the default mode it carries out six 10 
second tests at a screen resolution of 640 x 480 at 16 and 256 
colours. Run time parameters are available for test duration, number 
of passes of the whole program, resolutions of 800 x 600 and 1024
x 768 and 256 and/or 16 colours. 

A main purpose is to provide a video test that can be used for burn-in 
purposes in a DOS based test sequence, complementing other programs in 
the Library. The program can be run without intervention with results 
being saved in the default log file VIDEOLOG.TXT. Parameters are 
available for a user defined log file and to pause for keyboard input at 
the end of a test with a particular screen resolution.

The program has been tested on five PCs with different video cards via 
DOS 6.2 boots with no additional video drivers or set up programs. All 
cards had at least 1 MB RAM (768K required). All tests ran successfully. 
However, one monitor had to be temporarily replaced as the pictures 
broke up at 800 x 600 and 1024 x 768. This monitor is normally used at 
800 x 600 via Windows 95 but will not work at 1024 x 768. 

Parameters can be included in a command, executed from a DOS prompt or 
via a BAT file. VIDEODOS requires DOS4GW.EXE the protected run-time 
program.
 

2. PROGRAM DESCRIPTION

The program displays some introductory messages with a delay of 20 
seconds then creates seven framed boxes on the screen for messages 
and tests. Using run time parameter E 0, the starting delay and all 
other pauses are disabled. The graphics function used and results in 
millions of pixels per second (represented by m) are display under 
the test box.

Box 1 - screen resolution and number of colours are displayed.

Box 2 - a multicoloured pattern produced with increasing sized
        characters is moved from side to side using the putimage
        function. The following code is used with the pattern
        being captured to character string rect1 using getimage.
  
  count[0] = 0;            
  timea = dtime();

  do
   {
      for (j=0; j<param[0]; j++)
       {
           for (i=0; i < x3; i=i+4)
            {
                _putimage(i  , 0, rect1, _GPSET);
                _putimage(i+1, 0, rect1, _GPSET);
                _putimage(i+2, 0, rect1, _GPSET);
                _putimage(i+3, 0, rect1, _GPSET);
            }   
           for (i=0; i < x3; i=i+4)
            {
                _putimage(x3-i-1, 0, rect1, _GPSET);
                _putimage(x3-i-2, 0, rect1, _GPSET);
                _putimage(x3-i-3, 0, rect1, _GPSET);
                _putimage(x3-i-4, 0, rect1, _GPSET);
            }   
       }
      timeit[0] = dtime()-timea;
      count[0] = count[0] + param[0];
   }   
  while (timeit[0] < (double)looptime);


Box3 - 80 circles are displayed repetitively with changing colours
       via the ellipse function. The colours are obtained from an
       array containing random numbers. The code is:

  count[1] = 0;             
  timea = dtime();

  do
   {
      for (i=0; i < param[1]; i++)
       {       
           for (j=0; j<incq; j++)   // incq = 10
            {
                for (k=0; k<8; k++)
                 {
                    _setcolor(randcol[i+k+j*8]);
                    _ellipse(_GFILLINTERIOR, x[j], y[k], x[j] + incp,
                                             y[k] + incp);
                 }
            }   
       }      
      timeit[1] = dtime()-timea;
      count[1] = count[1] + param[1];
   }   
  while (timeit[1] < (double)looptime);


Box4 - This test simply fills the whole box with random colours,
       using the rectangle(FILL) function. 

  count[2] = 0;            
  timea = dtime();

  do
   {
      for (j=0; j<param[2]; j++)
       {
           for (i=0; i < colors; i=i+4)
            {
                   _setcolor(randcol[i]);
                   _rectangle(_GFILLINTERIOR, x1, y1, x2, y2);
                   _setcolor(randcol[i+1]);
                   _rectangle(_GFILLINTERIOR, x1, y1, x2, y2);
                    _setcolor(randcol[i+2]);
                   _rectangle(_GFILLINTERIOR, x1, y1, x2, y2);
                   _setcolor(randcol[i+3]);
                   _rectangle(_GFILLINTERIOR, x1, y1, x2, y2);
            }   
       }   
      timeit[2] = dtime()-timea;
      count[2] = count[2] + param[2];
   }   
  while (timeit[2] < (double)looptime);


Box 5 - This uses the setpixel function with random colours,
        producing a dot pattern that slides across the box.

  count[3] = 0;            

  timea = dtime();

  do
   {
      m=0;
      for (j=0; j<param[3]; j++)
       {
           _rectangle(_GFILLINTERIOR, x1, y1, x2, y2);
           for (i=x1; i < x2+1; i++)
            {
                for (k=y1; k<y2+1; k++)
                 {
                   _setcolor(randcol[m]);
                   _setpixel(i, k);
                   m = m + 1;
                   if (m > 500) m = 0;                 
                 }
            }
       }    
      timeit[3] = dtime()-timea;
      count[3] = count[3] + param[3];
   }   
  while (timeit[3] < (double)looptime);

Box 6 - This test draws horizontal and vertical lines of decreasing
        length and different colours using the moveto and lineto
        functions.

  timea = dtime();  

  do
   {
      for (j=0; j<param[4]; j++)
       {
           x3 = x2 - x1 - i1;
           x4 = x1 + i2;
           y3 = y2 - y1 - i1;
           y4 = y1 + i2;
           _moveto(x4, y4);
           _setcolor(m);
           m = m +1;
           if (m > 15) m = 1;
           for (i=0; i < 9; i++)
            {                  
               _lineto(x4+x3, y4);
               _lineto(x4+x3, y4+y3);
               _lineto(x4,    y4+y3);
               _lineto(x4,    y4+i2);
               pixels[4] = pixels[4] + (double)(2 * x3)
                                + (double)(2 * y3 - i2);
               x3 = x3 - i1;
               y3 = y3 - i1;
               x4 = x4 + i2;
               y4 = y4 + i2;
               
            }
       }                  
      timeit[4] = dtime()-timea;
   }   
  while (timeit[4] < (double)looptime);

Box 7 - This is used to display general messages and all colours
        (well most) available. Finally, the pattern, or middle
        section, is moved across the screen using getimage and
        putimage.

  count[5] = 0;            

  timea = dtime();  

  do
   {
      for (j=0; j<param[5]; j++)
       {
          for (i=0; i<100; i++)
           {
              _getimage(i, 0, x3, y2-y1, rect2);   
              _putimage(0, 0, rect2, _GPSET);
           }
          _putimage(0, 0, rect1, _GPSET); 
       }       
      timeit[5] = dtime()-timea;
      count[5] = count[5] + param[5];
   }   
  while (timeit[5] < (double)looptime);


Examples of messages and results display are:

   sprintf (outtext, "     Press any key to continue ");
   _setcolor(2); 
   _grtext(x3 - 4 * neww,     y1, outtext);  
   _grtext(x3 - 4 * neww + 1, y1, outtext);
   _grtext(x3 - 4 * neww + 2, y1, outtext);

   sprintf (outtext, "%8.2fm", speed[2]);  
  _setcolor(TextColour);
  _setcharsize(oldh, oldw);
  _grtext(x1 + xp,     yp + oldh, outtext);
  _grtext(x1 + xp + 1, yp + oldh, outtext);

At the end of each pass of a particular screen size/colour 
combination  delays are introduced using the sleep function. The 
default delay is 5 seconds but this can be changed via run time 
parameters. With parameter E -1, the test is suspended until a key is 
pressed. Then, all results are displayed until another key is 
pressed. With parameter E 0, all delays and pauses are disabled.


3. RESULTS

Results in terms of millions of pixels per second are displayed, 
mainly under the text box as, for example, 1.51m. They are also saved 
in a log file with the default name VideoLog.txt. An example for a 
200 MHz Pentium MMX with a Diamond Stealth 64 Video VRAM adapter, 
with parameters to run at all screen resolutions is:


       DOS Video Test Version 1.0, Thu Dec 18 20:12:17 1997
                 Copyright (C) 1998, Roy Longbottom

                    Via Watcom Version 11

               .......... Millions of Pixels Per Second ...........

 Wide High Col Putimage  Ellipse Rectfill SetPixel DrawLine  Get/Put

  640  480  16    1.577    2.311   20.424    0.101    0.521    1.361
  640  480 256    8.584    0.966    9.250    0.037    0.852    1.745
  800  600  16    1.771    3.238   26.011    0.101    0.528    1.370
  800  600 256    8.846    1.018    9.501    0.020    0.929    1.700
 1024  768  16    1.884    2.267   29.019    0.099    0.497    1.309
 1024  768 256    9.214    2.061    9.735    0.015    1.062    1.656


4. RUN TIME PARAMETERS

Executing VideoDOS.EXE from a command line runs the tests at 640 x 
480 pixels with 16 and 256 colours, each for a minimum of 10 seconds 
and 5 second delays at the end.

Available parameters are shown in a HELP display which can be seen by 
entering VideoDOS H or in the case of unacceptable parameters being 
entered. The display shows the command as seen up to help being 
displayed:

 COMMAND Secs 20, Res 1024,

     HELP  DOS Video Test Version 1.0 Fri Dec 19 12:20:26 1997
                Copyright (C) 1998, Roy Longbottom

The program can have up to 5 parameters with the following format

Secs x     or S x   - Run seconds each test  x = 1-600   default  10
Passex x   or P x   - Number of test passes  x = 1+      default   1
Res x      or R x   - Resolution can be all              default 640
                      R 640, R 800, R 1024
Color x    or C x   - Number of colours  x = 16 or 256   deflt 16&256
Ending x   or E x   - Delay after last test  x = 1+      default   5
              E 0     Remove all delays and pauses
              E -1    Wait for key press
Log  nn    or L nn  - User defined log file nn = name    default
                                                        VideoLOG.txt

Example commands to run each test for 20 seconds at all resolutions,
256 colours, 10 passes at 1 resolution with user defined log file

      VIDEODOS Secs 20,   R 640, R 800, R 1024, C 256
      VIDEODOS Passes 10, R 800, Log mylog.txt

E 0 and E -1 are for debugging purposes. E 0 removes all delays and 
pauses in the program for fastest running time. E -1 stops the 
program running at the end of a pass, until a key is pressed and 
again after displaying all calculated performance figures.


5. PERFORMANCE

The measured performance is not very good compared with Windows based 
benchmarks. For example, the MMX/Diamond Stealth configuration for 
the above tests obtains 80+ M pixels per second, including via the 
test in the JAVA based Whets.HTML in the Library.

Measurements using the 3D benchmark SVGABNCH at 640 x 480 x 256 
colours obtains 36.5 frames per second or 11.2 M pixels per second. 
BENCH at 320 x 200 x 256 obtains 6.9 M pixels per second.

The particular routines in VIDEODOS obtained somewhat faster 
performance when tested initially as full screen tests.


Following are results for four PCs:

80486DX/2 66MHz, S3 VLB graphics card

Pentium 100 MHz, Trident TGUI 9440

Pentium MMX 200 MHz, Diamond Stealth 64 Video VRAM

Pentium Pro 200 MHz, 9FX Reality 332.
 
Surprisingly, the slower PCs obtain the fastest results on some 
functions.


A. 16 COLOURS

640 x 480      Putimage  Ellipse Rectfill SetPixel DrawLine  Get/Put

80486      66     1.433    1.009   14.178    0.060    0.544    1.367
Pentium   100     1.702    1.849   17.546    0.084    0.548    1.496
Pent MMX  200     1.577    2.311   20.424    0.101    0.521    1.361
Pent Pro  200     1.093    1.725   16.505    0.064    0.342    1.012

800 x600       Putimage  Ellipse Rectfill SetPixel DrawLine  Get/Put

80486      66     1.483    1.300   12.121    0.059    0.508    1.290
Pentium   100     1.734    2.483   20.632    0.084    0.560    1.356
Pent MMX  200     1.771    3.238   26.011    0.101    0.528    1.370
Pent Pro  200     1.224    2.456   19.543    0.065    0.345    1.004

1024 x 768     Putimage  Ellipse Rectfill SetPixel DrawLine  Get/Put

80486      66     1.685    0.787   11.851    0.056    0.257    1.288
Pentium   100     1.882    1.949   21.946    0.080    0.545    1.318
Pent MMX  200     1.884    2.267   29.019    0.099    0.497    1.309
Pent Pro  200     1.352    1.717   21.656    0.063    0.345    0.974


B. 256 COLOURS

The P100, MMX and PPro obtained 28, 110, 52 M pixels per second 
respectively, at 640 x 480 x 256 in the Whets.HTML video test. The
VIDEODOS results also confirm the same sort of relationship on some 
of the tests, that is, the MMX configuration is the fastest.


640 x 480      Putimage  Ellipse Rectfill SetPixel DrawLine  Get/Put

80486      66     1.962    0.244    2.315    0.010    0.233    1.033
Pentium   100     4.470    0.815    4.826    0.037    0.792    1.332
Pent MMX  200     8.584    0.966    9.250    0.037    0.852    1.745
Pent Pro  200     5.606    0.732    6.051    0.029    0.661    1.193

800 x 600      Putimage  Ellipse Rectfill SetPixel DrawLine  Get/Put

80486      66     2.084    0.264    2.428    0.006    0.255    1.024
Pentium   100     4.622    0.879    4.859    0.021    0.858    1.284
Pent MMX  200     8.846    1.018    9.501    0.020    0.929    1.700
Pent Pro  200     5.769    0.763    6.138    0.016    0.720    1.153

1024 x 768     Putimage  Ellipse Rectfill SetPixel DrawLine  Get/Put

80486      66     2.109    0.513    2.424    0.004    0.290    0.964
Pentium   100     4.703    1.597    4.914    0.016    0.960    1.198
Pent MMX  200     9.214    2.061    9.735    0.015    1.062    1.656
Pent Pro  200     5.962    1.499    6.293    0.012    0.821    1.113

Some of the results are disappointingly slow where such as setpixel, 
getimage/putimage and drawing lines should be avoided.


6. PROBLEMS

Besides running via DOS, the program appears to operate correctly, 
albeit a little slower, via Windows 95 and in a DOS full screen 
window via OS/2 Warp 3.

On running in a Windows NT full screen DOS Window, the program ran at 
resolution 640 x 480 but caused the display system to hang when a 
higher resolution was reached. The program should not be run via 
Windows NT.

The program does not use specific display driver software and, when 
run via a clean DOS boot, no display set up programs. This does not 
seem to matter much on a good quality display. With medium quality, 
the 1024 x 768 display was too narrow and, with a poor quality 
display, the pictures broke up at 800 x 600 and 1024 x 768. This 
display works correctly under Windows 95 at 800 x 600 but not at 1024 
x 768.

The program ran correctly at all resolutions on five PCs with 
different video cards.


7. SUBMITTING RESULTS

Results should be sent to Roy_Longbottom@compuserve.com and the 
following  information on the system under test should be included.

         PC Supplier/model 
         CPU chip           
         Clock MHz             
         Cache size           
         Chipset & H/W Options  (including details of graphics card)
         OS/DOS version       
         Run by (name)        
         Company/Location 
         E-Mail address 

The configuration details can be provided via program SYSTEMxx.EXE as 
supplied with the Classic Benchmarks.



