AN2121 Freescale Semiconductor / Motorola, AN2121 Datasheet - Page 19

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
By buffering the completed bytes from the C register, the B register always keeps a byte just removed from
the C register before the byte is sent to the output code stream. A shift counter, CT, counts the number of
shifts in the C register. When CT counts down to zero, the byte currently stored in the B register is moved
to the output code stream, then a byte from the C register is moved to the B register. This process is
illustrated in Figure 6.
The C register in Figure 6 is partitioned as follows:
The operation of moving data to or from the B register must adhere to the following so-called ‘bit-stuffing’
rules (refer to the BYTEOUT procedure in Figure C-9 on page 46).
C Register
1. If B
2. If B = $FF, a bit must be ‘stuffed’:
3. If B $FF and the carry bit (‘c’) is set, the byte in the B register cannot be moved directly
The ‘x’ bits are the fractional bits which are directly incremented by the value of Q
The ‘b’ bits indicate the bit positions from which a complete byte of the data is removed from the
C register.
The ‘c’ bit is the carry bit.
The ‘s’ bits are spacer bits which provide a useful buffer for a carry, so that it takes longer for a carry
to be propagated from the 'x' bits to the 'c' bit.
a) the byte in the B register is moved directly into the output code stream
b) bits 19 through 26 in the C register are moved into B
c) CT is set to 8 so that the next byte is output when bit 18 is shifted to bit 26. The current
a) the byte in the B register is again moved directly to the output code stream.
b) bits 20 to 27 in the C register are moved into B to include the carry bit.
c) CT is set to 7 so that the next byte is output when bit 19, which has not yet been output,
into the output code stream; the carry bit must be propagated into B:
a) increment B by 1
b) clear bit ‘c’.
c) If B
byte output is complete.
is shifted to bit 26. The current byte output is complete.
$FF and the carry bit (‘c’) is clear:
31
0 0 0 0 c b b b b b b b b s s s x x x x x x x x x x x x x x x x
$FF, follow rule 1; otherwise, follow rule 2.
28
Figure 6. C Register Partitions and Encoder Output
Output Code Stream
Freescale Semiconductor, Inc.
For More Information On This Product,
24
B Register
Go to: www.freescale.com
20 19
Background Theory
16
12
8
JPEG2000 Arithmetic Coding
4
0
e
.
15

Related parts for AN2121