AN2121 Freescale Semiconductor / Motorola, AN2121 Datasheet - Page 34

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
Encoder.c
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include "arithEnc.h"
#include "fileIO.h"
/* Create arrayIn and arrayOut for testing */
#include "tile5-symbols.h"
void main()
{
/*
*/
} /* main */
/* ======================================================================== */
FileIO.c
/*
*/
#include <stdio.h>
30
A test harness for the MQ arithmetic encoder described in
Annex C of JPEG2000.
Handle the input and output of bytes.
This main program performs arithmetic encoding, given context-bit
pairs stored in arrayIn[].
author Matthew Leditschke
version $Revision: 1.3 $
author Matthew Leditschke
version $Revision: 1.3 $
int i,j,k;
uint16 CX;
uint8 D;
int numBlocks, numPairs, blockIdx;
ArithEncInit();
numBlocks = arrayIn[0];
blockIdx = 1;
for (i=0; i<numBlocks; i++)
{
}
numPairs = arrayIn[blockIdx];
blockIdx += (1+numPairs<<1);
for (j=0, k=2; j<numPairs; j++,k=k+2)
{
}
ArithEncFlush();
When including "tile5-symbols.h", the
correct results in arrayOut[] should be
CX = arrayIn[k];
D = arrayIn[k+1];
ArithEncEncode(D, CX);
11 50 54 af
JPEG2000 Arithmetic Encoding on the StarCore SC140
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2121