/*
* Copyright (c) 2022, 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.
*/
#ifndef IS_DEC
#error "IS_DEC must be defined for reconinter_template.inc."
#endif
// True if the following hold: // 1. Not intrabc and not build_for_obmc // 2. At least one dimension is size 4 with subsampling // 3. If sub-sampled, none of the previous blocks around the sub-sample // are intrabc or inter-blocks
static bool is_sub8x8_inter(const MACROBLOCKD *xd, int plane, BLOCK_SIZE bsize,
int is_intrabc, int build_for_obmc) { if (is_intrabc || build_for_obmc) {
return false;
}
const struct macroblockd_plane *const pd = &xd->plane[plane]; const int ss_x = pd->subsampling_x; const int ss_y = pd->subsampling_y; const int is_sub4_x = (block_size_wide[bsize] == 4) && ss_x; const int is_sub4_y = (block_size_high[bsize] == 4) && ss_y; if (!is_sub4_x && !is_sub4_y) {
return false;
}
// For sub8x8 chroma blocks, we may be covering more than one luma block's // worth of pixels. Thus (mi_x, mi_y) may not be the correct coordinates for // the top-left corner of the prediction source - the correct top-left corner // is at (pre_x, pre_y). const int row_start = is_sub4_y ? -1 : 0; const int col_start = is_sub4_x ? -1 : 0;
for (int row = row_start; row <= 0; ++row) { for (int col = col_start; col <= 0; ++col) { const MB_MODE_INFO *this_mbmi = xd->mi[row * xd->mi_stride + col]; if (!is_inter_block(this_mbmi)) return false; if (is_intrabc_block(this_mbmi)) return false;
}
}
return true;
}
#if IS_DEC
static inline void build_inter_predictors_sub8x8(const AV1_COMMON *cm,
MACROBLOCKD *xd, int plane, const MB_MODE_INFO *mi,
int mi_x, int mi_y,
uint8_t **mc_buf) {
#else
static inline void build_inter_predictors_sub8x8(const AV1_COMMON *cm,
MACROBLOCKD *xd, int plane, const MB_MODE_INFO *mi,
int mi_x, int mi_y) {
#endif // IS_DEC const BLOCK_SIZE bsize = mi->bsize;
struct macroblockd_plane *const pd = &xd->plane[plane]; const bool ss_x = pd->subsampling_x; const bool ss_y = pd->subsampling_y; const int b4_w = block_size_wide[bsize] >> ss_x; const int b4_h = block_size_high[bsize] >> ss_y; const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, ss_x, ss_y); const int b8_w = block_size_wide[plane_bsize]; const int b8_h = block_size_high[plane_bsize]; const int is_compound = has_second_ref(mi);
assert(!is_compound);
assert(!is_intrabc_block(mi));
// For sub8x8 chroma blocks, we may be covering more than one luma block's // worth of pixels. Thus (mi_x, mi_y) may not be the correct coordinates for // the top-left corner of the prediction source - the correct top-left corner // is at (pre_x, pre_y). const int row_start = (block_size_high[bsize] == 4) && ss_y ? -1 : 0; const int col_start = (block_size_wide[bsize] == 4) && ss_x ? -1 : 0; const int pre_x = (mi_x + MI_SIZE * col_start) >> ss_x; const int pre_y = (mi_y + MI_SIZE * row_start) >> ss_y;
int row = row_start; for (int y = 0; y < b8_h; y += b4_h) {
int col = col_start; for (int x = 0; x < b8_w; x += b4_w) {
MB_MODE_INFO *this_mbmi = xd->mi[row * xd->mi_stride + col];
struct buf_2d *const dst_buf = &pd->dst;
uint8_t *dst = dst_buf->buf + dst_buf->stride * y + x;
int ref = 0; const RefCntBuffer *ref_buf =
get_ref_frame_buf(cm, this_mbmi->ref_frame[ref]); const struct scale_factors *ref_scale_factors =
get_ref_scale_factors_const(cm, this_mbmi->ref_frame[ref]); const struct scale_factors *const sf = ref_scale_factors; const struct buf_2d pre_buf = {
NULL,
(plane == 1) ? ref_buf->buf.u_buffer : ref_buf->buf.v_buffer,
ref_buf->buf.uv_crop_width,
ref_buf->buf.uv_crop_height,
ref_buf->buf.uv_stride,
};
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.