/* * 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 av1_gen_inv_stage_range(int8_t *stage_range_col, int8_t *stage_range_row, const TXFM_2D_FLIP_CFG *cfg, TX_SIZE tx_size, int bd) { constint fwd_shift = inv_start_range[tx_size]; const int8_t *shift = cfg->shift;
int8_t opt_range_row, opt_range_col; if (bd == 8) {
opt_range_row = 16;
opt_range_col = 16;
} elseif (bd == 10) {
opt_range_row = 18;
opt_range_col = 16;
} else {
assert(bd == 12);
opt_range_row = 20;
opt_range_col = 18;
} // i < MAX_TXFM_STAGE_NUM will mute above array bounds warning for (int i = 0; i < cfg->stage_num_row && i < MAX_TXFM_STAGE_NUM; ++i) { int real_range_row = cfg->stage_range_row[i] + fwd_shift + bd + 1;
(void)real_range_row; if (cfg->txfm_type_row == TXFM_TYPE_ADST4 && i == 1) { // the adst4 may use 1 extra bit on top of opt_range_row at stage 1 // so opt_range_row >= real_range_row will not hold
stage_range_row[i] = opt_range_row;
} else {
assert(opt_range_row >= real_range_row);
stage_range_row[i] = opt_range_row;
}
} // i < MAX_TXFM_STAGE_NUM will mute above array bounds warning for (int i = 0; i < cfg->stage_num_col && i < MAX_TXFM_STAGE_NUM; ++i) { int real_range_col =
cfg->stage_range_col[i] + fwd_shift + shift[0] + bd + 1;
(void)real_range_col; if (cfg->txfm_type_col == TXFM_TYPE_ADST4 && i == 1) { // the adst4 may use 1 extra bit on top of opt_range_col at stage 1 // so opt_range_col >= real_range_col will not hold
stage_range_col[i] = opt_range_col;
} else {
assert(opt_range_col >= real_range_col);
stage_range_col[i] = opt_range_col;
}
}
}
staticinlinevoid inv_txfm2d_add_c(const int32_t *input, uint16_t *output, int stride, TXFM_2D_FLIP_CFG *cfg,
int32_t *txfm_buf, TX_SIZE tx_size, int bd) { // Note when assigning txfm_size_col, we use the txfm_size from the // row configuration and vice versa. This is intentionally done to // accurately perform rectangular transforms. When the transform is // rectangular, the number of columns will be the same as the // txfm_size stored in the row cfg struct. It will make no difference // for square transforms. constint txfm_size_col = tx_size_wide[cfg->tx_size]; constint txfm_size_row = tx_size_high[cfg->tx_size]; // Take the shift from the larger dimension in the rectangular case. const int8_t *shift = cfg->shift; constint rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row);
int8_t stage_range_row[MAX_TXFM_STAGE_NUM];
int8_t stage_range_col[MAX_TXFM_STAGE_NUM];
assert(cfg->stage_num_row <= MAX_TXFM_STAGE_NUM);
assert(cfg->stage_num_col <= MAX_TXFM_STAGE_NUM);
av1_gen_inv_stage_range(stage_range_col, stage_range_row, cfg, tx_size, bd);
void av1_inv_txfm2d_add_64x64_c(const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd) { // TODO(urvang): Can the same array be reused, instead of using a new array? // Remap 32x32 input into a modified 64x64 by: // - Copying over these values in top-left 32x32 locations. // - Setting the rest of the locations to 0.
int32_t mod_input[64 * 64]; for (int col = 0; col < 32; ++col) {
memcpy(mod_input + col * 64, input + col * 32, 32 * sizeof(*mod_input));
memset(mod_input + col * 64 + 32, 0, 32 * sizeof(*mod_input));
}
memset(mod_input + 32 * 64, 0, 32 * 64 * sizeof(*mod_input));
DECLARE_ALIGNED(32, int, txfm_buf[64 * 64 + 64 + 64]);
inv_txfm2d_add_facade(mod_input, output, stride, txfm_buf, tx_type, TX_64X64,
bd);
}
void av1_inv_txfm2d_add_64x32_c(const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd) { // Remap 32x32 input into a modified 64x32 by: // - Copying over these values in top-left 32x32 locations. // - Setting the rest of the locations to 0.
int32_t mod_input[32 * 64];
memcpy(mod_input, input, 32 * 32 * sizeof(*mod_input));
memset(mod_input + 32 * 32, 0, 32 * 32 * sizeof(*mod_input));
DECLARE_ALIGNED(32, int, txfm_buf[64 * 32 + 64 + 64]);
inv_txfm2d_add_facade(mod_input, output, stride, txfm_buf, tx_type, TX_64X32,
bd);
}
void av1_inv_txfm2d_add_32x64_c(const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd) { // Remap 32x32 input into a modified 32x64 input by: // - Copying over these values in top-left 32x32 locations. // - Setting the rest of the locations to 0.
int32_t mod_input[64 * 32]; for (int col = 0; col < 32; ++col) {
memcpy(mod_input + col * 64, input + col * 32, 32 * sizeof(*mod_input));
memset(mod_input + col * 64 + 32, 0, 32 * sizeof(*mod_input));
}
DECLARE_ALIGNED(32, int, txfm_buf[64 * 32 + 64 + 64]);
inv_txfm2d_add_facade(mod_input, output, stride, txfm_buf, tx_type, TX_32X64,
bd);
}
void av1_inv_txfm2d_add_16x64_c(const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd) { // Remap 16x32 input into a modified 16x64 input by: // - Copying over these values in top-left 16x32 locations. // - Setting the rest of the locations to 0.
int32_t mod_input[64 * 16]; for (int col = 0; col < 16; ++col) {
memcpy(mod_input + col * 64, input + col * 32, 32 * sizeof(*mod_input));
memset(mod_input + col * 64 + 32, 0, 32 * sizeof(*mod_input));
}
DECLARE_ALIGNED(32, int, txfm_buf[16 * 64 + 64 + 64]);
inv_txfm2d_add_facade(mod_input, output, stride, txfm_buf, tx_type, TX_16X64,
bd);
}
void av1_inv_txfm2d_add_64x16_c(const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd) { // Remap 32x16 input into a modified 64x16 by: // - Copying over these values in top-left 32x16 locations. // - Setting the rest of the locations to 0.
int32_t mod_input[16 * 64];
memcpy(mod_input, input, 16 * 32 * sizeof(*mod_input));
memset(mod_input + 16 * 32, 0, 16 * 32 * sizeof(*mod_input));
DECLARE_ALIGNED(32, int, txfm_buf[16 * 64 + 64 + 64]);
inv_txfm2d_add_facade(mod_input, output, stride, txfm_buf, tx_type, TX_64X16,
bd);
}
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.