/* * 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 Add(const aom_image_t *img) { for (int plane = 0; plane < 3; ++plane) { const uint8_t *buf = img->planes[plane]; // Calculate the width and height to do the md5 check. For the chroma // plane, we never want to round down and thus skip a pixel so if // we are shifting by 1 (chroma_shift) we add 1 before doing the shift. // This works only for chroma_shift of 0 and 1. constint bytes_per_sample =
(img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) ? 2 : 1; constint h =
plane ? (img->d_h + img->y_chroma_shift) >> img->y_chroma_shift
: img->d_h; constint w =
(plane ? (img->d_w + img->x_chroma_shift) >> img->x_chroma_shift
: img->d_w) *
bytes_per_sample;
for (int y = 0; y < h; ++y) {
MD5Update(&md5_, buf, w);
buf += img->stride[plane];
}
}
}
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.