Browse Prior Art Database

An Algorithm for Minimizing PCI Bus Usage for Arbitrary Frame Rates

IP.com Disclosure Number: IPCOM000006602D
Publication Date: 2002-Jan-16
Document File: 4 page(s) / 15K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method for programming DMA (direct memory access) controllers to minimize peripheral component interconnect (PCI) bus usage for arbitrary frame rates.

This text was extracted from a Microsoft Word document.
This is the abbreviated version, containing approximately 50% of the total text.

An Algorithm for Minimizing PCI Bus Usage for Arbitrary Frame Rates

Disclosed is a method for programming DMA (direct memory access) controllers to minimize peripheral component interconnect (PCI) bus usage for arbitrary frame rates. 

Traditionally, video capture on a personal computer requires intensive use of both the PCI bus and the CPU (central processing unit).  Real-time encoding of video capture further taxes both the CPU and PCI bus.  Real-time encoding increases the load on the CPU and PCI bus because real-time encoding is often performed during video capture. 

Traditional video-capture algorithms do not minimize PCI bus usage while delivering frames of video on-time and at the desired frame level.  Traditional video-capture drivers always deliver all frames of video, regardless of the requested capture frame rate. 

The disclosed method differs from traditional implementations of video-capture drivers.  The disclosed method manages the buffers one video frame ahead of time.  When the time interval arrives for the next video frame to be delivered, the DMA engine is reprogrammed (PATCHED) to start video capture.  If the next frame of video is not needed to maintain the proper frame rate, the DMA program idles in a busy loop. 

By managing the buffers one video frame ahead of time, the disclosed method minimizes PCI bus usage, while still delivering video frames on-time and at the desired frame level.  By minimizing PCI bus usage, the disclosed method makes more PCI bandwidth available to real-time encoders.  In addition, the disclosed algorithm reduces contention for main memory.

The following algorithm describes critical functions of the disclosed method for minimizing PCI bus usage for arbitrary frame rates.

int FrameTimeWillExpire(int offset)

{

                int rVal;

                VIDEOATTRIBUTES a;

                unsigned long hiTime, loTime, usNativeBetweenFrames;

                GetMicrosecondCounter(&hiTime, &loTime);

                GetAttributes(&a);

                if(a.standard == StdNTSC)

                  usNativeBetweenFrames = 33367;

                else

                  usNativeBetweenFrames = 40000;

                ExtendedValULongAdd(&hiTime, &loTime, usNativeBetweenFrames * offset);

                if(ExtendedValGreaterThan(hiTime, loTime, g_hiTime, g_loTime))

                {

                  rVal = 1;

                  do

                  {

                  ExtendedValULongAdd(&g_hiTime, &g_loTime, a.usBetweenFrames);

                  }

                  while(ExtendedValGreaterThan(hiTime, loTime, g_hiTime, g_loTime));

                }

                else

                  rVal = 0;

                return rVal;

                }

                void LinkIntoBufferChain(VIDEOBUFFER *pVideoBuffer, VIDEOATTRIBUTES *pFmt)

                {

                                int idx = LookupIndex(pVideoBuffer);

                                // If the buffer isn't in the pool yet, add it now.

                                if(INVALID_INDEX == idx)

                                          idx = AddBufferToPool(pVideoBuffer,pFmt);

                                // If the buffer was added successfully, link it in.

                                if(INV...