/* * 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 mismatch_record_block_pre(const uint8_t *src, int src_stride, int frame_offset, int plane, int pixel_c, int pixel_r, int blk_w, int blk_h, int highbd) { if (pixel_c + blk_w >= frame_stride || pixel_r + blk_h >= frame_height) {
printf("frame_buf undersized\n");
assert(0);
}
const uint16_t *src16 = highbd ? CONVERT_TO_SHORTPTR(src) : NULL; for (int r = 0; r < blk_h; ++r) { for (int c = 0; c < blk_w; ++c) {
frame_pre[frame_buf_idx_w][plane]
[(r + pixel_r) * frame_stride + c + pixel_c] =
src16 ? src16[r * src_stride + c] : src[r * src_stride + c];
}
} #if 0 int ref_frame_idx = 3; int ref_frame_offset = 4; int ref_plane = 1; int ref_pixel_c = 162; int ref_pixel_r = 16; if (frame_idx_w == ref_frame_idx && plane == ref_plane &&
frame_offset == ref_frame_offset && ref_pixel_c >= pixel_c &&
ref_pixel_c < pixel_c + blk_w && ref_pixel_r >= pixel_r &&
ref_pixel_r < pixel_r + blk_h) {
printf( "\nrecord_block_pre frame_idx %d frame_offset %d plane %d pixel_c %d pixel_r %d blk_w " "%d blk_h %d\n",
frame_idx_w, frame_offset, plane, pixel_c, pixel_r, blk_w, blk_h);
} #endif
} void mismatch_record_block_tx(const uint8_t *src, int src_stride, int frame_offset, int plane, int pixel_c, int pixel_r, int blk_w, int blk_h, int highbd) { if (pixel_c + blk_w >= frame_stride || pixel_r + blk_h >= frame_height) {
printf("frame_buf undersized\n");
assert(0);
}
const uint16_t *src16 = highbd ? CONVERT_TO_SHORTPTR(src) : NULL; for (int r = 0; r < blk_h; ++r) { for (int c = 0; c < blk_w; ++c) {
frame_tx[frame_buf_idx_w][plane]
[(r + pixel_r) * frame_stride + c + pixel_c] =
src16 ? src16[r * src_stride + c] : src[r * src_stride + c];
}
} #if 0 int ref_frame_idx = 3; int ref_frame_offset = 4; int ref_plane = 1; int ref_pixel_c = 162; int ref_pixel_r = 16; if (frame_idx_w == ref_frame_idx && plane == ref_plane && frame_offset == ref_frame_offset &&
ref_pixel_c >= pixel_c && ref_pixel_c < pixel_c + blk_w &&
ref_pixel_r >= pixel_r && ref_pixel_r < pixel_r + blk_h) {
printf( "\nrecord_block_tx frame_idx %d frame_offset %d plane %d pixel_c %d pixel_r %d blk_w " "%d blk_h %d\n",
frame_idx_w, frame_offset, plane, pixel_c, pixel_r, blk_w, blk_h);
} #endif
} void mismatch_check_block_pre(const uint8_t *src, int src_stride, int frame_offset, int plane, int pixel_c, int pixel_r, int blk_w, int blk_h, int highbd) { if (pixel_c + blk_w >= frame_stride || pixel_r + blk_h >= frame_height) {
printf("frame_buf undersized\n");
assert(0);
}
const uint16_t *src16 = highbd ? CONVERT_TO_SHORTPTR(src) : NULL; int mismatch = 0; for (int r = 0; r < blk_h; ++r) { for (int c = 0; c < blk_w; ++c) { if (frame_pre[frame_buf_idx_r][plane]
[(r + pixel_r) * frame_stride + c + pixel_c] !=
(uint16_t)(src16 ? src16[r * src_stride + c]
: src[r * src_stride + c])) {
mismatch = 1;
}
}
} if (mismatch) {
printf( "\ncheck_block_pre failed frame_idx %d frame_offset %d plane %d " "pixel_c %d pixel_r " "%d blk_w %d blk_h %d\n",
frame_idx_r, frame_offset, plane, pixel_c, pixel_r, blk_w, blk_h);
printf("enc\n"); for (int rr = 0; rr < blk_h; ++rr) { for (int cc = 0; cc < blk_w; ++cc) {
printf("%d ", frame_pre[frame_buf_idx_r][plane]
[(rr + pixel_r) * frame_stride + cc + pixel_c]);
}
printf("\n");
}
printf("dec\n"); for (int rr = 0; rr < blk_h; ++rr) { for (int cc = 0; cc < blk_w; ++cc) {
printf("%d ",
src16 ? src16[rr * src_stride + cc] : src[rr * src_stride + cc]);
}
printf("\n");
}
assert(0);
}
} void mismatch_check_block_tx(const uint8_t *src, int src_stride, int frame_offset, int plane, int pixel_c, int pixel_r, int blk_w, int blk_h, int highbd) { if (pixel_c + blk_w >= frame_stride || pixel_r + blk_h >= frame_height) {
printf("frame_buf undersized\n");
assert(0);
}
const uint16_t *src16 = highbd ? CONVERT_TO_SHORTPTR(src) : NULL; int mismatch = 0; for (int r = 0; r < blk_h; ++r) { for (int c = 0; c < blk_w; ++c) { if (frame_tx[frame_buf_idx_r][plane]
[(r + pixel_r) * frame_stride + c + pixel_c] !=
(uint16_t)(src16 ? src16[r * src_stride + c]
: src[r * src_stride + c])) {
mismatch = 1;
}
}
} if (mismatch) {
printf( "\ncheck_block_tx failed frame_idx %d frame_offset %d plane %d pixel_c " "%d pixel_r " "%d blk_w %d blk_h %d\n",
frame_idx_r, frame_offset, plane, pixel_c, pixel_r, blk_w, blk_h);
printf("enc\n"); for (int rr = 0; rr < blk_h; ++rr) { for (int cc = 0; cc < blk_w; ++cc) {
printf("%d ", frame_tx[frame_buf_idx_r][plane]
[(rr + pixel_r) * frame_stride + cc + pixel_c]);
}
printf("\n");
}
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.