==========================================================
*/
-opj_raw_t* raw_create(void) {
+opj_raw_t* opj_raw_create(void) {
opj_raw_t *raw = (opj_raw_t*)opj_malloc(sizeof(opj_raw_t));
return raw;
}
-void raw_destroy(opj_raw_t *raw) {
+void opj_raw_destroy(opj_raw_t *raw) {
if(raw) {
opj_free(raw);
}
}
-int raw_numbytes(opj_raw_t *raw) {
+OPJ_UINT32 opj_raw_numbytes(opj_raw_t *raw) {
return raw->bp - raw->start;
}
-void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len) {
+void opj_raw_init_dec(opj_raw_t *raw, OPJ_BYTE *bp, OPJ_UINT32 len) {
raw->start = bp;
raw->lenmax = len;
raw->len = 0;
raw->ct = 0;
}
-int raw_decode(opj_raw_t *raw) {
- int d;
+OPJ_UINT32 opj_raw_decode(opj_raw_t *raw) {
+ OPJ_UINT32 d;
if (raw->ct == 0) {
raw->ct = 8;
if (raw->len == raw->lenmax) {
*/
typedef struct opj_raw {
/** temporary buffer where bits are coded or decoded */
- unsigned char c;
+ OPJ_BYTE c;
/** number of bits already read or free to write */
- unsigned int ct;
+ OPJ_UINT32 ct;
/** maximum length to decode */
- unsigned int lenmax;
+ OPJ_UINT32 lenmax;
/** length decoded */
- unsigned int len;
+ OPJ_UINT32 len;
/** pointer to the current position in the buffer */
- unsigned char *bp;
+ OPJ_BYTE *bp;
/** pointer to the start of the buffer */
- unsigned char *start;
+ OPJ_BYTE *start;
/** pointer to the end of the buffer */
- unsigned char *end;
+ OPJ_BYTE *end;
} opj_raw_t;
/** @name Exported functions */
Create a new RAW handle
@return Returns a new RAW handle if successful, returns NULL otherwise
*/
-opj_raw_t* raw_create(void);
+opj_raw_t* opj_raw_create(void);
/**
Destroy a previously created RAW handle
@param raw RAW handle to destroy
*/
-void raw_destroy(opj_raw_t *raw);
+void opj_raw_destroy(opj_raw_t *raw);
/**
Return the number of bytes written/read since initialisation
@param raw RAW handle to destroy
@return Returns the number of bytes already encoded
*/
-int raw_numbytes(opj_raw_t *raw);
+OPJ_UINT32 opj_raw_numbytes(opj_raw_t *raw);
/**
Initialize the decoder
@param raw RAW handle
@param bp Pointer to the start of the buffer from which the bytes will be read
@param len Length of the input buffer
*/
-void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len);
+void opj_raw_init_dec(opj_raw_t *raw, OPJ_BYTE *bp, OPJ_UINT32 len);
/**
Decode a symbol using raw-decoder. Cfr p.506 TAUBMAN
@param raw RAW handle
@return Returns the decoded symbol (0 or 1)
*/
-int raw_decode(opj_raw_t *raw);
+OPJ_UINT32 opj_raw_decode(opj_raw_t *raw);
/* ----------------------------------------------------------------------- */
/*@}*/
return 00;
}
- l_t1->raw = raw_create();
+ l_t1->raw = opj_raw_create();
if (! l_t1->raw) {
opj_t1_destroy(l_t1);
return 00;
/* destroy MQC and RAW handles */
opj_mqc_destroy(p_t1->mqc);
p_t1->mqc = 00;
- raw_destroy(p_t1->raw);
+ opj_raw_destroy(p_t1->raw);
p_t1->raw = 00;
if (p_t1->data) {
continue;
}
if (type == T1_TYPE_RAW) {
- raw_init_dec(raw, (*seg->data) + seg->dataindex, seg->len);
+ opj_raw_init_dec(raw, (*seg->data) + seg->dataindex, seg->len);
} else {
if (OPJ_FALSE == opj_mqc_init_dec(mqc, (*seg->data) + seg->dataindex, seg->len)) {
return OPJ_FALSE;
if ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {
opj_mqc_setcurctx(mqc, opj_t1_getctxno_mag(flag)); /* ESSAI */
if (type == T1_TYPE_RAW) {
- v = raw_decode(raw);
+ v = opj_raw_decode(raw);
} else {
v = opj_mqc_decode(mqc);
}
flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {
if (type == T1_TYPE_RAW) {
- if (raw_decode(raw)) {
- v = raw_decode(raw); /* ESSAI */
+ if (opj_raw_decode(raw)) {
+ v = opj_raw_decode(raw); /* ESSAI */
*datap = v ? -oneplushalf : oneplushalf;
opj_t1_updateflags(flagsp, v, t1->flags_stride);
}