Commit c2c27e9e authored by Reimar Döffinger's avatar Reimar Döffinger

indeo2: move variable declarations into blocks using them.

Signed-off-by: 's avatarReimar Döffinger <Reimar.Doeffinger@gmx.de>
parent 79be2536
...@@ -54,15 +54,13 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst ...@@ -54,15 +54,13 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
int i; int i;
int j; int j;
int out = 0; int out = 0;
int c;
int t;
if (width & 1) if (width & 1)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
/* first line contain absolute values, other lines contain deltas */ /* first line contain absolute values, other lines contain deltas */
while (out < width) { while (out < width) {
c = ir2_get_code(&ctx->gb); int c = ir2_get_code(&ctx->gb);
if (c >= 0x80) { /* we have a run */ if (c >= 0x80) { /* we have a run */
c -= 0x7F; c -= 0x7F;
if (out + c*2 > width) if (out + c*2 > width)
...@@ -79,7 +77,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst ...@@ -79,7 +77,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
for (j = 1; j < height; j++) { for (j = 1; j < height; j++) {
out = 0; out = 0;
while (out < width) { while (out < width) {
c = ir2_get_code(&ctx->gb); int c = ir2_get_code(&ctx->gb);
if (c >= 0x80) { /* we have a skip */ if (c >= 0x80) { /* we have a skip */
c -= 0x7F; c -= 0x7F;
if (out + c*2 > width) if (out + c*2 > width)
...@@ -89,7 +87,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst ...@@ -89,7 +87,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
out++; out++;
} }
} else { /* add two deltas from table */ } else { /* add two deltas from table */
t = dst[out - pitch] + (table[c * 2] - 128); int t = dst[out - pitch] + (table[c * 2] - 128);
t = av_clip_uint8(t); t = av_clip_uint8(t);
dst[out] = t; dst[out] = t;
out++; out++;
......
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