Enables encoder for libvpx.

Based on libvpx v1.2.0 this change removes the
disable-encoder flags from all build configurations
thus enabling encoder and updates other build
files in accordance with UPDATING.

Change-Id: Ief7c74593fc4a585d4a8b1768a4e1008547f0c40
Signed-off-by: Kunter Gultekin <kuntergultekin@google.com>
diff --git a/UPDATING b/UPDATING
index 0633ccc..e71403a 100644
--- a/UPDATING
+++ b/UPDATING
@@ -21,8 +21,8 @@
 --sdk-path=$SDK_PATH
   For configuration we do some compiler tests. It is much easier to accept them
   than to work around them. This uses the compilers included in the NDK.
---disable-vp8-encoder
-  Build only the decoder.
+--enable-realtime-only
+  Reduce binary size when building the encoder.
 
 Aesthetic:
 --disable-examples
diff --git a/armv7a-neon/libvpx_srcs.txt b/armv7a-neon/libvpx_srcs.txt
index 3b2e0b2..494fe37 100644
--- a/armv7a-neon/libvpx_srcs.txt
+++ b/armv7a-neon/libvpx_srcs.txt
@@ -134,7 +134,75 @@
 vp8/decoder/onyxd_int.h
 vp8/decoder/threading.c
 vp8/decoder/treereader.h
+vp8/encoder/arm/armv5te/boolhuff_armv5te.asm.s
+vp8/encoder/arm/armv5te/vp8_packtokens_armv5.asm.s
+vp8/encoder/arm/armv5te/vp8_packtokens_mbrow_armv5.asm.s
+vp8/encoder/arm/armv5te/vp8_packtokens_partitions_armv5.asm.s
+vp8/encoder/arm/armv6/vp8_fast_quantize_b_armv6.asm.s
+vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm.s
+vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm.s
+vp8/encoder/arm/armv6/vp8_subtract_armv6.asm.s
+vp8/encoder/arm/armv6/walsh_v6.asm.s
+vp8/encoder/arm/boolhuff_arm.c
+vp8/encoder/arm/dct_arm.c
+vp8/encoder/arm/neon/fastquantizeb_neon.asm.s
+vp8/encoder/arm/neon/picklpf_arm.c
+vp8/encoder/arm/neon/shortfdct_neon.asm.s
+vp8/encoder/arm/neon/subtract_neon.asm.s
+vp8/encoder/arm/neon/vp8_memcpy_neon.asm.s
+vp8/encoder/arm/neon/vp8_mse16x16_neon.asm.s
+vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.asm.s
+vp8/encoder/arm/quantize_arm.c
+vp8/encoder/asm_enc_offsets.c
+vp8/encoder/bitstream.c
+vp8/encoder/bitstream.h
+vp8/encoder/block.h
+vp8/encoder/boolhuff.h
+vp8/encoder/dct.c
+vp8/encoder/dct_value_cost.h
+vp8/encoder/dct_value_tokens.h
+vp8/encoder/defaultcoefcounts.h
+vp8/encoder/denoising.c
+vp8/encoder/denoising.h
+vp8/encoder/encodeframe.c
+vp8/encoder/encodeframe.h
+vp8/encoder/encodeintra.c
+vp8/encoder/encodeintra.h
+vp8/encoder/encodemb.c
+vp8/encoder/encodemb.h
+vp8/encoder/encodemv.c
+vp8/encoder/encodemv.h
+vp8/encoder/ethreading.c
+vp8/encoder/firstpass.h
+vp8/encoder/lookahead.c
+vp8/encoder/lookahead.h
+vp8/encoder/mcomp.c
+vp8/encoder/mcomp.h
+vp8/encoder/modecosts.c
+vp8/encoder/modecosts.h
+vp8/encoder/onyx_if.c
+vp8/encoder/onyx_int.h
+vp8/encoder/pickinter.c
+vp8/encoder/pickinter.h
+vp8/encoder/picklpf.c
+vp8/encoder/psnr.c
+vp8/encoder/psnr.h
+vp8/encoder/quantize.c
+vp8/encoder/quantize.h
+vp8/encoder/ratectrl.c
+vp8/encoder/ratectrl.h
+vp8/encoder/rdopt.c
+vp8/encoder/rdopt.h
+vp8/encoder/segmentation.c
+vp8/encoder/segmentation.h
+vp8/encoder/tokenize.c
+vp8/encoder/tokenize.h
+vp8/encoder/treewriter.c
+vp8/encoder/treewriter.h
 vp8/vp8_common.mk
+vp8/vp8cx_arm.mk
+vp8/vp8_cx_iface.c
+vp8/vp8cx.mk
 vp8/vp8_dx_iface.c
 vp8/vp8dx.mk
 vpx_config.c
@@ -167,6 +235,7 @@
 vpx/src/vpx_decoder.c
 vpx/src/vpx_encoder.c
 vpx/src/vpx_image.c
+vpx/vp8cx.h
 vpx/vp8dx.h
 vpx/vp8.h
 vpx/vpx_codec.h
diff --git a/armv7a-neon/vpx_config.c b/armv7a-neon/vpx_config.c
index 7bb8e40..863c84c 100644
--- a/armv7a-neon/vpx_config.c
+++ b/armv7a-neon/vpx_config.c
@@ -5,5 +5,5 @@
 /* tree. An additional intellectual property rights grant can be found */
 /* in the file PATENTS.  All contributing project authors may */
 /* be found in the AUTHORS file in the root of the source tree. */
-static const char* const cfg = "--force-target=armv7-android-gcc --disable-runtime-cpu-detect --sdk-path=/usr/local/google/home/johannkoenig/android-ndk --disable-vp8-encoder --disable-examples --disable-docs";
+static const char* const cfg = "--force-target=armv7-android-gcc --disable-runtime-cpu-detect --sdk-path=/usr/local/google/home/johannkoenig/android-ndk --disable-examples --disable-docs --enable-realtime-only";
 const char *vpx_codec_build_config(void) {return cfg;}
diff --git a/armv7a-neon/vpx_config.h b/armv7a-neon/vpx_config.h
index fdea8f0..b3179e5 100644
--- a/armv7a-neon/vpx_config.h
+++ b/armv7a-neon/vpx_config.h
@@ -59,10 +59,10 @@
 #define CONFIG_POSTPROC 0
 #define CONFIG_MULTITHREAD 1
 #define CONFIG_INTERNAL_STATS 0
-#define CONFIG_VP8_ENCODER 0
+#define CONFIG_VP8_ENCODER 1
 #define CONFIG_VP8_DECODER 1
 #define CONFIG_VP8 1
-#define CONFIG_ENCODERS 0
+#define CONFIG_ENCODERS 1
 #define CONFIG_DECODERS 1
 #define CONFIG_STATIC_MSVCRT 0
 #define CONFIG_SPATIAL_RESAMPLING 1
diff --git a/armv7a-neon/vpx_rtcd.h b/armv7a-neon/vpx_rtcd.h
index 2aef442..914b08d 100644
--- a/armv7a-neon/vpx_rtcd.h
+++ b/armv7a-neon/vpx_rtcd.h
@@ -284,6 +284,103 @@
 void vp8_sad16x16x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int  ref_stride, unsigned int *sad_array);
 #define vp8_sad16x16x4d vp8_sad16x16x4d_c
 
+unsigned int vp8_get_mb_ss_c(const short *);
+#define vp8_get_mb_ss vp8_get_mb_ss_c
+
+unsigned int vp8_sub_pixel_mse16x16_c(const unsigned char  *src_ptr, int  source_stride, int  xoffset, int  yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse);
+#define vp8_sub_pixel_mse16x16 vp8_sub_pixel_mse16x16_c
+
+unsigned int vp8_mse16x16_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, unsigned int *sse);
+unsigned int vp8_mse16x16_armv6(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, unsigned int *sse);
+unsigned int vp8_mse16x16_neon(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, unsigned int *sse);
+#define vp8_mse16x16 vp8_mse16x16_neon
+
+unsigned int vp8_get4x4sse_cs_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride);
+unsigned int vp8_get4x4sse_cs_neon(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride);
+#define vp8_get4x4sse_cs vp8_get4x4sse_cs_neon
+
+void vp8_short_fdct4x4_c(short *input, short *output, int pitch);
+void vp8_short_fdct4x4_armv6(short *input, short *output, int pitch);
+void vp8_short_fdct4x4_neon(short *input, short *output, int pitch);
+#define vp8_short_fdct4x4 vp8_short_fdct4x4_neon
+
+void vp8_short_fdct8x4_c(short *input, short *output, int pitch);
+void vp8_short_fdct8x4_armv6(short *input, short *output, int pitch);
+void vp8_short_fdct8x4_neon(short *input, short *output, int pitch);
+#define vp8_short_fdct8x4 vp8_short_fdct8x4_neon
+
+void vp8_short_walsh4x4_c(short *input, short *output, int pitch);
+void vp8_short_walsh4x4_armv6(short *input, short *output, int pitch);
+void vp8_short_walsh4x4_neon(short *input, short *output, int pitch);
+#define vp8_short_walsh4x4 vp8_short_walsh4x4_neon
+
+void vp8_regular_quantize_b_c(struct block *, struct blockd *);
+#define vp8_regular_quantize_b vp8_regular_quantize_b_c
+
+void vp8_fast_quantize_b_c(struct block *, struct blockd *);
+void vp8_fast_quantize_b_armv6(struct block *, struct blockd *);
+void vp8_fast_quantize_b_neon(struct block *, struct blockd *);
+#define vp8_fast_quantize_b vp8_fast_quantize_b_neon
+
+void vp8_regular_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_regular_quantize_b_pair vp8_regular_quantize_b_pair_c
+
+void vp8_fast_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+void vp8_fast_quantize_b_pair_neon(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_fast_quantize_b_pair vp8_fast_quantize_b_pair_neon
+
+void vp8_quantize_mb_c(struct macroblock *);
+void vp8_quantize_mb_neon(struct macroblock *);
+#define vp8_quantize_mb vp8_quantize_mb_neon
+
+void vp8_quantize_mby_c(struct macroblock *);
+void vp8_quantize_mby_neon(struct macroblock *);
+#define vp8_quantize_mby vp8_quantize_mby_neon
+
+void vp8_quantize_mbuv_c(struct macroblock *);
+void vp8_quantize_mbuv_neon(struct macroblock *);
+#define vp8_quantize_mbuv vp8_quantize_mbuv_neon
+
+int vp8_block_error_c(short *coeff, short *dqcoeff);
+#define vp8_block_error vp8_block_error_c
+
+int vp8_mbblock_error_c(struct macroblock *mb, int dc);
+#define vp8_mbblock_error vp8_mbblock_error_c
+
+int vp8_mbuverror_c(struct macroblock *mb);
+#define vp8_mbuverror vp8_mbuverror_c
+
+void vp8_subtract_b_c(struct block *be, struct blockd *bd, int pitch);
+void vp8_subtract_b_armv6(struct block *be, struct blockd *bd, int pitch);
+void vp8_subtract_b_neon(struct block *be, struct blockd *bd, int pitch);
+#define vp8_subtract_b vp8_subtract_b_neon
+
+void vp8_subtract_mby_c(short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride);
+void vp8_subtract_mby_armv6(short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride);
+void vp8_subtract_mby_neon(short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride);
+#define vp8_subtract_mby vp8_subtract_mby_neon
+
+void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride);
+void vp8_subtract_mbuv_armv6(short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride);
+void vp8_subtract_mbuv_neon(short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride);
+#define vp8_subtract_mbuv vp8_subtract_mbuv_neon
+
+int vp8_full_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_full_search_sad vp8_full_search_sad_c
+
+int vp8_refining_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_refining_search_sad vp8_refining_search_sad_c
+
+int vp8_diamond_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_diamond_search_sad vp8_diamond_search_sad_c
+
+void vp8_yv12_copy_partial_frame_c(struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc);
+void vp8_yv12_copy_partial_frame_neon(struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc);
+#define vp8_yv12_copy_partial_frame vp8_yv12_copy_partial_frame_neon
+
+int vp8_denoiser_filter_c(struct yv12_buffer_config* mc_running_avg, struct yv12_buffer_config* running_avg, struct macroblock* signal, unsigned int motion_magnitude2, int y_offset, int uv_offset);
+#define vp8_denoiser_filter vp8_denoiser_filter_c
+
 void vp8_horizontal_line_4_5_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width);
 #define vp8_horizontal_line_4_5_scale vp8_horizontal_line_4_5_scale_c
 
diff --git a/armv7a/libvpx_srcs.txt b/armv7a/libvpx_srcs.txt
index cd05158..e63834d 100644
--- a/armv7a/libvpx_srcs.txt
+++ b/armv7a/libvpx_srcs.txt
@@ -103,7 +103,68 @@
 vp8/decoder/onyxd_int.h
 vp8/decoder/threading.c
 vp8/decoder/treereader.h
+vp8/encoder/arm/armv5te/boolhuff_armv5te.asm.s
+vp8/encoder/arm/armv5te/vp8_packtokens_armv5.asm.s
+vp8/encoder/arm/armv5te/vp8_packtokens_mbrow_armv5.asm.s
+vp8/encoder/arm/armv5te/vp8_packtokens_partitions_armv5.asm.s
+vp8/encoder/arm/armv6/vp8_fast_quantize_b_armv6.asm.s
+vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm.s
+vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm.s
+vp8/encoder/arm/armv6/vp8_subtract_armv6.asm.s
+vp8/encoder/arm/armv6/walsh_v6.asm.s
+vp8/encoder/arm/boolhuff_arm.c
+vp8/encoder/arm/dct_arm.c
+vp8/encoder/arm/quantize_arm.c
+vp8/encoder/asm_enc_offsets.c
+vp8/encoder/bitstream.c
+vp8/encoder/bitstream.h
+vp8/encoder/block.h
+vp8/encoder/boolhuff.h
+vp8/encoder/dct.c
+vp8/encoder/dct_value_cost.h
+vp8/encoder/dct_value_tokens.h
+vp8/encoder/defaultcoefcounts.h
+vp8/encoder/denoising.c
+vp8/encoder/denoising.h
+vp8/encoder/encodeframe.c
+vp8/encoder/encodeframe.h
+vp8/encoder/encodeintra.c
+vp8/encoder/encodeintra.h
+vp8/encoder/encodemb.c
+vp8/encoder/encodemb.h
+vp8/encoder/encodemv.c
+vp8/encoder/encodemv.h
+vp8/encoder/ethreading.c
+vp8/encoder/firstpass.h
+vp8/encoder/lookahead.c
+vp8/encoder/lookahead.h
+vp8/encoder/mcomp.c
+vp8/encoder/mcomp.h
+vp8/encoder/modecosts.c
+vp8/encoder/modecosts.h
+vp8/encoder/onyx_if.c
+vp8/encoder/onyx_int.h
+vp8/encoder/pickinter.c
+vp8/encoder/pickinter.h
+vp8/encoder/picklpf.c
+vp8/encoder/psnr.c
+vp8/encoder/psnr.h
+vp8/encoder/quantize.c
+vp8/encoder/quantize.h
+vp8/encoder/ratectrl.c
+vp8/encoder/ratectrl.h
+vp8/encoder/rdopt.c
+vp8/encoder/rdopt.h
+vp8/encoder/segmentation.c
+vp8/encoder/segmentation.h
+vp8/encoder/tokenize.c
+vp8/encoder/tokenize.h
+vp8/encoder/treewriter.c
+vp8/encoder/treewriter.h
 vp8/vp8_common.mk
+vp8/vp8cx_arm.mk
+vp8/vp8_cx_iface.c
+vp8/vp8cx.mk
 vp8/vp8_dx_iface.c
 vp8/vp8dx.mk
 vpx_config.c
@@ -131,6 +192,7 @@
 vpx/src/vpx_decoder.c
 vpx/src/vpx_encoder.c
 vpx/src/vpx_image.c
+vpx/vp8cx.h
 vpx/vp8dx.h
 vpx/vp8.h
 vpx/vpx_codec.h
diff --git a/armv7a/vpx_config.c b/armv7a/vpx_config.c
index 9ff4335..559f9b0 100644
--- a/armv7a/vpx_config.c
+++ b/armv7a/vpx_config.c
@@ -5,5 +5,5 @@
 /* tree. An additional intellectual property rights grant can be found */
 /* in the file PATENTS.  All contributing project authors may */
 /* be found in the AUTHORS file in the root of the source tree. */
-static const char* const cfg = "--force-target=armv7-android-gcc --disable-runtime-cpu-detect --sdk-path=/usr/local/google/home/johannkoenig/android-ndk --disable-vp8-encoder --disable-examples --disable-docs --disable-neon";
+static const char* const cfg = "--force-target=armv7-android-gcc --disable-runtime-cpu-detect --sdk-path=/usr/local/google/home/johannkoenig/android-ndk --disable-examples --disable-docs --disable-neon --enable-realtime-only";
 const char *vpx_codec_build_config(void) {return cfg;}
diff --git a/armv7a/vpx_config.h b/armv7a/vpx_config.h
index 84b75c2..ddb331f 100644
--- a/armv7a/vpx_config.h
+++ b/armv7a/vpx_config.h
@@ -59,10 +59,10 @@
 #define CONFIG_POSTPROC 0
 #define CONFIG_MULTITHREAD 1
 #define CONFIG_INTERNAL_STATS 0
-#define CONFIG_VP8_ENCODER 0
+#define CONFIG_VP8_ENCODER 1
 #define CONFIG_VP8_DECODER 1
 #define CONFIG_VP8 1
-#define CONFIG_ENCODERS 0
+#define CONFIG_ENCODERS 1
 #define CONFIG_DECODERS 1
 #define CONFIG_STATIC_MSVCRT 0
 #define CONFIG_SPATIAL_RESAMPLING 1
diff --git a/armv7a/vpx_rtcd.h b/armv7a/vpx_rtcd.h
index f9b97ca..6553876 100644
--- a/armv7a/vpx_rtcd.h
+++ b/armv7a/vpx_rtcd.h
@@ -244,6 +244,89 @@
 void vp8_sad16x16x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int  ref_stride, unsigned int *sad_array);
 #define vp8_sad16x16x4d vp8_sad16x16x4d_c
 
+unsigned int vp8_get_mb_ss_c(const short *);
+#define vp8_get_mb_ss vp8_get_mb_ss_c
+
+unsigned int vp8_sub_pixel_mse16x16_c(const unsigned char  *src_ptr, int  source_stride, int  xoffset, int  yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse);
+#define vp8_sub_pixel_mse16x16 vp8_sub_pixel_mse16x16_c
+
+unsigned int vp8_mse16x16_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, unsigned int *sse);
+unsigned int vp8_mse16x16_armv6(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, unsigned int *sse);
+#define vp8_mse16x16 vp8_mse16x16_armv6
+
+unsigned int vp8_get4x4sse_cs_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride);
+#define vp8_get4x4sse_cs vp8_get4x4sse_cs_c
+
+void vp8_short_fdct4x4_c(short *input, short *output, int pitch);
+void vp8_short_fdct4x4_armv6(short *input, short *output, int pitch);
+#define vp8_short_fdct4x4 vp8_short_fdct4x4_armv6
+
+void vp8_short_fdct8x4_c(short *input, short *output, int pitch);
+void vp8_short_fdct8x4_armv6(short *input, short *output, int pitch);
+#define vp8_short_fdct8x4 vp8_short_fdct8x4_armv6
+
+void vp8_short_walsh4x4_c(short *input, short *output, int pitch);
+void vp8_short_walsh4x4_armv6(short *input, short *output, int pitch);
+#define vp8_short_walsh4x4 vp8_short_walsh4x4_armv6
+
+void vp8_regular_quantize_b_c(struct block *, struct blockd *);
+#define vp8_regular_quantize_b vp8_regular_quantize_b_c
+
+void vp8_fast_quantize_b_c(struct block *, struct blockd *);
+void vp8_fast_quantize_b_armv6(struct block *, struct blockd *);
+#define vp8_fast_quantize_b vp8_fast_quantize_b_armv6
+
+void vp8_regular_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_regular_quantize_b_pair vp8_regular_quantize_b_pair_c
+
+void vp8_fast_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_fast_quantize_b_pair vp8_fast_quantize_b_pair_c
+
+void vp8_quantize_mb_c(struct macroblock *);
+#define vp8_quantize_mb vp8_quantize_mb_c
+
+void vp8_quantize_mby_c(struct macroblock *);
+#define vp8_quantize_mby vp8_quantize_mby_c
+
+void vp8_quantize_mbuv_c(struct macroblock *);
+#define vp8_quantize_mbuv vp8_quantize_mbuv_c
+
+int vp8_block_error_c(short *coeff, short *dqcoeff);
+#define vp8_block_error vp8_block_error_c
+
+int vp8_mbblock_error_c(struct macroblock *mb, int dc);
+#define vp8_mbblock_error vp8_mbblock_error_c
+
+int vp8_mbuverror_c(struct macroblock *mb);
+#define vp8_mbuverror vp8_mbuverror_c
+
+void vp8_subtract_b_c(struct block *be, struct blockd *bd, int pitch);
+void vp8_subtract_b_armv6(struct block *be, struct blockd *bd, int pitch);
+#define vp8_subtract_b vp8_subtract_b_armv6
+
+void vp8_subtract_mby_c(short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride);
+void vp8_subtract_mby_armv6(short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride);
+#define vp8_subtract_mby vp8_subtract_mby_armv6
+
+void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride);
+void vp8_subtract_mbuv_armv6(short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride);
+#define vp8_subtract_mbuv vp8_subtract_mbuv_armv6
+
+int vp8_full_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_full_search_sad vp8_full_search_sad_c
+
+int vp8_refining_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_refining_search_sad vp8_refining_search_sad_c
+
+int vp8_diamond_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_diamond_search_sad vp8_diamond_search_sad_c
+
+void vp8_yv12_copy_partial_frame_c(struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc);
+#define vp8_yv12_copy_partial_frame vp8_yv12_copy_partial_frame_c
+
+int vp8_denoiser_filter_c(struct yv12_buffer_config* mc_running_avg, struct yv12_buffer_config* running_avg, struct macroblock* signal, unsigned int motion_magnitude2, int y_offset, int uv_offset);
+#define vp8_denoiser_filter vp8_denoiser_filter_c
+
 void vp8_horizontal_line_4_5_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width);
 #define vp8_horizontal_line_4_5_scale vp8_horizontal_line_4_5_scale_c
 
diff --git a/generic/libvpx_srcs.txt b/generic/libvpx_srcs.txt
index 4ee59ef..5756427 100644
--- a/generic/libvpx_srcs.txt
+++ b/generic/libvpx_srcs.txt
@@ -75,7 +75,56 @@
 vp8/decoder/onyxd_int.h
 vp8/decoder/threading.c
 vp8/decoder/treereader.h
+vp8/encoder/asm_enc_offsets.c
+vp8/encoder/bitstream.c
+vp8/encoder/bitstream.h
+vp8/encoder/block.h
+vp8/encoder/boolhuff.c
+vp8/encoder/boolhuff.h
+vp8/encoder/dct.c
+vp8/encoder/dct_value_cost.h
+vp8/encoder/dct_value_tokens.h
+vp8/encoder/defaultcoefcounts.h
+vp8/encoder/denoising.c
+vp8/encoder/denoising.h
+vp8/encoder/encodeframe.c
+vp8/encoder/encodeframe.h
+vp8/encoder/encodeintra.c
+vp8/encoder/encodeintra.h
+vp8/encoder/encodemb.c
+vp8/encoder/encodemb.h
+vp8/encoder/encodemv.c
+vp8/encoder/encodemv.h
+vp8/encoder/ethreading.c
+vp8/encoder/firstpass.h
+vp8/encoder/lookahead.c
+vp8/encoder/lookahead.h
+vp8/encoder/mcomp.c
+vp8/encoder/mcomp.h
+vp8/encoder/modecosts.c
+vp8/encoder/modecosts.h
+vp8/encoder/onyx_if.c
+vp8/encoder/onyx_int.h
+vp8/encoder/pickinter.c
+vp8/encoder/pickinter.h
+vp8/encoder/picklpf.c
+vp8/encoder/psnr.c
+vp8/encoder/psnr.h
+vp8/encoder/quantize.c
+vp8/encoder/quantize.h
+vp8/encoder/ratectrl.c
+vp8/encoder/ratectrl.h
+vp8/encoder/rdopt.c
+vp8/encoder/rdopt.h
+vp8/encoder/segmentation.c
+vp8/encoder/segmentation.h
+vp8/encoder/tokenize.c
+vp8/encoder/tokenize.h
+vp8/encoder/treewriter.c
+vp8/encoder/treewriter.h
 vp8/vp8_common.mk
+vp8/vp8_cx_iface.c
+vp8/vp8cx.mk
 vp8/vp8_dx_iface.c
 vp8/vp8dx.mk
 vpx_config.c
@@ -101,6 +150,7 @@
 vpx/src/vpx_decoder.c
 vpx/src/vpx_encoder.c
 vpx/src/vpx_image.c
+vpx/vp8cx.h
 vpx/vp8dx.h
 vpx/vp8.h
 vpx/vpx_codec.h
diff --git a/generic/vpx_config.c b/generic/vpx_config.c
index 15c48f4..61f4fd8 100644
--- a/generic/vpx_config.c
+++ b/generic/vpx_config.c
@@ -5,5 +5,5 @@
 /* tree. An additional intellectual property rights grant can be found */
 /* in the file PATENTS.  All contributing project authors may */
 /* be found in the AUTHORS file in the root of the source tree. */
-static const char* const cfg = "--force-target=generic-gnu --disable-vp8-encoder --disable-examples --disable-docs";
+static const char* const cfg = "--force-target=generic-gnu --disable-examples --disable-docs --enable-realtime-only";
 const char *vpx_codec_build_config(void) {return cfg;}
diff --git a/generic/vpx_config.h b/generic/vpx_config.h
index 84eb822..9c6da62 100644
--- a/generic/vpx_config.h
+++ b/generic/vpx_config.h
@@ -59,14 +59,14 @@
 #define CONFIG_POSTPROC 0
 #define CONFIG_MULTITHREAD 1
 #define CONFIG_INTERNAL_STATS 0
-#define CONFIG_VP8_ENCODER 0
+#define CONFIG_VP8_ENCODER 1
 #define CONFIG_VP8_DECODER 1
 #define CONFIG_VP8 1
-#define CONFIG_ENCODERS 0
+#define CONFIG_ENCODERS 1
 #define CONFIG_DECODERS 1
 #define CONFIG_STATIC_MSVCRT 0
 #define CONFIG_SPATIAL_RESAMPLING 1
-#define CONFIG_REALTIME_ONLY 0
+#define CONFIG_REALTIME_ONLY 1
 #define CONFIG_ONTHEFLY_BITPACKING 0
 #define CONFIG_ERROR_CONCEALMENT 0
 #define CONFIG_SHARED 0
diff --git a/generic/vpx_rtcd.h b/generic/vpx_rtcd.h
index 7d57578..ab83978 100644
--- a/generic/vpx_rtcd.h
+++ b/generic/vpx_rtcd.h
@@ -209,6 +209,81 @@
 void vp8_sad16x16x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int  ref_stride, unsigned int *sad_array);
 #define vp8_sad16x16x4d vp8_sad16x16x4d_c
 
+unsigned int vp8_get_mb_ss_c(const short *);
+#define vp8_get_mb_ss vp8_get_mb_ss_c
+
+unsigned int vp8_sub_pixel_mse16x16_c(const unsigned char  *src_ptr, int  source_stride, int  xoffset, int  yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse);
+#define vp8_sub_pixel_mse16x16 vp8_sub_pixel_mse16x16_c
+
+unsigned int vp8_mse16x16_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, unsigned int *sse);
+#define vp8_mse16x16 vp8_mse16x16_c
+
+unsigned int vp8_get4x4sse_cs_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride);
+#define vp8_get4x4sse_cs vp8_get4x4sse_cs_c
+
+void vp8_short_fdct4x4_c(short *input, short *output, int pitch);
+#define vp8_short_fdct4x4 vp8_short_fdct4x4_c
+
+void vp8_short_fdct8x4_c(short *input, short *output, int pitch);
+#define vp8_short_fdct8x4 vp8_short_fdct8x4_c
+
+void vp8_short_walsh4x4_c(short *input, short *output, int pitch);
+#define vp8_short_walsh4x4 vp8_short_walsh4x4_c
+
+void vp8_regular_quantize_b_c(struct block *, struct blockd *);
+#define vp8_regular_quantize_b vp8_regular_quantize_b_c
+
+void vp8_fast_quantize_b_c(struct block *, struct blockd *);
+#define vp8_fast_quantize_b vp8_fast_quantize_b_c
+
+void vp8_regular_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_regular_quantize_b_pair vp8_regular_quantize_b_pair_c
+
+void vp8_fast_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_fast_quantize_b_pair vp8_fast_quantize_b_pair_c
+
+void vp8_quantize_mb_c(struct macroblock *);
+#define vp8_quantize_mb vp8_quantize_mb_c
+
+void vp8_quantize_mby_c(struct macroblock *);
+#define vp8_quantize_mby vp8_quantize_mby_c
+
+void vp8_quantize_mbuv_c(struct macroblock *);
+#define vp8_quantize_mbuv vp8_quantize_mbuv_c
+
+int vp8_block_error_c(short *coeff, short *dqcoeff);
+#define vp8_block_error vp8_block_error_c
+
+int vp8_mbblock_error_c(struct macroblock *mb, int dc);
+#define vp8_mbblock_error vp8_mbblock_error_c
+
+int vp8_mbuverror_c(struct macroblock *mb);
+#define vp8_mbuverror vp8_mbuverror_c
+
+void vp8_subtract_b_c(struct block *be, struct blockd *bd, int pitch);
+#define vp8_subtract_b vp8_subtract_b_c
+
+void vp8_subtract_mby_c(short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride);
+#define vp8_subtract_mby vp8_subtract_mby_c
+
+void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride);
+#define vp8_subtract_mbuv vp8_subtract_mbuv_c
+
+int vp8_full_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_full_search_sad vp8_full_search_sad_c
+
+int vp8_refining_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_refining_search_sad vp8_refining_search_sad_c
+
+int vp8_diamond_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_diamond_search_sad vp8_diamond_search_sad_c
+
+void vp8_yv12_copy_partial_frame_c(struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc);
+#define vp8_yv12_copy_partial_frame vp8_yv12_copy_partial_frame_c
+
+int vp8_denoiser_filter_c(struct yv12_buffer_config* mc_running_avg, struct yv12_buffer_config* running_avg, struct macroblock* signal, unsigned int motion_magnitude2, int y_offset, int uv_offset);
+#define vp8_denoiser_filter vp8_denoiser_filter_c
+
 void vp8_horizontal_line_4_5_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width);
 #define vp8_horizontal_line_4_5_scale vp8_horizontal_line_4_5_scale_c
 
diff --git a/libvpx.mk b/libvpx.mk
index 7b3cd9b..5cb7820 100644
--- a/libvpx.mk
+++ b/libvpx.mk
@@ -62,14 +62,12 @@
 libvpx_asm_offsets_intermediates := \
     vp8/common/asm_com_offsets.intermediate \
     vp8/decoder/asm_dec_offsets.intermediate \
-
-#    vp8/encoder/asm_enc_offsets.intermediate \
+    vp8/encoder/asm_enc_offsets.intermediate \
 
 libvpx_asm_offsets_files := \
     vp8/common/asm_com_offsets.asm \
     vp8/decoder/asm_dec_offsets.asm \
-
-#    vp8/encoder/asm_enc_offsets.asm \
+    vp8/encoder/asm_enc_offsets.asm \
 
 # Build the S files with inline assembly.
 COMPILE_TO_S := $(addprefix $(libvpx_intermediates)/, $(libvpx_asm_offsets_intermediates))
@@ -108,8 +106,7 @@
     $(libvpx_config_dir) \
     $(libvpx_intermediates)/vp8/common \
     $(libvpx_intermediates)/vp8/decoder \
-
-#    $(libvpx_intermediates)/vp8/encoder \
+    $(libvpx_intermediates)/vp8/encoder \
 
 libvpx_target :=
 libvpx_asm :=
diff --git a/mips-dspr2/libvpx_srcs.txt b/mips-dspr2/libvpx_srcs.txt
index fa2d647..8b5b727 100644
--- a/mips-dspr2/libvpx_srcs.txt
+++ b/mips-dspr2/libvpx_srcs.txt
@@ -81,7 +81,56 @@
 vp8/decoder/onyxd_int.h
 vp8/decoder/threading.c
 vp8/decoder/treereader.h
+vp8/encoder/asm_enc_offsets.c
+vp8/encoder/bitstream.c
+vp8/encoder/bitstream.h
+vp8/encoder/block.h
+vp8/encoder/boolhuff.c
+vp8/encoder/boolhuff.h
+vp8/encoder/dct.c
+vp8/encoder/dct_value_cost.h
+vp8/encoder/dct_value_tokens.h
+vp8/encoder/defaultcoefcounts.h
+vp8/encoder/denoising.c
+vp8/encoder/denoising.h
+vp8/encoder/encodeframe.c
+vp8/encoder/encodeframe.h
+vp8/encoder/encodeintra.c
+vp8/encoder/encodeintra.h
+vp8/encoder/encodemb.c
+vp8/encoder/encodemb.h
+vp8/encoder/encodemv.c
+vp8/encoder/encodemv.h
+vp8/encoder/ethreading.c
+vp8/encoder/firstpass.h
+vp8/encoder/lookahead.c
+vp8/encoder/lookahead.h
+vp8/encoder/mcomp.c
+vp8/encoder/mcomp.h
+vp8/encoder/modecosts.c
+vp8/encoder/modecosts.h
+vp8/encoder/onyx_if.c
+vp8/encoder/onyx_int.h
+vp8/encoder/pickinter.c
+vp8/encoder/pickinter.h
+vp8/encoder/picklpf.c
+vp8/encoder/psnr.c
+vp8/encoder/psnr.h
+vp8/encoder/quantize.c
+vp8/encoder/quantize.h
+vp8/encoder/ratectrl.c
+vp8/encoder/ratectrl.h
+vp8/encoder/rdopt.c
+vp8/encoder/rdopt.h
+vp8/encoder/segmentation.c
+vp8/encoder/segmentation.h
+vp8/encoder/tokenize.c
+vp8/encoder/tokenize.h
+vp8/encoder/treewriter.c
+vp8/encoder/treewriter.h
 vp8/vp8_common.mk
+vp8/vp8_cx_iface.c
+vp8/vp8cx.mk
 vp8/vp8_dx_iface.c
 vp8/vp8dx.mk
 vpx_config.c
@@ -107,6 +156,7 @@
 vpx/src/vpx_decoder.c
 vpx/src/vpx_encoder.c
 vpx/src/vpx_image.c
+vpx/vp8cx.h
 vpx/vp8dx.h
 vpx/vp8.h
 vpx/vpx_codec.h
diff --git a/mips-dspr2/vpx_config.c b/mips-dspr2/vpx_config.c
index 49cf24e..42fc4cb 100644
--- a/mips-dspr2/vpx_config.c
+++ b/mips-dspr2/vpx_config.c
@@ -5,5 +5,5 @@
 /* tree. An additional intellectual property rights grant can be found */
 /* in the file PATENTS.  All contributing project authors may */
 /* be found in the AUTHORS file in the root of the source tree. */
-static const char* const cfg = "--force-target=mips32-android-gcc --disable-runtime-cpu-detect --sdk-path=/usr/local/google/home/johannkoenig/android-ndk --disable-vp8-encoder --disable-examples --disable-docs --enable-dspr2";
+static const char* const cfg = "--force-target=mips32-android-gcc --disable-runtime-cpu-detect --sdk-path=/usr/local/google/home/johannkoenig/android-ndk --disable-examples --disable-docs --enable-dspr2 --enable-realtime-only";
 const char *vpx_codec_build_config(void) {return cfg;}
diff --git a/mips-dspr2/vpx_config.h b/mips-dspr2/vpx_config.h
index 3a9e711..b03bd7c 100644
--- a/mips-dspr2/vpx_config.h
+++ b/mips-dspr2/vpx_config.h
@@ -59,14 +59,14 @@
 #define CONFIG_POSTPROC 0
 #define CONFIG_MULTITHREAD 1
 #define CONFIG_INTERNAL_STATS 0
-#define CONFIG_VP8_ENCODER 0
+#define CONFIG_VP8_ENCODER 1
 #define CONFIG_VP8_DECODER 1
 #define CONFIG_VP8 1
-#define CONFIG_ENCODERS 0
+#define CONFIG_ENCODERS 1
 #define CONFIG_DECODERS 1
 #define CONFIG_STATIC_MSVCRT 0
 #define CONFIG_SPATIAL_RESAMPLING 1
-#define CONFIG_REALTIME_ONLY 0
+#define CONFIG_REALTIME_ONLY 1
 #define CONFIG_ONTHEFLY_BITPACKING 0
 #define CONFIG_ERROR_CONCEALMENT 0
 #define CONFIG_SHARED 0
diff --git a/mips-dspr2/vpx_rtcd.h b/mips-dspr2/vpx_rtcd.h
index 880e0f4..4e212f8 100644
--- a/mips-dspr2/vpx_rtcd.h
+++ b/mips-dspr2/vpx_rtcd.h
@@ -227,6 +227,81 @@
 void vp8_sad16x16x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int  ref_stride, unsigned int *sad_array);
 #define vp8_sad16x16x4d vp8_sad16x16x4d_c
 
+unsigned int vp8_get_mb_ss_c(const short *);
+#define vp8_get_mb_ss vp8_get_mb_ss_c
+
+unsigned int vp8_sub_pixel_mse16x16_c(const unsigned char  *src_ptr, int  source_stride, int  xoffset, int  yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse);
+#define vp8_sub_pixel_mse16x16 vp8_sub_pixel_mse16x16_c
+
+unsigned int vp8_mse16x16_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, unsigned int *sse);
+#define vp8_mse16x16 vp8_mse16x16_c
+
+unsigned int vp8_get4x4sse_cs_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride);
+#define vp8_get4x4sse_cs vp8_get4x4sse_cs_c
+
+void vp8_short_fdct4x4_c(short *input, short *output, int pitch);
+#define vp8_short_fdct4x4 vp8_short_fdct4x4_c
+
+void vp8_short_fdct8x4_c(short *input, short *output, int pitch);
+#define vp8_short_fdct8x4 vp8_short_fdct8x4_c
+
+void vp8_short_walsh4x4_c(short *input, short *output, int pitch);
+#define vp8_short_walsh4x4 vp8_short_walsh4x4_c
+
+void vp8_regular_quantize_b_c(struct block *, struct blockd *);
+#define vp8_regular_quantize_b vp8_regular_quantize_b_c
+
+void vp8_fast_quantize_b_c(struct block *, struct blockd *);
+#define vp8_fast_quantize_b vp8_fast_quantize_b_c
+
+void vp8_regular_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_regular_quantize_b_pair vp8_regular_quantize_b_pair_c
+
+void vp8_fast_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_fast_quantize_b_pair vp8_fast_quantize_b_pair_c
+
+void vp8_quantize_mb_c(struct macroblock *);
+#define vp8_quantize_mb vp8_quantize_mb_c
+
+void vp8_quantize_mby_c(struct macroblock *);
+#define vp8_quantize_mby vp8_quantize_mby_c
+
+void vp8_quantize_mbuv_c(struct macroblock *);
+#define vp8_quantize_mbuv vp8_quantize_mbuv_c
+
+int vp8_block_error_c(short *coeff, short *dqcoeff);
+#define vp8_block_error vp8_block_error_c
+
+int vp8_mbblock_error_c(struct macroblock *mb, int dc);
+#define vp8_mbblock_error vp8_mbblock_error_c
+
+int vp8_mbuverror_c(struct macroblock *mb);
+#define vp8_mbuverror vp8_mbuverror_c
+
+void vp8_subtract_b_c(struct block *be, struct blockd *bd, int pitch);
+#define vp8_subtract_b vp8_subtract_b_c
+
+void vp8_subtract_mby_c(short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride);
+#define vp8_subtract_mby vp8_subtract_mby_c
+
+void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride);
+#define vp8_subtract_mbuv vp8_subtract_mbuv_c
+
+int vp8_full_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_full_search_sad vp8_full_search_sad_c
+
+int vp8_refining_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_refining_search_sad vp8_refining_search_sad_c
+
+int vp8_diamond_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_diamond_search_sad vp8_diamond_search_sad_c
+
+void vp8_yv12_copy_partial_frame_c(struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc);
+#define vp8_yv12_copy_partial_frame vp8_yv12_copy_partial_frame_c
+
+int vp8_denoiser_filter_c(struct yv12_buffer_config* mc_running_avg, struct yv12_buffer_config* running_avg, struct macroblock* signal, unsigned int motion_magnitude2, int y_offset, int uv_offset);
+#define vp8_denoiser_filter vp8_denoiser_filter_c
+
 void vp8_horizontal_line_4_5_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width);
 #define vp8_horizontal_line_4_5_scale vp8_horizontal_line_4_5_scale_c
 
diff --git a/mips/libvpx_srcs.txt b/mips/libvpx_srcs.txt
index 4ee59ef..5756427 100644
--- a/mips/libvpx_srcs.txt
+++ b/mips/libvpx_srcs.txt
@@ -75,7 +75,56 @@
 vp8/decoder/onyxd_int.h
 vp8/decoder/threading.c
 vp8/decoder/treereader.h
+vp8/encoder/asm_enc_offsets.c
+vp8/encoder/bitstream.c
+vp8/encoder/bitstream.h
+vp8/encoder/block.h
+vp8/encoder/boolhuff.c
+vp8/encoder/boolhuff.h
+vp8/encoder/dct.c
+vp8/encoder/dct_value_cost.h
+vp8/encoder/dct_value_tokens.h
+vp8/encoder/defaultcoefcounts.h
+vp8/encoder/denoising.c
+vp8/encoder/denoising.h
+vp8/encoder/encodeframe.c
+vp8/encoder/encodeframe.h
+vp8/encoder/encodeintra.c
+vp8/encoder/encodeintra.h
+vp8/encoder/encodemb.c
+vp8/encoder/encodemb.h
+vp8/encoder/encodemv.c
+vp8/encoder/encodemv.h
+vp8/encoder/ethreading.c
+vp8/encoder/firstpass.h
+vp8/encoder/lookahead.c
+vp8/encoder/lookahead.h
+vp8/encoder/mcomp.c
+vp8/encoder/mcomp.h
+vp8/encoder/modecosts.c
+vp8/encoder/modecosts.h
+vp8/encoder/onyx_if.c
+vp8/encoder/onyx_int.h
+vp8/encoder/pickinter.c
+vp8/encoder/pickinter.h
+vp8/encoder/picklpf.c
+vp8/encoder/psnr.c
+vp8/encoder/psnr.h
+vp8/encoder/quantize.c
+vp8/encoder/quantize.h
+vp8/encoder/ratectrl.c
+vp8/encoder/ratectrl.h
+vp8/encoder/rdopt.c
+vp8/encoder/rdopt.h
+vp8/encoder/segmentation.c
+vp8/encoder/segmentation.h
+vp8/encoder/tokenize.c
+vp8/encoder/tokenize.h
+vp8/encoder/treewriter.c
+vp8/encoder/treewriter.h
 vp8/vp8_common.mk
+vp8/vp8_cx_iface.c
+vp8/vp8cx.mk
 vp8/vp8_dx_iface.c
 vp8/vp8dx.mk
 vpx_config.c
@@ -101,6 +150,7 @@
 vpx/src/vpx_decoder.c
 vpx/src/vpx_encoder.c
 vpx/src/vpx_image.c
+vpx/vp8cx.h
 vpx/vp8dx.h
 vpx/vp8.h
 vpx/vpx_codec.h
diff --git a/mips/vpx_config.c b/mips/vpx_config.c
index 1a07e06..fa93c2c 100644
--- a/mips/vpx_config.c
+++ b/mips/vpx_config.c
@@ -5,5 +5,5 @@
 /* tree. An additional intellectual property rights grant can be found */
 /* in the file PATENTS.  All contributing project authors may */
 /* be found in the AUTHORS file in the root of the source tree. */
-static const char* const cfg = "--force-target=mips32-android-gcc --disable-runtime-cpu-detect --sdk-path=/usr/local/google/home/johannkoenig/android-ndk --disable-vp8-encoder --disable-examples --disable-docs";
+static const char* const cfg = "--force-target=mips32-android-gcc --disable-runtime-cpu-detect --sdk-path=/usr/local/google/home/johannkoenig/android-ndk --disable-examples --disable-docs --enable-realtime-only";
 const char *vpx_codec_build_config(void) {return cfg;}
diff --git a/mips/vpx_config.h b/mips/vpx_config.h
index c567363..9f51b09 100644
--- a/mips/vpx_config.h
+++ b/mips/vpx_config.h
@@ -59,14 +59,14 @@
 #define CONFIG_POSTPROC 0
 #define CONFIG_MULTITHREAD 1
 #define CONFIG_INTERNAL_STATS 0
-#define CONFIG_VP8_ENCODER 0
+#define CONFIG_VP8_ENCODER 1
 #define CONFIG_VP8_DECODER 1
 #define CONFIG_VP8 1
-#define CONFIG_ENCODERS 0
+#define CONFIG_ENCODERS 1
 #define CONFIG_DECODERS 1
 #define CONFIG_STATIC_MSVCRT 0
 #define CONFIG_SPATIAL_RESAMPLING 1
-#define CONFIG_REALTIME_ONLY 0
+#define CONFIG_REALTIME_ONLY 1
 #define CONFIG_ONTHEFLY_BITPACKING 0
 #define CONFIG_ERROR_CONCEALMENT 0
 #define CONFIG_SHARED 0
diff --git a/mips/vpx_rtcd.h b/mips/vpx_rtcd.h
index 00d86af..fe84d62 100644
--- a/mips/vpx_rtcd.h
+++ b/mips/vpx_rtcd.h
@@ -209,6 +209,81 @@
 void vp8_sad16x16x4d_c(const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int  ref_stride, unsigned int *sad_array);
 #define vp8_sad16x16x4d vp8_sad16x16x4d_c
 
+unsigned int vp8_get_mb_ss_c(const short *);
+#define vp8_get_mb_ss vp8_get_mb_ss_c
+
+unsigned int vp8_sub_pixel_mse16x16_c(const unsigned char  *src_ptr, int  source_stride, int  xoffset, int  yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse);
+#define vp8_sub_pixel_mse16x16 vp8_sub_pixel_mse16x16_c
+
+unsigned int vp8_mse16x16_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride, unsigned int *sse);
+#define vp8_mse16x16 vp8_mse16x16_c
+
+unsigned int vp8_get4x4sse_cs_c(const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int  ref_stride);
+#define vp8_get4x4sse_cs vp8_get4x4sse_cs_c
+
+void vp8_short_fdct4x4_c(short *input, short *output, int pitch);
+#define vp8_short_fdct4x4 vp8_short_fdct4x4_c
+
+void vp8_short_fdct8x4_c(short *input, short *output, int pitch);
+#define vp8_short_fdct8x4 vp8_short_fdct8x4_c
+
+void vp8_short_walsh4x4_c(short *input, short *output, int pitch);
+#define vp8_short_walsh4x4 vp8_short_walsh4x4_c
+
+void vp8_regular_quantize_b_c(struct block *, struct blockd *);
+#define vp8_regular_quantize_b vp8_regular_quantize_b_c
+
+void vp8_fast_quantize_b_c(struct block *, struct blockd *);
+#define vp8_fast_quantize_b vp8_fast_quantize_b_c
+
+void vp8_regular_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_regular_quantize_b_pair vp8_regular_quantize_b_pair_c
+
+void vp8_fast_quantize_b_pair_c(struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2);
+#define vp8_fast_quantize_b_pair vp8_fast_quantize_b_pair_c
+
+void vp8_quantize_mb_c(struct macroblock *);
+#define vp8_quantize_mb vp8_quantize_mb_c
+
+void vp8_quantize_mby_c(struct macroblock *);
+#define vp8_quantize_mby vp8_quantize_mby_c
+
+void vp8_quantize_mbuv_c(struct macroblock *);
+#define vp8_quantize_mbuv vp8_quantize_mbuv_c
+
+int vp8_block_error_c(short *coeff, short *dqcoeff);
+#define vp8_block_error vp8_block_error_c
+
+int vp8_mbblock_error_c(struct macroblock *mb, int dc);
+#define vp8_mbblock_error vp8_mbblock_error_c
+
+int vp8_mbuverror_c(struct macroblock *mb);
+#define vp8_mbuverror vp8_mbuverror_c
+
+void vp8_subtract_b_c(struct block *be, struct blockd *bd, int pitch);
+#define vp8_subtract_b vp8_subtract_b_c
+
+void vp8_subtract_mby_c(short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride);
+#define vp8_subtract_mby vp8_subtract_mby_c
+
+void vp8_subtract_mbuv_c(short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride);
+#define vp8_subtract_mbuv vp8_subtract_mbuv_c
+
+int vp8_full_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_full_search_sad vp8_full_search_sad_c
+
+int vp8_refining_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_refining_search_sad vp8_refining_search_sad_c
+
+int vp8_diamond_search_sad_c(struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv);
+#define vp8_diamond_search_sad vp8_diamond_search_sad_c
+
+void vp8_yv12_copy_partial_frame_c(struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc);
+#define vp8_yv12_copy_partial_frame vp8_yv12_copy_partial_frame_c
+
+int vp8_denoiser_filter_c(struct yv12_buffer_config* mc_running_avg, struct yv12_buffer_config* running_avg, struct macroblock* signal, unsigned int motion_magnitude2, int y_offset, int uv_offset);
+#define vp8_denoiser_filter vp8_denoiser_filter_c
+
 void vp8_horizontal_line_4_5_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width);
 #define vp8_horizontal_line_4_5_scale vp8_horizontal_line_4_5_scale_c