mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
bit_writer: cosmetics: rename kFlush() -> Flush()
(cherry picked from commit 4c6dde37b9
)
Change-Id: I8907927974188bee85ffade1d75d2e50817aa115
This commit is contained in:
parent
fc3c1750dc
commit
4610c9c55a
@ -52,7 +52,7 @@ static int BitWriterResize(VP8BitWriter* const bw, size_t extra_size) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void kFlush(VP8BitWriter* const bw) {
|
static void Flush(VP8BitWriter* const bw) {
|
||||||
const int s = 8 + bw->nb_bits_;
|
const int s = 8 + bw->nb_bits_;
|
||||||
const int32_t bits = bw->value_ >> s;
|
const int32_t bits = bw->value_ >> s;
|
||||||
assert(bw->nb_bits_ >= 0);
|
assert(bw->nb_bits_ >= 0);
|
||||||
@ -118,7 +118,7 @@ int VP8PutBit(VP8BitWriter* const bw, int bit, int prob) {
|
|||||||
bw->range_ = kNewRange[bw->range_];
|
bw->range_ = kNewRange[bw->range_];
|
||||||
bw->value_ <<= shift;
|
bw->value_ <<= shift;
|
||||||
bw->nb_bits_ += shift;
|
bw->nb_bits_ += shift;
|
||||||
if (bw->nb_bits_ > 0) kFlush(bw);
|
if (bw->nb_bits_ > 0) Flush(bw);
|
||||||
}
|
}
|
||||||
return bit;
|
return bit;
|
||||||
}
|
}
|
||||||
@ -135,7 +135,7 @@ int VP8PutBitUniform(VP8BitWriter* const bw, int bit) {
|
|||||||
bw->range_ = kNewRange[bw->range_];
|
bw->range_ = kNewRange[bw->range_];
|
||||||
bw->value_ <<= 1;
|
bw->value_ <<= 1;
|
||||||
bw->nb_bits_ += 1;
|
bw->nb_bits_ += 1;
|
||||||
if (bw->nb_bits_ > 0) kFlush(bw);
|
if (bw->nb_bits_ > 0) Flush(bw);
|
||||||
}
|
}
|
||||||
return bit;
|
return bit;
|
||||||
}
|
}
|
||||||
@ -173,14 +173,14 @@ int VP8BitWriterInit(VP8BitWriter* const bw, size_t expected_size) {
|
|||||||
uint8_t* VP8BitWriterFinish(VP8BitWriter* const bw) {
|
uint8_t* VP8BitWriterFinish(VP8BitWriter* const bw) {
|
||||||
VP8PutValue(bw, 0, 9 - bw->nb_bits_);
|
VP8PutValue(bw, 0, 9 - bw->nb_bits_);
|
||||||
bw->nb_bits_ = 0; // pad with zeroes
|
bw->nb_bits_ = 0; // pad with zeroes
|
||||||
kFlush(bw);
|
Flush(bw);
|
||||||
return bw->buf_;
|
return bw->buf_;
|
||||||
}
|
}
|
||||||
|
|
||||||
int VP8BitWriterAppend(VP8BitWriter* const bw,
|
int VP8BitWriterAppend(VP8BitWriter* const bw,
|
||||||
const uint8_t* data, size_t size) {
|
const uint8_t* data, size_t size) {
|
||||||
assert(data != NULL);
|
assert(data != NULL);
|
||||||
if (bw->nb_bits_ != -8) return 0; // kFlush() must have been called
|
if (bw->nb_bits_ != -8) return 0; // Flush() must have been called
|
||||||
if (!BitWriterResize(bw, size)) return 0;
|
if (!BitWriterResize(bw, size)) return 0;
|
||||||
memcpy(bw->buf_ + bw->pos_, data, size);
|
memcpy(bw->buf_ + bw->pos_, data, size);
|
||||||
bw->pos_ += size;
|
bw->pos_ += size;
|
||||||
|
Loading…
Reference in New Issue
Block a user