/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
void EncoderTest::InitializeConfig(TestMode mode) { int usage = AOM_USAGE_GOOD_QUALITY; switch (mode) { case kOnePassGood: case kTwoPassGood: break; case kRealTime: usage = AOM_USAGE_REALTIME; break; case kAllIntra: usage = AOM_USAGE_ALL_INTRA; break; default: ASSERT_TRUE(false) << "Unexpected mode " << mode;
}
mode_ = mode;
passes_ = (mode == kTwoPassGood) ? 2 : 1;
const aom_codec_err_t res = codec_->DefaultEncoderConfig(&cfg_, usage);
ASSERT_EQ(AOM_CODEC_OK, res);
}
staticbool compare_plane(const uint8_t *const buf1, int stride1, const uint8_t *const buf2, int stride2, int w, int h, int *const mismatch_row, int *const mismatch_col, int *const mismatch_pix1, int *const mismatch_pix2) { int r, c;
for (r = 0; r < h; ++r) { for (c = 0; c < w; ++c) { constint pix1 = buf1[r * stride1 + c]; constint pix2 = buf2[r * stride2 + c];
if (pix1 != pix2) { if (mismatch_row != nullptr) *mismatch_row = r; if (mismatch_col != nullptr) *mismatch_col = c; if (mismatch_pix1 != nullptr) *mismatch_pix1 = pix1; if (mismatch_pix2 != nullptr) *mismatch_pix2 = pix2; returnfalse;
}
}
}
returntrue;
}
// The function should return "true" most of the time, therefore no early // break-out is implemented within the match checking process. staticbool compare_img(const aom_image_t *img1, const aom_image_t *img2, int *const mismatch_row, int *const mismatch_col, int *const mismatch_plane, int *const mismatch_pix1, int *const mismatch_pix2) { if (img1->fmt != img2->fmt || img1->cp != img2->cp || img1->tc != img2->tc ||
img1->mc != img2->mc || img1->d_w != img2->d_w ||
img1->d_h != img2->d_h || img1->monochrome != img2->monochrome) { if (mismatch_row != nullptr) *mismatch_row = -1; if (mismatch_col != nullptr) *mismatch_col = -1; returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.