Multi-thread the lossless cruncher.

BUG=webp:336

Change-Id: I8e861d6a61d51a5cdc4bbd00cd4f17d4ff006d2f
This commit is contained in:
Vincent Rabaud
2017-06-13 18:07:12 +02:00
parent a88c6522f6
commit f8c2ac15af
3 changed files with 180 additions and 28 deletions

View File

@ -243,7 +243,6 @@ int VP8LBitWriterClone(const VP8LBitWriter* const src,
VP8LBitWriter* const dst) {
const size_t current_size = src->cur_ - src->buf_;
assert(src->cur_ >= src->buf_ && src->cur_ <= src->end_);
memset(dst, 0, sizeof(*dst));
if (!VP8LBitWriterResize(dst, current_size)) return 0;
memcpy(dst->buf_, src->buf_, current_size);
dst->bits_ = src->bits_;

View File

@ -100,7 +100,7 @@ typedef struct {
int error_;
} VP8LBitWriter;
static WEBP_INLINE size_t VP8LBitWriterNumBytes(VP8LBitWriter* const bw) {
static WEBP_INLINE size_t VP8LBitWriterNumBytes(const VP8LBitWriter* const bw) {
return (bw->cur_ - bw->buf_) + ((bw->used_ + 7) >> 3);
}