This code and information is provided "as is" without warranty of any
kind, either expressed or implied, including but not limited to the
implied warranties of merchantability and/or fitness for a particular
purpose.
1995,1998 Analog Devices, Inc.
MMX-based Software Decoder Simulator for ADV601
This directory contains source and library files for MMX-based
ADV601 Software Decoder. It also conatains a test file
(bmmain.c)
for testing and benchmarking the performance of the
decoder under MS-DOS.
Version 6 has two new features added to it:
-
Different color schemes, or rather sample orders (all of them are YUV 4:2:2
) are supported: UYVY, VYUY, YUYV and YVYU.
-
The size of the actual input data returned after the decompression.
Using the library
To call the decoder functions described in the
Interface Document one has to include the
codec.h file in the program and link it with the
library adv6dec.lib. As an example of the use of the
library (and an illustration to
Interface Document), refer to the test file
(bmmain.c).
Using the Source Files
Instead of using the precompiled library one might decide to recompile the
source files.
Here is how the benchmark executable can be built using the source files:
-
Create a subdirectory named MSMMXDEC
-
In MS-DOS execute the following command:
NMAKE /F MSMMXDEC.MAK ALL
This should result in the file MSMMXDEC\BM.EXE, which can be
used for testing and performance measurements of the decoder.
Note that the above step required several utilities:
- NMAKE utility from Microsoft
- MASM v. 6.12 (MMX enahnced) -- the Pentium assembler from
Microsoft
- Visual C++ version 5.0
Note also that the
makefile
builds the library files
ADV6DEC.lib
and
ADV6MMX.lib. If the libraries are already present in the
MSMMXDEC subdirectory and if they are up-to-date, then the
libraries are used instead of the source files.
This might be useful, for example, if you don't have
version 6.12 of
MASM -- just make sure that you have adv6mmx.lib in
the
MSMMXDEC
subdirectory.
If not using the supplied makefile, it is important to
use the switch /Gr
and set the following macros
- WIN32
- __MS__
- HDISP_SIZE=14
- AMMX
- DECODER
Appendix: File List
Short description of the files in the distribution:
- adv6dec.lib
-
Library containing the MMX-based decoder.
- adv6mmx.lib
-
Library containing compiled assembly sources only. For those without
access to version 6.12 of MASM.
- awmodel.c
-
(De)Modeller: decodes symbols into values and run-length sequences of zeroes.
- awmodel.h
-
- block.c
-
Description of block geometry and access functions.
- block.h
-
- bmmain.c
-
The test file. Can be used to build the test executable. Might also be
useful as an example of the usage of the decoder.
- bstream.c
-
Bit Stream Parser. Extracts the bit fields and headers from the
compressed data.
- bstream.h
-
- codec.c
-
Top level functions of the decoder.
- codec.h
-
- common.c
- Contains long jump buffer.
- common.h
- Common include files and macros.
- fix16.h
- Fixed point arithmetic.
- havemmx.asm
- Test for MMX-extension.
- havemmx.h
-
- hcoder.c
- Huffman Decoder.
- hcoder.h
-
- ht-data.c
- Data for initializing the Huffman tables.
- htable.c
- Huffman Table management (initialization) routines.
- htable.h
-
- ioyuv.asm
- Conversion of internal data to YUV (UYVY 4:2:2) format.
- ioyuv.h
-
- msmmxdec.mak
- The makefile.
- parms.c
- Definition of internal parameters which are used by most source codes.
- parms.h
- Declaration of internal parameters which are used by most source codes.
- parms.inc
- Same as "parms.h", but in the assembler.
- quant.c
- Dequantization function.
- quant.h
-
- stat.c
- Statistics computation (encoder only).
- stat.h
-
- targ.h
- Some target-dependent macros and pragmas.
- wtanl.c
- Wavelet Transform, Analysis (encoder only).
- wtanl.h
-
- wths.asm
- Wavelet Transform Horizontal Synthesis (single stage code).
- wtmmx.h
- External declarations for "wths.asm"
- wttop.c
- Top level wavelet transform code (multiple stages).
- wttop.h
-
- wtvs.asm
- Wavelet Transform Vertical Synthesis.
- wtypes.h
- Type and structure declarations.
Some Implementation Details
-
Internal precision in the Wavelet transform is 10.6.
-
There is no separate dequantization stage. Instead the demodeller (in
awmodel.c) writes integer values straight into the WT memory. The
first (DC) block is dequantized explicitly, and all other blocks
are dequantized during inverse WT by pre-scaling wavelet coefficients.
-
-