92 for(k = 0; (state->
N[Q] << k) < state->
A[Q]; k++);
101 ret = -((ret + 1) >> 1);
106 if(!state->
near && !k && (2 * state->
B[Q] <= -state->
N[Q]))
118 int k, ret,
temp, map;
119 int Q = 365 + RItype;
123 temp += state->
N[Q] >> 1;
125 for(k = 0; (state->
N[Q] << k) < temp; k++);
134 if(!k && (RItype || ret) && (2 * state->
B[Q] < state->
N[Q]))
139 ret = map - ((ret + 1) >> 1);
146 state->
A[Q] +=
FFABS(ret) - RItype;
165 Ra = x ?
R(dst, x - stride) :
R(last, x);
167 Rc = x ?
R(last, x - stride) : last2;
168 Rd = (x >= w -
stride) ?
R(last, x) :
R(last, x + stride);
181 if(x + r * stride > w) {
182 r = (w - x) / stride;
184 for(i = 0; i <
r; i++) {
200 if(x + r * stride > w) {
201 r = (w - x) / stride;
203 for(i = 0; i <
r; i++) {
210 RItype = (
FFABS(Ra - Rb) <= state->
near) ? 1 : 0;
215 if(state->
near && RItype){
227 pred =
mid_pred(Ra, Ra + Rb - Rc, Rb);
237 pred = av_clip(pred - state->
C[context], 0, state->
maxval);
240 pred = av_clip(pred + state->
C[context], 0, state->
maxval);
248 if(pred < -state->near)
252 pred = av_clip(pred, 0, state->
maxval);
284 shift = point_transform + (8 - s->
bits);
286 shift = point_transform + (16 - s->
bits);
289 av_log(s->
avctx,
AV_LOG_DEBUG,
"JPEG-LS params: %ix%i NEAR=%i MV=%i T(%i,%i,%i) RESET=%i, LIMIT=%i, qbpp=%i, RANGE=%i\n",
291 state->
T1, state->
T2, state->
T3,
301 for(i = 0; i < s->
height; i++) {
307 t = *((uint16_t*)last);
317 }
else if(ilv == 1) {
319 int Rc[3] = {0, 0, 0};
323 for(i = 0; i < s->
height; i++) {
324 for(j = 0; j <
stride; j++) {
336 }
else if(ilv == 2) {
351 for(i = 0; i < s->
height; i++){
352 for(x = off; x < w; x+=
stride){
360 for(i = 0; i < s->
height; i++){
361 for(x = 0; x < w; x++){