AN2121 Freescale Semiconductor / Motorola, AN2121 Datasheet - Page 29

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
Appendix A
Arithmetic Encoder: C Code
Arithenc.c
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include "arithEnc.h"
#include "fileIO.h"
/*
#define inline
/* The information associated with a context state */
typedef struct
{
} ArithEncContext;
/*
/* The lower bound of the current probability interval */
static uint32 C;
/* The size of the current probability interval */
static uint32 A;
/* Counts the number of shifts that have been performed */
static uint32 CT;
/* The byte that is currently being assembled */
static uint8 B;
/* 1 if the current byte is the first output byte, otherwise 0 */
static int firstByte;
/* The array of allowable context states */
#define MAXCONTEXT 18
static ArithEncContext contexts[MAXCONTEXT+1];
An implementation of the MQ arithmetic encoder described in
Annex C of the JPEG2000 FDIS,[4].
All data types converted to uint32.
Context variables made global, rather than access via pointers.
Manually inlined the CodeMPS and CodeLPS functions.
* Set this to inline to make all internal functions inline.
*/
* The state information required by the arithmetic encoder.
*/
author Matthew Leditschke
version $Revision: 1.1 $
uint32 I;
uint32 MPS;
Freescale Semiconductor, Inc.
Appendix A. Arithmetic Encoder: C Code
For More Information On This Product,
/*< The index into Table C-2 (values in the range 0..46) */
/*< The most probable symbol (either 0 or 1) */
Go to: www.freescale.com
25

Related parts for AN2121