Merge changes I92eb4312,Ibb2afe4e
* changes: subpel variance neon: add mixed sizes sub pixel variance neon: use generic variance
This commit is contained in:
@@ -1264,9 +1264,16 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
NEON, VpxSubpelVarianceTest,
|
||||
::testing::Values(make_tuple(6, 6, &vpx_sub_pixel_variance64x64_neon, 0),
|
||||
make_tuple(6, 5, &vpx_sub_pixel_variance64x32_neon, 0),
|
||||
make_tuple(5, 6, &vpx_sub_pixel_variance32x64_neon, 0),
|
||||
make_tuple(5, 5, &vpx_sub_pixel_variance32x32_neon, 0),
|
||||
make_tuple(5, 4, &vpx_sub_pixel_variance32x16_neon, 0),
|
||||
make_tuple(4, 5, &vpx_sub_pixel_variance16x32_neon, 0),
|
||||
make_tuple(4, 4, &vpx_sub_pixel_variance16x16_neon, 0),
|
||||
make_tuple(3, 3, &vpx_sub_pixel_variance8x8_neon, 0)));
|
||||
make_tuple(4, 3, &vpx_sub_pixel_variance16x8_neon, 0),
|
||||
make_tuple(3, 4, &vpx_sub_pixel_variance8x16_neon, 0),
|
||||
make_tuple(3, 3, &vpx_sub_pixel_variance8x8_neon, 0),
|
||||
make_tuple(3, 2, &vpx_sub_pixel_variance8x4_neon, 0)));
|
||||
#endif // HAVE_NEON
|
||||
|
||||
#if HAVE_MSA
|
||||
|
||||
@@ -22,12 +22,12 @@ static const uint8_t bilinear_filters[8][2] = {
|
||||
{ 64, 64 }, { 48, 80 }, { 32, 96 }, { 16, 112 },
|
||||
};
|
||||
|
||||
// Process a block exactly 8 wide and any height.
|
||||
static void var_filter_block2d_bil_w8(const uint8_t *src_ptr,
|
||||
uint8_t *output_ptr,
|
||||
unsigned int src_pixels_per_line,
|
||||
int pixel_step,
|
||||
unsigned int output_height,
|
||||
unsigned int output_width,
|
||||
const uint8_t *filter) {
|
||||
const uint8x8_t f0 = vmov_n_u8(filter[0]);
|
||||
const uint8x8_t f1 = vmov_n_u8(filter[1]);
|
||||
@@ -41,10 +41,11 @@ static void var_filter_block2d_bil_w8(const uint8_t *src_ptr,
|
||||
vst1_u8(&output_ptr[0], out);
|
||||
// Next row...
|
||||
src_ptr += src_pixels_per_line;
|
||||
output_ptr += output_width;
|
||||
output_ptr += 8;
|
||||
}
|
||||
}
|
||||
|
||||
// Process a block which is a mutiple of 16 wide and any height.
|
||||
static void var_filter_block2d_bil_w16(const uint8_t *src_ptr,
|
||||
uint8_t *output_ptr,
|
||||
unsigned int src_pixels_per_line,
|
||||
@@ -73,61 +74,36 @@ static void var_filter_block2d_bil_w16(const uint8_t *src_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int vpx_sub_pixel_variance8x8_neon(const uint8_t *src, int src_stride,
|
||||
int xoffset, int yoffset,
|
||||
const uint8_t *dst, int dst_stride,
|
||||
unsigned int *sse) {
|
||||
DECLARE_ALIGNED(16, uint8_t, temp2[8 * 8]);
|
||||
DECLARE_ALIGNED(16, uint8_t, fdata3[9 * 8]);
|
||||
// TODO(johannkoenig): support 4xM block sizes.
|
||||
#define sub_pixel_varianceNxM(n, m) \
|
||||
unsigned int vpx_sub_pixel_variance##n##x##m##_neon( \
|
||||
const uint8_t *src, int src_stride, int xoffset, int yoffset, \
|
||||
const uint8_t *dst, int dst_stride, unsigned int *sse) { \
|
||||
DECLARE_ALIGNED(16, uint8_t, fdata3[n * (m + 1)]); \
|
||||
DECLARE_ALIGNED(16, uint8_t, temp2[n * m]); \
|
||||
\
|
||||
if (n == 8) { \
|
||||
var_filter_block2d_bil_w8(src, fdata3, src_stride, 1, (m + 1), \
|
||||
bilinear_filters[xoffset]); \
|
||||
var_filter_block2d_bil_w8(fdata3, temp2, n, n, m, \
|
||||
bilinear_filters[yoffset]); \
|
||||
} else { \
|
||||
var_filter_block2d_bil_w16(src, fdata3, src_stride, 1, (m + 1), n, \
|
||||
bilinear_filters[xoffset]); \
|
||||
var_filter_block2d_bil_w16(fdata3, temp2, n, n, m, n, \
|
||||
bilinear_filters[yoffset]); \
|
||||
} \
|
||||
return vpx_variance##n##x##m(temp2, n, dst, dst_stride, sse); \
|
||||
}
|
||||
|
||||
var_filter_block2d_bil_w8(src, fdata3, src_stride, 1, 9, 8,
|
||||
bilinear_filters[xoffset]);
|
||||
var_filter_block2d_bil_w8(fdata3, temp2, 8, 8, 8, 8,
|
||||
bilinear_filters[yoffset]);
|
||||
return vpx_variance8x8_neon(temp2, 8, dst, dst_stride, sse);
|
||||
}
|
||||
|
||||
unsigned int vpx_sub_pixel_variance16x16_neon(const uint8_t *src,
|
||||
int src_stride, int xoffset,
|
||||
int yoffset, const uint8_t *dst,
|
||||
int dst_stride,
|
||||
unsigned int *sse) {
|
||||
DECLARE_ALIGNED(16, uint8_t, temp2[16 * 16]);
|
||||
DECLARE_ALIGNED(16, uint8_t, fdata3[17 * 16]);
|
||||
|
||||
var_filter_block2d_bil_w16(src, fdata3, src_stride, 1, 17, 16,
|
||||
bilinear_filters[xoffset]);
|
||||
var_filter_block2d_bil_w16(fdata3, temp2, 16, 16, 16, 16,
|
||||
bilinear_filters[yoffset]);
|
||||
return vpx_variance16x16_neon(temp2, 16, dst, dst_stride, sse);
|
||||
}
|
||||
|
||||
unsigned int vpx_sub_pixel_variance32x32_neon(const uint8_t *src,
|
||||
int src_stride, int xoffset,
|
||||
int yoffset, const uint8_t *dst,
|
||||
int dst_stride,
|
||||
unsigned int *sse) {
|
||||
DECLARE_ALIGNED(16, uint8_t, temp2[32 * 32]);
|
||||
DECLARE_ALIGNED(16, uint8_t, fdata3[33 * 32]);
|
||||
|
||||
var_filter_block2d_bil_w16(src, fdata3, src_stride, 1, 33, 32,
|
||||
bilinear_filters[xoffset]);
|
||||
var_filter_block2d_bil_w16(fdata3, temp2, 32, 32, 32, 32,
|
||||
bilinear_filters[yoffset]);
|
||||
return vpx_variance32x32_neon(temp2, 32, dst, dst_stride, sse);
|
||||
}
|
||||
|
||||
unsigned int vpx_sub_pixel_variance64x64_neon(const uint8_t *src,
|
||||
int src_stride, int xoffset,
|
||||
int yoffset, const uint8_t *dst,
|
||||
int dst_stride,
|
||||
unsigned int *sse) {
|
||||
DECLARE_ALIGNED(16, uint8_t, temp2[64 * 64]);
|
||||
DECLARE_ALIGNED(16, uint8_t, fdata3[65 * 64]);
|
||||
|
||||
var_filter_block2d_bil_w16(src, fdata3, src_stride, 1, 65, 64,
|
||||
bilinear_filters[xoffset]);
|
||||
var_filter_block2d_bil_w16(fdata3, temp2, 64, 64, 64, 64,
|
||||
bilinear_filters[yoffset]);
|
||||
return vpx_variance64x64_neon(temp2, 64, dst, dst_stride, sse);
|
||||
}
|
||||
sub_pixel_varianceNxM(8, 4);
|
||||
sub_pixel_varianceNxM(8, 8);
|
||||
sub_pixel_varianceNxM(8, 16);
|
||||
sub_pixel_varianceNxM(16, 8);
|
||||
sub_pixel_varianceNxM(16, 16);
|
||||
sub_pixel_varianceNxM(16, 32);
|
||||
sub_pixel_varianceNxM(32, 16);
|
||||
sub_pixel_varianceNxM(32, 32);
|
||||
sub_pixel_varianceNxM(32, 64);
|
||||
sub_pixel_varianceNxM(64, 32);
|
||||
sub_pixel_varianceNxM(64, 64);
|
||||
|
||||
@@ -1242,34 +1242,34 @@ add_proto qw/uint32_t vpx_sub_pixel_variance64x64/, "const uint8_t *src_ptr, int
|
||||
specialize qw/vpx_sub_pixel_variance64x64 avx2 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance64x32 msa sse2 ssse3/;
|
||||
specialize qw/vpx_sub_pixel_variance64x32 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance32x64 msa sse2 ssse3/;
|
||||
specialize qw/vpx_sub_pixel_variance32x64 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance32x32 avx2 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance32x16 msa sse2 ssse3/;
|
||||
specialize qw/vpx_sub_pixel_variance32x16 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance16x32 msa sse2 ssse3/;
|
||||
specialize qw/vpx_sub_pixel_variance16x32 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance16x16 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance16x8 msa sse2 ssse3/;
|
||||
specialize qw/vpx_sub_pixel_variance16x8 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance8x16 msa sse2 ssse3/;
|
||||
specialize qw/vpx_sub_pixel_variance8x16 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance8x8 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance8x4 msa sse2 ssse3/;
|
||||
specialize qw/vpx_sub_pixel_variance8x4 neon msa sse2 ssse3/;
|
||||
|
||||
add_proto qw/uint32_t vpx_sub_pixel_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse";
|
||||
specialize qw/vpx_sub_pixel_variance4x8 msa sse2 ssse3/;
|
||||
|
||||
Reference in New Issue
Block a user