Commit 82920bf4 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ivi: Only clip samples when needed in ivi_output_plane()

435740 -> 396078 dezicycles
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6d8a289c
...@@ -913,6 +913,13 @@ static void ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, ptrdiff_t dst_pi ...@@ -913,6 +913,13 @@ static void ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, ptrdiff_t dst_pi
return; return;
for (y = 0; y < plane->height; y++) { for (y = 0; y < plane->height; y++) {
int m = 0;
for (x = 0; x < plane->width; x++) {
int t = src[x] + 128;
dst[x] = t;
m |= t;
}
if (m & ~255)
for (x = 0; x < plane->width; x++) for (x = 0; x < plane->width; x++)
dst[x] = av_clip_uint8(src[x] + 128); dst[x] = av_clip_uint8(src[x] + 128);
src += pitch; src += pitch;
......
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