summaryrefslogtreecommitdiff
path: root/libopenjpeg/raw.c
diff options
context:
space:
mode:
authorSebastien Lugan <slugan@users.noreply.github.com>2004-04-29 13:10:05 +0000
committerSebastien Lugan <slugan@users.noreply.github.com>2004-04-29 13:10:05 +0000
commitec9bd9f6a455a83da8c2c77f5b2628b416cca18f (patch)
treee9f3cb176093b68fc7faf35f09b595f5b1f6680d /libopenjpeg/raw.c
parent4f83e82a74e7456881eadd68f5b863ea502ea8bc (diff)
Reformatage : indent -kr $(find . -name '*.c') $(find . -name '*.h')
Diffstat (limited to 'libopenjpeg/raw.c')
-rw-r--r--libopenjpeg/raw.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/libopenjpeg/raw.c b/libopenjpeg/raw.c
index 180a1dec..390146ce 100644
--- a/libopenjpeg/raw.c
+++ b/libopenjpeg/raw.c
@@ -27,20 +27,20 @@
#include "raw.h"
-unsigned char raw_c; /* temporary buffer where bits are coded or decoded */
-unsigned int raw_ct; /* number of bits already read or free to write */
-unsigned int raw_lenmax; /* maximum length to decode */
-unsigned int raw_len; /* length decoded */
-unsigned char *raw_bp; /* pointer to the current position in the buffer */
-unsigned char *raw_start; /* pointer to the start of the buffer */
-unsigned char *raw_end; /* pointer to the end of the buffer */
+unsigned char raw_c; /* temporary buffer where bits are coded or decoded */
+unsigned int raw_ct; /* number of bits already read or free to write */
+unsigned int raw_lenmax; /* maximum length to decode */
+unsigned int raw_len; /* length decoded */
+unsigned char *raw_bp; /* pointer to the current position in the buffer */
+unsigned char *raw_start; /* pointer to the start of the buffer */
+unsigned char *raw_end; /* pointer to the end of the buffer */
/*
* Return the number of bytes already encoded.
*/
int raw_numbytes()
{
- return raw_bp - raw_start;
+ return raw_bp - raw_start;
}
/*
@@ -51,11 +51,11 @@ int raw_numbytes()
*/
void raw_init_dec(unsigned char *bp, int len)
{
- raw_start = bp;
- raw_lenmax = len;
- raw_len = 0;
- raw_c = 0;
- raw_ct = 0;
+ raw_start = bp;
+ raw_lenmax = len;
+ raw_len = 0;
+ raw_c = 0;
+ raw_ct = 0;
}
/*
@@ -63,19 +63,19 @@ void raw_init_dec(unsigned char *bp, int len)
*/
int raw_decode()
{
- int d;
- if (raw_ct == 0) {
- raw_ct = 8;
- if (raw_len == raw_lenmax)
- raw_c = 0xff;
- else {
- if (raw_c == 0xff)
- raw_ct = 7;
- raw_c = *(raw_start + raw_len);
- raw_len++;
- }
+ int d;
+ if (raw_ct == 0) {
+ raw_ct = 8;
+ if (raw_len == raw_lenmax)
+ raw_c = 0xff;
+ else {
+ if (raw_c == 0xff)
+ raw_ct = 7;
+ raw_c = *(raw_start + raw_len);
+ raw_len++;
}
- raw_ct--;
- d = (raw_c >> raw_ct) & 0x01;
- return d;
+ }
+ raw_ct--;
+ d = (raw_c >> raw_ct) & 0x01;
+ return d;
}