AN2121 Freescale Semiconductor / Motorola, AN2121 Datasheet - Page 23

no-image

AN2121

Manufacturer Part Number
AN2121
Description
JPEG2000 Arithmetic Encoding on StarCore SC140
Manufacturer
Freescale Semiconductor / Motorola
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN2121SC
Manufacturer:
TERIDIAN
Quantity:
40
The marker code has a prefix of $FF which can be made to overlap the final bits of the compressed data by
ensuring that the final bits of the C register are also $FF. This means that any marker code at the end of the
compressed image data is recognized and interpreted before decoding is complete because the marker and
last image data for the arithmetic decoder are the same. Therefore, the final $FF in the C register can be
discarded, thus reducing the length of the output stream. This overlapping of compressed data and marker
code is achieved by setting as many bits in the C register as possible. This is determined as follows:
At the end of encoding, C points to the lower bound of the given interval. The upper bound of the interval
is equal to C + A. The process of renormalization ensures that A
Therefore, when A
C, beyond the interval even if they are all set. If A > $8000, this is true for the 16 least significant bits of
the C register. Setting the correct number of bits is performed by the SETBITS procedure illustrated in
Figure C-12 on page 49, which consists of the following steps:
This procedure guarantees that C points to the required final interval with the lowest 16 or 15 bits set, and
the original symbol can be decoded correctly.
After the SETBITS procedure is called, the last of the compressed data bits in the C register are moved to
the output code stream via the B register. The final $FF byte can be discarded.
3.1.3
Benchmark tests of several images were run on the StarCore processor with the C code listed in
Appendix A, using level 2 optimization with 4 parallel multiply accumulator modules. Figure 8 shows a
typical image used in the benchmark tests.
This image is 128
corresponding context/data pairs, the number of clock cycles required to encode this image was
extrapolated to determine the performance figures in seconds for a 1 megapixel color image with 12 bits
per pixel, assuming a 300MHz clock speed and multiplying by 2 to represent a YUV:422 format. For
comparison purposes, the experiments were repeated for a constant grey scale image, which should yield
the fastest possible execution times and the greatest compression. The results are summarized in Table 3
on page 20.
The results for the constant grey scale image are two orders of magnitude faster than the typical image.
This is because the encoder receives almost constant MPS’s, which yields a considerably more compressed
bit stream. In addition to this, the coefficient bit modeller only produces context/data pairs for the LL
subband at the lowest level of decomposition. Consequently, none of the other subbands have any
context/data pairs associated with them.
1. Set bits 0 to 15 in the C register.
2. Compare the result to the upper bound of A to determine if C still points to the given
3. If C is too large (i.e., A == $8000), clear bit 15.
interval.
StarCore Performance
128 pixels with 12 bits/pixel. After the coefficient bit modeler had produced the
$
Freescale Semiconductor, Inc.
the 15 least significant bits of the C register cannot increment the code word,
Figure 8. Test Image for Arithmetic Encoder
For More Information On This Product,
Go to: www.freescale.com
Implementation
$8000, hence (C + A)
StarCore Implementation in C Code
(C + $8000).
19

Related parts for AN2121