Merge "store prediction mode array as uint8_t[16], not int[16]."

This commit is contained in:
Pascal Massimino 2012-01-27 07:16:50 -08:00 committed by Gerrit Code Review
commit b9600308e8
4 changed files with 8 additions and 10 deletions

View File

@ -253,7 +253,7 @@ static int MBAnalyzeBestIntra16Mode(VP8EncIterator* const it) {
static int MBAnalyzeBestIntra4Mode(VP8EncIterator* const it, static int MBAnalyzeBestIntra4Mode(VP8EncIterator* const it,
int best_alpha) { int best_alpha) {
int modes[16]; uint8_t modes[16];
const int max_mode = (it->enc_->method_ >= 3) ? MAX_INTRA4_MODE : NUM_BMODES; const int max_mode = (it->enc_->method_ >= 3) ? MAX_INTRA4_MODE : NUM_BMODES;
int i4_alpha = 0; int i4_alpha = 0;
VP8IteratorStartI4(it); VP8IteratorStartI4(it);

View File

@ -294,15 +294,13 @@ void VP8SetIntra16Mode(const VP8EncIterator* const it, int mode) {
it->mb_->type_ = 1; 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_; uint8_t* preds = it->preds_;
int y; int y;
for (y = 0; y < 4; ++y) { for (y = 4; y > 0; --y) {
int x; memcpy(preds, modes, 4 * sizeof(*modes));
for (x = 0; x < 4; ++x) {
preds[x] = modes[x + y * 4];
}
preds += it->enc_->preds_w_; preds += it->enc_->preds_w_;
modes += 4;
} }
it->mb_->type_ = 0; it->mb_->type_ = 0;
} }

View File

@ -742,7 +742,7 @@ static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* const rd) {
// return the cost array corresponding to the surrounding prediction modes. // return the cost array corresponding to the surrounding prediction modes.
static const uint16_t* GetCostModeI4(VP8EncIterator* const it, 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 preds_w = it->enc_->preds_w_;
const int x = (it->i4_ & 3), y = it->i4_ >> 2; 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]; const int left = (x == 0) ? it->preds_[y * preds_w - 1] : modes[it->i4_ - 1];

View File

@ -243,7 +243,7 @@ typedef struct {
int16_t y_ac_levels[16][16]; int16_t y_ac_levels[16][16];
int16_t uv_levels[4 + 4][16]; int16_t uv_levels[4 + 4][16];
int mode_i16; // mode number for intra16 prediction 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 int mode_uv; // mode number of chroma prediction
uint32_t nz; // non-zero blocks uint32_t nz; // non-zero blocks
} VP8ModeScore; } VP8ModeScore;
@ -306,7 +306,7 @@ void VP8IteratorBytesToNz(VP8EncIterator* const it);
// Helper functions to set mode properties // Helper functions to set mode properties
void VP8SetIntra16Mode(const VP8EncIterator* const it, int mode); 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 VP8SetIntraUVMode(const VP8EncIterator* const it, int mode);
void VP8SetSkip(const VP8EncIterator* const it, int skip); void VP8SetSkip(const VP8EncIterator* const it, int skip);
void VP8SetSegment(const VP8EncIterator* const it, int segment); void VP8SetSegment(const VP8EncIterator* const it, int segment);