/* * Copyright (c) 2015 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/ #ifndef VPX_VPX_DSP_X86_CONVOLVE_H_ #define VPX_VPX_DSP_X86_CONVOLVE_H_
// TODO(chiyotsai@google.com): Refactor the code here. Currently this is pretty // hacky and awful to read. Note that there is a filter_x[3] == 128 check in // HIGHBD_FUN_CONV_2D to avoid seg fault due to the fact that the c function // assumes the filter is always 8 tap. typedefvoid filter8_1dfunction(const uint8_t *src_ptr, ptrdiff_t src_pitch,
uint8_t *output_ptr, ptrdiff_t out_pitch,
uint32_t output_height, const int16_t *filter);
// TODO(chiyotsai@google.com): Remove the is_avg argument to the MACROS once we // have 4-tap vert avg filter. #define FUN_CONV_1D(name, offset, step_q4, dir, src_start, avg, opt, is_avg) \ void vpx_convolve8_##name##_##opt( \ 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) { \ const int16_t *filter_row = filter[offset]; \
(void)x0_q4; \
(void)x_step_q4; \
(void)y0_q4; \
(void)y_step_q4; \
assert(filter_row[3] != 128); \
assert(step_q4 == 16); \ if (filter_row[0] | filter_row[1] | filter_row[6] | filter_row[7]) { \ constint num_taps = 8; \ while (w >= 16) { \
vpx_filter_block1d16_##dir##8_##avg##opt(src_start, src_stride, dst, \
dst_stride, h, filter_row); \
src += 16; \
dst += 16; \
w -= 16; \
} \ if (w == 8) { \
vpx_filter_block1d8_##dir##8_##avg##opt(src_start, src_stride, dst, \
dst_stride, h, filter_row); \
} elseif (w == 4) { \
vpx_filter_block1d4_##dir##8_##avg##opt(src_start, src_stride, dst, \
dst_stride, h, filter_row); \
} \
(void)num_taps; \
} elseif (filter_row[2] | filter_row[5]) { \ constint num_taps = is_avg ? 8 : 4; \ while (w >= 16) { \
vpx_filter_block1d16_##dir##4_##avg##opt(src_start, src_stride, dst, \
dst_stride, h, filter_row); \
src += 16; \
dst += 16; \
w -= 16; \
} \ if (w == 8) { \
vpx_filter_block1d8_##dir##4_##avg##opt(src_start, src_stride, dst, \
dst_stride, h, filter_row); \
} elseif (w == 4) { \
vpx_filter_block1d4_##dir##4_##avg##opt(src_start, src_stride, dst, \
dst_stride, h, filter_row); \
} \
(void)num_taps; \
} else { \ constint num_taps = 2; \ while (w >= 16) { \
vpx_filter_block1d16_##dir##2_##avg##opt(src_start, src_stride, dst, \
dst_stride, h, filter_row); \
src += 16; \
dst += 16; \
w -= 16; \
} \ if (w == 8) { \
vpx_filter_block1d8_##dir##2_##avg##opt(src_start, src_stride, dst, \
dst_stride, h, filter_row); \
} elseif (w == 4) { \
vpx_filter_block1d4_##dir##2_##avg##opt(src_start, src_stride, dst, \
dst_stride, h, filter_row); \
} \
(void)num_taps; \
} \
}
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.