/* * Copyright (c) 2020, 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.
*/
// Process a 4x4 tile. for (int r = 0; r < 4; ++r) { const uint8_t *s = &src[x_q4 >> SUBPEL_BITS];
if (x_q4 & SUBPEL_MASK) { // Halve filter values (all even) to avoid the need for saturating // arithmetic in convolution kernels. const int16x8_t filter =
vshrq_n_s16(vld1q_s16(x_filter[x_q4 & SUBPEL_MASK]), 1);
src += 4 * src_stride;
dst += 4 * dst_stride;
h -= 4;
} while (h > 0); return;
}
// w >= 8 do { int x_q4 = x0_q4;
uint8_t *d = dst; int width = w;
do { // Process an 8x8 tile. for (int r = 0; r < 8; ++r) { const uint8_t *s = &src[x_q4 >> SUBPEL_BITS];
if (x_q4 & SUBPEL_MASK) { // Halve filter values (all even) to avoid the need for saturating // arithmetic in convolution kernels. const int16x8_t filter =
vshrq_n_s16(vld1q_s16(x_filter[x_q4 & SUBPEL_MASK]), 1);
src += 8 * src_stride;
dst += 8 * dst_stride;
h -= 8;
} while (h > 0);
}
staticinlinevoid scaled_convolve_vert_neon( const uint8_t *src, const ptrdiff_t src_stride, uint8_t *dst, const ptrdiff_t dst_stride, const InterpKernel *const y_filter, constint y0_q4, constint y_step_q4, int w, int h) { int y_q4 = y0_q4;
if (w == 4) { do { const uint8_t *s = &src[(y_q4 >> SUBPEL_BITS) * src_stride];
if (y_q4 & SUBPEL_MASK) { // Halve filter values (all even) to avoid the need for saturating // arithmetic in convolution kernels. const int16x8_t filter =
vshrq_n_s16(vld1q_s16(y_filter[y_q4 & SUBPEL_MASK]), 1);
if (w == 8) { do { const uint8_t *s = &src[(y_q4 >> SUBPEL_BITS) * src_stride];
if (y_q4 & SUBPEL_MASK) { // Halve filter values (all even) to avoid the need for saturating // arithmetic in convolution kernels. const int16x8_t filter =
vshrq_n_s16(vld1q_s16(y_filter[y_q4 & SUBPEL_MASK]), 1);
// w >= 16 do { const uint8_t *s = &src[(y_q4 >> SUBPEL_BITS) * src_stride];
uint8_t *d = dst; int width = w;
if (y_q4 & SUBPEL_MASK) { do { // Halve filter values (all even) to avoid the need for saturating // arithmetic in convolution kernels. const int16x8_t filter =
vshrq_n_s16(vld1q_s16(y_filter[y_q4 & SUBPEL_MASK]), 1);
void aom_scaled_2d_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst,
ptrdiff_t dst_stride, const InterpKernel *filter, int x0_q4, int x_step_q4, int y0_q4, int y_step_q4, int w, int h) { // Fixed size intermediate buffer, im_block, places limits on parameters. // 2d filtering proceeds in 2 steps: // (1) Interpolate horizontally into an intermediate buffer, temp. // (2) Interpolate temp vertically to derive the sub-pixel result. // Deriving the maximum number of rows in the im_block buffer (135): // --Smallest scaling factor is x1/2 ==> y_step_q4 = 32 (Normative). // --Largest block size is 64x64 pixels. // --64 rows in the downscaled frame span a distance of (64 - 1) * 32 in the // original frame (in 1/16th pixel units). // --Must round-up because block may be located at sub-pixel position. // --Require an additional SUBPEL_TAPS rows for the 8-tap filter tails. // --((64 - 1) * 32 + 15) >> 4 + 8 = 135. // --Require an additional 8 rows for the horiz_w8 transpose tail. // When calling in frame scaling function, the smallest scaling factor is x1/4 // ==> y_step_q4 = 64. Since w and h are at most 16, the temp buffer is still // big enough.
DECLARE_ALIGNED(16, uint8_t, im_block[(135 + 8) * 64]); constint im_height =
(((h - 1) * y_step_q4 + y0_q4) >> SUBPEL_BITS) + SUBPEL_TAPS; const ptrdiff_t im_stride = 64;
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.