diff options
| author | Antonin Descampe <antonin@gmail.com> | 2016-01-25 23:22:06 +0100 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2016-01-25 23:22:06 +0100 |
| commit | 0febbff19e05cb1a6c2613eee76ad46a669c96cd (patch) | |
| tree | b6442d01348e2ba6404d0fd6abcc4eb6d6cc1390 /src/lib/openjp3d/raw.c | |
| parent | bede1568b197021bb576b935422af6c1d0a79e21 (diff) | |
processed all c/h files through astyle with opj_astyle.cfgcodingstyle
Diffstat (limited to 'src/lib/openjp3d/raw.c')
| -rw-r--r-- | src/lib/openjp3d/raw.c | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/src/lib/openjp3d/raw.c b/src/lib/openjp3d/raw.c index 7f6a3ad5..b7aa6786 100644 --- a/src/lib/openjp3d/raw.c +++ b/src/lib/openjp3d/raw.c @@ -1,6 +1,6 @@ /* - * The copyright in this software is being made available under the 2-clauses - * BSD License, included below. This software may be subject to other third + * The copyright in this software is being made available under the 2-clauses + * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * @@ -33,59 +33,64 @@ #include "opj_includes.h" -/* +/* ========================================================== local functions ========================================================== */ -/* +/* ========================================================== RAW encoding interface ========================================================== */ -opj_raw_t* raw_create() { - opj_raw_t *raw = (opj_raw_t*)opj_malloc(sizeof(opj_raw_t)); - return raw; +opj_raw_t* raw_create() +{ + opj_raw_t *raw = (opj_raw_t*)opj_malloc(sizeof(opj_raw_t)); + return raw; } -void raw_destroy(opj_raw_t *raw) { - if(raw) { - opj_free(raw); - } +void raw_destroy(opj_raw_t *raw) +{ + if(raw) { + opj_free(raw); + } } -int raw_numbytes(opj_raw_t *raw) { - return raw->bp - raw->start; +int raw_numbytes(opj_raw_t *raw) +{ + return raw->bp - raw->start; } -void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len) { - raw->start = bp; - raw->lenmax = len; - raw->len = 0; - raw->c = 0; - raw->ct = 0; +void raw_init_dec(opj_raw_t *raw, unsigned char *bp, int len) +{ + raw->start = bp; + raw->lenmax = len; + raw->len = 0; + raw->c = 0; + raw->ct = 0; } -int raw_decode(opj_raw_t *raw) { - 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; +int raw_decode(opj_raw_t *raw) +{ + 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; } |
