/* * Copyright (c) 2015 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/ #include <algorithm> #include"gtest/gtest.h" #include"test/codec_factory.h" #include"test/encode_test_driver.h" #include"test/util.h" #include"test/y4m_video_source.h"
namespace {
// Check if any pixel in a 16x16 macroblock varies between frames. int CheckMb(const vpx_image_t ¤t, const vpx_image_t &previous, int mb_r, int mb_c) { for (int plane = 0; plane < 3; plane++) { int r = 16 * mb_r; int c0 = 16 * mb_c; int r_top = std::min(r + 16, static_cast<int>(current.d_h)); int c_top = std::min(c0 + 16, static_cast<int>(current.d_w));
r = std::max(r, 0);
c0 = std::max(c0, 0); if (plane > 0 && current.x_chroma_shift) {
c_top = (c_top + 1) >> 1;
c0 >>= 1;
} if (plane > 0 && current.y_chroma_shift) {
r_top = (r_top + 1) >> 1;
r >>= 1;
} for (; r < r_top; ++r) { for (int c = c0; c < c_top; ++c) { if (current.planes[plane][current.stride[plane] * r + c] !=
previous.planes[plane][previous.stride[plane] * r + c]) { return 1;
}
}
}
} return 0;
}
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.