cpi->rtcd.search.full_search = vp8_full_search_sad;
cpi->rtcd.search.diamond_search = vp8_diamond_search_sad;
+
+ cpi->rtcd.temporal.filter = vp8_apply_temporal_filter_c;
#endif
// Pure C:
int vp8_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, const vp8_variance_rtcd_vtable_t *rtcd);
int vp8_calc_low_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, const vp8_variance_rtcd_vtable_t *rtcd);
+extern void vp8cx_temp_filter_c(VP8_COMP *cpi);
static void set_default_lf_deltas(VP8_COMP *cpi);
#include "vpx_ports/mem.h"
#include "vpx/internal/vpx_codec_internal.h"
#include "mcomp.h"
+#include "temporal_filter.h"
//#define SPEEDSTATS 1
#define MIN_GF_INTERVAL 4
vp8_encodemb_rtcd_vtable_t encodemb;
vp8_quantize_rtcd_vtable_t quantize;
vp8_search_rtcd_vtable_t search;
+ vp8_temporal_rtcd_vtable_t temporal;
} VP8_ENCODER_RTCD;
enum
RECON_INVOKE(&x->rtcd->recon, copy8x8)(vptr, stride, &pred[320], 8);
}
}
-static void apply_temporal_filter
+void vp8_apply_temporal_filter_c
(
unsigned char *frame1,
unsigned int stride,
predictor );
// Apply the filter (YUV)
- apply_temporal_filter ( f->y_buffer + mb_y_offset,
- f->y_stride,
- predictor,
- 16,
- strength,
- filter_weight[frame],
- accumulator,
- count );
-
- apply_temporal_filter ( f->u_buffer + mb_uv_offset,
- f->uv_stride,
- predictor + 256,
- 8,
- strength,
- filter_weight[frame],
- accumulator + 256,
- count + 256 );
-
- apply_temporal_filter ( f->v_buffer + mb_uv_offset,
- f->uv_stride,
- predictor + 320,
- 8,
- strength,
- filter_weight[frame],
- accumulator + 320,
- count + 320 );
+ TEMPORAL_INVOKE(&cpi->rtcd.temporal, filter)
+ (f->y_buffer + mb_y_offset,
+ f->y_stride,
+ predictor,
+ 16,
+ strength,
+ filter_weight[frame],
+ accumulator,
+ count);
+
+ TEMPORAL_INVOKE(&cpi->rtcd.temporal, filter)
+ (f->u_buffer + mb_uv_offset,
+ f->uv_stride,
+ predictor + 256,
+ 8,
+ strength,
+ filter_weight[frame],
+ accumulator + 256,
+ count + 256);
+
+ TEMPORAL_INVOKE(&cpi->rtcd.temporal, filter)
+ (f->v_buffer + mb_uv_offset,
+ f->uv_stride,
+ predictor + 320,
+ 8,
+ strength,
+ filter_weight[frame],
+ accumulator + 320,
+ count + 320);
}
}
#ifndef __INC_VP8_TEMPORAL_FILTER_H
#define __INC_VP8_TEMPORAL_FILTER_H
-#include "onyx_int.h"
+#define prototype_filter(sym)\
+ void (sym) \
+ ( \
+ unsigned char *frame1, \
+ unsigned int stride, \
+ unsigned char *frame2, \
+ unsigned int block_size, \
+ int strength, \
+ int filter_weight, \
+ unsigned int *accumulator, \
+ unsigned int *count \
+ )
-void vp8cx_temp_filter_c(VP8_COMP *cpi);
+#ifndef vp8_temporal_filter
+#define vp8_temporal_filter vp8_apply_temporal_filter_c
+#endif
+extern prototype_filter(vp8_temporal_filter);
+
+typedef struct
+{
+ prototype_filter(*filter);
+} vp8_temporal_rtcd_vtable_t;
+
+#if CONFIG_RUNTIME_CPU_DETECT
+#define TEMPORAL_INVOKE(ctx,fn) (ctx)->fn
+#else
+#define TEMPORAL_INVOKE(ctx,fn) vp8_temporal_##fn
+#endif
#endif // __INC_VP8_TEMPORAL_FILTER_H