diff options
author | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-09 01:14:58 +0400 |
---|---|---|
committer | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-09 01:14:58 +0400 |
commit | a9b7bf3fb3e1334d8defd05ca4cfae870b4912e5 (patch) | |
tree | 2dab453d94d5e003379a6cc895eceb84c80e23ec /src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/jpegls.h | |
parent | aafd49a91f7c2fa9c7103971c16fa6e1b29e8bfd (diff) |
astyle formatting cleanup to make the sourcecode more accessible
switch used: astyle --style=ansi --min-conditional-indent=0 --pad=oper --unpad=paren
http://astyle.sourceforge.net/
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1783 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/jpegls.h')
-rw-r--r-- | src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/jpegls.h | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/jpegls.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/jpegls.h index 61d64cd1c..2efd2ab40 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/jpegls.h +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/jpegls.h @@ -30,18 +30,20 @@ #include "avcodec.h"
-typedef struct JpeglsContext{
+typedef struct JpeglsContext
+{
AVCodecContext *avctx;
AVFrame picture;
-}JpeglsContext;
+} JpeglsContext;
-typedef struct JLSState{
+typedef struct JLSState
+{
int T1, T2, T3;
int A[367], B[367], C[365], N[367];
int limit, reset, bpp, qbpp, maxval, range;
int near, twonear;
int run_index[3];
-}JLSState;
+} JLSState;
extern const uint8_t ff_log2_run[32];
@@ -53,15 +55,19 @@ void ff_jpegls_init_state(JLSState *state); /**
* Calculate quantized gradient value, used for context determination
*/
-static inline int ff_jpegls_quantize(JLSState *s, int v){ //FIXME optimize
- if(v==0) return 0;
- if(v < 0){
+static inline int ff_jpegls_quantize(JLSState *s, int v) //FIXME optimize
+{
+ if(v == 0) return 0;
+ if(v < 0)
+ {
if(v <= -s->T3) return -4;
if(v <= -s->T2) return -3;
if(v <= -s->T1) return -2;
if(v < -s->near) return -1;
return 0;
- }else{
+ }
+ else
+ {
if(v <= s->near) return 0;
if(v < s->T1) return 1;
if(v < s->T2) return 2;
@@ -76,28 +82,34 @@ static inline int ff_jpegls_quantize(JLSState *s, int v){ //FIXME optimize void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all);
-static inline void ff_jpegls_downscale_state(JLSState *state, int Q){
- if(state->N[Q] == state->reset){
- state->A[Q] >>=1;
- state->B[Q] >>=1;
- state->N[Q] >>=1;
+static inline void ff_jpegls_downscale_state(JLSState *state, int Q)
+{
+ if(state->N[Q] == state->reset)
+ {
+ state->A[Q] >>= 1;
+ state->B[Q] >>= 1;
+ state->N[Q] >>= 1;
}
state->N[Q]++;
}
-static inline int ff_jpegls_update_state_regular(JLSState *state, int Q, int err){
+static inline int ff_jpegls_update_state_regular(JLSState *state, int Q, int err)
+{
state->A[Q] += FFABS(err);
err *= state->twonear;
state->B[Q] += err;
ff_jpegls_downscale_state(state, Q);
- if(state->B[Q] <= -state->N[Q]) {
- state->B[Q]= FFMAX(state->B[Q] + state->N[Q], 1-state->N[Q]);
+ if(state->B[Q] <= -state->N[Q])
+ {
+ state->B[Q] = FFMAX(state->B[Q] + state->N[Q], 1 - state->N[Q]);
if(state->C[Q] > -128)
state->C[Q]--;
- }else if(state->B[Q] > 0){
- state->B[Q]= FFMIN(state->B[Q] - state->N[Q], 0);
+ }
+ else if(state->B[Q] > 0)
+ {
+ state->B[Q] = FFMIN(state->B[Q] - state->N[Q], 0);
if(state->C[Q] < 127)
state->C[Q]++;
}
|