This patch removes the old pred-filter experiment and replaces it
with one that is implemented using the switchable filter framework.

If the pred-filter experiment is enabled, three interopolation
filters are tested during mode selection; the standard 8-tap
interpolation filter, a sharp 8-tap filter and a (new) 8-tap
smoothing filter.

The 6-tap filter code has been preserved for now and if the
enable-6tap experiment is enabled (in addition to the pred-filter
experiment) the original 6-tap filter replaces the new 8-tap smooth
filter in the switchable mode.

The new experiment applies the prediction filter in cases of a
fractional-pel motion vector. Future patches will apply the filter
where the mv is pel-aligned and also to intra predicted blocks.

Change-Id: I08e8cba978f2bbf3019f8413f376b8e2cd85eba4
This commit is contained in:
Adrian Grange 2013-01-08 14:14:01 -08:00
Родитель 4b7304ee68
Коммит 7d6b5425d7
18 изменённых файлов: 338 добавлений и 893 удалений

1
configure поставляемый
Просмотреть файл

@ -253,6 +253,7 @@ EXPERIMENT_LIST="
dwtdcthybrid dwtdcthybrid
cnvcontext cnvcontext
newcoefcontext newcoefcontext
enable_6tap
" "
CONFIG_LIST=" CONFIG_LIST="
external_build external_build

Просмотреть файл

@ -76,10 +76,13 @@ typedef enum {
typedef enum typedef enum
{ {
SIXTAP = 0, #if CONFIG_ENABLE_6TAP
BILINEAR = 1, SIXTAP,
EIGHTTAP = 2, #endif
EIGHTTAP_SHARP = 3, EIGHTTAP_SMOOTH,
EIGHTTAP,
EIGHTTAP_SHARP,
BILINEAR,
SWITCHABLE /* should be the last one */ SWITCHABLE /* should be the last one */
} INTERPOLATIONFILTERTYPE; } INTERPOLATIONFILTERTYPE;
@ -268,10 +271,6 @@ typedef struct {
// a valid predictor // a valid predictor
unsigned char mb_in_image; unsigned char mb_in_image;
#if CONFIG_PRED_FILTER
// Flag to turn prediction signal filter on(1)/off(0 ) at the MB level
unsigned int pred_filter_enabled;
#endif
INTERPOLATIONFILTERTYPE interp_filter; INTERPOLATIONFILTERTYPE interp_filter;
BLOCK_SIZE_TYPE sb_type; BLOCK_SIZE_TYPE sb_type;
@ -399,11 +398,11 @@ typedef struct macroblockd {
void (*inv_walsh4x4_lossless)(int16_t *in, int16_t *out); void (*inv_walsh4x4_lossless)(int16_t *in, int16_t *out);
vp9_subpix_fn_t subpixel_predict; vp9_subpix_fn_t subpixel_predict4x4;
vp9_subpix_fn_t subpixel_predict8x4; vp9_subpix_fn_t subpixel_predict8x4;
vp9_subpix_fn_t subpixel_predict8x8; vp9_subpix_fn_t subpixel_predict8x8;
vp9_subpix_fn_t subpixel_predict16x16; vp9_subpix_fn_t subpixel_predict16x16;
vp9_subpix_fn_t subpixel_predict_avg; vp9_subpix_fn_t subpixel_predict_avg4x4;
vp9_subpix_fn_t subpixel_predict_avg8x4; vp9_subpix_fn_t subpixel_predict_avg8x4;
vp9_subpix_fn_t subpixel_predict_avg8x8; vp9_subpix_fn_t subpixel_predict_avg8x8;
vp9_subpix_fn_t subpixel_predict_avg16x16; vp9_subpix_fn_t subpixel_predict_avg16x16;

Просмотреть файл

@ -388,9 +388,15 @@ const vp9_tree_index vp9_switchable_interp_tree[VP9_SWITCHABLE_FILTERS*2-2] = {
-1, -2 -1, -2
}; };
struct vp9_token_struct vp9_switchable_interp_encodings[VP9_SWITCHABLE_FILTERS]; struct vp9_token_struct vp9_switchable_interp_encodings[VP9_SWITCHABLE_FILTERS];
#if CONFIG_ENABLE_6TAP
const INTERPOLATIONFILTERTYPE vp9_switchable_interp[VP9_SWITCHABLE_FILTERS] = { const INTERPOLATIONFILTERTYPE vp9_switchable_interp[VP9_SWITCHABLE_FILTERS] = {
EIGHTTAP, SIXTAP, EIGHTTAP_SHARP}; SIXTAP, EIGHTTAP, EIGHTTAP_SHARP};
const int vp9_switchable_interp_map[SWITCHABLE+1] = {1, -1, 0, 2, -1}; const int vp9_switchable_interp_map[SWITCHABLE+1] = {0, -1, 1, 2, -1, -1};
#else
const INTERPOLATIONFILTERTYPE vp9_switchable_interp[VP9_SWITCHABLE_FILTERS] = {
EIGHTTAP, EIGHTTAP_SMOOTH, EIGHTTAP_SHARP};
const int vp9_switchable_interp_map[SWITCHABLE+1] = {1, 0, 2, -1, -1};
#endif
const vp9_prob vp9_switchable_interp_prob [VP9_SWITCHABLE_FILTERS+1] const vp9_prob vp9_switchable_interp_prob [VP9_SWITCHABLE_FILTERS+1]
[VP9_SWITCHABLE_FILTERS-1] = { [VP9_SWITCHABLE_FILTERS-1] = {
{248, 192}, { 32, 248}, { 32, 32}, {192, 160} {248, 192}, { 32, 248}, { 32, 32}, {192, 160}
@ -408,7 +414,11 @@ const vp9_prob vp9_switchable_interp_prob [VP9_SWITCHABLE_FILTERS+1]
}; };
const INTERPOLATIONFILTERTYPE vp9_switchable_interp[VP9_SWITCHABLE_FILTERS] = { const INTERPOLATIONFILTERTYPE vp9_switchable_interp[VP9_SWITCHABLE_FILTERS] = {
EIGHTTAP, EIGHTTAP_SHARP}; EIGHTTAP, EIGHTTAP_SHARP};
const int vp9_switchable_interp_map[SWITCHABLE+1] = {-1, -1, 0, 1, -1}; //8, 8s #if CONFIG_ENABLE_6TAP
const int vp9_switchable_interp_map[SWITCHABLE+1] = {-1, -1, 0, 1, -1, -1};
#else
const int vp9_switchable_interp_map[SWITCHABLE+1] = {-1, 0, 1, -1, -1};
#endif
#endif #endif
void vp9_entropy_mode_init() { void vp9_entropy_mode_init() {

Просмотреть файл

@ -97,7 +97,11 @@ void vp9_kf_default_bmode_probs(vp9_prob dest[VP9_KF_BINTRAMODES]
void vp9_adapt_mode_probs(struct VP9Common *); void vp9_adapt_mode_probs(struct VP9Common *);
#if CONFIG_PRED_FILTER
#define VP9_SWITCHABLE_FILTERS 3 /* number of switchable filters */
#else
#define VP9_SWITCHABLE_FILTERS 2 /* number of switchable filters */ #define VP9_SWITCHABLE_FILTERS 2 /* number of switchable filters */
#endif
extern const INTERPOLATIONFILTERTYPE vp9_switchable_interp extern const INTERPOLATIONFILTERTYPE vp9_switchable_interp
[VP9_SWITCHABLE_FILTERS]; [VP9_SWITCHABLE_FILTERS];

Просмотреть файл

@ -122,6 +122,28 @@ DECLARE_ALIGNED(16, const int16_t, vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][8]) = {
#endif /* FILTER_ALPHA_SHARP */ #endif /* FILTER_ALPHA_SHARP */
}; };
DECLARE_ALIGNED(16, const int16_t,
vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS][8]) = {
/* 8-tap lowpass filter */
/* Hamming window */
{-1, -7, 32, 80, 32, -7, -1, 0},
{-1, -8, 28, 80, 37, -7, -2, 1},
{ 0, -8, 24, 79, 41, -7, -2, 1},
{ 0, -8, 20, 78, 45, -5, -3, 1},
{ 0, -8, 16, 76, 50, -4, -3, 1},
{ 0, -7, 13, 74, 54, -3, -4, 1},
{ 1, -7, 9, 71, 58, -1, -4, 1},
{ 1, -6, 6, 68, 62, 1, -5, 1},
{ 1, -6, 4, 65, 65, 4, -6, 1},
{ 1, -5, 1, 62, 68, 6, -6, 1},
{ 1, -4, -1, 58, 71, 9, -7, 1},
{ 1, -4, -3, 54, 74, 13, -7, 0},
{ 1, -3, -4, 50, 76, 16, -8, 0},
{ 1, -3, -5, 45, 78, 20, -8, 0},
{ 1, -2, -7, 41, 79, 24, -8, 0},
{ 1, -2, -7, 37, 80, 28, -8, -1}
};
DECLARE_ALIGNED(16, const int16_t, vp9_sub_pel_filters_6[SUBPEL_SHIFTS][6]) = { DECLARE_ALIGNED(16, const int16_t, vp9_sub_pel_filters_6[SUBPEL_SHIFTS][6]) = {
{0, 0, 128, 0, 0, 0}, {0, 0, 128, 0, 0, 0},
{1, -5, 125, 8, -2, 1}, {1, -5, 125, 8, -2, 1},
@ -254,30 +276,33 @@ static void filter_block2d_6(uint8_t *src_ptr,
int output_pitch, int output_pitch,
const int16_t *HFilter, const int16_t *HFilter,
const int16_t *VFilter) { const int16_t *VFilter) {
int FData[(3 + Interp_Extend * 2) * 4]; /* Temp data buffer used in filtering */ int FData[(3 + Interp_Extend * 2) * 4]; /* Temp data buffer */
/* First filter 1-D horizontally... */ /* First filter 1-D horizontally... */
filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, filter_block2d_first_pass_6(
3 + Interp_Extend * 2, 4, HFilter); src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData,
src_pixels_per_line, 1, 3 + Interp_Extend * 2, 4, HFilter);
/* then filter verticaly... */ /* then filter vertically... */
filter_block2d_second_pass_6(FData + 4 * (Interp_Extend - 1), output_ptr, output_pitch, 4, 4, 4, 4, VFilter); filter_block2d_second_pass_6(FData + 4 * (Interp_Extend - 1), output_ptr,
output_pitch, 4, 4, 4, 4, VFilter);
} }
void vp9_sixtap_predict_c(uint8_t *src_ptr, void vp9_sixtap_predict4x4_c(uint8_t *src_ptr,
int src_pixels_per_line, int src_pixels_per_line,
int xoffset, int xoffset,
int yoffset, int yoffset,
uint8_t *dst_ptr, uint8_t *dst_ptr,
int dst_pitch) { int dst_pitch) {
const int16_t *HFilter; const int16_t *HFilter;
const int16_t *VFilter; const int16_t *VFilter;
HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */ HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */
VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */ VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */
filter_block2d_6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); filter_block2d_6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter,
VFilter);
} }
/* /*
@ -293,32 +318,32 @@ static void filter_block2d_avg_6(uint8_t *src_ptr,
int output_pitch, int output_pitch,
const int16_t *HFilter, const int16_t *HFilter,
const int16_t *VFilter) { const int16_t *VFilter) {
int FData[(3 + Interp_Extend * 2) * 4]; /* Temp data buffer used in filtering */ int FData[(3 + Interp_Extend * 2) * 4]; /* Temp data buffer */
/* First filter 1-D horizontally... */ /* First filter 1-D horizontally... */
filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), filter_block2d_first_pass_6(
FData, src_pixels_per_line, 1, src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData,
3 + Interp_Extend * 2, 4, HFilter); src_pixels_per_line, 1, 3 + Interp_Extend * 2, 4, HFilter);
/* then filter verticaly... */ /* then filter vertically... */
filter_block2d_second_pass_avg_6(FData + 4 * (Interp_Extend - 1), output_ptr, filter_block2d_second_pass_avg_6(FData + 4 * (Interp_Extend - 1), output_ptr,
output_pitch, 4, 4, 4, 4, VFilter); output_pitch, 4, 4, 4, 4, VFilter);
} }
void vp9_sixtap_predict_avg_c(uint8_t *src_ptr, void vp9_sixtap_predict_avg4x4_c(uint8_t *src_ptr,
int src_pixels_per_line, int src_pixels_per_line,
int xoffset, int xoffset,
int yoffset, int yoffset,
uint8_t *dst_ptr, uint8_t *dst_ptr,
int dst_pitch) { int dst_pitch) {
const int16_t *HFilter; const int16_t *HFilter;
const int16_t *VFilter; const int16_t *VFilter;
HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */ HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */
VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */ VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */
filter_block2d_avg_6(src_ptr, dst_ptr, src_pixels_per_line, filter_block2d_avg_6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch,
dst_pitch, HFilter, VFilter); HFilter, VFilter);
} }
void vp9_sixtap_predict8x8_c(uint8_t *src_ptr, void vp9_sixtap_predict8x8_c(uint8_t *src_ptr,
@ -329,19 +354,19 @@ void vp9_sixtap_predict8x8_c(uint8_t *src_ptr,
int dst_pitch) { int dst_pitch) {
const int16_t *HFilter; const int16_t *HFilter;
const int16_t *VFilter; const int16_t *VFilter;
// int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer */
int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */
HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */ HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */
VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */ VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */
/* First filter 1-D horizontally... */ /* First filter 1-D horizontally... */
filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, filter_block2d_first_pass_6(
7 + Interp_Extend * 2, 8, HFilter); src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData,
src_pixels_per_line, 1, 7 + Interp_Extend * 2, 8, HFilter);
/* then filter vertically... */
/* then filter verticaly... */ filter_block2d_second_pass_6(FData + 8 * (Interp_Extend - 1), dst_ptr,
filter_block2d_second_pass_6(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); dst_pitch, 8, 8, 8, 8, VFilter);
} }
@ -353,18 +378,19 @@ void vp9_sixtap_predict_avg8x8_c(uint8_t *src_ptr,
int dst_pitch) { int dst_pitch) {
const int16_t *HFilter; const int16_t *HFilter;
const int16_t *VFilter; const int16_t *VFilter;
// int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer */
int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */
HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */ HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */
VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */ VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */
/* First filter 1-D horizontally... */ /* First filter 1-D horizontally... */
filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, filter_block2d_first_pass_6(
7 + Interp_Extend * 2, 8, HFilter); src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData,
src_pixels_per_line, 1, 7 + Interp_Extend * 2, 8, HFilter);
/* then filter verticaly... */ /* then filter vertically... */
filter_block2d_second_pass_avg_6(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); filter_block2d_second_pass_avg_6(FData + 8 * (Interp_Extend - 1), dst_ptr,
dst_pitch, 8, 8, 8, 8, VFilter);
} }
void vp9_sixtap_predict8x4_c(uint8_t *src_ptr, void vp9_sixtap_predict8x4_c(uint8_t *src_ptr,
@ -375,20 +401,19 @@ void vp9_sixtap_predict8x4_c(uint8_t *src_ptr,
int dst_pitch) { int dst_pitch) {
const int16_t *HFilter; const int16_t *HFilter;
const int16_t *VFilter; const int16_t *VFilter;
// int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ int FData[(3 + Interp_Extend * 2) * 8]; /* Temp data buffer */
int FData[(3 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */
HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */ HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */
VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */ VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */
/* First filter 1-D horizontally... */ /* First filter 1-D horizontally... */
filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, filter_block2d_first_pass_6(
3 + Interp_Extend * 2, 8, HFilter); src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData,
src_pixels_per_line, 1, 3 + Interp_Extend * 2, 8, HFilter);
/* then filter verticaly... */
filter_block2d_second_pass_6(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter);
/* then filter vertically... */
filter_block2d_second_pass_6(FData + 8 * (Interp_Extend - 1), dst_ptr,
dst_pitch, 8, 8, 4, 8, VFilter);
} }
void vp9_sixtap_predict16x16_c(uint8_t *src_ptr, void vp9_sixtap_predict16x16_c(uint8_t *src_ptr,
@ -399,20 +424,19 @@ void vp9_sixtap_predict16x16_c(uint8_t *src_ptr,
int dst_pitch) { int dst_pitch) {
const int16_t *HFilter; const int16_t *HFilter;
const int16_t *VFilter; const int16_t *VFilter;
// int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer */
int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer used in filtering */
HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */ HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */
VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */ VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */
/* First filter 1-D horizontally... */ /* First filter 1-D horizontally... */
filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, filter_block2d_first_pass_6(
15 + Interp_Extend * 2, 16, HFilter); src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData,
src_pixels_per_line, 1, 15 + Interp_Extend * 2, 16, HFilter);
/* then filter verticaly... */
filter_block2d_second_pass_6(FData + 16 * (Interp_Extend - 1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter);
/* then filter vertically... */
filter_block2d_second_pass_6(FData + 16 * (Interp_Extend - 1), dst_ptr,
dst_pitch, 16, 16, 16, 16, VFilter);
} }
void vp9_sixtap_predict_avg16x16_c(uint8_t *src_ptr, void vp9_sixtap_predict_avg16x16_c(uint8_t *src_ptr,
@ -423,19 +447,19 @@ void vp9_sixtap_predict_avg16x16_c(uint8_t *src_ptr,
int dst_pitch) { int dst_pitch) {
const int16_t *HFilter; const int16_t *HFilter;
const int16_t *VFilter; const int16_t *VFilter;
// int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer */
int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer used in filtering */
HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */ HFilter = vp9_sub_pel_filters_6[xoffset]; /* 6 tap */
VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */ VFilter = vp9_sub_pel_filters_6[yoffset]; /* 6 tap */
/* First filter 1-D horizontally... */ /* First filter 1-D horizontally... */
filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, filter_block2d_first_pass_6(
src_pixels_per_line, 1, 15 + Interp_Extend * 2, 16, HFilter); src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData,
src_pixels_per_line, 1, 15 + Interp_Extend * 2, 16, HFilter);
/* then filter verticaly... */ /* then filter vertically... */
filter_block2d_second_pass_avg_6(FData + 16 * (Interp_Extend - 1), dst_ptr, dst_pitch, filter_block2d_second_pass_avg_6(FData + 16 * (Interp_Extend - 1), dst_ptr,
16, 16, 16, 16, VFilter); dst_pitch, 16, 16, 16, 16, VFilter);
} }
typedef enum { typedef enum {
@ -543,8 +567,7 @@ void vp9_filter_block2d_4x4_8_c(const uint8_t *src_ptr,
const int16_t *VFilter_aligned16, const int16_t *VFilter_aligned16,
uint8_t *dst_ptr, uint8_t *dst_ptr,
unsigned int dst_stride) { unsigned int dst_stride) {
filter_block2d_8_c(src_ptr, src_stride, filter_block2d_8_c(src_ptr, src_stride, HFilter_aligned16, VFilter_aligned16,
HFilter_aligned16, VFilter_aligned16,
VPX_FILTER_4x4, dst_ptr, dst_stride); VPX_FILTER_4x4, dst_ptr, dst_stride);
} }
@ -554,8 +577,7 @@ void vp9_filter_block2d_8x4_8_c(const uint8_t *src_ptr,
const int16_t *VFilter_aligned16, const int16_t *VFilter_aligned16,
uint8_t *dst_ptr, uint8_t *dst_ptr,
unsigned int dst_stride) { unsigned int dst_stride) {
filter_block2d_8_c(src_ptr, src_stride, filter_block2d_8_c(src_ptr, src_stride, HFilter_aligned16, VFilter_aligned16,
HFilter_aligned16, VFilter_aligned16,
VPX_FILTER_8x4, dst_ptr, dst_stride); VPX_FILTER_8x4, dst_ptr, dst_stride);
} }
@ -565,8 +587,7 @@ void vp9_filter_block2d_8x8_8_c(const uint8_t *src_ptr,
const int16_t *VFilter_aligned16, const int16_t *VFilter_aligned16,
uint8_t *dst_ptr, uint8_t *dst_ptr,
unsigned int dst_stride) { unsigned int dst_stride) {
filter_block2d_8_c(src_ptr, src_stride, filter_block2d_8_c(src_ptr, src_stride, HFilter_aligned16, VFilter_aligned16,
HFilter_aligned16, VFilter_aligned16,
VPX_FILTER_8x8, dst_ptr, dst_stride); VPX_FILTER_8x8, dst_ptr, dst_stride);
} }
@ -576,8 +597,7 @@ void vp9_filter_block2d_16x16_8_c(const uint8_t *src_ptr,
const int16_t *VFilter_aligned16, const int16_t *VFilter_aligned16,
uint8_t *dst_ptr, uint8_t *dst_ptr,
unsigned int dst_stride) { unsigned int dst_stride) {
filter_block2d_8_c(src_ptr, src_stride, filter_block2d_8_c(src_ptr, src_stride, HFilter_aligned16, VFilter_aligned16,
HFilter_aligned16, VFilter_aligned16,
VPX_FILTER_16x16, dst_ptr, dst_stride); VPX_FILTER_16x16, dst_ptr, dst_stride);
} }
@ -600,20 +620,19 @@ static void block2d_average_c(uint8_t *src,
#define block2d_average block2d_average_c #define block2d_average block2d_average_c
void vp9_eighttap_predict_c(uint8_t *src_ptr, void vp9_eighttap_predict4x4_c(uint8_t *src_ptr,
int src_pixels_per_line, int src_pixels_per_line,
int xoffset, int xoffset,
int yoffset, int yoffset,
uint8_t *dst_ptr, uint8_t *dst_ptr,
int dst_pitch) { int dst_pitch) {
const int16_t *HFilter; const int16_t *HFilter;
const int16_t *VFilter; const int16_t *VFilter;
HFilter = vp9_sub_pel_filters_8[xoffset]; HFilter = vp9_sub_pel_filters_8[xoffset];
VFilter = vp9_sub_pel_filters_8[yoffset]; VFilter = vp9_sub_pel_filters_8[yoffset];
vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
HFilter, VFilter,
dst_ptr, dst_pitch); dst_ptr, dst_pitch);
} }
@ -627,24 +646,39 @@ void vp9_eighttap_predict_avg4x4_c(uint8_t *src_ptr,
const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset];
uint8_t tmp[4 * 4]; uint8_t tmp[4 * 4];
vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line, HFilter, VFilter, tmp,
HFilter, VFilter, 4);
tmp, 4);
block2d_average(tmp, 4, dst_ptr, dst_pitch, VPX_FILTER_4x4); block2d_average(tmp, 4, dst_ptr, dst_pitch, VPX_FILTER_4x4);
} }
void vp9_eighttap_predict_sharp_c(uint8_t *src_ptr, void vp9_eighttap_predict4x4_sharp_c(uint8_t *src_ptr,
int src_pixels_per_line, int src_pixels_per_line,
int xoffset, int xoffset,
int yoffset, int yoffset,
uint8_t *dst_ptr, uint8_t *dst_ptr,
int dst_pitch) { int dst_pitch) {
const int16_t *HFilter; const int16_t *HFilter;
const int16_t *VFilter; const int16_t *VFilter;
HFilter = vp9_sub_pel_filters_8s[xoffset]; HFilter = vp9_sub_pel_filters_8s[xoffset];
VFilter = vp9_sub_pel_filters_8s[yoffset]; VFilter = vp9_sub_pel_filters_8s[yoffset];
vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
dst_ptr, dst_pitch);
}
void vp9_eighttap_predict4x4_smooth_c(uint8_t *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
uint8_t *dst_ptr,
int dst_pitch) {
const int16_t *HFilter;
const int16_t *VFilter;
HFilter = vp9_sub_pel_filters_8lp[xoffset];
VFilter = vp9_sub_pel_filters_8lp[yoffset];
vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line,
HFilter, VFilter, HFilter, VFilter,
dst_ptr, dst_pitch); dst_ptr, dst_pitch);
@ -660,12 +694,27 @@ void vp9_eighttap_predict_avg4x4_sharp_c(uint8_t *src_ptr,
const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset];
uint8_t tmp[4 * 4]; uint8_t tmp[4 * 4];
vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line, HFilter, VFilter, tmp,
HFilter, VFilter, 4);
tmp, 4);
block2d_average(tmp, 4, dst_ptr, dst_pitch, VPX_FILTER_4x4); block2d_average(tmp, 4, dst_ptr, dst_pitch, VPX_FILTER_4x4);
} }
void vp9_eighttap_predict_avg4x4_smooth_c(uint8_t *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
uint8_t *dst_ptr,
int dst_pitch) {
const int16_t *HFilter = vp9_sub_pel_filters_8lp[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8lp[yoffset];
uint8_t tmp[4 * 4];
vp9_filter_block2d_4x4_8(src_ptr, src_pixels_per_line, HFilter, VFilter, tmp,
4);
block2d_average(tmp, 4, dst_ptr, dst_pitch, VPX_FILTER_4x4);
}
void vp9_eighttap_predict8x8_c(uint8_t *src_ptr, void vp9_eighttap_predict8x8_c(uint8_t *src_ptr,
int src_pixels_per_line, int src_pixels_per_line,
int xoffset, int xoffset,
@ -675,8 +724,7 @@ void vp9_eighttap_predict8x8_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset];
vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
HFilter, VFilter,
dst_ptr, dst_pitch); dst_ptr, dst_pitch);
} }
@ -689,8 +737,20 @@ void vp9_eighttap_predict8x8_sharp_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset];
vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
HFilter, VFilter, dst_ptr, dst_pitch);
}
void vp9_eighttap_predict8x8_smooth_c(uint8_t *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
uint8_t *dst_ptr,
int dst_pitch) {
const int16_t *HFilter = vp9_sub_pel_filters_8lp[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8lp[yoffset];
vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
dst_ptr, dst_pitch); dst_ptr, dst_pitch);
} }
@ -704,9 +764,8 @@ void vp9_eighttap_predict_avg8x8_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset];
vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, HFilter, VFilter, tmp,
HFilter, VFilter, 8);
tmp, 8);
block2d_average(tmp, 8, dst_ptr, dst_pitch, VPX_FILTER_8x8); block2d_average(tmp, 8, dst_ptr, dst_pitch, VPX_FILTER_8x8);
} }
@ -720,9 +779,23 @@ void vp9_eighttap_predict_avg8x8_sharp_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset];
vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, HFilter, VFilter, tmp,
HFilter, VFilter, 8);
tmp, 8); block2d_average(tmp, 8, dst_ptr, dst_pitch, VPX_FILTER_8x8);
}
void vp9_eighttap_predict_avg8x8_smooth_c(uint8_t *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
uint8_t *dst_ptr,
int dst_pitch) {
uint8_t tmp[8 * 8];
const int16_t *HFilter = vp9_sub_pel_filters_8lp[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8lp[yoffset];
vp9_filter_block2d_8x8_8(src_ptr, src_pixels_per_line, HFilter, VFilter, tmp,
8);
block2d_average(tmp, 8, dst_ptr, dst_pitch, VPX_FILTER_8x8); block2d_average(tmp, 8, dst_ptr, dst_pitch, VPX_FILTER_8x8);
} }
@ -735,8 +808,7 @@ void vp9_eighttap_predict8x4_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset];
vp9_filter_block2d_8x4_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_8x4_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
HFilter, VFilter,
dst_ptr, dst_pitch); dst_ptr, dst_pitch);
} }
@ -749,8 +821,20 @@ void vp9_eighttap_predict8x4_sharp_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset];
vp9_filter_block2d_8x4_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_8x4_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
HFilter, VFilter, dst_ptr, dst_pitch);
}
void vp9_eighttap_predict8x4_smooth_c(uint8_t *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
uint8_t *dst_ptr,
int dst_pitch) {
const int16_t *HFilter = vp9_sub_pel_filters_8lp[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8lp[yoffset];
vp9_filter_block2d_8x4_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
dst_ptr, dst_pitch); dst_ptr, dst_pitch);
} }
@ -763,9 +847,8 @@ void vp9_eighttap_predict16x16_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset];
vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
HFilter, VFilter, dst_ptr, dst_pitch);
dst_ptr, dst_pitch);
} }
void vp9_eighttap_predict16x16_sharp_c(uint8_t *src_ptr, void vp9_eighttap_predict16x16_sharp_c(uint8_t *src_ptr,
@ -777,9 +860,21 @@ void vp9_eighttap_predict16x16_sharp_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset];
vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
HFilter, VFilter, dst_ptr, dst_pitch);
dst_ptr, dst_pitch); }
void vp9_eighttap_predict16x16_smooth_c(uint8_t *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
uint8_t *dst_ptr,
int dst_pitch) {
const int16_t *HFilter = vp9_sub_pel_filters_8lp[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8lp[yoffset];
vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
dst_ptr, dst_pitch);
} }
void vp9_eighttap_predict_avg16x16_c(uint8_t *src_ptr, void vp9_eighttap_predict_avg16x16_c(uint8_t *src_ptr,
@ -792,9 +887,8 @@ void vp9_eighttap_predict_avg16x16_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8[yoffset];
vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
HFilter, VFilter, tmp, 16);
tmp, 16);
block2d_average(tmp, 16, dst_ptr, dst_pitch, VPX_FILTER_16x16); block2d_average(tmp, 16, dst_ptr, dst_pitch, VPX_FILTER_16x16);
} }
@ -808,9 +902,23 @@ void vp9_eighttap_predict_avg16x16_sharp_c(uint8_t *src_ptr,
const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset]; const int16_t *HFilter = vp9_sub_pel_filters_8s[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset]; const int16_t *VFilter = vp9_sub_pel_filters_8s[yoffset];
vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
HFilter, VFilter, tmp, 16);
tmp, 16); block2d_average(tmp, 16, dst_ptr, dst_pitch, VPX_FILTER_16x16);
}
void vp9_eighttap_predict_avg16x16_smooth_c(uint8_t *src_ptr,
int src_pixels_per_line,
int xoffset,
int yoffset,
uint8_t *dst_ptr,
int dst_pitch) {
DECLARE_ALIGNED_ARRAY(16, uint8_t, tmp, 16 * 16);
const int16_t *HFilter = vp9_sub_pel_filters_8lp[xoffset];
const int16_t *VFilter = vp9_sub_pel_filters_8lp[yoffset];
vp9_filter_block2d_16x16_8(src_ptr, src_pixels_per_line, HFilter, VFilter,
tmp, 16);
block2d_average(tmp, 16, dst_ptr, dst_pitch, VPX_FILTER_16x16); block2d_average(tmp, 16, dst_ptr, dst_pitch, VPX_FILTER_16x16);
} }

Просмотреть файл

@ -25,5 +25,6 @@ extern const int16_t vp9_bilinear_filters[SUBPEL_SHIFTS][2];
extern const int16_t vp9_sub_pel_filters_6[SUBPEL_SHIFTS][6]; extern const int16_t vp9_sub_pel_filters_6[SUBPEL_SHIFTS][6];
extern const int16_t vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8]; extern const int16_t vp9_sub_pel_filters_8[SUBPEL_SHIFTS][8];
extern const int16_t vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][8]; extern const int16_t vp9_sub_pel_filters_8s[SUBPEL_SHIFTS][8];
extern const int16_t vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS][8];
#endif // VP9_COMMON_VP9_FILTER_H_ #endif // VP9_COMMON_VP9_FILTER_H_

Просмотреть файл

@ -278,13 +278,6 @@ typedef struct VP9Common {
struct postproc_state postproc_state; struct postproc_state postproc_state;
#endif #endif
#if CONFIG_PRED_FILTER
/* Prediction filter variables */
int pred_filter_mode; // 0=disabled at the frame level (no MB filtered)
// 1=enabled at the frame level (all MB filtered)
// 2=specified per MB (1=filtered, 0=non-filtered)
vp9_prob prob_pred_filter_off;
#endif
#if CONFIG_COMP_INTERINTRA_PRED #if CONFIG_COMP_INTERINTRA_PRED
int use_interintra; int use_interintra;
#endif #endif

Просмотреть файл

@ -18,39 +18,53 @@
void vp9_setup_interp_filters(MACROBLOCKD *xd, void vp9_setup_interp_filters(MACROBLOCKD *xd,
INTERPOLATIONFILTERTYPE mcomp_filter_type, INTERPOLATIONFILTERTYPE mcomp_filter_type,
VP9_COMMON *cm) { VP9_COMMON *cm) {
#if CONFIG_ENABLE_6TAP
if (mcomp_filter_type == SIXTAP) { if (mcomp_filter_type == SIXTAP) {
xd->subpixel_predict = vp9_sixtap_predict; xd->subpixel_predict4x4 = vp9_sixtap_predict4x4;
xd->subpixel_predict8x4 = vp9_sixtap_predict8x4; xd->subpixel_predict8x4 = vp9_sixtap_predict8x4;
xd->subpixel_predict8x8 = vp9_sixtap_predict8x8; xd->subpixel_predict8x8 = vp9_sixtap_predict8x8;
xd->subpixel_predict16x16 = vp9_sixtap_predict16x16; xd->subpixel_predict16x16 = vp9_sixtap_predict16x16;
xd->subpixel_predict_avg = vp9_sixtap_predict_avg; xd->subpixel_predict_avg4x4 = vp9_sixtap_predict_avg4x4;
xd->subpixel_predict_avg8x8 = vp9_sixtap_predict_avg8x8; xd->subpixel_predict_avg8x8 = vp9_sixtap_predict_avg8x8;
xd->subpixel_predict_avg16x16 = vp9_sixtap_predict_avg16x16; xd->subpixel_predict_avg16x16 = vp9_sixtap_predict_avg16x16;
} else if (mcomp_filter_type == EIGHTTAP || mcomp_filter_type == SWITCHABLE) { } else {
xd->subpixel_predict = vp9_eighttap_predict; #endif
if (mcomp_filter_type == EIGHTTAP || mcomp_filter_type == SWITCHABLE) {
xd->subpixel_predict4x4 = vp9_eighttap_predict4x4;
xd->subpixel_predict8x4 = vp9_eighttap_predict8x4; xd->subpixel_predict8x4 = vp9_eighttap_predict8x4;
xd->subpixel_predict8x8 = vp9_eighttap_predict8x8; xd->subpixel_predict8x8 = vp9_eighttap_predict8x8;
xd->subpixel_predict16x16 = vp9_eighttap_predict16x16; xd->subpixel_predict16x16 = vp9_eighttap_predict16x16;
xd->subpixel_predict_avg = vp9_eighttap_predict_avg4x4; xd->subpixel_predict_avg4x4 = vp9_eighttap_predict_avg4x4;
xd->subpixel_predict_avg8x8 = vp9_eighttap_predict_avg8x8; xd->subpixel_predict_avg8x8 = vp9_eighttap_predict_avg8x8;
xd->subpixel_predict_avg16x16 = vp9_eighttap_predict_avg16x16; xd->subpixel_predict_avg16x16 = vp9_eighttap_predict_avg16x16;
} else if (mcomp_filter_type == EIGHTTAP_SMOOTH) {
xd->subpixel_predict4x4 = vp9_eighttap_predict4x4_smooth;
xd->subpixel_predict8x4 = vp9_eighttap_predict8x4_smooth;
xd->subpixel_predict8x8 = vp9_eighttap_predict8x8_smooth;
xd->subpixel_predict16x16 = vp9_eighttap_predict16x16_smooth;
xd->subpixel_predict_avg4x4 = vp9_eighttap_predict_avg4x4_smooth;
xd->subpixel_predict_avg8x8 = vp9_eighttap_predict_avg8x8_smooth;
xd->subpixel_predict_avg16x16 = vp9_eighttap_predict_avg16x16_smooth;
} else if (mcomp_filter_type == EIGHTTAP_SHARP) { } else if (mcomp_filter_type == EIGHTTAP_SHARP) {
xd->subpixel_predict = vp9_eighttap_predict_sharp; xd->subpixel_predict4x4 = vp9_eighttap_predict4x4_sharp;
xd->subpixel_predict8x4 = vp9_eighttap_predict8x4_sharp; xd->subpixel_predict8x4 = vp9_eighttap_predict8x4_sharp;
xd->subpixel_predict8x8 = vp9_eighttap_predict8x8_sharp; xd->subpixel_predict8x8 = vp9_eighttap_predict8x8_sharp;
xd->subpixel_predict16x16 = vp9_eighttap_predict16x16_sharp; xd->subpixel_predict16x16 = vp9_eighttap_predict16x16_sharp;
xd->subpixel_predict_avg = vp9_eighttap_predict_avg4x4_sharp; xd->subpixel_predict_avg4x4 = vp9_eighttap_predict_avg4x4_sharp;
xd->subpixel_predict_avg8x8 = vp9_eighttap_predict_avg8x8_sharp; xd->subpixel_predict_avg8x8 = vp9_eighttap_predict_avg8x8_sharp;
xd->subpixel_predict_avg16x16 = vp9_eighttap_predict_avg16x16_sharp_c; xd->subpixel_predict_avg16x16 = vp9_eighttap_predict_avg16x16_sharp_c;
} else { } else {
xd->subpixel_predict = vp9_bilinear_predict4x4; xd->subpixel_predict4x4 = vp9_bilinear_predict4x4;
xd->subpixel_predict8x4 = vp9_bilinear_predict8x4; xd->subpixel_predict8x4 = vp9_bilinear_predict8x4;
xd->subpixel_predict8x8 = vp9_bilinear_predict8x8; xd->subpixel_predict8x8 = vp9_bilinear_predict8x8;
xd->subpixel_predict16x16 = vp9_bilinear_predict16x16; xd->subpixel_predict16x16 = vp9_bilinear_predict16x16;
xd->subpixel_predict_avg = vp9_bilinear_predict_avg4x4; xd->subpixel_predict_avg4x4 = vp9_bilinear_predict_avg4x4;
xd->subpixel_predict_avg8x8 = vp9_bilinear_predict_avg8x8; xd->subpixel_predict_avg8x8 = vp9_bilinear_predict_avg8x8;
xd->subpixel_predict_avg16x16 = vp9_bilinear_predict_avg16x16; xd->subpixel_predict_avg16x16 = vp9_bilinear_predict_avg16x16;
} }
#if CONFIG_ENABLE_6TAP
}
#endif
} }
void vp9_copy_mem16x16_c(uint8_t *src, void vp9_copy_mem16x16_c(uint8_t *src,
@ -313,132 +327,6 @@ static void build_inter_predictors2b(MACROBLOCKD *xd, BLOCKD *d, int pitch) {
} }
} }
/*encoder only*/
#if CONFIG_PRED_FILTER
// Select the thresholded or non-thresholded filter
#define USE_THRESH_FILTER 0
#define PRED_FILT_LEN 5
static const int filt_shift = 4;
static const int pred_filter[PRED_FILT_LEN] = {1, 2, 10, 2, 1};
// Alternative filter {1, 1, 4, 1, 1}
#if !USE_THRESH_FILTER
void filter_mb(uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
int width, int height) {
int i, j, k;
unsigned int temp[32 * 32];
unsigned int *pTmp = temp;
uint8_t *pSrc = src - (1 + src_stride) * (PRED_FILT_LEN / 2);
// Horizontal
for (i = 0; i < height + PRED_FILT_LEN - 1; i++) {
for (j = 0; j < width; j++) {
int sum = 0;
for (k = 0; k < PRED_FILT_LEN; k++)
sum += pSrc[j + k] * pred_filter[k];
pTmp[j] = sum;
}
pSrc += src_stride;
pTmp += width;
}
// Vertical
pTmp = temp;
for (i = 0; i < width; i++) {
uint8_t *pDst = dst + i;
for (j = 0; j < height; j++) {
int sum = 0;
for (k = 0; k < PRED_FILT_LEN; k++)
sum += pTmp[(j + k) * width] * pred_filter[k];
// Round
pDst[j * dst_stride] = (sum + ((1 << (filt_shift << 1)) >> 1)) >>
(filt_shift << 1);
}
++pTmp;
}
}
#else
// Based on vp9_post_proc_down_and_across_c (vp9_postproc.c)
void filter_mb(uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
int width, int height) {
uint8_t *pSrc, *pDst;
int row;
int col;
int i;
int v;
uint8_t d[8];
/* TODO flimit should be linked to the quantizer value */
int flimit = 7;
for (row = 0; row < height; row++) {
/* post_proc_down for one row */
pSrc = src;
pDst = dst;
for (col = 0; col < width; col++) {
int kernel = (1 << (filt_shift - 1));
int v = pSrc[col];
for (i = -2; i <= 2; i++) {
if (abs(v - pSrc[col + i * src_stride]) > flimit)
goto down_skip_convolve;
kernel += pred_filter[2 + i] * pSrc[col + i * src_stride];
}
v = (kernel >> filt_shift);
down_skip_convolve:
pDst[col] = v;
}
/* now post_proc_across */
pSrc = dst;
pDst = dst;
for (i = 0; i < 8; i++)
d[i] = pSrc[i];
for (col = 0; col < width; col++) {
int kernel = (1 << (filt_shift - 1));
v = pSrc[col];
d[col & 7] = v;
for (i = -2; i <= 2; i++) {
if (abs(v - pSrc[col + i]) > flimit)
goto across_skip_convolve;
kernel += pred_filter[2 + i] * pSrc[col + i];
}
d[col & 7] = (kernel >> filt_shift);
across_skip_convolve:
if (col >= 2)
pDst[col - 2] = d[(col - 2) & 7];
}
/* handle the last two pixels */
pDst[col - 2] = d[(col - 2) & 7];
pDst[col - 1] = d[(col - 1) & 7];
/* next row */
src += src_stride;
dst += dst_stride;
}
}
#endif // !USE_THRESH_FILTER
#endif // CONFIG_PRED_FILTER
/*encoder only*/ /*encoder only*/
void vp9_build_inter4x4_predictors_mbuv(MACROBLOCKD *xd) { void vp9_build_inter4x4_predictors_mbuv(MACROBLOCKD *xd) {
int i, j; int i, j;
@ -523,13 +411,13 @@ void vp9_build_inter4x4_predictors_mbuv(MACROBLOCKD *xd) {
if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int) if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int)
build_inter_predictors2b(xd, d0, 8); build_inter_predictors2b(xd, d0, 8);
else { else {
vp9_build_inter_predictors_b(d0, 8, xd->subpixel_predict); vp9_build_inter_predictors_b(d0, 8, xd->subpixel_predict4x4);
vp9_build_inter_predictors_b(d1, 8, xd->subpixel_predict); vp9_build_inter_predictors_b(d1, 8, xd->subpixel_predict4x4);
} }
if (xd->mode_info_context->mbmi.second_ref_frame > 0) { if (xd->mode_info_context->mbmi.second_ref_frame > 0) {
vp9_build_2nd_inter_predictors_b(d0, 8, xd->subpixel_predict_avg); vp9_build_2nd_inter_predictors_b(d0, 8, xd->subpixel_predict_avg4x4);
vp9_build_2nd_inter_predictors_b(d1, 8, xd->subpixel_predict_avg); vp9_build_2nd_inter_predictors_b(d1, 8, xd->subpixel_predict_avg4x4);
} }
} }
} }
@ -587,29 +475,6 @@ void vp9_build_1st_inter16x16_predictors_mby(MACROBLOCKD *xd,
ptr = ptr_base + (ymv.as_mv.row >> 3) * pre_stride + (ymv.as_mv.col >> 3); ptr = ptr_base + (ymv.as_mv.row >> 3) * pre_stride + (ymv.as_mv.col >> 3);
#if CONFIG_PRED_FILTER
if (xd->mode_info_context->mbmi.pred_filter_enabled) {
if ((ymv.as_mv.row | ymv.as_mv.col) & 7) {
// Sub-pel filter needs extended input
int len = 15 + (VP9_INTERP_EXTEND << 1);
uint8_t Temp[32 * 32]; // Data required by sub-pel filter
uint8_t *pTemp = Temp + (VP9_INTERP_EXTEND - 1) * (len + 1);
// Copy extended MB into Temp array, applying the spatial filter
filter_mb(ptr - (VP9_INTERP_EXTEND - 1) * (pre_stride + 1), pre_stride,
Temp, len, len, len);
// Sub-pel interpolation
xd->subpixel_predict16x16(pTemp, len,
(ymv.as_mv.col & 7) << 1,
(ymv.as_mv.row & 7) << 1,
dst_y, dst_ystride);
} else {
// Apply spatial filter to create the prediction directly
filter_mb(ptr, pre_stride, dst_y, dst_ystride, 16, 16);
}
} else
#endif
if ((ymv.as_mv.row | ymv.as_mv.col) & 7) { if ((ymv.as_mv.row | ymv.as_mv.col) & 7) {
xd->subpixel_predict16x16(ptr, pre_stride, xd->subpixel_predict16x16(ptr, pre_stride,
(ymv.as_mv.col & 7) << 1, (ymv.as_mv.col & 7) << 1,
@ -658,37 +523,6 @@ void vp9_build_1st_inter16x16_predictors_mbuv(MACROBLOCKD *xd,
uptr = xd->pre.u_buffer + offset; uptr = xd->pre.u_buffer + offset;
vptr = xd->pre.v_buffer + offset; vptr = xd->pre.v_buffer + offset;
#if CONFIG_PRED_FILTER
if (xd->mode_info_context->mbmi.pred_filter_enabled) {
int i;
uint8_t *pSrc = uptr;
uint8_t *pDst = dst_u;
int len = 7 + (VP9_INTERP_EXTEND << 1);
uint8_t Temp[32 * 32]; // Data required by the sub-pel filter
uint8_t *pTemp = Temp + (VP9_INTERP_EXTEND - 1) * (len + 1);
// U & V
for (i = 0; i < 2; i++) {
if (_o16x16mv.as_int & 0x000f000f) {
// Copy extended MB into Temp array, applying the spatial filter
filter_mb(pSrc - (VP9_INTERP_EXTEND - 1) * (pre_stride + 1), pre_stride,
Temp, len, len, len);
// Sub-pel filter
xd->subpixel_predict8x8(pTemp, len,
_o16x16mv.as_mv.col & 15,
_o16x16mv.as_mv.row & 15,
pDst, dst_uvstride);
} else {
filter_mb(pSrc, pre_stride, pDst, dst_uvstride, 8, 8);
}
// V
pSrc = vptr;
pDst = dst_v;
}
} else
#endif
if (_o16x16mv.as_int & 0x000f000f) { if (_o16x16mv.as_int & 0x000f000f) {
xd->subpixel_predict8x8(uptr, pre_stride, _o16x16mv.as_mv.col & 15, xd->subpixel_predict8x8(uptr, pre_stride, _o16x16mv.as_mv.col & 15,
_o16x16mv.as_mv.row & 15, dst_u, dst_uvstride); _o16x16mv.as_mv.row & 15, dst_u, dst_uvstride);
@ -849,9 +683,9 @@ void vp9_build_inter64x64_predictors_sb(MACROBLOCKD *x,
/* /*
* The following functions should be called after an initial * The following functions should be called after an initial
* call to vp9_build_1st_inter16x16_predictors_mb() or _mby()/_mbuv(). * call to vp9_build_1st_inter16x16_predictors_mb() or _mby()/_mbuv().
* It will run a second sixtap filter on a (different) ref * It will run a second filter on a (different) ref
* frame and average the result with the output of the * frame and average the result with the output of the
* first sixtap filter. The second reference frame is stored * first filter. The second reference frame is stored
* in x->second_pre (the reference frame index is in * in x->second_pre (the reference frame index is in
* x->mode_info_context->mbmi.second_ref_frame). The second * x->mode_info_context->mbmi.second_ref_frame). The second
* motion vector is x->mode_info_context->mbmi.second_mv. * motion vector is x->mode_info_context->mbmi.second_mv.
@ -882,35 +716,11 @@ void vp9_build_2nd_inter16x16_predictors_mby(MACROBLOCKD *xd,
ptr = ptr_base + (mv_row >> 3) * pre_stride + (mv_col >> 3); ptr = ptr_base + (mv_row >> 3) * pre_stride + (mv_col >> 3);
#if CONFIG_PRED_FILTER if ((mv_row | mv_col) & 7) {
if (xd->mode_info_context->mbmi.pred_filter_enabled) { xd->subpixel_predict_avg16x16(ptr, pre_stride, (mv_col & 7) << 1,
if ((mv_row | mv_col) & 7) { (mv_row & 7) << 1, dst_y, dst_ystride);
// Sub-pel filter needs extended input } else {
int len = 15 + (VP9_INTERP_EXTEND << 1); vp9_avg_mem16x16(ptr, pre_stride, dst_y, dst_ystride);
uint8_t Temp[32 * 32]; // Data required by sub-pel filter
uint8_t *pTemp = Temp + (VP9_INTERP_EXTEND - 1) * (len + 1);
// Copy extended MB into Temp array, applying the spatial filter
filter_mb(ptr - (VP9_INTERP_EXTEND - 1) * (pre_stride + 1), pre_stride,
Temp, len, len, len);
// Sub-pel filter
xd->subpixel_predict_avg16x16(pTemp, len, (mv_col & 7) << 1,
(mv_row & 7) << 1, dst_y, dst_ystride);
} else {
// TODO Needs to AVERAGE with the dst_y
// For now, do not apply the prediction filter in these cases!
vp9_avg_mem16x16(ptr, pre_stride, dst_y, dst_ystride);
}
} else
#endif // CONFIG_PRED_FILTER
{
if ((mv_row | mv_col) & 7) {
xd->subpixel_predict_avg16x16(ptr, pre_stride, (mv_col & 7) << 1,
(mv_row & 7) << 1, dst_y, dst_ystride);
} else {
vp9_avg_mem16x16(ptr, pre_stride, dst_y, dst_ystride);
}
} }
} }
@ -950,37 +760,6 @@ void vp9_build_2nd_inter16x16_predictors_mbuv(MACROBLOCKD *xd,
uptr = xd->second_pre.u_buffer + offset; uptr = xd->second_pre.u_buffer + offset;
vptr = xd->second_pre.v_buffer + offset; vptr = xd->second_pre.v_buffer + offset;
#if CONFIG_PRED_FILTER
if (xd->mode_info_context->mbmi.pred_filter_enabled) {
int i;
int len = 7 + (VP9_INTERP_EXTEND << 1);
uint8_t Temp[32 * 32]; // Data required by sub-pel filter
uint8_t *pTemp = Temp + (VP9_INTERP_EXTEND - 1) * (len + 1);
uint8_t *pSrc = uptr;
uint8_t *pDst = dst_u;
// U & V
for (i = 0; i < 2; i++) {
if ((omv_row | omv_col) & 15) {
// Copy extended MB into Temp array, applying the spatial filter
filter_mb(pSrc - (VP9_INTERP_EXTEND - 1) * (pre_stride + 1), pre_stride,
Temp, len, len, len);
// Sub-pel filter
xd->subpixel_predict_avg8x8(pTemp, len, omv_col & 15,
omv_row & 15, pDst, dst_uvstride);
} else {
// TODO Needs to AVERAGE with the dst_[u|v]
// For now, do not apply the prediction filter here!
vp9_avg_mem8x8(pSrc, pre_stride, pDst, dst_uvstride);
}
// V
pSrc = vptr;
pDst = dst_v;
}
} else
#endif // CONFIG_PRED_FILTER
if ((omv_row | omv_col) & 15) { if ((omv_row | omv_col) & 15) {
xd->subpixel_predict_avg8x8(uptr, pre_stride, omv_col & 15, xd->subpixel_predict_avg8x8(uptr, pre_stride, omv_col & 15,
omv_row & 15, dst_u, dst_uvstride); omv_row & 15, dst_u, dst_uvstride);
@ -1058,13 +837,13 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *xd) {
if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int) if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int)
build_inter_predictors2b(xd, d0, 16); build_inter_predictors2b(xd, d0, 16);
else { else {
vp9_build_inter_predictors_b(d0, 16, xd->subpixel_predict); vp9_build_inter_predictors_b(d0, 16, xd->subpixel_predict4x4);
vp9_build_inter_predictors_b(d1, 16, xd->subpixel_predict); vp9_build_inter_predictors_b(d1, 16, xd->subpixel_predict4x4);
} }
if (mbmi->second_ref_frame > 0) { if (mbmi->second_ref_frame > 0) {
vp9_build_2nd_inter_predictors_b(d0, 16, xd->subpixel_predict_avg); vp9_build_2nd_inter_predictors_b(d0, 16, xd->subpixel_predict_avg4x4);
vp9_build_2nd_inter_predictors_b(d1, 16, xd->subpixel_predict_avg); vp9_build_2nd_inter_predictors_b(d1, 16, xd->subpixel_predict_avg4x4);
} }
} }
} }
@ -1076,13 +855,13 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *xd) {
if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int) if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int)
build_inter_predictors2b(xd, d0, 8); build_inter_predictors2b(xd, d0, 8);
else { else {
vp9_build_inter_predictors_b(d0, 8, xd->subpixel_predict); vp9_build_inter_predictors_b(d0, 8, xd->subpixel_predict4x4);
vp9_build_inter_predictors_b(d1, 8, xd->subpixel_predict); vp9_build_inter_predictors_b(d1, 8, xd->subpixel_predict4x4);
} }
if (mbmi->second_ref_frame > 0) { if (mbmi->second_ref_frame > 0) {
vp9_build_2nd_inter_predictors_b(d0, 8, xd->subpixel_predict_avg); vp9_build_2nd_inter_predictors_b(d0, 8, xd->subpixel_predict_avg4x4);
vp9_build_2nd_inter_predictors_b(d1, 8, xd->subpixel_predict_avg); vp9_build_2nd_inter_predictors_b(d1, 8, xd->subpixel_predict_avg4x4);
} }
} }
} }

Просмотреть файл

@ -310,8 +310,8 @@ specialize vp9_eighttap_predict_avg4x4
prototype void vp9_eighttap_predict8x4 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_eighttap_predict8x4 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict8x4 specialize vp9_eighttap_predict8x4
prototype void vp9_eighttap_predict "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_eighttap_predict4x4 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict specialize vp9_eighttap_predict4x4
prototype void vp9_eighttap_predict16x16_sharp "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_eighttap_predict16x16_sharp "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict16x16_sharp specialize vp9_eighttap_predict16x16_sharp
@ -331,8 +331,29 @@ specialize vp9_eighttap_predict_avg4x4_sharp
prototype void vp9_eighttap_predict8x4_sharp "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_eighttap_predict8x4_sharp "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict8x4_sharp specialize vp9_eighttap_predict8x4_sharp
prototype void vp9_eighttap_predict_sharp "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_eighttap_predict4x4_sharp "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict_sharp specialize vp9_eighttap_predict4x4_sharp
prototype void vp9_eighttap_predict16x16_smooth "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict16x16_smooth
prototype void vp9_eighttap_predict8x8_smooth "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict8x8_smooth
prototype void vp9_eighttap_predict_avg16x16_smooth "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict_avg16x16_smooth
prototype void vp9_eighttap_predict_avg8x8_smooth "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict_avg8x8_smooth
prototype void vp9_eighttap_predict_avg4x4_smooth "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict_avg4x4_smooth
prototype void vp9_eighttap_predict8x4_smooth "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict8x4_smooth
prototype void vp9_eighttap_predict4x4_smooth "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_eighttap_predict4x4_smooth
prototype void vp9_sixtap_predict16x16 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_sixtap_predict16x16 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_sixtap_predict16x16 specialize vp9_sixtap_predict16x16
@ -349,11 +370,11 @@ specialize vp9_sixtap_predict_avg8x8
prototype void vp9_sixtap_predict8x4 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_sixtap_predict8x4 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_sixtap_predict8x4 specialize vp9_sixtap_predict8x4
prototype void vp9_sixtap_predict "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_sixtap_predict4x4 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_sixtap_predict specialize vp9_sixtap_predict4x4
prototype void vp9_sixtap_predict_avg "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_sixtap_predict_avg4x4 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_sixtap_predict_avg specialize vp9_sixtap_predict_avg4x4
prototype void vp9_bilinear_predict16x16 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch" prototype void vp9_bilinear_predict16x16 "uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, uint8_t *dst_ptr, int dst_pitch"
specialize vp9_bilinear_predict16x16 sse2 specialize vp9_bilinear_predict16x16 sse2

Просмотреть файл

@ -550,12 +550,6 @@ static void mb_mode_mv_init(VP9D_COMP *pbi, vp9_reader *bc) {
if (!cm->kf_ymode_probs_update) if (!cm->kf_ymode_probs_update)
cm->kf_ymode_probs_index = vp9_read_literal(bc, 3); cm->kf_ymode_probs_index = vp9_read_literal(bc, 3);
} else { } else {
#if CONFIG_PRED_FILTER
cm->pred_filter_mode = (vp9_prob)vp9_read_literal(bc, 2);
if (cm->pred_filter_mode == 2)
cm->prob_pred_filter_off = (vp9_prob)vp9_read_literal(bc, 8);
#endif
if (cm->mcomp_filter_type == SWITCHABLE) if (cm->mcomp_filter_type == SWITCHABLE)
read_switchable_interp_probs(pbi, bc); read_switchable_interp_probs(pbi, bc);
#if CONFIG_COMP_INTERINTRA_PRED #if CONFIG_COMP_INTERINTRA_PRED
@ -825,17 +819,6 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
#endif #endif
} }
#if CONFIG_PRED_FILTER
if (mbmi->mode >= NEARESTMV && mbmi->mode < SPLITMV) {
// Is the prediction filter enabled
if (cm->pred_filter_mode == 2)
mbmi->pred_filter_enabled =
vp9_read(bc, cm->prob_pred_filter_off);
else
mbmi->pred_filter_enabled = cm->pred_filter_mode;
}
#endif
if (mbmi->mode >= NEARESTMV && mbmi->mode <= SPLITMV) if (mbmi->mode >= NEARESTMV && mbmi->mode <= SPLITMV)
{ {
if (cm->mcomp_filter_type == SWITCHABLE) { if (cm->mcomp_filter_type == SWITCHABLE) {

Просмотреть файл

@ -831,17 +831,6 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
vp9_accum_mv_refs(&cpi->common, mode, mi->mb_mode_context[rf]); vp9_accum_mv_refs(&cpi->common, mode, mi->mb_mode_context[rf]);
} }
#if CONFIG_PRED_FILTER
// Is the prediction filter enabled
if (mode >= NEARESTMV && mode < SPLITMV) {
if (cpi->common.pred_filter_mode == 2)
vp9_write(bc, mi->pred_filter_enabled,
pc->prob_pred_filter_off);
else
assert(mi->pred_filter_enabled ==
cpi->common.pred_filter_mode);
}
#endif
if (mode >= NEARESTMV && mode <= SPLITMV) { if (mode >= NEARESTMV && mode <= SPLITMV) {
if (cpi->common.mcomp_filter_type == SWITCHABLE) { if (cpi->common.mcomp_filter_type == SWITCHABLE) {
write_token(bc, vp9_switchable_interp_tree, write_token(bc, vp9_switchable_interp_tree,
@ -2023,15 +2012,6 @@ void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest,
active_section = 1; active_section = 1;
#endif #endif
#if CONFIG_PRED_FILTER
// Write the prediction filter mode used for this frame
vp9_write_literal(&header_bc, pc->pred_filter_mode, 2);
// Write prediction filter on/off probability if signaling at MB level
if (pc->pred_filter_mode == 2)
vp9_write_literal(&header_bc, pc->prob_pred_filter_off, 8);
#endif
if (pc->mcomp_filter_type == SWITCHABLE) if (pc->mcomp_filter_type == SWITCHABLE)
update_switchable_interp_probs(cpi, &header_bc); update_switchable_interp_probs(cpi, &header_bc);

Просмотреть файл

@ -1300,16 +1300,6 @@ static void encode_frame_internal(VP9_COMP *cpi) {
cpi->skip_true_count[0] = cpi->skip_true_count[1] = cpi->skip_true_count[2] = 0; cpi->skip_true_count[0] = cpi->skip_true_count[1] = cpi->skip_true_count[2] = 0;
cpi->skip_false_count[0] = cpi->skip_false_count[1] = cpi->skip_false_count[2] = 0; cpi->skip_false_count[0] = cpi->skip_false_count[1] = cpi->skip_false_count[2] = 0;
#if CONFIG_PRED_FILTER
if (cm->current_video_frame == 0) {
// Initially assume that we'll signal the prediction filter
// state at the frame level and that it is off.
cpi->common.pred_filter_mode = 0;
cpi->common.prob_pred_filter_off = 128;
}
cpi->pred_filter_on_count = 0;
cpi->pred_filter_off_count = 0;
#endif
vp9_zero(cpi->switchable_interp_count); vp9_zero(cpi->switchable_interp_count);
vp9_zero(cpi->best_switchable_interp_count); vp9_zero(cpi->best_switchable_interp_count);

Просмотреть файл

@ -889,11 +889,6 @@ void vp9_encode_inter16x16y(MACROBLOCK *x) {
MACROBLOCKD *xd = &x->e_mbd; MACROBLOCKD *xd = &x->e_mbd;
BLOCK *b = &x->block[0]; BLOCK *b = &x->block[0];
#if CONFIG_PRED_FILTER
// Disable the prediction filter for firstpass
xd->mode_info_context->mbmi.pred_filter_enabled = 0;
#endif
vp9_build_1st_inter16x16_predictors_mby(xd, xd->predictor, 16, 0); vp9_build_1st_inter16x16_predictors_mby(xd, xd->predictor, 16, 0);
vp9_subtract_mby(x->src_diff, *(b->base_src), xd->predictor, b->src_stride); vp9_subtract_mby(x->src_diff, *(b->base_src), xd->predictor, b->src_stride);

Просмотреть файл

@ -18,9 +18,6 @@ typedef struct {
MB_PREDICTION_MODE mode; MB_PREDICTION_MODE mode;
MV_REFERENCE_FRAME ref_frame; MV_REFERENCE_FRAME ref_frame;
MV_REFERENCE_FRAME second_ref_frame; MV_REFERENCE_FRAME second_ref_frame;
#if CONFIG_PRED_FILTER
int pred_filter_flag;
#endif
} MODE_DEFINITION; } MODE_DEFINITION;

Просмотреть файл

@ -71,11 +71,6 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
& distortion, &sse); & distortion, &sse);
} }
#if CONFIG_PRED_FILTER
// Disable the prediction filter
xd->mode_info_context->mbmi.pred_filter_enabled = 0;
#endif
vp9_set_mbmode_and_mvs(x, NEWMV, dst_mv); vp9_set_mbmode_and_mvs(x, NEWMV, dst_mv);
vp9_build_1st_inter16x16_predictors_mby(xd, xd->predictor, 16, 0); vp9_build_1st_inter16x16_predictors_mby(xd, xd->predictor, 16, 0);
best_err = vp9_sad16x16(xd->dst.y_buffer, xd->dst.y_stride, best_err = vp9_sad16x16(xd->dst.y_buffer, xd->dst.y_stride,

Просмотреть файл

@ -49,7 +49,12 @@ extern void print_tree_update_probs();
static void set_default_lf_deltas(VP9_COMP *cpi); static void set_default_lf_deltas(VP9_COMP *cpi);
#define DEFAULT_INTERP_FILTER EIGHTTAP /* SWITCHABLE for better performance */ #if CONFIG_PRED_FILTER
#define DEFAULT_INTERP_FILTER SWITCHABLE
#else
#define DEFAULT_INTERP_FILTER EIGHTTAP
#endif
#define SEARCH_BEST_FILTER 0 /* to search exhaustively for #define SEARCH_BEST_FILTER 0 /* to search exhaustively for
best filter */ best filter */
#define RESET_FOREACH_FILTER 0 /* whether to reset the encoder state #define RESET_FOREACH_FILTER 0 /* whether to reset the encoder state
@ -632,47 +637,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
switch (Mode) { switch (Mode) {
case 0: // best quality mode case 0: // best quality mode
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_ZEROMV ] = 0;
sf->thresh_mult[THR_ZEROMV_FILT ] = 0;
sf->thresh_mult[THR_ZEROG ] = 0;
sf->thresh_mult[THR_ZEROG_FILT ] = 0;
sf->thresh_mult[THR_ZEROA ] = 0;
sf->thresh_mult[THR_ZEROA_FILT ] = 0;
sf->thresh_mult[THR_NEARESTMV ] = 0;
sf->thresh_mult[THR_NEARESTMV_FILT] = 0;
sf->thresh_mult[THR_NEARESTG ] = 0;
sf->thresh_mult[THR_NEARESTG_FILT ] = 0;
sf->thresh_mult[THR_NEARESTA ] = 0;
sf->thresh_mult[THR_NEARESTA_FILT ] = 0;
sf->thresh_mult[THR_NEARMV ] = 0;
sf->thresh_mult[THR_NEARMV_FILT ] = 0;
sf->thresh_mult[THR_NEARG ] = 0;
sf->thresh_mult[THR_NEARG_FILT ] = 0;
sf->thresh_mult[THR_NEARA ] = 0;
sf->thresh_mult[THR_NEARA_FILT ] = 0;
sf->thresh_mult[THR_DC ] = 0;
sf->thresh_mult[THR_V_PRED ] = 1000;
sf->thresh_mult[THR_H_PRED ] = 1000;
sf->thresh_mult[THR_D45_PRED ] = 1000;
sf->thresh_mult[THR_D135_PRED] = 1000;
sf->thresh_mult[THR_D117_PRED] = 1000;
sf->thresh_mult[THR_D153_PRED] = 1000;
sf->thresh_mult[THR_D27_PRED ] = 1000;
sf->thresh_mult[THR_D63_PRED ] = 1000;
sf->thresh_mult[THR_B_PRED ] = 2000;
sf->thresh_mult[THR_I8X8_PRED] = 2000;
sf->thresh_mult[THR_TM ] = 1000;
sf->thresh_mult[THR_NEWMV ] = 1000;
sf->thresh_mult[THR_NEWG ] = 1000;
sf->thresh_mult[THR_NEWA ] = 1000;
sf->thresh_mult[THR_NEWMV_FILT ] = 1000;
sf->thresh_mult[THR_NEWG_FILT ] = 1000;
sf->thresh_mult[THR_NEWA_FILT ] = 1000;
#else
sf->thresh_mult[THR_ZEROMV ] = 0; sf->thresh_mult[THR_ZEROMV ] = 0;
sf->thresh_mult[THR_ZEROG ] = 0; sf->thresh_mult[THR_ZEROG ] = 0;
sf->thresh_mult[THR_ZEROA ] = 0; sf->thresh_mult[THR_ZEROA ] = 0;
@ -700,7 +664,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->thresh_mult[THR_NEWMV ] = 1000; sf->thresh_mult[THR_NEWMV ] = 1000;
sf->thresh_mult[THR_NEWG ] = 1000; sf->thresh_mult[THR_NEWG ] = 1000;
sf->thresh_mult[THR_NEWA ] = 1000; sf->thresh_mult[THR_NEWA ] = 1000;
#endif
sf->thresh_mult[THR_SPLITMV ] = 2500; sf->thresh_mult[THR_SPLITMV ] = 2500;
sf->thresh_mult[THR_SPLITG ] = 5000; sf->thresh_mult[THR_SPLITG ] = 5000;
sf->thresh_mult[THR_SPLITA ] = 5000; sf->thresh_mult[THR_SPLITA ] = 5000;
@ -743,66 +707,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->search_best_filter = SEARCH_BEST_FILTER; sf->search_best_filter = SEARCH_BEST_FILTER;
break; break;
case 1: case 1:
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEARESTMV] = 0;
sf->thresh_mult[THR_NEARESTMV_FILT] = 0;
sf->thresh_mult[THR_ZEROMV ] = 0;
sf->thresh_mult[THR_ZEROMV_FILT ] = 0;
sf->thresh_mult[THR_DC ] = 0;
sf->thresh_mult[THR_NEARMV ] = 0;
sf->thresh_mult[THR_NEARMV_FILT ] = 0;
sf->thresh_mult[THR_V_PRED ] = 1000;
sf->thresh_mult[THR_H_PRED ] = 1000;
sf->thresh_mult[THR_D45_PRED ] = 1000;
sf->thresh_mult[THR_D135_PRED] = 1000;
sf->thresh_mult[THR_D117_PRED] = 1000;
sf->thresh_mult[THR_D153_PRED] = 1000;
sf->thresh_mult[THR_D27_PRED ] = 1000;
sf->thresh_mult[THR_D63_PRED ] = 1000;
sf->thresh_mult[THR_B_PRED ] = 2500;
sf->thresh_mult[THR_I8X8_PRED] = 2500;
sf->thresh_mult[THR_TM ] = 1000;
sf->thresh_mult[THR_NEARESTG ] = 1000;
sf->thresh_mult[THR_NEARESTG_FILT ] = 1000;
sf->thresh_mult[THR_NEARESTA ] = 1000;
sf->thresh_mult[THR_NEARESTA_FILT ] = 1000;
sf->thresh_mult[THR_ZEROG ] = 1000;
sf->thresh_mult[THR_ZEROA ] = 1000;
sf->thresh_mult[THR_NEARG ] = 1000;
sf->thresh_mult[THR_NEARA ] = 1000;
sf->thresh_mult[THR_ZEROG_FILT ] = 1000;
sf->thresh_mult[THR_ZEROA_FILT ] = 1000;
sf->thresh_mult[THR_NEARG_FILT ] = 1000;
sf->thresh_mult[THR_NEARA_FILT ] = 1000;
sf->thresh_mult[THR_ZEROMV ] = 0;
sf->thresh_mult[THR_ZEROG ] = 0;
sf->thresh_mult[THR_ZEROA ] = 0;
sf->thresh_mult[THR_NEARESTMV] = 0;
sf->thresh_mult[THR_NEARESTG ] = 0;
sf->thresh_mult[THR_NEARESTA ] = 0;
sf->thresh_mult[THR_NEARMV ] = 0;
sf->thresh_mult[THR_NEARG ] = 0;
sf->thresh_mult[THR_NEARA ] = 0;
sf->thresh_mult[THR_ZEROMV_FILT ] = 0;
sf->thresh_mult[THR_ZEROG_FILT ] = 0;
sf->thresh_mult[THR_ZEROA_FILT ] = 0;
sf->thresh_mult[THR_NEARESTMV_FILT] = 0;
sf->thresh_mult[THR_NEARESTG_FILT ] = 0;
sf->thresh_mult[THR_NEARESTA_FILT ] = 0;
sf->thresh_mult[THR_NEARMV_FILT ] = 0;
sf->thresh_mult[THR_NEARG_FILT ] = 0;
sf->thresh_mult[THR_NEARA_FILT ] = 0;
sf->thresh_mult[THR_NEWMV ] = 1000;
sf->thresh_mult[THR_NEWG ] = 1000;
sf->thresh_mult[THR_NEWA ] = 1000;
sf->thresh_mult[THR_NEWMV_FILT ] = 1000;
sf->thresh_mult[THR_NEWG_FILT ] = 1000;
sf->thresh_mult[THR_NEWA_FILT ] = 1000;
#else
sf->thresh_mult[THR_NEARESTMV] = 0; sf->thresh_mult[THR_NEARESTMV] = 0;
sf->thresh_mult[THR_ZEROMV ] = 0; sf->thresh_mult[THR_ZEROMV ] = 0;
sf->thresh_mult[THR_DC ] = 0; sf->thresh_mult[THR_DC ] = 0;
@ -840,7 +744,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->thresh_mult[THR_NEWMV ] = 1000; sf->thresh_mult[THR_NEWMV ] = 1000;
sf->thresh_mult[THR_NEWG ] = 1000; sf->thresh_mult[THR_NEWG ] = 1000;
sf->thresh_mult[THR_NEWA ] = 1000; sf->thresh_mult[THR_NEWA ] = 1000;
#endif
sf->thresh_mult[THR_SPLITMV ] = 1700; sf->thresh_mult[THR_SPLITMV ] = 1700;
sf->thresh_mult[THR_SPLITG ] = 4500; sf->thresh_mult[THR_SPLITG ] = 4500;
sf->thresh_mult[THR_SPLITA ] = 4500; sf->thresh_mult[THR_SPLITA ] = 4500;
@ -916,9 +820,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
if (cpi->ref_frame_flags & VP9_LAST_FLAG) { if (cpi->ref_frame_flags & VP9_LAST_FLAG) {
sf->thresh_mult[THR_NEWMV ] = 2000; sf->thresh_mult[THR_NEWMV ] = 2000;
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEWMV_FILT ] = 2000;
#endif
sf->thresh_mult[THR_SPLITMV ] = 10000; sf->thresh_mult[THR_SPLITMV ] = 10000;
sf->thresh_mult[THR_COMP_SPLITLG ] = 20000; sf->thresh_mult[THR_COMP_SPLITLG ] = 20000;
} }
@ -928,12 +829,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->thresh_mult[THR_ZEROG ] = 1500; sf->thresh_mult[THR_ZEROG ] = 1500;
sf->thresh_mult[THR_NEARG ] = 1500; sf->thresh_mult[THR_NEARG ] = 1500;
sf->thresh_mult[THR_NEWG ] = 2000; sf->thresh_mult[THR_NEWG ] = 2000;
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEARESTG_FILT ] = 1500;
sf->thresh_mult[THR_ZEROG_FILT ] = 1500;
sf->thresh_mult[THR_NEARG_FILT ] = 1500;
sf->thresh_mult[THR_NEWG_FILT ] = 2000;
#endif
sf->thresh_mult[THR_SPLITG ] = 20000; sf->thresh_mult[THR_SPLITG ] = 20000;
sf->thresh_mult[THR_COMP_SPLITGA ] = 20000; sf->thresh_mult[THR_COMP_SPLITGA ] = 20000;
} }
@ -943,12 +838,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->thresh_mult[THR_ZEROA ] = 1500; sf->thresh_mult[THR_ZEROA ] = 1500;
sf->thresh_mult[THR_NEARA ] = 1500; sf->thresh_mult[THR_NEARA ] = 1500;
sf->thresh_mult[THR_NEWA ] = 2000; sf->thresh_mult[THR_NEWA ] = 2000;
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEARESTA_FILT ] = 1500;
sf->thresh_mult[THR_ZEROA_FILT ] = 1500;
sf->thresh_mult[THR_NEARA_FILT ] = 1500;
sf->thresh_mult[THR_NEWA_FILT ] = 2000;
#endif
sf->thresh_mult[THR_SPLITA ] = 20000; sf->thresh_mult[THR_SPLITA ] = 20000;
sf->thresh_mult[THR_COMP_SPLITLA ] = 10000; sf->thresh_mult[THR_COMP_SPLITLA ] = 10000;
} }
@ -1005,9 +894,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
if (cpi->ref_frame_flags & VP9_LAST_FLAG) { if (cpi->ref_frame_flags & VP9_LAST_FLAG) {
sf->thresh_mult[THR_NEWMV ] = 2000; sf->thresh_mult[THR_NEWMV ] = 2000;
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEWMV_FILT ] = 2000;
#endif
sf->thresh_mult[THR_SPLITMV ] = 25000; sf->thresh_mult[THR_SPLITMV ] = 25000;
sf->thresh_mult[THR_COMP_SPLITLG ] = 50000; sf->thresh_mult[THR_COMP_SPLITLG ] = 50000;
} }
@ -1017,12 +903,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->thresh_mult[THR_ZEROG ] = 2000; sf->thresh_mult[THR_ZEROG ] = 2000;
sf->thresh_mult[THR_NEARG ] = 2000; sf->thresh_mult[THR_NEARG ] = 2000;
sf->thresh_mult[THR_NEWG ] = 2500; sf->thresh_mult[THR_NEWG ] = 2500;
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEARESTG_FILT ] = 2000;
sf->thresh_mult[THR_ZEROG_FILT ] = 2000;
sf->thresh_mult[THR_NEARG_FILT ] = 2000;
sf->thresh_mult[THR_NEWG_FILT ] = 2500;
#endif
sf->thresh_mult[THR_SPLITG ] = 50000; sf->thresh_mult[THR_SPLITG ] = 50000;
sf->thresh_mult[THR_COMP_SPLITGA ] = 50000; sf->thresh_mult[THR_COMP_SPLITGA ] = 50000;
} }
@ -1032,12 +912,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->thresh_mult[THR_ZEROA ] = 2000; sf->thresh_mult[THR_ZEROA ] = 2000;
sf->thresh_mult[THR_NEARA ] = 2000; sf->thresh_mult[THR_NEARA ] = 2000;
sf->thresh_mult[THR_NEWA ] = 2500; sf->thresh_mult[THR_NEWA ] = 2500;
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEARESTA_FILT ] = 2000;
sf->thresh_mult[THR_ZEROA_FILT ] = 2000;
sf->thresh_mult[THR_NEARA_FILT ] = 2000;
sf->thresh_mult[THR_NEWA_FILT ] = 2500;
#endif
sf->thresh_mult[THR_SPLITA ] = 50000; sf->thresh_mult[THR_SPLITA ] = 50000;
sf->thresh_mult[THR_COMP_SPLITLA ] = 25000; sf->thresh_mult[THR_COMP_SPLITLA ] = 25000;
} }
@ -1088,12 +962,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->thresh_mult[THR_NEARESTMV] = INT_MAX; sf->thresh_mult[THR_NEARESTMV] = INT_MAX;
sf->thresh_mult[THR_ZEROMV ] = INT_MAX; sf->thresh_mult[THR_ZEROMV ] = INT_MAX;
sf->thresh_mult[THR_NEARMV ] = INT_MAX; sf->thresh_mult[THR_NEARMV ] = INT_MAX;
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEWMV_FILT ] = INT_MAX;
sf->thresh_mult[THR_NEARESTMV_FILT] = INT_MAX;
sf->thresh_mult[THR_ZEROMV_FILT ] = INT_MAX;
sf->thresh_mult[THR_NEARMV_FILT ] = INT_MAX;
#endif
sf->thresh_mult[THR_SPLITMV ] = INT_MAX; sf->thresh_mult[THR_SPLITMV ] = INT_MAX;
} }
@ -1102,12 +970,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->thresh_mult[THR_ZEROG ] = INT_MAX; sf->thresh_mult[THR_ZEROG ] = INT_MAX;
sf->thresh_mult[THR_NEARG ] = INT_MAX; sf->thresh_mult[THR_NEARG ] = INT_MAX;
sf->thresh_mult[THR_NEWG ] = INT_MAX; sf->thresh_mult[THR_NEWG ] = INT_MAX;
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEARESTG_FILT ] = INT_MAX;
sf->thresh_mult[THR_ZEROG_FILT ] = INT_MAX;
sf->thresh_mult[THR_NEARG_FILT ] = INT_MAX;
sf->thresh_mult[THR_NEWG_FILT ] = INT_MAX;
#endif
#if CONFIG_COMP_INTERINTRA_PRED #if CONFIG_COMP_INTERINTRA_PRED
sf->thresh_mult[THR_COMP_INTERINTRA_ZEROG ] = INT_MAX; sf->thresh_mult[THR_COMP_INTERINTRA_ZEROG ] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTG] = INT_MAX; sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTG] = INT_MAX;
@ -1122,12 +984,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->thresh_mult[THR_ZEROA ] = INT_MAX; sf->thresh_mult[THR_ZEROA ] = INT_MAX;
sf->thresh_mult[THR_NEARA ] = INT_MAX; sf->thresh_mult[THR_NEARA ] = INT_MAX;
sf->thresh_mult[THR_NEWA ] = INT_MAX; sf->thresh_mult[THR_NEWA ] = INT_MAX;
#if CONFIG_PRED_FILTER
sf->thresh_mult[THR_NEARESTA_FILT ] = INT_MAX;
sf->thresh_mult[THR_ZEROA_FILT ] = INT_MAX;
sf->thresh_mult[THR_NEARA_FILT ] = INT_MAX;
sf->thresh_mult[THR_NEWA_FILT ] = INT_MAX;
#endif
#if CONFIG_COMP_INTERINTRA_PRED #if CONFIG_COMP_INTERINTRA_PRED
sf->thresh_mult[THR_COMP_INTERINTRA_ZEROA ] = INT_MAX; sf->thresh_mult[THR_COMP_INTERINTRA_ZEROA ] = INT_MAX;
sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTA] = INT_MAX; sf->thresh_mult[THR_COMP_INTERINTRA_NEARESTA] = INT_MAX;
@ -2823,7 +2679,7 @@ static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) {
void select_interp_filter_type(VP9_COMP *cpi) { void select_interp_filter_type(VP9_COMP *cpi) {
int i; int i;
int high_filter_index; int high_filter_index = 0;
unsigned int thresh; unsigned int thresh;
unsigned int high_count = 0; unsigned int high_count = 0;
unsigned int count_sum = 0; unsigned int count_sum = 0;
@ -2860,38 +2716,6 @@ void select_interp_filter_type(VP9_COMP *cpi) {
} }
} }
#if CONFIG_PRED_FILTER
void select_pred_filter_mode(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
int prob_pred_filter_off = cm->prob_pred_filter_off;
// Force filter on/off if probability is extreme
if (prob_pred_filter_off >= 255 * 0.95)
cm->pred_filter_mode = 0; // Off at the frame level
else if (prob_pred_filter_off <= 255 * 0.05)
cm->pred_filter_mode = 1; // On at the frame level
else
cm->pred_filter_mode = 2; // Selectable at the MB level
}
void update_pred_filt_prob(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
// Based on the selection in the previous frame determine what mode
// to use for the current frame and work out the signaling probability
cm->prob_pred_filter_off = get_binary_prob(cpi->pred_filter_off_count,
cpi->pred_filter_on_count);
/*
{
FILE *fp = fopen("filt_use.txt", "a");
fprintf (fp, "%d %d prob=%d\n", cpi->pred_filter_off_count,
cpi->pred_filter_on_count, cm->prob_pred_filter_off);
fclose(fp);
}
*/
}
#endif
#if CONFIG_COMP_INTERINTRA_PRED #if CONFIG_COMP_INTERINTRA_PRED
static void select_interintra_mode(VP9_COMP *cpi) { static void select_interintra_mode(VP9_COMP *cpi) {
static const double threshold = 0.01; static const double threshold = 0.01;
@ -2949,7 +2773,11 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
/* list of filters to search over */ /* list of filters to search over */
int mcomp_filters_to_search[] = { int mcomp_filters_to_search[] = {
EIGHTTAP, EIGHTTAP_SHARP, SIXTAP, SWITCHABLE #if CONFIG_ENABLE_6TAP
EIGHTTAP, EIGHTTAP_SHARP, SIXTAP, SWITCHABLE
#else
EIGHTTAP, EIGHTTAP_SHARP, EIGHTTAP_SMOOTH, SWITCHABLE
#endif
}; };
int mcomp_filters = sizeof(mcomp_filters_to_search) / int mcomp_filters = sizeof(mcomp_filters_to_search) /
sizeof(*mcomp_filters_to_search); sizeof(*mcomp_filters_to_search);
@ -3323,13 +3151,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
vp9_clear_system_state(); // __asm emms; vp9_clear_system_state(); // __asm emms;
#if CONFIG_PRED_FILTER
// Update prediction filter on/off probability based on
// selection made for the current frame
if (cm->frame_type != KEY_FRAME)
update_pred_filt_prob(cpi);
#endif
// Dummy pack of the bitstream using up to date stats to get an // Dummy pack of the bitstream using up to date stats to get an
// accurate estimate of output frame size to determine if we need // accurate estimate of output frame size to determine if we need
// to recode. // to recode.
@ -3634,13 +3455,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
update_reference_segmentation_map(cpi); update_reference_segmentation_map(cpi);
} }
#if CONFIG_PRED_FILTER
// Select the prediction filtering mode to use for the
// next frame based on the current frame selections
if (cm->frame_type != KEY_FRAME)
select_pred_filter_mode(cpi);
#endif
update_reference_frames(cm); update_reference_frames(cm);
vp9_copy(cpi->common.fc.coef_counts_4x4, cpi->coef_counts_4x4); vp9_copy(cpi->common.fc.coef_counts_4x4, cpi->coef_counts_4x4);
vp9_copy(cpi->common.fc.hybrid_coef_counts_4x4, vp9_copy(cpi->common.fc.hybrid_coef_counts_4x4,

Просмотреть файл

@ -41,19 +41,11 @@
#define AF_THRESH2 100 #define AF_THRESH2 100
#define ARF_DECAY_THRESH 12 #define ARF_DECAY_THRESH 12
#if CONFIG_PRED_FILTER
#if CONFIG_COMP_INTERINTRA_PRED
#define MAX_MODES 66
#else
#define MAX_MODES 54
#endif
#else // CONFIG_PRED_FILTER
#if CONFIG_COMP_INTERINTRA_PRED #if CONFIG_COMP_INTERINTRA_PRED
#define MAX_MODES 54 #define MAX_MODES 54
#else #else
#define MAX_MODES 42 #define MAX_MODES 42
#endif #endif
#endif // CONFIG_PRED_FILTER
#define MIN_THRESHMULT 32 #define MIN_THRESHMULT 32
#define MAX_THRESHMULT 512 #define MAX_THRESHMULT 512
@ -173,94 +165,6 @@ typedef struct {
MBGRAPH_MB_STATS *mb_stats; MBGRAPH_MB_STATS *mb_stats;
} MBGRAPH_FRAME_STATS; } MBGRAPH_FRAME_STATS;
#if CONFIG_PRED_FILTER
typedef enum {
THR_ZEROMV,
THR_ZEROMV_FILT,
THR_DC,
THR_NEARESTMV,
THR_NEARESTMV_FILT,
THR_NEARMV,
THR_NEARMV_FILT,
THR_ZEROG,
THR_ZEROG_FILT,
THR_NEARESTG,
THR_NEARESTG_FILT,
THR_ZEROA,
THR_ZEROA_FILT,
THR_NEARESTA,
THR_NEARESTA_FILT,
THR_NEARG,
THR_NEARG_FILT,
THR_NEARA,
THR_NEARA_FILT,
THR_V_PRED,
THR_H_PRED,
THR_D45_PRED,
THR_D135_PRED,
THR_D117_PRED,
THR_D153_PRED,
THR_D27_PRED,
THR_D63_PRED,
THR_TM,
THR_NEWMV,
THR_NEWMV_FILT,
THR_NEWG,
THR_NEWG_FILT,
THR_NEWA,
THR_NEWA_FILT,
THR_SPLITMV,
THR_SPLITG,
THR_SPLITA,
THR_B_PRED,
THR_I8X8_PRED,
THR_COMP_ZEROLG,
THR_COMP_NEARESTLG,
THR_COMP_NEARLG,
THR_COMP_ZEROLA,
THR_COMP_NEARESTLA,
THR_COMP_NEARLA,
THR_COMP_ZEROGA,
THR_COMP_NEARESTGA,
THR_COMP_NEARGA,
THR_COMP_NEWLG,
THR_COMP_NEWLA,
THR_COMP_NEWGA,
THR_COMP_SPLITLG,
THR_COMP_SPLITLA,
THR_COMP_SPLITGA,
#if CONFIG_COMP_INTERINTRA_PRED
THR_COMP_INTERINTRA_ZEROL,
THR_COMP_INTERINTRA_NEARESTL,
THR_COMP_INTERINTRA_NEARL,
THR_COMP_INTERINTRA_NEWL,
THR_COMP_INTERINTRA_ZEROG,
THR_COMP_INTERINTRA_NEARESTG,
THR_COMP_INTERINTRA_NEARG,
THR_COMP_INTERINTRA_NEWG,
THR_COMP_INTERINTRA_ZEROA,
THR_COMP_INTERINTRA_NEARESTA,
THR_COMP_INTERINTRA_NEARA,
THR_COMP_INTERINTRA_NEWA,
#endif
}
THR_MODES;
#else
typedef enum { typedef enum {
THR_ZEROMV, THR_ZEROMV,
THR_DC, THR_DC,
@ -335,7 +239,6 @@ typedef enum {
#endif #endif
} }
THR_MODES; THR_MODES;
#endif
typedef enum { typedef enum {
DIAMOND = 0, DIAMOND = 0,
@ -795,10 +698,6 @@ typedef struct VP9_COMP {
int dummy_packing; /* flag to indicate if packing is dummy */ int dummy_packing; /* flag to indicate if packing is dummy */
#if CONFIG_PRED_FILTER
int pred_filter_on_count;
int pred_filter_off_count;
#endif
unsigned int switchable_interp_count[VP9_SWITCHABLE_FILTERS + 1] unsigned int switchable_interp_count[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS]; [VP9_SWITCHABLE_FILTERS];
unsigned int best_switchable_interp_count[VP9_SWITCHABLE_FILTERS]; unsigned int best_switchable_interp_count[VP9_SWITCHABLE_FILTERS];

Просмотреть файл

@ -70,97 +70,6 @@ static const int auto_speed_thresh[17] = {
105 105
}; };
#if CONFIG_PRED_FILTER
const MODE_DEFINITION vp9_mode_order[MAX_MODES] = {
{ZEROMV, LAST_FRAME, NONE, 0},
{ZEROMV, LAST_FRAME, NONE, 1},
{DC_PRED, INTRA_FRAME, NONE, 0},
{NEARESTMV, LAST_FRAME, NONE, 0},
{NEARESTMV, LAST_FRAME, NONE, 1},
{NEARMV, LAST_FRAME, NONE, 0},
{NEARMV, LAST_FRAME, NONE, 1},
{ZEROMV, GOLDEN_FRAME, NONE, 0},
{ZEROMV, GOLDEN_FRAME, NONE, 1},
{NEARESTMV, GOLDEN_FRAME, NONE, 0},
{NEARESTMV, GOLDEN_FRAME, NONE, 1},
{ZEROMV, ALTREF_FRAME, NONE, 0},
{ZEROMV, ALTREF_FRAME, NONE, 1},
{NEARESTMV, ALTREF_FRAME, NONE, 0},
{NEARESTMV, ALTREF_FRAME, NONE, 1},
{NEARMV, GOLDEN_FRAME, NONE, 0},
{NEARMV, GOLDEN_FRAME, NONE, 1},
{NEARMV, ALTREF_FRAME, NONE, 0},
{NEARMV, ALTREF_FRAME, NONE, 1},
{V_PRED, INTRA_FRAME, NONE, 0},
{H_PRED, INTRA_FRAME, NONE, 0},
{D45_PRED, INTRA_FRAME, NONE, 0},
{D135_PRED, INTRA_FRAME, NONE, 0},
{D117_PRED, INTRA_FRAME, NONE, 0},
{D153_PRED, INTRA_FRAME, NONE, 0},
{D27_PRED, INTRA_FRAME, NONE, 0},
{D63_PRED, INTRA_FRAME, NONE, 0},
{TM_PRED, INTRA_FRAME, NONE, 0},
{NEWMV, LAST_FRAME, NONE, 0},
{NEWMV, LAST_FRAME, NONE, 1},
{NEWMV, GOLDEN_FRAME, NONE, 0},
{NEWMV, GOLDEN_FRAME, NONE, 1},
{NEWMV, ALTREF_FRAME, NONE, 0},
{NEWMV, ALTREF_FRAME, NONE, 1},
{SPLITMV, LAST_FRAME, NONE, 0},
{SPLITMV, GOLDEN_FRAME, NONE, 0},
{SPLITMV, ALTREF_FRAME, NONE, 0},
{B_PRED, INTRA_FRAME, NONE, 0},
{I8X8_PRED, INTRA_FRAME, NONE, 0},
/* compound prediction modes */
{ZEROMV, LAST_FRAME, GOLDEN_FRAME, 0},
{NEARESTMV, LAST_FRAME, GOLDEN_FRAME, 0},
{NEARMV, LAST_FRAME, GOLDEN_FRAME, 0},
{ZEROMV, ALTREF_FRAME, LAST_FRAME, 0},
{NEARESTMV, ALTREF_FRAME, LAST_FRAME, 0},
{NEARMV, ALTREF_FRAME, LAST_FRAME, 0},
{ZEROMV, GOLDEN_FRAME, ALTREF_FRAME, 0},
{NEARESTMV, GOLDEN_FRAME, ALTREF_FRAME, 0},
{NEARMV, GOLDEN_FRAME, ALTREF_FRAME, 0},
{NEWMV, LAST_FRAME, GOLDEN_FRAME, 0},
{NEWMV, ALTREF_FRAME, LAST_FRAME, 0},
{NEWMV, GOLDEN_FRAME, ALTREF_FRAME, 0},
{SPLITMV, LAST_FRAME, GOLDEN_FRAME, 0},
{SPLITMV, ALTREF_FRAME, LAST_FRAME, 0},
{SPLITMV, GOLDEN_FRAME, ALTREF_FRAME, 0},
#if CONFIG_COMP_INTERINTRA_PRED
/* compound inter-intra prediction */
{ZEROMV, LAST_FRAME, INTRA_FRAME, 0},
{NEARESTMV, LAST_FRAME, INTRA_FRAME, 0},
{NEARMV, LAST_FRAME, INTRA_FRAME, 0},
{NEWMV, LAST_FRAME, INTRA_FRAME, 0},
{ZEROMV, GOLDEN_FRAME, INTRA_FRAME, 0},
{NEARESTMV, GOLDEN_FRAME, INTRA_FRAME, 0},
{NEARMV, GOLDEN_FRAME, INTRA_FRAME, 0},
{NEWMV, GOLDEN_FRAME, INTRA_FRAME, 0},
{ZEROMV, ALTREF_FRAME, INTRA_FRAME, 0},
{NEARESTMV, ALTREF_FRAME, INTRA_FRAME, 0},
{NEARMV, ALTREF_FRAME, INTRA_FRAME, 0},
{NEWMV, ALTREF_FRAME, INTRA_FRAME, 0},
#endif
};
#else
const MODE_DEFINITION vp9_mode_order[MAX_MODES] = { const MODE_DEFINITION vp9_mode_order[MAX_MODES] = {
{ZEROMV, LAST_FRAME, NONE}, {ZEROMV, LAST_FRAME, NONE},
{DC_PRED, INTRA_FRAME, NONE}, {DC_PRED, INTRA_FRAME, NONE},
@ -238,7 +147,6 @@ const MODE_DEFINITION vp9_mode_order[MAX_MODES] = {
{NEWMV, ALTREF_FRAME, INTRA_FRAME}, {NEWMV, ALTREF_FRAME, INTRA_FRAME},
#endif #endif
}; };
#endif
static void fill_token_costs(vp9_coeff_count *c, static void fill_token_costs(vp9_coeff_count *c,
vp9_coeff_probs *p, vp9_coeff_probs *p,
@ -2508,9 +2416,9 @@ static int64_t encode_inter_mb_segment(MACROBLOCK *x,
BLOCK *be = &x->block[i]; BLOCK *be = &x->block[i];
int thisdistortion; int thisdistortion;
vp9_build_inter_predictors_b(bd, 16, xd->subpixel_predict); vp9_build_inter_predictors_b(bd, 16, xd->subpixel_predict4x4);
if (xd->mode_info_context->mbmi.second_ref_frame > 0) if (xd->mode_info_context->mbmi.second_ref_frame > 0)
vp9_build_2nd_inter_predictors_b(bd, 16, xd->subpixel_predict_avg); vp9_build_2nd_inter_predictors_b(bd, 16, xd->subpixel_predict_avg4x4);
vp9_subtract_b(be, bd, 16); vp9_subtract_b(be, bd, 16);
x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32); x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32);
x->quantize_b_4x4(be, bd); x->quantize_b_4x4(be, bd);
@ -3611,12 +3519,6 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
mbmi->mv[i].as_int = cur_mv[i].as_int; mbmi->mv[i].as_int = cur_mv[i].as_int;
} }
#if CONFIG_PRED_FILTER
// Filtered prediction:
mbmi->pred_filter_enabled = vp9_mode_order[mode_index].pred_filter_flag;
*rate2 += vp9_cost_bit(cpi->common.prob_pred_filter_off,
mbmi->pred_filter_enabled);
#endif
if (cpi->common.mcomp_filter_type == SWITCHABLE) { if (cpi->common.mcomp_filter_type == SWITCHABLE) {
const int c = vp9_get_pred_context(cm, xd, PRED_SWITCHABLE_INTERP); const int c = vp9_get_pred_context(cm, xd, PRED_SWITCHABLE_INTERP);
const int m = vp9_switchable_interp_map[mbmi->interp_filter]; const int m = vp9_switchable_interp_map[mbmi->interp_filter];
@ -3854,9 +3756,6 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int rate_y, UNINITIALIZED_IS_SAFE(rate_uv); int rate_y, UNINITIALIZED_IS_SAFE(rate_uv);
int distortion_uv = INT_MAX; int distortion_uv = INT_MAX;
int64_t best_yrd = LLONG_MAX; int64_t best_yrd = LLONG_MAX;
#if CONFIG_PRED_FILTER
int best_filter_state = 0;
#endif
int switchable_filter_index = 0; int switchable_filter_index = 0;
MB_PREDICTION_MODE uv_intra_mode; MB_PREDICTION_MODE uv_intra_mode;
@ -3969,9 +3868,6 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
mbmi->uv_mode = DC_PRED; mbmi->uv_mode = DC_PRED;
mbmi->ref_frame = vp9_mode_order[mode_index].ref_frame; mbmi->ref_frame = vp9_mode_order[mode_index].ref_frame;
mbmi->second_ref_frame = vp9_mode_order[mode_index].second_ref_frame; mbmi->second_ref_frame = vp9_mode_order[mode_index].second_ref_frame;
#if CONFIG_PRED_FILTER
mbmi->pred_filter_enabled = 0;
#endif
// Evaluate all sub-pel filters irrespective of whether we can use // Evaluate all sub-pel filters irrespective of whether we can use
// them for this frame. // them for this frame.
@ -4396,21 +4292,11 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
best_overall_rd = this_rd; best_overall_rd = this_rd;
best_filter = mbmi->interp_filter; best_filter = mbmi->interp_filter;
best_mode = this_mode; best_mode = this_mode;
#if CONFIG_PRED_FILTER
best_filter_state = mbmi->pred_filter_enabled;
#endif
#if CONFIG_COMP_INTERINTRA_PRED #if CONFIG_COMP_INTERINTRA_PRED
is_best_interintra = (mbmi->second_ref_frame == INTRA_FRAME); is_best_interintra = (mbmi->second_ref_frame == INTRA_FRAME);
#endif #endif
} }
#if CONFIG_PRED_FILTER
// Ignore modes where the prediction filter state doesn't
// match the state signaled at the frame level
if ((cm->pred_filter_mode == 2) ||
(cm->pred_filter_mode ==
mbmi->pred_filter_enabled)) {
#endif
// Did this mode help.. i.e. is it the new best mode // Did this mode help.. i.e. is it the new best mode
if (this_rd < best_rd || x->skip) { if (this_rd < best_rd || x->skip) {
if (!mode_excluded) { if (!mode_excluded) {
@ -4519,21 +4405,11 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (x->skip && !mode_excluded) if (x->skip && !mode_excluded)
break; break;
} }
#if CONFIG_PRED_FILTER
}
#endif
assert((cm->mcomp_filter_type == SWITCHABLE) || assert((cm->mcomp_filter_type == SWITCHABLE) ||
(cm->mcomp_filter_type == best_mbmode.interp_filter) || (cm->mcomp_filter_type == best_mbmode.interp_filter) ||
(best_mbmode.mode <= B_PRED)); (best_mbmode.mode <= B_PRED));
#if CONFIG_PRED_FILTER
// Update counts for prediction filter usage
if (best_filter_state != 0)
++cpi->pred_filter_on_count;
else
++cpi->pred_filter_off_count;
#endif
#if CONFIG_COMP_INTERINTRA_PRED #if CONFIG_COMP_INTERINTRA_PRED
++cpi->interintra_select_count[is_best_interintra]; ++cpi->interintra_select_count[is_best_interintra];
#endif #endif