/* * 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.
*/
memset(&cfl->recon_buf_q3, 0, sizeof(cfl->recon_buf_q3));
memset(&cfl->ac_buf_q3, 0, sizeof(cfl->ac_buf_q3));
cfl->subsampling_x = seq_params->subsampling_x;
cfl->subsampling_y = seq_params->subsampling_y;
cfl->are_parameters_computed = 0;
cfl->store_y = 0; // The DC_PRED cache is disabled by default and is only enabled in // cfl_rd_pick_alpha
clear_cfl_dc_pred_cache_flags(cfl);
}
// Due to frame boundary issues, it is possible that the total area covered by // chroma exceeds that of luma. When this happens, we fill the missing pixels by // repeating the last columns and/or rows. staticinlinevoid cfl_pad(CFL_CTX *cfl, int width, int height) { constint diff_width = width - cfl->buf_width; constint diff_height = height - cfl->buf_height;
staticinlinevoid cfl_predict_lbd_c(const int16_t *ac_buf_q3, uint8_t *dst, int dst_stride, int alpha_q3, int width, int height) { for (int j = 0; j < height; j++) { for (int i = 0; i < width; i++) {
dst[i] = clip_pixel(get_scaled_luma_q0(alpha_q3, ac_buf_q3[i]) + dst[i]);
}
dst += dst_stride;
ac_buf_q3 += CFL_BUF_LINE;
}
}
CFL_PREDICT_FN(c, lbd)
#if CONFIG_AV1_HIGHBITDEPTH staticinlinevoid cfl_predict_hbd_c(const int16_t *ac_buf_q3, uint16_t *dst, int dst_stride, int alpha_q3, int bit_depth, int width, int height) { for (int j = 0; j < height; j++) { for (int i = 0; i < width; i++) {
dst[i] = clip_pixel_highbd(
get_scaled_luma_q0(alpha_q3, ac_buf_q3[i]) + dst[i], bit_depth);
}
dst += dst_stride;
ac_buf_q3 += CFL_BUF_LINE;
}
}
CFL_PREDICT_FN(c, hbd) #endif
staticvoid cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) {
CFL_CTX *const cfl = &xd->cfl; // Do not call cfl_compute_parameters multiple time on the same values.
assert(cfl->are_parameters_computed == 0);
// Invalidate current parameters
cfl->are_parameters_computed = 0;
// Store the surface of the pixel buffer that was written to, this way we // can manage chroma overrun (e.g. when the chroma surfaces goes beyond the // frame boundary) if (col == 0 && row == 0) {
cfl->buf_width = store_width;
cfl->buf_height = store_height;
} else {
cfl->buf_width = OD_MAXI(store_col + store_width, cfl->buf_width);
cfl->buf_height = OD_MAXI(store_row + store_height, cfl->buf_height);
}
// Check that we will remain inside the pixel buffer.
assert(store_row + store_height <= CFL_BUF_LINE);
assert(store_col + store_width <= CFL_BUF_LINE);
// Store the input into the CfL pixel buffer
uint16_t *recon_buf_q3 =
cfl->recon_buf_q3 + (store_row * CFL_BUF_LINE + store_col); #if CONFIG_AV1_HIGHBITDEPTH if (use_hbd) {
cfl_subsampling_hbd(tx_size, sub_x, sub_y)(CONVERT_TO_SHORTPTR(input),
input_stride, recon_buf_q3);
} else {
cfl_subsampling_lbd(tx_size, sub_x, sub_y)(input, input_stride,
recon_buf_q3);
} #else
(void)use_hbd;
cfl_subsampling_lbd(tx_size, sub_x, sub_y)(input, input_stride, recon_buf_q3); #endif
}
// Adjust the row and column of blocks smaller than 8X8, as chroma-referenced // and non-chroma-referenced blocks are stored together in the CfL buffer. staticinlinevoid sub8x8_adjust_offset(const CFL_CTX *cfl, int mi_row, int mi_col, int *row_out, int *col_out) { // Increment row index for bottom: 8x4, 16x4 or both bottom 4x4s. if ((mi_row & 0x01) && cfl->subsampling_y) {
assert(*row_out == 0);
(*row_out)++;
}
// Increment col index for right: 4x8, 4x16 or both right 4x4s. if ((mi_col & 0x01) && cfl->subsampling_x) {
assert(*col_out == 0);
(*col_out)++;
}
}
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.