DVIEW - a Digital Video decoder & viewer



Introduction

DView is a program that decodes and displays Digital Video (DV) data. The data can be read from a file or from a network stream. It is written in C to ensure both good performance and portability.

Requirements

Hardware:
The faster CPU, the better! During the tests we run it on a 600 Mhz Pentium III with 256 Mb of RAM and we still couldn't get full framerate, although we got an "acceptable" framerate of 8-13 frames/s. Note that fancy graphic-cards doesn't help much since the decoding is done by the CPU.

Software:
  • The X11 window system (with libraries and header files)
  • A well optimizing C compiler
  • The data

    The input data consists of a series of frames. Each frame contain one full video image, 1/30 seconds of sound and auxiliary data. The video data consists of luminance (brightness) and chrominance (color) data with the ratio 4:1:1, often referred to as YCrCb.
    The iDCT scanline pattern over a pixelgroup

    The algorithm

    The decoding algorithm works in three steps.

    1. Decode the DIF-blocks and lookup the frequency and amplitude in a Huffman-table.
    2. Run the inverse-Discrete-Cosine-Transformation (iDCT) to get the luminance and chrominance.
    3. Convert YCrCb to RGB and draw the data on the screen.

    Options

    DView has three options that can greatly improve the performance. These options are downscaling, reduced rendering precision and greyscale.
       Downscaling reduces the displayed size of the video, which means that a smaller number of pixels need to be rendered.
       Reduced rendering precision means that the iDCT algorithm will run fewer times, thus reducing the number of values available to calculate the brightness and color. Half rendering precision is the default since higher rendering doesn't give notably increased image quality.
       Greyscaling removes the need to decode and render the chrominance part of a video block, and to convert YCrCb to RGB.

    The framerate as a function of scale and precision

    Efficiency

    The iDCT function is the single major bottleneck for performance. The execution time of iDCT is however depending on the square of both the scale and the precision. If both scale and precision is halved, the framerate increases eightfold! For really small scales and precisions; constant-time functions, whose performance impact otherwise would be minimal, will put an upper limit on framerate.

    Bugs