mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
Merge "store prediction mode array as uint8_t[16], not int[16]."
This commit is contained in:
commit
b9600308e8
@ -253,7 +253,7 @@ static int MBAnalyzeBestIntra16Mode(VP8EncIterator* const it) {
|
||||
|
||||
static int MBAnalyzeBestIntra4Mode(VP8EncIterator* const it,
|
||||
int best_alpha) {
|
||||
int modes[16];
|
||||
uint8_t modes[16];
|
||||
const int max_mode = (it->enc_->method_ >= 3) ? MAX_INTRA4_MODE : NUM_BMODES;
|
||||
int i4_alpha = 0;
|
||||
VP8IteratorStartI4(it);
|
||||
|
@ -294,15 +294,13 @@ void VP8SetIntra16Mode(const VP8EncIterator* const it, int mode) {
|
||||
it->mb_->type_ = 1;
|
||||
}
|
||||
|
||||
void VP8SetIntra4Mode(const VP8EncIterator* const it, int modes[16]) {
|
||||
void VP8SetIntra4Mode(const VP8EncIterator* const it, const uint8_t* modes) {
|
||||
uint8_t* preds = it->preds_;
|
||||
int y;
|
||||
for (y = 0; y < 4; ++y) {
|
||||
int x;
|
||||
for (x = 0; x < 4; ++x) {
|
||||
preds[x] = modes[x + y * 4];
|
||||
}
|
||||
for (y = 4; y > 0; --y) {
|
||||
memcpy(preds, modes, 4 * sizeof(*modes));
|
||||
preds += it->enc_->preds_w_;
|
||||
modes += 4;
|
||||
}
|
||||
it->mb_->type_ = 0;
|
||||
}
|
||||
|
@ -742,7 +742,7 @@ static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* const rd) {
|
||||
|
||||
// return the cost array corresponding to the surrounding prediction modes.
|
||||
static const uint16_t* GetCostModeI4(VP8EncIterator* const it,
|
||||
const int modes[16]) {
|
||||
const uint8_t modes[16]) {
|
||||
const int preds_w = it->enc_->preds_w_;
|
||||
const int x = (it->i4_ & 3), y = it->i4_ >> 2;
|
||||
const int left = (x == 0) ? it->preds_[y * preds_w - 1] : modes[it->i4_ - 1];
|
||||
|
@ -243,7 +243,7 @@ typedef struct {
|
||||
int16_t y_ac_levels[16][16];
|
||||
int16_t uv_levels[4 + 4][16];
|
||||
int mode_i16; // mode number for intra16 prediction
|
||||
int modes_i4[16]; // mode numbers for intra4 predictions
|
||||
uint8_t modes_i4[16]; // mode numbers for intra4 predictions
|
||||
int mode_uv; // mode number of chroma prediction
|
||||
uint32_t nz; // non-zero blocks
|
||||
} VP8ModeScore;
|
||||
@ -306,7 +306,7 @@ void VP8IteratorBytesToNz(VP8EncIterator* const it);
|
||||
|
||||
// Helper functions to set mode properties
|
||||
void VP8SetIntra16Mode(const VP8EncIterator* const it, int mode);
|
||||
void VP8SetIntra4Mode(const VP8EncIterator* const it, int modes[16]);
|
||||
void VP8SetIntra4Mode(const VP8EncIterator* const it, const uint8_t* modes);
|
||||
void VP8SetIntraUVMode(const VP8EncIterator* const it, int mode);
|
||||
void VP8SetSkip(const VP8EncIterator* const it, int skip);
|
||||
void VP8SetSegment(const VP8EncIterator* const it, int segment);
|
||||
|
Loading…
Reference in New Issue
Block a user