/* * 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.
*/
staticint is_8x8_block_skip(MB_MODE_INFO **grid, int mi_row, int mi_col, int mi_stride) {
MB_MODE_INFO **mbmi = grid + mi_row * mi_stride + mi_col; for (int r = 0; r < mi_size_high[BLOCK_8X8]; ++r, mbmi += mi_stride) { for (int c = 0; c < mi_size_wide[BLOCK_8X8]; ++c) { if (!mbmi[c]->skip_txfm) return 0;
}
}
return 1;
}
int av1_cdef_compute_sb_list(const CommonModeInfoParams *const mi_params, int mi_row, int mi_col, cdef_list *dlist,
BLOCK_SIZE bs) {
MB_MODE_INFO **grid = mi_params->mi_grid_base; int maxc = mi_params->mi_cols - mi_col; int maxr = mi_params->mi_rows - mi_row;
if (fbr == nvfb - 1)
rend = vsize; else
rend = vsize + CDEF_VBORDER;
/* Copy in the pixels we need from the current superblock for
deringing.*/
av1_cdef_copy_sb8_16(
cm, &src[CDEF_VBORDER * CDEF_BSTRIDE + CDEF_HBORDER + cstart],
CDEF_BSTRIDE, fb_info->dst, fb_info->roffset, fb_info->coffset + cstart,
fb_info->dst_stride, vsize, cend - cstart);
/* Copy in the pixels we need for the current superblock from bottom buffer.*/ if (fbr < nvfb - 1) {
copy_rect(&src[bot_offset + CDEF_HBORDER], CDEF_BSTRIDE,
&bot_linebuf[fb_info->coffset], stride, CDEF_VBORDER, hsize);
} else {
fill_rect(&src[bot_offset + CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER,
hsize, CDEF_VERY_LARGE);
} if (fbr < nvfb - 1 && fbc > 0) {
copy_rect(&src[bot_offset], CDEF_BSTRIDE,
&bot_linebuf[fb_info->coffset - CDEF_HBORDER], stride,
CDEF_VBORDER, CDEF_HBORDER);
} else {
fill_rect(&src[bot_offset], CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER,
CDEF_VERY_LARGE);
} if (fbr < nvfb - 1 && fbc < nhfb - 1) {
copy_rect(&src[bot_offset + hsize + CDEF_HBORDER], CDEF_BSTRIDE,
&bot_linebuf[fb_info->coffset + hsize], stride, CDEF_VBORDER,
CDEF_HBORDER);
} else {
fill_rect(&src[bot_offset + hsize + CDEF_HBORDER], CDEF_BSTRIDE,
CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
}
/* Copy in the pixels we need from the current superblock from top buffer.*/ if (fbr > 0) {
copy_rect(&src[CDEF_HBORDER], CDEF_BSTRIDE, &top_linebuf[fb_info->coffset],
stride, CDEF_VBORDER, hsize);
} else {
fill_rect(&src[CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER, hsize,
CDEF_VERY_LARGE);
} if (fbr > 0 && fbc > 0) {
copy_rect(src, CDEF_BSTRIDE, &top_linebuf[fb_info->coffset - CDEF_HBORDER],
stride, CDEF_VBORDER, CDEF_HBORDER);
} else {
fill_rect(src, CDEF_BSTRIDE, CDEF_VBORDER, CDEF_HBORDER, CDEF_VERY_LARGE);
} if (fbr > 0 && fbc < nhfb - 1) {
copy_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE,
&top_linebuf[fb_info->coffset + hsize], stride, CDEF_VBORDER,
CDEF_HBORDER);
} else {
fill_rect(&src[hsize + CDEF_HBORDER], CDEF_BSTRIDE, CDEF_VBORDER,
CDEF_HBORDER, CDEF_VERY_LARGE);
} if (cdef_left) { /* If we deringed the superblock on the left then we need to copy in
saved pixels. */
copy_rect(src, CDEF_BSTRIDE, colbuf[plane], CDEF_HBORDER,
rend + CDEF_VBORDER, CDEF_HBORDER);
} /* Saving pixels in case we need to dering the superblock on the
right. */
copy_rect(colbuf[plane], CDEF_HBORDER, src + hsize, CDEF_BSTRIDE,
rend + CDEF_VBORDER, CDEF_HBORDER);
for (int plane = 0; plane < num_planes; plane++) { // Do not skip cdef filtering for luma plane as filter direction is // computed based on luma. if (plane && is_zero_level[get_plane_type(plane)]) {
cdef_left[plane] = 0; continue;
}
cdef_init_fb_col(xd, fb_info, level, sec_strength, fbc, fbr, plane);
cdef_prepare_fb(cm, fb_info, colbuf, cdef_left[plane], fbc, fbr, plane);
cdef_filter_fb(fb_info, plane, cm->seq_params->use_highbitdepth);
cdef_left[plane] = 1;
}
}
// Initializes row-level parameters for CDEF frame. void av1_cdef_init_fb_row(const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
CdefBlockInfo *const fb_info,
uint16_t **const linebuf, uint16_t *const src, struct AV1CdefSyncData *const cdef_sync, int fbr) {
(void)cdef_sync; constint num_planes = av1_num_planes(cm); constint nvfb = (cm->mi_params.mi_rows + MI_SIZE_64X64 - 1) / MI_SIZE_64X64; constint luma_stride =
ALIGN_POWER_OF_TWO(cm->mi_params.mi_cols << MI_SIZE_LOG2, 4); constbool ping_pong = fbr & 1; // for the current filter block, it's top left corner mi structure (mi_tl) // is first accessed to check whether the top and left boundaries are // frame boundaries. Then bottom-left and top-right mi structures are // accessed to check whether the bottom and right boundaries // (respectively) are frame boundaries. // // Note that we can't just check the bottom-right mi structure - eg. if // we're at the right-hand edge of the frame but not the bottom, then // the bottom-right mi is NULL but the bottom-left is not.
fb_info->frame_boundary[TOP] = (MI_SIZE_64X64 * fbr == 0) ? 1 : 0; if (fbr != nvfb - 1)
fb_info->frame_boundary[BOTTOM] =
(MI_SIZE_64X64 * (fbr + 1) == cm->mi_params.mi_rows) ? 1 : 0; else
fb_info->frame_boundary[BOTTOM] = 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.