提交 cdc23059 编写于 作者: F Fabian Giesen

stb_image: Fast path for matches with dist=1 (runs) in stbi__parse_huffman_block.

上级 92b9e262
......@@ -2210,8 +2210,12 @@ static int stbi__parse_huffman_block(stbi__zbuf *a)
zout = a->zout;
}
p = (stbi_uc *) (zout - dist);
while (len--)
*zout++ = *p++;
if (dist == 1) { // run of one byte; common in images.
stbi_uc v = *p;
do *zout++ = v; while (--len);
} else {
do *zout++ = *p++; while (--len);
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册