static void MBAnalyze(VP8EncIterator* const it, int alphas[256], int* const uv_alpha) { const VP8Encoder* const enc = it->enc_; int best_alpha, best_uv_alpha; VP8SetIntra16Mode(it, 0); // default: Intra16, DC_PRED VP8SetSkip(it, 0); // not skipped VP8SetSegment(it, 0); // default segment, spec-wise. best_alpha = MBAnalyzeBestIntra16Mode(it); if (enc->method_ != 3) { // We go and make a fast decision for intra4/intra16. // It's usually not a good and definitive pick, but helps seeding the stats // about level bit-cost. // TODO(skal): improve criterion. best_alpha = MBAnalyzeBestIntra4Mode(it, best_alpha); } best_uv_alpha = MBAnalyzeBestUVMode(it); // Final susceptibility mix best_alpha = (best_alpha + best_uv_alpha + 1) / 2; alphas[best_alpha]++; *uv_alpha += best_uv_alpha; it->mb_->alpha_ = best_alpha; // Informative only. }
static void MBAnalyze(VP8EncIterator* const it, int alphas[MAX_ALPHA + 1], int* const alpha, int* const uv_alpha) { const VP8Encoder* const enc = it->enc_; int best_alpha, best_uv_alpha; VP8SetIntra16Mode(it, 0); // default: Intra16, DC_PRED VP8SetSkip(it, 0); // not skipped VP8SetSegment(it, 0); // default segment, spec-wise. best_alpha = MBAnalyzeBestIntra16Mode(it); if (enc->method_ >= 5) { // We go and make a fast decision for intra4/intra16. // It's usually not a good and definitive pick, but helps seeding the stats // about level bit-cost. // TODO(skal): improve criterion. best_alpha = MBAnalyzeBestIntra4Mode(it, best_alpha); } best_uv_alpha = MBAnalyzeBestUVMode(it); // Final susceptibility mix best_alpha = (3 * best_alpha + best_uv_alpha + 2) >> 2; best_alpha = FinalAlphaValue(best_alpha); alphas[best_alpha]++; it->mb_->alpha_ = best_alpha; // for later remapping. // Accumulate for later complexity analysis. *alpha += best_alpha; // mixed susceptibility (not just luma) *uv_alpha += best_uv_alpha; }
static void MBAnalyze(VP8EncIterator* const it, int alphas[MAX_ALPHA + 1], int* const alpha, int* const uv_alpha) { const VP8Encoder* const enc = it->enc_; int best_alpha, best_uv_alpha; VP8SetIntra16Mode(it, 0); VP8SetSkip(it, 0); VP8SetSegment(it, 0); best_alpha = MBAnalyzeBestIntra16Mode(it); if (enc->method_ >= 5) { best_alpha = MBAnalyzeBestIntra4Mode(it, best_alpha); } best_uv_alpha = MBAnalyzeBestUVMode(it); best_alpha = (3 * best_alpha + best_uv_alpha + 2) >> 2; best_alpha = FinalAlphaValue(best_alpha); alphas[best_alpha]++; it->mb_->alpha_ = best_alpha; *alpha += best_alpha; *uv_alpha += best_uv_alpha; }