18e90d744e
This is the initial patch for supporting 1/8th pel motion. Currently if we configure with enable-high-precision-mv, all motion vectors would default to 1/8 pel. Encode and decode syncs fine with the current code. In the next phase the code will be refactored so that we can choose the 1/8 pel mode adaptively at a frame/segment/mb level. Derf results: http://www.corp.google.com/~debargha/vp8_results/enhinterp_hpmv.html (about 0.83% better than 8-tap interpoaltion) Patch 3: Rebased. Also adding 1/16th pel interpolation for U and V Patch 4: HD results. http://www.corp.google.com/~debargha/vp8_results/enhinterp_hd_hpmv.html Seems impressive (unless I am doing something wrong). Patch 5: Added mmx/sse for bilateral filtering, as well as enforced use of c-versions of subpel filters with 8-taps and 1/16th pel; Also redesigned the 8-tap filters to reduce the cut-off in order to introduce a denoising effect. There is a new configure option sixteenth-subpel-uv which will use 1/16 th pel interpolation for uv, if the motion vectors have 1/8 pel accuracy. With the fixes the results are promising on the derf set. The enhanced interpolation option with 8-taps alone gives 3% improvement over thei derf set: http://www.corp.google.com/~debargha/vp8_results/enhinterpn.html Results on high precision mv and on the hd set are to follow. Patch 6: Adding a missing condition for CONFIG_SIXTEENTH_SUBPEL_UV in vp8/common/x86/x86_systemdependent.c Patch 7: Cleaning up various debug messages. Patch 8: Merge conflict Change-Id: I5b1d844457aefd7414a9e4e0e06c6ed38fd8cc04
127 lines
4.0 KiB
C
127 lines
4.0 KiB
C
/*
|
|
* Copyright (c) 2010 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.
|
|
*/
|
|
|
|
#include "vpx_config.h"
|
|
#include "vp8/encoder/variance.h"
|
|
#include "vp8/common/filter.h"
|
|
#include "vp8/common/arm/bilinearfilter_arm.h"
|
|
|
|
#if CONFIG_SIXTEENTH_SUBPEL_UV
|
|
#define HALFNDX 8
|
|
#else
|
|
#define HALFNDX 4
|
|
#endif
|
|
|
|
#if HAVE_ARMV6
|
|
|
|
unsigned int vp8_sub_pixel_variance8x8_armv6
|
|
(
|
|
const unsigned char *src_ptr,
|
|
int src_pixels_per_line,
|
|
int xoffset,
|
|
int yoffset,
|
|
const unsigned char *dst_ptr,
|
|
int dst_pixels_per_line,
|
|
unsigned int *sse
|
|
)
|
|
{
|
|
unsigned short first_pass[10*8];
|
|
unsigned char second_pass[8*8];
|
|
const short *HFilter, *VFilter;
|
|
|
|
HFilter = vp8_bilinear_filters[xoffset];
|
|
VFilter = vp8_bilinear_filters[yoffset];
|
|
|
|
vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass,
|
|
src_pixels_per_line,
|
|
9, 8, HFilter);
|
|
vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass,
|
|
8, 8, 8, VFilter);
|
|
|
|
return vp8_variance8x8_armv6(second_pass, 8, dst_ptr,
|
|
dst_pixels_per_line, sse);
|
|
}
|
|
|
|
unsigned int vp8_sub_pixel_variance16x16_armv6
|
|
(
|
|
const unsigned char *src_ptr,
|
|
int src_pixels_per_line,
|
|
int xoffset,
|
|
int yoffset,
|
|
const unsigned char *dst_ptr,
|
|
int dst_pixels_per_line,
|
|
unsigned int *sse
|
|
)
|
|
{
|
|
unsigned short first_pass[36*16];
|
|
unsigned char second_pass[20*16];
|
|
const short *HFilter, *VFilter;
|
|
unsigned int var;
|
|
|
|
if (xoffset == HALFNDX && yoffset == 0)
|
|
{
|
|
var = vp8_variance_halfpixvar16x16_h_armv6(src_ptr, src_pixels_per_line,
|
|
dst_ptr, dst_pixels_per_line, sse);
|
|
}
|
|
else if (xoffset == 0 && yoffset == HALFNDX)
|
|
{
|
|
var = vp8_variance_halfpixvar16x16_v_armv6(src_ptr, src_pixels_per_line,
|
|
dst_ptr, dst_pixels_per_line, sse);
|
|
}
|
|
else if (xoffset == HALFNDX && yoffset == HALFNDX)
|
|
{
|
|
var = vp8_variance_halfpixvar16x16_hv_armv6(src_ptr, src_pixels_per_line,
|
|
dst_ptr, dst_pixels_per_line, sse);
|
|
}
|
|
else
|
|
{
|
|
HFilter = vp8_bilinear_filters[xoffset];
|
|
VFilter = vp8_bilinear_filters[yoffset];
|
|
|
|
vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass,
|
|
src_pixels_per_line,
|
|
17, 16, HFilter);
|
|
vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass,
|
|
16, 16, 16, VFilter);
|
|
|
|
var = vp8_variance16x16_armv6(second_pass, 16, dst_ptr,
|
|
dst_pixels_per_line, sse);
|
|
}
|
|
return var;
|
|
}
|
|
|
|
#endif /* HAVE_ARMV6 */
|
|
|
|
|
|
#if HAVE_ARMV7
|
|
|
|
unsigned int vp8_sub_pixel_variance16x16_neon
|
|
(
|
|
const unsigned char *src_ptr,
|
|
int src_pixels_per_line,
|
|
int xoffset,
|
|
int yoffset,
|
|
const unsigned char *dst_ptr,
|
|
int dst_pixels_per_line,
|
|
unsigned int *sse
|
|
)
|
|
{
|
|
if (xoffset == HALFNDX && yoffset == 0)
|
|
return vp8_variance_halfpixvar16x16_h_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse);
|
|
else if (xoffset == 0 && yoffset == HALFNDX)
|
|
return vp8_variance_halfpixvar16x16_v_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse);
|
|
else if (xoffset == HALFNDX && yoffset == HALFNDX)
|
|
return vp8_variance_halfpixvar16x16_hv_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse);
|
|
else
|
|
return vp8_sub_pixel_variance16x16_neon_func(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse);
|
|
}
|
|
|
|
#endif
|