Commit 68c607e9 authored by michael's avatar michael

common subexpression elimination


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6784 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a1abb5de
......@@ -248,10 +248,9 @@ static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state, int RI
int k, ret, temp, map;
int Q = 365 + RItype;
if(!RItype)
temp = state->A[Q];
else
temp = state->A[Q] + (state->N[Q] >> 1);
temp= state->A[Q];
if(RItype)
temp += state->N[Q] >> 1;
for(k = 0; (state->N[Q] << k) < temp; k++);
......@@ -355,17 +354,6 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
else
pred = Rb + err;
}
if(state->near){
if(pred < -state->near)
pred += state->range * state->twonear;
else if(pred > state->maxval + state->near)
pred -= state->range * state->twonear;
pred = clip(pred, 0, state->maxval);
}
W(dst, x, pred);
x += stride;
} else { /* regular mode */
int context, sign;
......@@ -389,7 +377,8 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
/* we have to do something more for near-lossless coding */
pred += err;
if(state->near) {
}
if(state->near){
if(pred < -state->near)
pred += state->range * state->twonear;
else if(pred > state->maxval + state->near)
......@@ -400,7 +389,6 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
W(dst, x, pred);
x += stride;
}
}
}
static int ls_decode_picture(MJpegDecodeContext *s, int near, int point_transform, int ilv){
......@@ -677,7 +665,6 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
if(state->run_index[comp] > 0)
state->run_index[comp]--;
x += stride;
} else { /* regular mode */
int context;
......@@ -708,8 +695,8 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
}
ls_encode_regular(state, pb, context, err);
x += stride;
}
x += stride;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment