AN2121 Freescale Semiconductor / Motorola, AN2121 Datasheet - Page 21

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
3
This section describes the software written for a StarCore implementation of the JPEG2000 arithmetic
coder. Appendix A is a listing of the C code, and Appendix B lists the assembly code. All variables in the
following descriptions refer to the actual variables used in the code.
3.1
The code given in Appendix A is a direct implementation of the JPEG2000 arithmetic encoder as
presented in Section 2.4, and is based on the flow diagrams provided in the FDIS [4] which have been
produced for ease of reference in Appendix C. A brief description of these diagrams can be found on page
11.
The pseudo code for the encoder software in Appendix A is listed in Code Example 1.
/* pre-set A to Pe interval
A = A – Qe
if symbol == MPS
else
if A < 0.75
else
end
IF a < qE
else
end
/* the switch is on when Qe > 0.5 in this state */
if switch == 1
end
/* update Qe */
transfer to new state
end
/* symbol == LPS */
Implementation
StarCore Implementation in C Code
if A < Qe
else
end
/* update Qe */
transfer to new state
/* scale A and C */
renormalize
/* encode the current symbol as MPS */
C = C + Qe
/* IF pE < qE, encode the current symbol as MPS.
the switch to invert the sense of MPS will be on */
C = C + Qe
/* encode the current symbol as LPS */
A = Qe
/* if switch is on for this state,
MPS = 1 – MPS
/* scale A and C */
renormalize
Code Example 1. JPEG2000 Arithmetic Encoder Pseudo Code
invert the sense of MPS */
/* if Pe < Qe, encode the current symbol as LPS */
A = Qe
/* encode the current symbol as MPS */
C = C + Qe
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
Implementation
StarCore Implementation in C Code
17

Related parts for AN2121