diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-10-24 10:33:40 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-10-24 10:33:40 +0000 |
commit | 836096aa7a2acb1bba591519b822351955c03a41 (patch) | |
tree | dde25f86cd0c14949933cfb798261778869f9583 | |
parent | 54fe115921ac6451055fee469889d18a66fa8bea (diff) | |
download | ffmpeg-836096aa7a2acb1bba591519b822351955c03a41.tar.gz |
simplify
Originally committed as revision 6789 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/jpeg_ls.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libavcodec/jpeg_ls.c b/libavcodec/jpeg_ls.c index c0ce742c53..6f6d109c20 100644 --- a/libavcodec/jpeg_ls.c +++ b/libavcodec/jpeg_ls.c @@ -204,17 +204,13 @@ static inline int update_state_regular(JLSState *state, int Q, int err){ downscale_state(state, Q); if(state->B[Q] <= -state->N[Q]) { - 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]--; - if(state->B[Q] <= -state->N[Q]) - state->B[Q] = -state->N[Q] + 1; }else if(state->B[Q] > 0){ - state->B[Q] -= state->N[Q]; + state->B[Q]= FFMIN(state->B[Q] - state->N[Q], 0); if(state->C[Q] < 127) state->C[Q]++; - if(state->B[Q] > 0) - state->B[Q] = 0; } return err; |