From 9cacdabd1c8cd257a942d8289349c37d992989b7 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 15 May 2013 19:55:09 +0200 Subject: [PATCH] jpegls: cosmetics: Drop some unnecessary parentheses --- libavcodec/jpegls.c | 8 ++++---- libavcodec/jpeglsdec.c | 6 +++--- libavcodec/jpeglsenc.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libavcodec/jpegls.c b/libavcodec/jpegls.c index 4740f11..bbe1a04 100644 --- a/libavcodec/jpegls.c +++ b/libavcodec/jpegls.c @@ -31,7 +31,7 @@ void ff_jpegls_init_state(JLSState *state){ int i; state->twonear = state->near * 2 + 1; - state->range = ((state->maxval + state->twonear - 1) / state->twonear) + 1; + state->range = (state->maxval + state->twonear - 1) / state->twonear + 1; // QBPP = ceil(log2(RANGE)) for(state->qbpp = 0; (1 << state->qbpp) < state->range; state->qbpp++); @@ -39,10 +39,10 @@ void ff_jpegls_init_state(JLSState *state){ if(state->bpp < 8) state->limit = 16 + 2 * state->bpp - state->qbpp; else - state->limit = (4 * state->bpp) - state->qbpp; + state->limit = 4 * state->bpp - state->qbpp; for(i = 0; i < 367; i++) { - state->A[i] = FFMAX((state->range + 32) >> 6, 2); + state->A[i] = FFMAX(state->range + 32 >> 6, 2); state->N[i] = 1; } @@ -65,7 +65,7 @@ void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all){ if(s->maxval==0 || reset_all) s->maxval= (1 << s->bpp) - 1; if(s->maxval >=128){ - factor= (FFMIN(s->maxval, 4095) + 128)>>8; + factor = FFMIN(s->maxval, 4095) + 128 >> 8; if(s->T1==0 || reset_all) s->T1= iso_clip(factor*(basic_t1-2) + 2 + 3*s->near, s->near+1, s->maxval); diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index 8a55847..5f01631 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -98,7 +98,7 @@ static inline int ls_get_code_regular(GetBitContext *gb, JLSState *state, int Q) /* decode mapped error */ if(ret & 1) - ret = -((ret + 1) >> 1); + ret = -(ret + 1 >> 1); else ret >>= 1; @@ -136,7 +136,7 @@ static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state, int RI ret += RItype + map; if(ret & 1){ - ret = map - ((ret + 1) >> 1); + ret = map - (ret + 1 >> 1); state->B[Q]++; } else { ret = ret >> 1; @@ -186,7 +186,7 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void * x += stride; } /* if EOL reached, we stop decoding */ - if(r != (1 << ff_log2_run[state->run_index[comp]])) + if (r != 1 << ff_log2_run[state->run_index[comp]]) return; if(state->run_index[comp] < 31) state->run_index[comp]++; diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c index f6d8801..4d219cb 100644 --- a/libavcodec/jpeglsenc.c +++ b/libavcodec/jpeglsenc.c @@ -48,7 +48,7 @@ static inline void ls_encode_regular(JLSState *state, PutBitContext *pb, int Q, if(err < 0) err += state->range; - if(err >= ((state->range + 1) >> 1)) { + if (err >= (state->range + 1 >> 1)) { err -= state->range; val = 2 * FFABS(err) - 1 - map; } else @@ -144,7 +144,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last if(x >= w) return; Rb = R(last, x); - RItype = (FFABS(Ra - Rb) <= state->near); + RItype = FFABS(Ra - Rb) <= state->near; pred = RItype ? Ra : Rb; err = R(cur, x) - pred; @@ -165,7 +165,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last } if(err < 0) err += state->range; - if(err >= ((state->range + 1) >> 1)) + if (err >= state->range + 1 >> 1) err -= state->range; ls_encode_runterm(state, pb, RItype, err, ff_log2_run[state->run_index[comp]]); -- 2.7.4