|
@@ -88,6 +88,8 @@ static inline int loco_get_rice(RICEContext *r) |
|
|
loco_update_rice_param(r, 0); |
|
|
loco_update_rice_param(r, 0); |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
if (get_bits_left(&r->gb) < 1) |
|
|
|
|
|
return INT_MIN; |
|
|
v = get_ur_golomb_jpegls(&r->gb, loco_get_rice_param(r), INT_MAX, 0); |
|
|
v = get_ur_golomb_jpegls(&r->gb, loco_get_rice_param(r), INT_MAX, 0); |
|
|
loco_update_rice_param(r, (v + 1) >> 1); |
|
|
loco_update_rice_param(r, (v + 1) >> 1); |
|
|
if (!v) { |
|
|
if (!v) { |
|
@@ -163,6 +165,8 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh |
|
|
/* restore all other pixels */ |
|
|
/* restore all other pixels */ |
|
|
for (i = 1; i < width; i++) { |
|
|
for (i = 1; i < width; i++) { |
|
|
val = loco_get_rice(&rc); |
|
|
val = loco_get_rice(&rc); |
|
|
|
|
|
if (val == INT_MIN) |
|
|
|
|
|
return -1; |
|
|
data[i] = loco_predict(&data[i], stride) + val; |
|
|
data[i] = loco_predict(&data[i], stride) + val; |
|
|
} |
|
|
} |
|
|
data += stride; |
|
|
data += stride; |
|
|