]> granicus.if.org Git - libvpx/commitdiff
A build fix and some other cosmetic changes
authorDebargha Mukherjee <debargha@google.com>
Mon, 29 Feb 2016 18:08:23 +0000 (10:08 -0800)
committerDebargha Mukherjee <debargha@google.com>
Mon, 29 Feb 2016 18:20:52 +0000 (10:20 -0800)
Fixes some issues introduced by a merge of two patches.
Also decouples the temporal interpolation filter from the switchable
filters for now for ease of experimentation with both separately.

Change-Id: If1c7c08adf00e0cf818fe8d0d3656c26ea65eb32

vp10/common/filter.c
vp10/common/filter.h
vp10/encoder/temporal_filter.c

index 7756729fde875ad945f121bbc6f0552fc1b35348..2023cd6b49bf9e797dc94bce2bf4abdf4c0c558b 100644 (file)
@@ -32,9 +32,9 @@ DECLARE_ALIGNED(256, static const InterpKernel,
   { 0, 0, 0,   8, 120, 0, 0, 0 }
 };
 
-#if (CONFIG_EXT_INTERP && SWITCHABLE_FILTERS == 5) || FILTER_12TAP
+#if USE_TEMPORALFILTER_12TAP
 DECLARE_ALIGNED(16, static const int16_t,
-                sub_pel_filters_12sharp[SUBPEL_SHIFTS][12]) = {
+                sub_pel_filters_temporalfilter_12[SUBPEL_SHIFTS][12]) = {
   // intfilt 0.8
   {0,   0,   0,   0,   0, 128,   0,   0,   0,   0,   0, 0},
   {0,   1,  -1,   3,  -7, 127,   8,  -4,   2,  -1,   0, 0},
@@ -53,7 +53,7 @@ DECLARE_ALIGNED(16, static const int16_t,
   {0,   1,  -2,   4,  -8,  18, 124, -12,   5,  -3,   1, 0},
   {0,   0,  -1,   2,  -4,   8, 127,  -7,   3,  -1,   1, 0},
 };
-#endif
+#endif  // USE_TEMPORALFILTER_12TAP
 
 #if CONFIG_EXT_INTERP
 DECLARE_ALIGNED(256, static const InterpKernel,
@@ -143,8 +143,26 @@ DECLARE_ALIGNED(256, static const InterpKernel,
 #endif  // SWITCHABLE_FILTERS >= 4
 
 #if SWITCHABLE_FILTERS == 5
-// Once FILTER 12TAP is resolved move the sub_pel_filters_12sharp
-// filter here.
+DECLARE_ALIGNED(16, static const int16_t,
+                sub_pel_filters_12sharp[SUBPEL_SHIFTS][12]) = {
+  // intfilt 0.8
+  {0,   0,   0,   0,   0, 128,   0,   0,   0,   0,   0, 0},
+  {0,   1,  -1,   3,  -7, 127,   8,  -4,   2,  -1,   0, 0},
+  {0,   1,  -3,   5, -12, 124,  18,  -8,   4,  -2,   1, 0},
+  {-1,   2,  -4,   8, -17, 120,  28, -11,   6,  -3,   1, -1},
+  {-1,   2,  -4,  10, -21, 114,  38, -15,   8,  -4,   2, -1},
+  {-1,   3,  -5,  11, -23, 107,  49, -18,   9,  -5,   2, -1},
+  {-1,   3,  -6,  12, -25,  99,  60, -21,  11,  -6,   3, -1},
+  {-1,   3,  -6,  12, -25,  90,  70, -23,  12,  -6,   3, -1},
+  {-1,   3,  -6,  12, -24,  80,  80, -24,  12,  -6,   3, -1},
+  {-1,   3,  -6,  12, -23,  70,  90, -25,  12,  -6,   3, -1},
+  {-1,   3,  -6,  11, -21,  60,  99, -25,  12,  -6,   3, -1},
+  {-1,   2,  -5,   9, -18,  49, 107, -23,  11,  -5,   3, -1},
+  {-1,   2,  -4,   8, -15,  38, 114, -21,  10,  -4,   2, -1},
+  {-1,   1,  -3,   6, -11,  28, 120, -17,   8,  -4,   2, -1},
+  {0,   1,  -2,   4,  -8,  18, 124, -12,   5,  -3,   1, 0},
+  {0,   0,  -1,   2,  -4,   8, 127,  -7,   3,  -1,   1, 0},
+};
 #endif
 
 #else  // CONFIG_EXT_INTERP
@@ -246,23 +264,27 @@ vp10_interp_filter_params_list[SWITCHABLE_FILTERS + 1] = {
 };
 #endif  // CONFIG_EXT_INTERP
 
-#if FILTER_12TAP
-static const InterpFilterParams vp10_interp_filter_12tap = {
-    (const int16_t*)sub_pel_filters_12sharp, 12, SUBPEL_SHIFTS
+#if USE_TEMPORALFILTER_12TAP
+static const InterpFilterParams vp10_interp_temporalfilter_12tap = {
+    (const int16_t*)sub_pel_filters_temporalfilter_12, 12, SUBPEL_SHIFTS
 };
-#endif
+#endif  // USE_TEMPORALFILTER_12TAP
 
 InterpFilterParams vp10_get_interp_filter_params(
     const INTERP_FILTER interp_filter) {
-#if FILTER_12TAP
-  if (interp_filter == SHARP_FILTER_12TAP)
-    return vp10_interp_filter_12tap;
-#endif
+#if USE_TEMPORALFILTER_12TAP
+  if (interp_filter == TEMPORALFILTER_12TAP)
+    return vp10_interp_temporalfilter_12tap;
+#endif  // USE_TEMPORALFILTER_12TAP
   return vp10_interp_filter_params_list[interp_filter];
 }
 
 const int16_t *vp10_get_interp_filter_kernel(
     const INTERP_FILTER interp_filter) {
+#if USE_TEMPORALFILTER_12TAP
+  if (interp_filter == TEMPORALFILTER_12TAP)
+    return vp10_interp_temporalfilter_12tap.filter_ptr;
+#endif  // USE_TEMPORALFILTER_12TAP
   return (const int16_t*)
       vp10_interp_filter_params_list[interp_filter].filter_ptr;
 }
index 014dddb14fe6e0520b3d5d791fd3d318732e402c..74a0c99684703e1cf7e4b8bac85d8cf0db65227b 100644 (file)
@@ -41,10 +41,9 @@ extern "C" {
 #define SWITCHABLE_FILTERS  3 /* Number of switchable filters */
 #endif  // CONFIG_EXT_INTERP
 
-// TODO(jingning): Align the experiment flags and clean this up.
-#define FILTER_12TAP (!CONFIG_EXT_INTERP)
-#if FILTER_12TAP
-#define SHARP_FILTER_12TAP (SWITCHABLE_FILTERS + 1)
+#define USE_TEMPORALFILTER_12TAP 1
+#if USE_TEMPORALFILTER_12TAP
+#define TEMPORALFILTER_12TAP (SWITCHABLE_FILTERS + 1)
 #endif
 
 // The codec can operate in four possible inter prediction filter mode:
index b4db2512854ff216173e427d498a66dec68bb7c5..d16e4a4e20dab414b53ec22f349998848abb3629 100644 (file)
@@ -48,15 +48,12 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
   enum mv_precision mv_precision_uv;
   int uv_stride;
 
-#if FILTER_12TAP
-  const INTERP_FILTER interp_filter = SHARP_FILTER_12TAP;
-  (void)xd;
-#elif SWITCHABLE_FILTERS == 5
-  const INTERP_FILTER interp_filter = EIGHTTAP_SHARP2;
+#if USE_TEMPORALFILTER_12TAP
+  const INTERP_FILTER interp_filter = TEMPORALFILTER_12TAP;
   (void)xd;
 #else
   const INTERP_FILTER interp_filter = xd->mi[0]->mbmi.interp_filter;
-#endif
+#endif  // USE_TEMPORALFILTER_12TAP
 
   if (uv_block_width == 8) {
     uv_stride = (stride + 1) >> 1;
@@ -98,28 +95,28 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
   }
 #endif  // CONFIG_VP9_HIGHBITDEPTH
   vp10_build_inter_predictor(y_mb_ptr, stride,
-                            &pred[0], 16,
-                            &mv,
-                            scale,
-                            16, 16,
-                            which_mv,
-                            interp_filter, MV_PRECISION_Q3, x, y);
+                             &pred[0], 16,
+                             &mv,
+                             scale,
+                             16, 16,
+                             which_mv,
+                             interp_filter, MV_PRECISION_Q3, x, y);
 
   vp10_build_inter_predictor(u_mb_ptr, uv_stride,
-                            &pred[256], uv_block_width,
-                            &mv,
-                            scale,
-                            uv_block_width, uv_block_height,
-                            which_mv,
-                            interp_filter, mv_precision_uv, x, y);
+                             &pred[256], uv_block_width,
+                             &mv,
+                             scale,
+                             uv_block_width, uv_block_height,
+                             which_mv,
+                             interp_filter, mv_precision_uv, x, y);
 
   vp10_build_inter_predictor(v_mb_ptr, uv_stride,
-                            &pred[512], uv_block_width,
-                            &mv,
-                            scale,
-                            uv_block_width, uv_block_height,
-                            which_mv,
-                            interp_filter, mv_precision_uv, x, y);
+                             &pred[512], uv_block_width,
+                             &mv,
+                             scale,
+                             uv_block_width, uv_block_height,
+                             which_mv,
+                             interp_filter, mv_precision_uv, x, y);
 }
 
 void vp10_temporal_filter_init(void) {
@@ -131,14 +128,14 @@ void vp10_temporal_filter_init(void) {
 }
 
 void vp10_temporal_filter_apply_c(uint8_t *frame1,
-                                 unsigned int stride,
-                                 uint8_t *frame2,
-                                 unsigned int block_width,
-                                 unsigned int block_height,
-                                 int strength,
-                                 int filter_weight,
-                                 unsigned int *accumulator,
-                                 uint16_t *count) {
+                                  unsigned int stride,
+                                  uint8_t *frame2,
+                                  unsigned int block_width,
+                                  unsigned int block_height,
+                                  int strength,
+                                  int filter_weight,
+                                  unsigned int *accumulator,
+                                  uint16_t *count) {
   unsigned int i, j, k;
   int modifier;
   int byte = 0;
@@ -199,14 +196,14 @@ void vp10_temporal_filter_apply_c(uint8_t *frame1,
 
 #if CONFIG_VP9_HIGHBITDEPTH
 void vp10_highbd_temporal_filter_apply_c(uint8_t *frame1_8,
-                                        unsigned int stride,
-                                        uint8_t *frame2_8,
-                                        unsigned int block_width,
-                                        unsigned int block_height,
-                                        int strength,
-                                        int filter_weight,
-                                        unsigned int *accumulator,
-                                        uint16_t *count) {
+                                         unsigned int stride,
+                                         uint8_t *frame2_8,
+                                         unsigned int block_width,
+                                         unsigned int block_height,
+                                         int strength,
+                                         int filter_weight,
+                                         unsigned int *accumulator,
+                                         uint16_t *count) {
   uint16_t *frame1 = CONVERT_TO_SHORTPTR(frame1_8);
   uint16_t *frame2 = CONVERT_TO_SHORTPTR(frame2_8);
   unsigned int i, j, k;