Commit fbae0ac3 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ffv1enc: Use av_clip_uint8()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 114a2eb2
...@@ -924,7 +924,7 @@ static av_cold int encode_init(AVCodecContext *avctx) ...@@ -924,7 +924,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (a+b) if (a+b)
p = 256.0 * b / (a + b); p = 256.0 * b / (a + b);
s->initial_states[i][jp][k] = s->initial_states[i][jp][k] =
best_state[av_clip(round(p), 1, 255)][av_clip((a + b) / gob_count, 0, 255)]; best_state[av_clip(round(p), 1, 255)][av_clip_uint8((a + b) / gob_count)];
for(jp++; jp<j; jp++) for(jp++; jp<j; jp++)
s->initial_states[i][jp][k] = s->initial_states[i][jp-1][k]; s->initial_states[i][jp][k] = s->initial_states[i][jp-1][k];
a=b=0; a=b=0;
...@@ -935,7 +935,7 @@ static av_cold int encode_init(AVCodecContext *avctx) ...@@ -935,7 +935,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
p = 256.0 * b / (a + b); p = 256.0 * b / (a + b);
} }
s->initial_states[i][j][k] = s->initial_states[i][j][k] =
best_state[av_clip(round(p), 1, 255)][av_clip((a + b) / gob_count, 0, 255)]; best_state[av_clip(round(p), 1, 255)][av_clip_uint8((a + b) / gob_count)];
} }
} }
} }
......
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