AN2121 Freescale Semiconductor / Motorola, AN2121 Datasheet - Page 42

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
; Initialize the arithmetic encoder - Fig C-10
INITENC:
; if B not equal 0xFF, CT = 12
BLOCK
CODELPS:
CODEMPS:
38
moveu.w #RENORM_THRESH,d0.l
move.l #$00010000,PCTL1
move.b (r7)+,d2
bmtsts
move.b (r1)+,d5
ift
asla r6
adda r2,r6
dosetup0 BLOCK
doen0 d3
loopstart0
falign
move.w (r6),r3
jtd
sub d7,d0,d0
move.w (r3+n0),d9
adda #2,r3
bmtsts
move.w (r3),d8
ift bmchg #$0001,d6.l
jmp RENORME
bmtsts
move.w (r3),d8
jt
ift add d7,d1,d1
ift move.w d6,(r5)
norenorm
#$ff,d2.l
#$0001,d9.l
#$8000,d0.l
CODEMPS
cmpeq d5,d6
adda r0,r3
JPEG2000 Arithmetic Encoding on the StarCore SC140
move.w
tfra r6,r5
; tables for indices and MPS values respectively, so to access
; correct index and MPS need to offset by base addresses
adda r4,r5
Freescale Semiconductor, Inc.
For More Information On This Product,
; Need CX-1 because context table:MPS starts at 0.
; BP = BPST-1
; output compressed bitstream (BP in FDIS)
; This is BPST-1, i.e. the first byte will be output to r7+1
; Assign this to BP
; 300MHz; rest of input data in bytes, so byte align r1
; output stream, i.e. B pointed to by BP
; and d5.
; CX is an index into CONTXT table of indices; B = 0xFF?
move.w (r5),d6
; now pointing at Qe in table entry for this index as r0 is
; base address for Qe table
; now code lps or mps
move.w (r3)+,d7
; i.e. if 0 change to 1 and vice versa
; replace new sense of MPS to memory and d8 = NLPS(I(CX))
;CX-1 because CONTXT:index table address starts at 0
#13,d4
; in either MPS or LPS case, first step is A = A - Qe
Go to: www.freescale.com
else CT = 13
; need to multiply CX by 2 because stored indices
; as words in table
; r5 points to CX:MPS of bytes
; r2 and r4 are the base addresses of the CONTXT
; set up loop through cx,d pairs in one block
; (assumed only 1 block in this example)
cmpgt d0,d7
tfrf d7,d0
move.w d8,(r6)
ift
add d7,d1,d1
move.w #OUTPUT,r7
adda #1,r1
move.w #2,n0
move.b (r1)+,r6
deca r2
iff
i.e. r7 is BP
move.w #12,d4
; d6 = MPS
; i.e. I(CX)
; D = MPS(CX)?
;
; from D = MPS(CX)? test, d7 = Qe,
; d9 = SWITCH; A < Qe(I(CX))?
; r3 -> NLPS(I(CX))
; if A<Qe true, C = C + Qe(I(CX))
; SWITCH(I(CX)) = 1?
; if A>Qe then A = Qe(I(CX))
; if A<Qe, I(CX) = NLPS(I(CX))
; if SWITCH, MPS = 1 - MPS
; if SWITCH,
;always renormalize on the CODELPS path
; A AND 0x8000 = 1?
;
r3 -> NMPS
d8 = NMPS(I(CX))
; Ensure clock speed is
; I(CX) = NLPS(I(CX))
; if false (i.e. T set)
; C = C + Qe(I(CX))
i.e. MPS(CX) ; r3 = index
; A = 0x8000 (in d0.l)
; get previous byte from
; data in d5, need to have
MPS(CX) = 1 - MPS(CX)
; read CX, D pair into r6

Related parts for AN2121