/* * Copyright (c) 2010 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.
*/
#if CONFIG_VP9_HIGHBITDEPTH staticvoid build_intra_predictors_high( const MACROBLOCKD *xd, const uint8_t *ref8, int ref_stride, uint8_t *dst8, int dst_stride, PREDICTION_MODE mode, TX_SIZE tx_size, int up_available, int left_available, int right_available, int x, int y, int plane, int bd) { int i;
uint16_t *dst = CONVERT_TO_SHORTPTR(dst8);
uint16_t *ref = CONVERT_TO_SHORTPTR(ref8);
DECLARE_ALIGNED(16, uint16_t, left_col[32]);
DECLARE_ALIGNED(16, uint16_t, above_data[64 + 16]);
uint16_t *above_row = above_data + 16; const uint16_t *const_above_row = above_row; constint bs = 4 << tx_size; int frame_width, frame_height; int x0, y0; conststruct macroblockd_plane *const pd = &xd->plane[plane]; constint need_left = extend_modes[mode] & NEED_LEFT; constint need_above = extend_modes[mode] & NEED_ABOVE; constint need_aboveright = extend_modes[mode] & NEED_ABOVERIGHT; int base = 128 << (bd - 8); // 127 127 127 .. 127 127 127 127 127 127 // 129 A B .. Y Z // 129 C D .. W X // 129 E F .. U V // 129 G H .. S T T T T T // For 10 bit and 12 bit, 127 and 129 are replaced by base -1 and base + 1.
// Get current frame pointer, width and height. if (plane == 0) {
frame_width = xd->cur_buf->y_width;
frame_height = xd->cur_buf->y_height;
} else {
frame_width = xd->cur_buf->uv_width;
frame_height = xd->cur_buf->uv_height;
}
// Get block position in current frame.
x0 = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x)) + x;
y0 = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y)) + y;
// NEED_LEFT if (need_left) { if (left_available) { if (xd->mb_to_bottom_edge < 0) { /* slower path if the block needs border extension */ if (y0 + bs <= frame_height) { for (i = 0; i < bs; ++i) left_col[i] = ref[i * ref_stride - 1];
} else { constint extend_bottom = frame_height - y0; for (i = 0; i < extend_bottom; ++i)
left_col[i] = ref[i * ref_stride - 1]; for (; i < bs; ++i)
left_col[i] = ref[(extend_bottom - 1) * ref_stride - 1];
}
} else { /* faster path if the block does not need extension */ for (i = 0; i < bs; ++i) left_col[i] = ref[i * ref_stride - 1];
}
} else {
vpx_memset16(left_col, base + 1, bs);
}
}
// NEED_ABOVE if (need_above) { if (up_available) { const uint16_t *above_ref = ref - ref_stride; if (xd->mb_to_right_edge < 0) { /* slower path if the block needs border extension */ if (x0 + bs <= frame_width) {
memcpy(above_row, above_ref, bs * sizeof(above_row[0]));
} elseif (x0 <= frame_width) { constint r = frame_width - x0;
memcpy(above_row, above_ref, r * sizeof(above_row[0]));
vpx_memset16(above_row + r, above_row[r - 1], x0 + bs - frame_width);
}
} else { /* faster path if the block does not need extension */ if (bs == 4 && right_available && left_available) {
const_above_row = above_ref;
} else {
memcpy(above_row, above_ref, bs * sizeof(above_row[0]));
}
}
above_row[-1] = left_available ? above_ref[-1] : (base + 1);
} else {
vpx_memset16(above_row, base - 1, bs);
above_row[-1] = base - 1;
}
}
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.