diff options
Diffstat (limited to 'third_party/aom/av1/common/filter.c')
-rw-r--r-- | third_party/aom/av1/common/filter.c | 64 |
1 files changed, 59 insertions, 5 deletions
diff --git a/third_party/aom/av1/common/filter.c b/third_party/aom/av1/common/filter.c index 9f0c58866..c5555e34e 100644 --- a/third_party/aom/av1/common/filter.c +++ b/third_party/aom/av1/common/filter.c @@ -48,9 +48,19 @@ DECLARE_ALIGNED(16, static const int16_t, }; #endif // USE_TEMPORALFILTER_12TAP -#if CONFIG_DUAL_FILTER +#if USE_EXTRA_FILTER DECLARE_ALIGNED(256, static const InterpKernel, sub_pel_filters_8[SUBPEL_SHIFTS]) = { +#if CONFIG_FILTER_7BIT + { 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, 2, -6, 126, 8, -2, 0, 0 }, + { 0, 2, -10, 122, 18, -4, 0, 0 }, { 0, 2, -12, 116, 28, -8, 2, 0 }, + { 0, 2, -14, 110, 38, -10, 2, 0 }, { 0, 2, -14, 102, 48, -12, 2, 0 }, + { 0, 2, -16, 94, 58, -12, 2, 0 }, { 0, 2, -14, 84, 66, -12, 2, 0 }, + { 0, 2, -14, 76, 76, -14, 2, 0 }, { 0, 2, -12, 66, 84, -14, 2, 0 }, + { 0, 2, -12, 58, 94, -16, 2, 0 }, { 0, 2, -12, 48, 102, -14, 2, 0 }, + { 0, 2, -10, 38, 110, -14, 2, 0 }, { 0, 2, -8, 28, 116, -12, 2, 0 }, + { 0, 0, -4, 18, 122, -10, 2, 0 }, { 0, 0, -2, 8, 126, -6, 2, 0 } +#else // intfilt 0.575 { 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, 1, -5, 126, 8, -3, 1, 0 }, { -1, 3, -10, 123, 18, -6, 2, -1 }, { -1, 4, -14, 118, 27, -9, 3, 0 }, @@ -60,10 +70,21 @@ DECLARE_ALIGNED(256, static const InterpKernel, { -1, 5, -17, 58, 97, -19, 6, -1 }, { -1, 4, -14, 48, 105, -18, 5, -1 }, { -1, 4, -12, 37, 112, -16, 5, -1 }, { 0, 3, -9, 27, 118, -14, 4, -1 }, { -1, 2, -6, 18, 123, -10, 3, -1 }, { 0, 1, -3, 8, 126, -5, 1, 0 }, +#endif }; DECLARE_ALIGNED(256, static const InterpKernel, sub_pel_filters_regular_uv[SUBPEL_SHIFTS]) = { +#if CONFIG_FILTER_7BIT + { 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, 2, -6, 126, 8, -2, 0, 0 }, + { 0, 2, -10, 122, 18, -4, 0, 0 }, { 0, 2, -12, 116, 28, -8, 2, 0 }, + { 0, 2, -14, 110, 38, -10, 2, 0 }, { 0, 2, -14, 102, 48, -12, 2, 0 }, + { 0, 2, -16, 94, 58, -12, 2, 0 }, { 0, 2, -14, 84, 66, -12, 2, 0 }, + { 0, 2, -14, 76, 76, -14, 2, 0 }, { 0, 2, -12, 66, 84, -14, 2, 0 }, + { 0, 2, -12, 58, 94, -16, 2, 0 }, { 0, 2, -12, 48, 102, -14, 2, 0 }, + { 0, 2, -10, 38, 110, -14, 2, 0 }, { 0, 2, -8, 28, 116, -12, 2, 0 }, + { 0, 0, -4, 18, 122, -10, 2, 0 }, { 0, 0, -2, 8, 126, -6, 2, 0 } +#else // intfilt 0.575 { 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, 1, -5, 126, 8, -3, 1, 0 }, { -1, 3, -10, 123, 18, -6, 2, -1 }, { -1, 4, -14, 118, 27, -9, 3, 0 }, @@ -73,6 +94,7 @@ DECLARE_ALIGNED(256, static const InterpKernel, { -1, 5, -17, 58, 97, -19, 6, -1 }, { -1, 4, -14, 48, 105, -18, 5, -1 }, { -1, 4, -12, 37, 112, -16, 5, -1 }, { 0, 3, -9, 27, 118, -14, 4, -1 }, { -1, 2, -6, 18, 123, -10, 3, -1 }, { 0, 1, -3, 8, 126, -5, 1, 0 }, +#endif }; #if USE_12TAP_FILTER @@ -162,6 +184,16 @@ DECLARE_ALIGNED(256, static const InterpKernel, DECLARE_ALIGNED(256, static const InterpKernel, sub_pel_filters_8smooth[SUBPEL_SHIFTS]) = { +#if CONFIG_FILTER_7BIT + { 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, 2, 28, 62, 34, 2, 0, 0 }, + { 0, 0, 26, 62, 36, 4, 0, 0 }, { 0, 0, 22, 62, 40, 4, 0, 0 }, + { 0, 0, 20, 60, 42, 6, 0, 0 }, { 0, 0, 18, 58, 44, 8, 0, 0 }, + { 0, 0, 16, 56, 46, 10, 0, 0 }, { 0, -2, 16, 54, 48, 12, 0, 0 }, + { 0, -2, 14, 52, 52, 14, -2, 0 }, { 0, 0, 12, 48, 54, 16, -2, 0 }, + { 0, 0, 10, 46, 56, 16, 0, 0 }, { 0, 0, 8, 44, 58, 18, 0, 0 }, + { 0, 0, 6, 42, 60, 20, 0, 0 }, { 0, 0, 4, 40, 62, 22, 0, 0 }, + { 0, 0, 4, 36, 62, 26, 0, 0 }, { 0, 0, 2, 34, 62, 28, 2, 0 } +#else // freqmultiplier = 0.8 { 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, -5, 13, 102, 24, -7, 1, 0 }, { 0, -4, 8, 100, 31, -8, 1, 0 }, { 0, -3, 4, 97, 37, -8, 1, 0 }, @@ -171,10 +203,21 @@ DECLARE_ALIGNED(256, static const InterpKernel, { 0, 0, -9, 59, 84, -5, -1, 0 }, { 0, 1, -9, 51, 90, -3, -2, 0 }, { 0, 1, -9, 44, 94, 0, -2, 0 }, { 0, 1, -8, 37, 97, 4, -3, 0 }, { 0, 1, -8, 31, 100, 8, -4, 0 }, { 0, 1, -7, 24, 102, 13, -5, 0 }, +#endif }; DECLARE_ALIGNED(256, static const InterpKernel, sub_pel_filters_smooth_uv[SUBPEL_SHIFTS]) = { +#if CONFIG_FILTER_7BIT + { 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, 2, 28, 62, 34, 2, 0, 0 }, + { 0, 0, 26, 62, 36, 4, 0, 0 }, { 0, 0, 22, 62, 40, 4, 0, 0 }, + { 0, 0, 20, 60, 42, 6, 0, 0 }, { 0, 0, 18, 58, 44, 8, 0, 0 }, + { 0, 0, 16, 56, 46, 10, 0, 0 }, { 0, -2, 16, 54, 48, 12, 0, 0 }, + { 0, -2, 14, 52, 52, 14, -2, 0 }, { 0, 0, 12, 48, 54, 16, -2, 0 }, + { 0, 0, 10, 46, 56, 16, 0, 0 }, { 0, 0, 8, 44, 58, 18, 0, 0 }, + { 0, 0, 6, 42, 60, 20, 0, 0 }, { 0, 0, 4, 40, 62, 22, 0, 0 }, + { 0, 0, 4, 36, 62, 26, 0, 0 }, { 0, 0, 2, 34, 62, 28, 2, 0 } +#else // freqmultiplier = 0.8 { 0, 0, 0, 128, 0, 0, 0, 0 }, { 0, -5, 13, 102, 24, -7, 1, 0 }, { 0, -4, 8, 100, 31, -8, 1, 0 }, { 0, -3, 4, 97, 37, -8, 1, 0 }, @@ -184,8 +227,9 @@ DECLARE_ALIGNED(256, static const InterpKernel, { 0, 0, -9, 59, 84, -5, -1, 0 }, { 0, 1, -9, 51, 90, -3, -2, 0 }, { 0, 1, -9, 44, 94, 0, -2, 0 }, { 0, 1, -8, 37, 97, 4, -3, 0 }, { 0, 1, -8, 31, 100, 8, -4, 0 }, { 0, 1, -7, 24, 102, 13, -5, 0 }, +#endif }; -#else // CONFIG_DUAL_FILTER +#else // USE_EXTRA_FILTER DECLARE_ALIGNED(256, static const InterpKernel, sub_pel_filters_8[SUBPEL_SHIFTS]) = { @@ -255,7 +299,7 @@ DECLARE_ALIGNED(256, static const InterpKernel, { 0, -3, 2, 41, 63, 29, -2, -2 }, { 0, -3, 1, 38, 64, 32, -1, -3 } #endif }; -#endif // CONFIG_DUAL_FILTER +#endif // USE_EXTRA_FILTER #if CONFIG_EXT_INTRA #if CONFIG_INTRA_INTERP @@ -268,7 +312,7 @@ const InterpKernel *av1_intra_filter_kernels[INTRA_FILTERS] = { #endif // CONFIG_INTRA_INTERP #endif // CONFIG_EXT_INTRA -#if CONFIG_DUAL_FILTER +#if USE_EXTRA_FILTER static const InterpFilterParams av1_interp_filter_params_list[SWITCHABLE_FILTERS + EXTRA_FILTERS] = { { (const int16_t *)sub_pel_filters_8, SUBPEL_TAPS, SUBPEL_SHIFTS, @@ -309,7 +353,7 @@ static const InterpFilterParams { (const int16_t *)bilinear_filters, SUBPEL_TAPS, SUBPEL_SHIFTS, BILINEAR } }; -#endif // CONFIG_DUAL_FILTER +#endif // USE_EXTRA_FILTER #if USE_TEMPORALFILTER_12TAP static const InterpFilterParams av1_interp_temporalfilter_12tap = { @@ -340,11 +384,17 @@ const int16_t *av1_get_interp_filter_kernel(const InterpFilter interp_filter) { InterpFilter av1_get_plane_interp_filter(InterpFilter interp_filter, int plane) { #if USE_TEMPORALFILTER_12TAP +#if USE_EXTRA_FILTER assert(interp_filter <= EIGHTTAP_SHARP || interp_filter == TEMPORALFILTER_12TAP); +#else // USE_EXTRA_FILTER + assert(interp_filter <= SWITCHABLE_FILTERS || + interp_filter == TEMPORALFILTER_12TAP); +#endif // USE_EXTRA_FILTER #else assert(interp_filter <= EIGHTTAP_SHARP); #endif +#if USE_EXTRA_FILTER if (plane == 0) { return interp_filter; } else { @@ -356,5 +406,9 @@ InterpFilter av1_get_plane_interp_filter(InterpFilter interp_filter, default: return interp_filter; } } +#else // USE_EXTRA_FILTER + (void)plane; + return interp_filter; +#endif // USE_EXTRA_FILTER } #endif |