shithub: openh264

Download patch

ref: 2edc251ded2d7d7c8d9f82f99b3d072aa2581131
parent: 59dae50b1069dbd532226ea024a3ba3982ab4386
author: EKR <[email protected]>
date: Tue Dec 10 11:19:42 EST 2013

First cut at new build system. Tested on Mac

--- /dev/null
+++ b/Makefile
@@ -1,0 +1,40 @@
+LIBPREFIX=lib
+LIBSUFFIX=a
+ROOTDIR=$(PWD)
+
+CFLAGS = -g -arch i386 -fPIC -DNO_DYNAMIC_VP
+LDFLAGS = -arch i386 -ldl -lpthread 
+
+INCLUDES = -Icodec/api/svc
+DECODER_INCLUDES = \
+    -Icodec/decoder/core/inc \
+    -Icodec/decoder/plus/inc
+
+ENCODER_INCLUDES = \
+    -Icodec/encoder/core/inc \
+    -Icodec/encoder/plus/inc \
+    -Icodec/WelsThreadLib/api
+
+PROCESSING_INCLUDES = \
+    -Icodec/encoder/core/inc \
+    -Icodec/encoder/plus/inc
+
+H264DEC_INCLUDES = $(DECODER_INCLUDES) -Icodec/console/dec/inc
+H264DEC_LDFLAGS = -L. -ldecoder
+
+H264ENC_INCLUDES = $(ENCODER_INCLUDES) -Icodec/console/enc/inc
+H264ENC_LDFLAGS = -L. -lencoder -lprocessing
+
+all:	libraries binaries
+
+clean:
+	rm -f $(OBJS) $(LIBRARIES) $(BINARIES)
+
+include codec/decoder/targets.mk
+include codec/encoder/targets.mk
+include processing/targets.mk
+include codec/console/dec/targets.mk
+include codec/console/enc/targets.mk
+
+
+
--- /dev/null
+++ b/build/mktargets.py
@@ -1,0 +1,96 @@
+#!/usr/bin/python
+import sys
+import argparse
+import os
+
+parser = argparse.ArgumentParser(description="Make helper parser")
+parser.add_argument("--directory", dest="directory", required=True)
+parser.add_argument("--library", dest="library", help="Make a library")
+parser.add_argument("--binary", dest="binary", help="Make a binary")
+parser.add_argument("--exclude", dest="exclude", help="Exclude file", action="append")
+PREFIX=None
+LIBRARY=None
+BINARY=None
+EXCLUDE=[]
+
+def make_o(x):
+    return os.path.splitext(x)[0] + ".o"
+
+def write_cpp_rule(f, x):
+    src = "$(%s_SRCDIR)/%s"%(PREFIX, x)
+    dst = "$(%s_SRCDIR)/%s"%(PREFIX, make_o(x))
+    
+    f.write("%s: %s\n"%(dst, src))
+    f.write('\t$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(' + PREFIX + '_CFLAGS) $(' + PREFIX + '_INCLUDES) -c -o ' + dst + ' ' + src + '\n');
+    f.write("\n")
+    
+
+def find_sources():
+    cpp_files = []
+    asm_files = []
+    print EXCLUDE
+    for dir in os.walk("."):
+        for file in dir[2]:
+            if not file in EXCLUDE:
+                if os.path.splitext(file)[1] == '.cpp':
+                    cpp_files.append(os.path.join(dir[0], file))
+                if os.path.splitext(file)[1] == '.asm':
+                    asm_files.append(os.path.join(dir[0], file))
+    return [cpp_files, asm_files]
+
+
+args = parser.parse_args()
+
+if args.library is not None:
+    PREFIX=args.library.upper()
+elif args.binary is not None:
+    PREFIX=args.binary.upper()
+else:
+    sys.stderr.write("Must provide either library or binary")
+    sys.exit(1)
+
+if args.exclude is not None:
+    EXCLUDE = args.exclude
+(cpp, asm) = find_sources()
+
+
+
+f = open("targets.mk", "w")
+f.write("%s_PREFIX=%s\n"%(PREFIX, PREFIX))
+f.write("%s_SRCDIR=%s\n"%(PREFIX, args.directory))
+
+f.write("%s_CPP_SRCS=\\\n"%(PREFIX))
+for c in cpp:
+    f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
+f.write("\n")    
+f.write("%s_OBJS += $(%s_CPP_SRCS:.cpp=.o)\n"%(PREFIX, PREFIX))
+
+f.write("ifdef USE_ASM\n")
+f.write("%s_ASM_SRCS=\\\n"%(PREFIX))
+for c in asm:
+    f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
+f.write("\n")
+f.write("%s_OBJS += $(%s_ASM_SRCS:.asm=.o)\n"%(PREFIX, PREFIX))
+f.write("endif\n\n")
+
+f.write("OBJS += $(%s_OBJS)\n"%PREFIX)
+
+for c in cpp:
+    write_cpp_rule(f, c)
+
+#for a in asm:
+#    write_asm_rule(f, a)
+
+if args.library is not None:
+    f.write("$(LIBPREFIX)%s.$(LIBSUFFIX): $(%s_OBJS)\n"%(args.library, PREFIX));
+    f.write("\trm -f $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library)
+    f.write("\tar cr $@ $(%s_OBJS)\n"%PREFIX);
+    f.write("\n");
+    f.write("libraries: $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library);
+    f.write("LIBRARIES += $(LIBPREFIX)%s.$(LIBSUFFIX)\n"%args.library);
+
+if args.binary is not None:
+    f.write("%s: $(%s_OBJS) $(LIBS) $(%s_LIBS)\n"%(args.binary, PREFIX, PREFIX))
+    f.write("\t$(CXX) -o $@  $(%s_OBJS) $(%s_LDFLAGS) $(%s_LIBS) $(LDFLAGS) $(LIBS)\n\n"%(PREFIX, PREFIX, PREFIX))
+    f.write("binaries: %s\n"%args.binary);
+    f.write("BINARIES += %s\n"%args.binary);
--- /dev/null
+++ b/build/mktargets.sh
@@ -1,0 +1,7 @@
+#!/bin/sh
+(cd codec/decoder; python ../../build/mktargets.py --directory codec/decoder --library decoder --exclude StdAfx.cpp)
+(cd codec/encoder; python ../../build/mktargets.py --directory codec/encoder --library encoder --exclude DllEntry.cpp)
+(cd processing; python ../build/mktargets.py --directory processing --library processing --exclude wels_process.cpp --exclude WelsVideoProcessor.cpp)
+
+(cd codec/console/dec; python ../../../build/mktargets.py --directory codec/console/dec --binary h264dec --exclude dec_console.h --exclude load_bundle_functions.cpp)
+(cd codec/console/enc; python ../../../build/mktargets.py --directory codec/console/enc --binary h264enc --exclude enc_console.h --exclude bundlewelsenc.cpp)
--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -52,9 +52,6 @@
 typedef void_t (*PDestroyDecoderFunc)(ISVCDecoder* pDecoder);
 
 
-#if defined(__APPLE__)
-#include "dec_console.h"
-#endif
 using namespace std;
 
 //using namespace WelsDec;
@@ -346,11 +343,7 @@
 }
 
 
-#if !defined(__APPLE__)
 int32_t main(int32_t iArgC, char* pArgV[])
-#else
-int32_t DecoderMain(int32_t iArgC, char * pArgV[])
-#endif
 {
 	ISVCDecoder *pDecoder = NULL;
 
@@ -488,18 +481,6 @@
 	}
 
 
-#elif defined(__APPLE__)
-
-
-	bool flag_load_bundle = load_bundle_welsdec();
-	
-	get_functions_address_create_decoder(&pDecoder);
-	
-	if (flag_load_bundle == false) {
-		printf( "Create Decoder failed.\n" );
-		return NULL;
-	}	
-
 #else
 
 
@@ -535,8 +516,6 @@
 		
 #if defined(_MSC_VER)
 		pDestroyDecoderFunc( pDecoder );
-#elif defined(__APPLE__)
-		get_functions_address_free_decoder(pDecoder);
 #else
 		DestroyDecoder(pDecoder);
 #endif
--- /dev/null
+++ b/codec/console/dec/targets.mk
@@ -1,0 +1,29 @@
+H264DEC_PREFIX=H264DEC
+H264DEC_SRCDIR=codec/console/dec
+H264DEC_CPP_SRCS=\
+	$(H264DEC_SRCDIR)/./src/d3d9_utils.cpp\
+	$(H264DEC_SRCDIR)/./src/h264dec.cpp\
+	$(H264DEC_SRCDIR)/./src/read_config.cpp\
+
+H264DEC_OBJS += $(H264DEC_CPP_SRCS:.cpp=.o)
+ifdef USE_ASM
+H264DEC_ASM_SRCS=\
+
+H264DEC_OBJS += $(H264DEC_ASM_SRCS:.asm=.o)
+endif
+
+OBJS += $(H264DEC_OBJS)
+$(H264DEC_SRCDIR)/./src/d3d9_utils.o: $(H264DEC_SRCDIR)/./src/d3d9_utils.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c -o $(H264DEC_SRCDIR)/./src/d3d9_utils.o $(H264DEC_SRCDIR)/./src/d3d9_utils.cpp
+
+$(H264DEC_SRCDIR)/./src/h264dec.o: $(H264DEC_SRCDIR)/./src/h264dec.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c -o $(H264DEC_SRCDIR)/./src/h264dec.o $(H264DEC_SRCDIR)/./src/h264dec.cpp
+
+$(H264DEC_SRCDIR)/./src/read_config.o: $(H264DEC_SRCDIR)/./src/read_config.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c -o $(H264DEC_SRCDIR)/./src/read_config.o $(H264DEC_SRCDIR)/./src/read_config.cpp
+
+h264dec: $(H264DEC_OBJS) $(LIBS) $(H264DEC_LIBS)
+	$(CXX) -o $@  $(H264DEC_OBJS) $(H264DEC_LDFLAGS) $(H264DEC_LIBS) $(LDFLAGS) $(LIBS)
+
+binaries: h264dec
+BINARIES += h264dec
--- /dev/null
+++ b/codec/console/enc/targets.mk
@@ -1,0 +1,25 @@
+H264ENC_PREFIX=H264ENC
+H264ENC_SRCDIR=codec/console/enc
+H264ENC_CPP_SRCS=\
+	$(H264ENC_SRCDIR)/./src/read_config.cpp\
+	$(H264ENC_SRCDIR)/./src/welsenc.cpp\
+
+H264ENC_OBJS += $(H264ENC_CPP_SRCS:.cpp=.o)
+ifdef USE_ASM
+H264ENC_ASM_SRCS=\
+
+H264ENC_OBJS += $(H264ENC_ASM_SRCS:.asm=.o)
+endif
+
+OBJS += $(H264ENC_OBJS)
+$(H264ENC_SRCDIR)/./src/read_config.o: $(H264ENC_SRCDIR)/./src/read_config.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264ENC_CFLAGS) $(H264ENC_INCLUDES) -c -o $(H264ENC_SRCDIR)/./src/read_config.o $(H264ENC_SRCDIR)/./src/read_config.cpp
+
+$(H264ENC_SRCDIR)/./src/welsenc.o: $(H264ENC_SRCDIR)/./src/welsenc.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264ENC_CFLAGS) $(H264ENC_INCLUDES) -c -o $(H264ENC_SRCDIR)/./src/welsenc.o $(H264ENC_SRCDIR)/./src/welsenc.cpp
+
+h264enc: $(H264ENC_OBJS) $(LIBS) $(H264ENC_LIBS)
+	$(CXX) -o $@  $(H264ENC_OBJS) $(H264ENC_LDFLAGS) $(H264ENC_LIBS) $(LDFLAGS) $(LIBS)
+
+binaries: h264enc
+BINARIES += h264enc
--- /dev/null
+++ b/codec/decoder/targets.mk
@@ -1,0 +1,121 @@
+DECODER_PREFIX=DECODER
+DECODER_SRCDIR=codec/decoder
+DECODER_CPP_SRCS=\
+	$(DECODER_SRCDIR)/./core/src/au_parser.cpp\
+	$(DECODER_SRCDIR)/./core/src/bit_stream.cpp\
+	$(DECODER_SRCDIR)/./core/src/cpu.cpp\
+	$(DECODER_SRCDIR)/./core/src/deblocking.cpp\
+	$(DECODER_SRCDIR)/./core/src/decode_mb_aux.cpp\
+	$(DECODER_SRCDIR)/./core/src/decode_slice.cpp\
+	$(DECODER_SRCDIR)/./core/src/decoder.cpp\
+	$(DECODER_SRCDIR)/./core/src/decoder_core.cpp\
+	$(DECODER_SRCDIR)/./core/src/decoder_data_tables.cpp\
+	$(DECODER_SRCDIR)/./core/src/expand_pic.cpp\
+	$(DECODER_SRCDIR)/./core/src/fmo.cpp\
+	$(DECODER_SRCDIR)/./core/src/get_intra_predictor.cpp\
+	$(DECODER_SRCDIR)/./core/src/manage_dec_ref.cpp\
+	$(DECODER_SRCDIR)/./core/src/mc.cpp\
+	$(DECODER_SRCDIR)/./core/src/mem_align.cpp\
+	$(DECODER_SRCDIR)/./core/src/memmgr_nal_unit.cpp\
+	$(DECODER_SRCDIR)/./core/src/mv_pred.cpp\
+	$(DECODER_SRCDIR)/./core/src/parse_mb_syn_cavlc.cpp\
+	$(DECODER_SRCDIR)/./core/src/pic_queue.cpp\
+	$(DECODER_SRCDIR)/./core/src/rec_mb.cpp\
+	$(DECODER_SRCDIR)/./core/src/utils.cpp\
+	$(DECODER_SRCDIR)/./plus/src/welsCodecTrace.cpp\
+	$(DECODER_SRCDIR)/./plus/src/welsDecoderExt.cpp\
+
+DECODER_OBJS += $(DECODER_CPP_SRCS:.cpp=.o)
+ifdef USE_ASM
+DECODER_ASM_SRCS=\
+	$(DECODER_SRCDIR)/./core/asm/asm_inc.asm\
+	$(DECODER_SRCDIR)/./core/asm/block_add.asm\
+	$(DECODER_SRCDIR)/./core/asm/cpuid.asm\
+	$(DECODER_SRCDIR)/./core/asm/dct.asm\
+	$(DECODER_SRCDIR)/./core/asm/deblock.asm\
+	$(DECODER_SRCDIR)/./core/asm/expand_picture.asm\
+	$(DECODER_SRCDIR)/./core/asm/intra_pred.asm\
+	$(DECODER_SRCDIR)/./core/asm/mb_copy.asm\
+	$(DECODER_SRCDIR)/./core/asm/mc_chroma.asm\
+	$(DECODER_SRCDIR)/./core/asm/mc_luma.asm\
+	$(DECODER_SRCDIR)/./core/asm/memzero.asm\
+
+DECODER_OBJS += $(DECODER_ASM_SRCS:.asm=.o)
+endif
+
+OBJS += $(DECODER_OBJS)
+$(DECODER_SRCDIR)/./core/src/au_parser.o: $(DECODER_SRCDIR)/./core/src/au_parser.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/au_parser.o $(DECODER_SRCDIR)/./core/src/au_parser.cpp
+
+$(DECODER_SRCDIR)/./core/src/bit_stream.o: $(DECODER_SRCDIR)/./core/src/bit_stream.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/bit_stream.o $(DECODER_SRCDIR)/./core/src/bit_stream.cpp
+
+$(DECODER_SRCDIR)/./core/src/cpu.o: $(DECODER_SRCDIR)/./core/src/cpu.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/cpu.o $(DECODER_SRCDIR)/./core/src/cpu.cpp
+
+$(DECODER_SRCDIR)/./core/src/deblocking.o: $(DECODER_SRCDIR)/./core/src/deblocking.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/deblocking.o $(DECODER_SRCDIR)/./core/src/deblocking.cpp
+
+$(DECODER_SRCDIR)/./core/src/decode_mb_aux.o: $(DECODER_SRCDIR)/./core/src/decode_mb_aux.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/decode_mb_aux.o $(DECODER_SRCDIR)/./core/src/decode_mb_aux.cpp
+
+$(DECODER_SRCDIR)/./core/src/decode_slice.o: $(DECODER_SRCDIR)/./core/src/decode_slice.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/decode_slice.o $(DECODER_SRCDIR)/./core/src/decode_slice.cpp
+
+$(DECODER_SRCDIR)/./core/src/decoder.o: $(DECODER_SRCDIR)/./core/src/decoder.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/decoder.o $(DECODER_SRCDIR)/./core/src/decoder.cpp
+
+$(DECODER_SRCDIR)/./core/src/decoder_core.o: $(DECODER_SRCDIR)/./core/src/decoder_core.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/decoder_core.o $(DECODER_SRCDIR)/./core/src/decoder_core.cpp
+
+$(DECODER_SRCDIR)/./core/src/decoder_data_tables.o: $(DECODER_SRCDIR)/./core/src/decoder_data_tables.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/decoder_data_tables.o $(DECODER_SRCDIR)/./core/src/decoder_data_tables.cpp
+
+$(DECODER_SRCDIR)/./core/src/expand_pic.o: $(DECODER_SRCDIR)/./core/src/expand_pic.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/expand_pic.o $(DECODER_SRCDIR)/./core/src/expand_pic.cpp
+
+$(DECODER_SRCDIR)/./core/src/fmo.o: $(DECODER_SRCDIR)/./core/src/fmo.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/fmo.o $(DECODER_SRCDIR)/./core/src/fmo.cpp
+
+$(DECODER_SRCDIR)/./core/src/get_intra_predictor.o: $(DECODER_SRCDIR)/./core/src/get_intra_predictor.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/get_intra_predictor.o $(DECODER_SRCDIR)/./core/src/get_intra_predictor.cpp
+
+$(DECODER_SRCDIR)/./core/src/manage_dec_ref.o: $(DECODER_SRCDIR)/./core/src/manage_dec_ref.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/manage_dec_ref.o $(DECODER_SRCDIR)/./core/src/manage_dec_ref.cpp
+
+$(DECODER_SRCDIR)/./core/src/mc.o: $(DECODER_SRCDIR)/./core/src/mc.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/mc.o $(DECODER_SRCDIR)/./core/src/mc.cpp
+
+$(DECODER_SRCDIR)/./core/src/mem_align.o: $(DECODER_SRCDIR)/./core/src/mem_align.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/mem_align.o $(DECODER_SRCDIR)/./core/src/mem_align.cpp
+
+$(DECODER_SRCDIR)/./core/src/memmgr_nal_unit.o: $(DECODER_SRCDIR)/./core/src/memmgr_nal_unit.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/memmgr_nal_unit.o $(DECODER_SRCDIR)/./core/src/memmgr_nal_unit.cpp
+
+$(DECODER_SRCDIR)/./core/src/mv_pred.o: $(DECODER_SRCDIR)/./core/src/mv_pred.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/mv_pred.o $(DECODER_SRCDIR)/./core/src/mv_pred.cpp
+
+$(DECODER_SRCDIR)/./core/src/parse_mb_syn_cavlc.o: $(DECODER_SRCDIR)/./core/src/parse_mb_syn_cavlc.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/parse_mb_syn_cavlc.o $(DECODER_SRCDIR)/./core/src/parse_mb_syn_cavlc.cpp
+
+$(DECODER_SRCDIR)/./core/src/pic_queue.o: $(DECODER_SRCDIR)/./core/src/pic_queue.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/pic_queue.o $(DECODER_SRCDIR)/./core/src/pic_queue.cpp
+
+$(DECODER_SRCDIR)/./core/src/rec_mb.o: $(DECODER_SRCDIR)/./core/src/rec_mb.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/rec_mb.o $(DECODER_SRCDIR)/./core/src/rec_mb.cpp
+
+$(DECODER_SRCDIR)/./core/src/utils.o: $(DECODER_SRCDIR)/./core/src/utils.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./core/src/utils.o $(DECODER_SRCDIR)/./core/src/utils.cpp
+
+$(DECODER_SRCDIR)/./plus/src/welsCodecTrace.o: $(DECODER_SRCDIR)/./plus/src/welsCodecTrace.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./plus/src/welsCodecTrace.o $(DECODER_SRCDIR)/./plus/src/welsCodecTrace.cpp
+
+$(DECODER_SRCDIR)/./plus/src/welsDecoderExt.o: $(DECODER_SRCDIR)/./plus/src/welsDecoderExt.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c -o $(DECODER_SRCDIR)/./plus/src/welsDecoderExt.o $(DECODER_SRCDIR)/./plus/src/welsDecoderExt.cpp
+
+$(LIBPREFIX)decoder.$(LIBSUFFIX): $(DECODER_OBJS)
+	rm -f $(LIBPREFIX)decoder.$(LIBSUFFIX)
+	ar cr $@ $(DECODER_OBJS)
+
+libraries: $(LIBPREFIX)decoder.$(LIBSUFFIX)
+LIBRARIES += $(LIBPREFIX)decoder.$(LIBSUFFIX)
--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -50,11 +50,16 @@
 #include "encoder_context.h"
 #include "utils.h"
 
+#ifdef NO_DYNAMIC_VP
+EResult WELSAPI CreateVpInterface  (void **ppCtx, int iVersion);
+EResult WELSAPI DestroyVpInterface  (void **ppCtx, int iVersion);
+#endif
 
 namespace WelsSVCEnc {
 
 #define WelsSafeDelete(p) if(p){ delete (p); (p) = NULL; }
 
+
 //***** entry API declaration ************************************************************************//
 typedef EResult (WELSAPI *pfnCreateVpInterface)  (void **, int );
 typedef EResult (WELSAPI *pfnDestroyVpInterface) (void * , int );
@@ -87,6 +92,8 @@
 CWelsLib::CWelsLib(void *pEncCtx)
 {
 	m_pInterface[0] = m_pInterface[1] = NULL;
+
+#ifndef NO_DYNAMIC_VP
 #if defined(WIN32)
 	const str_t WelsVPLib[] = "welsvp.dll";
 	HMODULE shModule = LoadLibrary(WelsVPLib);
@@ -111,6 +118,7 @@
 #endif
 
 	m_pVpLib = (void *)shModule;
+#endif
 }
 
 CWelsLib::~CWelsLib()
@@ -136,6 +144,7 @@
 void* CWelsLib::QueryFunction(const str_t *pName)
 {
 	void *pFunc = NULL;
+
 	if (m_pVpLib)
 	{
 #if defined(WIN32)
@@ -158,13 +167,22 @@
 
 int32_t CWelsLib::CreateIface(void **ppEncCtx)
 {
+#ifndef NO_DYNAMIC_VP
 	if (m_pVpLib)
 	{
+
+#endif
 		pfnCreateVpInterface  pCreateVpInterface  = NULL;
 		pfnDestroyVpInterface pDestroyVpInterface = NULL;
 
+#ifndef NO_DYNAMIC_VP
 		pCreateVpInterface  = (pfnCreateVpInterface)  QueryFunction("CreateVpInterface");
 		pDestroyVpInterface = (pfnDestroyVpInterface) QueryFunction("DestroyVpInterface");
+#else
+		pCreateVpInterface  = CreateVpInterface;
+		// TODO([email protected]): This cast corrects a signature difference... This is a potential real problem
+		pDestroyVpInterface = (pfnDestroyVpInterface)DestroyVpInterface;
+#endif
 
 		m_pInterface[0] = (void *)pCreateVpInterface;
 		m_pInterface[1] = (void *)pDestroyVpInterface;
@@ -171,10 +189,12 @@
 
 		if (m_pInterface[0] && m_pInterface[1])
 			pCreateVpInterface(ppEncCtx, WELSVP_INTERFACE_VERION);
+#ifndef NO_DYNAMIC_VP
 	}
 	else
 	{
 	}	
+#endif
 
 	return ppEncCtx ? 0 : 1;
 }
--- /dev/null
+++ b/codec/encoder/targets.mk
@@ -1,0 +1,166 @@
+ENCODER_PREFIX=ENCODER
+ENCODER_SRCDIR=codec/encoder
+ENCODER_CPP_SRCS=\
+	$(ENCODER_SRCDIR)/./core/src/au_set.cpp\
+	$(ENCODER_SRCDIR)/./core/src/cpu.cpp\
+	$(ENCODER_SRCDIR)/./core/src/deblocking.cpp\
+	$(ENCODER_SRCDIR)/./core/src/decode_mb_aux.cpp\
+	$(ENCODER_SRCDIR)/./core/src/encode_mb_aux.cpp\
+	$(ENCODER_SRCDIR)/./core/src/encoder.cpp\
+	$(ENCODER_SRCDIR)/./core/src/encoder_data_tables.cpp\
+	$(ENCODER_SRCDIR)/./core/src/encoder_ext.cpp\
+	$(ENCODER_SRCDIR)/./core/src/expand_pic.cpp\
+	$(ENCODER_SRCDIR)/./core/src/get_intra_predictor.cpp\
+	$(ENCODER_SRCDIR)/./core/src/mc.cpp\
+	$(ENCODER_SRCDIR)/./core/src/md.cpp\
+	$(ENCODER_SRCDIR)/./core/src/memory_align.cpp\
+	$(ENCODER_SRCDIR)/./core/src/mv_pred.cpp\
+	$(ENCODER_SRCDIR)/./core/src/nal_encap.cpp\
+	$(ENCODER_SRCDIR)/./core/src/picture_handle.cpp\
+	$(ENCODER_SRCDIR)/./core/src/property.cpp\
+	$(ENCODER_SRCDIR)/./core/src/ratectl.cpp\
+	$(ENCODER_SRCDIR)/./core/src/ref_list_mgr_svc.cpp\
+	$(ENCODER_SRCDIR)/./core/src/sample.cpp\
+	$(ENCODER_SRCDIR)/./core/src/set_mb_syn_cavlc.cpp\
+	$(ENCODER_SRCDIR)/./core/src/slice_multi_threading.cpp\
+	$(ENCODER_SRCDIR)/./core/src/svc_base_layer_md.cpp\
+	$(ENCODER_SRCDIR)/./core/src/svc_enc_slice_segment.cpp\
+	$(ENCODER_SRCDIR)/./core/src/svc_encode_mb.cpp\
+	$(ENCODER_SRCDIR)/./core/src/svc_encode_slice.cpp\
+	$(ENCODER_SRCDIR)/./core/src/svc_mode_decision.cpp\
+	$(ENCODER_SRCDIR)/./core/src/svc_motion_estimate.cpp\
+	$(ENCODER_SRCDIR)/./core/src/svc_set_mb_syn_cavlc.cpp\
+	$(ENCODER_SRCDIR)/./core/src/utils.cpp\
+	$(ENCODER_SRCDIR)/./core/src/wels_preprocess.cpp\
+	$(ENCODER_SRCDIR)/./plus/src/welsCodecTrace.cpp\
+	$(ENCODER_SRCDIR)/./plus/src/welsEncoderExt.cpp\
+
+ENCODER_OBJS += $(ENCODER_CPP_SRCS:.cpp=.o)
+ifdef USE_ASM
+ENCODER_ASM_SRCS=\
+	$(ENCODER_SRCDIR)/./core/asm/asm_inc.asm\
+	$(ENCODER_SRCDIR)/./core/asm/coeff.asm\
+	$(ENCODER_SRCDIR)/./core/asm/cpuid.asm\
+	$(ENCODER_SRCDIR)/./core/asm/dct.asm\
+	$(ENCODER_SRCDIR)/./core/asm/deblock.asm\
+	$(ENCODER_SRCDIR)/./core/asm/expand_picture.asm\
+	$(ENCODER_SRCDIR)/./core/asm/intra_pred.asm\
+	$(ENCODER_SRCDIR)/./core/asm/intra_pred_util.asm\
+	$(ENCODER_SRCDIR)/./core/asm/mb_copy.asm\
+	$(ENCODER_SRCDIR)/./core/asm/mc_chroma.asm\
+	$(ENCODER_SRCDIR)/./core/asm/mc_luma.asm\
+	$(ENCODER_SRCDIR)/./core/asm/memzero.asm\
+	$(ENCODER_SRCDIR)/./core/asm/quant.asm\
+	$(ENCODER_SRCDIR)/./core/asm/satd_sad.asm\
+	$(ENCODER_SRCDIR)/./core/asm/score.asm\
+	$(ENCODER_SRCDIR)/./core/asm/vaa.asm\
+
+ENCODER_OBJS += $(ENCODER_ASM_SRCS:.asm=.o)
+endif
+
+OBJS += $(ENCODER_OBJS)
+$(ENCODER_SRCDIR)/./core/src/au_set.o: $(ENCODER_SRCDIR)/./core/src/au_set.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/au_set.o $(ENCODER_SRCDIR)/./core/src/au_set.cpp
+
+$(ENCODER_SRCDIR)/./core/src/cpu.o: $(ENCODER_SRCDIR)/./core/src/cpu.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/cpu.o $(ENCODER_SRCDIR)/./core/src/cpu.cpp
+
+$(ENCODER_SRCDIR)/./core/src/deblocking.o: $(ENCODER_SRCDIR)/./core/src/deblocking.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/deblocking.o $(ENCODER_SRCDIR)/./core/src/deblocking.cpp
+
+$(ENCODER_SRCDIR)/./core/src/decode_mb_aux.o: $(ENCODER_SRCDIR)/./core/src/decode_mb_aux.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/decode_mb_aux.o $(ENCODER_SRCDIR)/./core/src/decode_mb_aux.cpp
+
+$(ENCODER_SRCDIR)/./core/src/encode_mb_aux.o: $(ENCODER_SRCDIR)/./core/src/encode_mb_aux.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/encode_mb_aux.o $(ENCODER_SRCDIR)/./core/src/encode_mb_aux.cpp
+
+$(ENCODER_SRCDIR)/./core/src/encoder.o: $(ENCODER_SRCDIR)/./core/src/encoder.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/encoder.o $(ENCODER_SRCDIR)/./core/src/encoder.cpp
+
+$(ENCODER_SRCDIR)/./core/src/encoder_data_tables.o: $(ENCODER_SRCDIR)/./core/src/encoder_data_tables.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/encoder_data_tables.o $(ENCODER_SRCDIR)/./core/src/encoder_data_tables.cpp
+
+$(ENCODER_SRCDIR)/./core/src/encoder_ext.o: $(ENCODER_SRCDIR)/./core/src/encoder_ext.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/encoder_ext.o $(ENCODER_SRCDIR)/./core/src/encoder_ext.cpp
+
+$(ENCODER_SRCDIR)/./core/src/expand_pic.o: $(ENCODER_SRCDIR)/./core/src/expand_pic.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/expand_pic.o $(ENCODER_SRCDIR)/./core/src/expand_pic.cpp
+
+$(ENCODER_SRCDIR)/./core/src/get_intra_predictor.o: $(ENCODER_SRCDIR)/./core/src/get_intra_predictor.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/get_intra_predictor.o $(ENCODER_SRCDIR)/./core/src/get_intra_predictor.cpp
+
+$(ENCODER_SRCDIR)/./core/src/mc.o: $(ENCODER_SRCDIR)/./core/src/mc.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/mc.o $(ENCODER_SRCDIR)/./core/src/mc.cpp
+
+$(ENCODER_SRCDIR)/./core/src/md.o: $(ENCODER_SRCDIR)/./core/src/md.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/md.o $(ENCODER_SRCDIR)/./core/src/md.cpp
+
+$(ENCODER_SRCDIR)/./core/src/memory_align.o: $(ENCODER_SRCDIR)/./core/src/memory_align.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/memory_align.o $(ENCODER_SRCDIR)/./core/src/memory_align.cpp
+
+$(ENCODER_SRCDIR)/./core/src/mv_pred.o: $(ENCODER_SRCDIR)/./core/src/mv_pred.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/mv_pred.o $(ENCODER_SRCDIR)/./core/src/mv_pred.cpp
+
+$(ENCODER_SRCDIR)/./core/src/nal_encap.o: $(ENCODER_SRCDIR)/./core/src/nal_encap.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/nal_encap.o $(ENCODER_SRCDIR)/./core/src/nal_encap.cpp
+
+$(ENCODER_SRCDIR)/./core/src/picture_handle.o: $(ENCODER_SRCDIR)/./core/src/picture_handle.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/picture_handle.o $(ENCODER_SRCDIR)/./core/src/picture_handle.cpp
+
+$(ENCODER_SRCDIR)/./core/src/property.o: $(ENCODER_SRCDIR)/./core/src/property.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/property.o $(ENCODER_SRCDIR)/./core/src/property.cpp
+
+$(ENCODER_SRCDIR)/./core/src/ratectl.o: $(ENCODER_SRCDIR)/./core/src/ratectl.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/ratectl.o $(ENCODER_SRCDIR)/./core/src/ratectl.cpp
+
+$(ENCODER_SRCDIR)/./core/src/ref_list_mgr_svc.o: $(ENCODER_SRCDIR)/./core/src/ref_list_mgr_svc.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/ref_list_mgr_svc.o $(ENCODER_SRCDIR)/./core/src/ref_list_mgr_svc.cpp
+
+$(ENCODER_SRCDIR)/./core/src/sample.o: $(ENCODER_SRCDIR)/./core/src/sample.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/sample.o $(ENCODER_SRCDIR)/./core/src/sample.cpp
+
+$(ENCODER_SRCDIR)/./core/src/set_mb_syn_cavlc.o: $(ENCODER_SRCDIR)/./core/src/set_mb_syn_cavlc.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/set_mb_syn_cavlc.o $(ENCODER_SRCDIR)/./core/src/set_mb_syn_cavlc.cpp
+
+$(ENCODER_SRCDIR)/./core/src/slice_multi_threading.o: $(ENCODER_SRCDIR)/./core/src/slice_multi_threading.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/slice_multi_threading.o $(ENCODER_SRCDIR)/./core/src/slice_multi_threading.cpp
+
+$(ENCODER_SRCDIR)/./core/src/svc_base_layer_md.o: $(ENCODER_SRCDIR)/./core/src/svc_base_layer_md.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/svc_base_layer_md.o $(ENCODER_SRCDIR)/./core/src/svc_base_layer_md.cpp
+
+$(ENCODER_SRCDIR)/./core/src/svc_enc_slice_segment.o: $(ENCODER_SRCDIR)/./core/src/svc_enc_slice_segment.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/svc_enc_slice_segment.o $(ENCODER_SRCDIR)/./core/src/svc_enc_slice_segment.cpp
+
+$(ENCODER_SRCDIR)/./core/src/svc_encode_mb.o: $(ENCODER_SRCDIR)/./core/src/svc_encode_mb.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/svc_encode_mb.o $(ENCODER_SRCDIR)/./core/src/svc_encode_mb.cpp
+
+$(ENCODER_SRCDIR)/./core/src/svc_encode_slice.o: $(ENCODER_SRCDIR)/./core/src/svc_encode_slice.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/svc_encode_slice.o $(ENCODER_SRCDIR)/./core/src/svc_encode_slice.cpp
+
+$(ENCODER_SRCDIR)/./core/src/svc_mode_decision.o: $(ENCODER_SRCDIR)/./core/src/svc_mode_decision.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/svc_mode_decision.o $(ENCODER_SRCDIR)/./core/src/svc_mode_decision.cpp
+
+$(ENCODER_SRCDIR)/./core/src/svc_motion_estimate.o: $(ENCODER_SRCDIR)/./core/src/svc_motion_estimate.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/svc_motion_estimate.o $(ENCODER_SRCDIR)/./core/src/svc_motion_estimate.cpp
+
+$(ENCODER_SRCDIR)/./core/src/svc_set_mb_syn_cavlc.o: $(ENCODER_SRCDIR)/./core/src/svc_set_mb_syn_cavlc.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/svc_set_mb_syn_cavlc.o $(ENCODER_SRCDIR)/./core/src/svc_set_mb_syn_cavlc.cpp
+
+$(ENCODER_SRCDIR)/./core/src/utils.o: $(ENCODER_SRCDIR)/./core/src/utils.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/utils.o $(ENCODER_SRCDIR)/./core/src/utils.cpp
+
+$(ENCODER_SRCDIR)/./core/src/wels_preprocess.o: $(ENCODER_SRCDIR)/./core/src/wels_preprocess.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./core/src/wels_preprocess.o $(ENCODER_SRCDIR)/./core/src/wels_preprocess.cpp
+
+$(ENCODER_SRCDIR)/./plus/src/welsCodecTrace.o: $(ENCODER_SRCDIR)/./plus/src/welsCodecTrace.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./plus/src/welsCodecTrace.o $(ENCODER_SRCDIR)/./plus/src/welsCodecTrace.cpp
+
+$(ENCODER_SRCDIR)/./plus/src/welsEncoderExt.o: $(ENCODER_SRCDIR)/./plus/src/welsEncoderExt.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c -o $(ENCODER_SRCDIR)/./plus/src/welsEncoderExt.o $(ENCODER_SRCDIR)/./plus/src/welsEncoderExt.cpp
+
+$(LIBPREFIX)encoder.$(LIBSUFFIX): $(ENCODER_OBJS)
+	rm -f $(LIBPREFIX)encoder.$(LIBSUFFIX)
+	ar cr $@ $(ENCODER_OBJS)
+
+libraries: $(LIBPREFIX)encoder.$(LIBSUFFIX)
+LIBRARIES += $(LIBPREFIX)encoder.$(LIBSUFFIX)
--- a/processing/src/common/WelsFrameWork.cpp
+++ b/processing/src/common/WelsFrameWork.cpp
@@ -93,8 +93,12 @@
 
 CVpFrameWork::CVpFrameWork(uint32_t uiThreadsNum, EResult &eReturn)
 {
-	int32_t iCoreNum = 0;
+	int32_t iCoreNum = 1;
+#ifndef X86_ASM
+	uint32_t uiCPUFlag = 0;
+#else
 	uint32_t uiCPUFlag = WelsCPUFeatureDetect(&iCoreNum);
+#endif
 
 	for (int32_t i = 0; i < MAX_STRATEGY_NUM; i++)
 	{
--- /dev/null
+++ b/processing/targets.mk
@@ -1,0 +1,105 @@
+PROCESSING_PREFIX=PROCESSING
+PROCESSING_SRCDIR=processing
+PROCESSING_CPP_SRCS=\
+	$(PROCESSING_SRCDIR)/./src/adaptivequantization/AdaptiveQuantization.cpp\
+	$(PROCESSING_SRCDIR)/./src/backgounddetection/BackgroundDetection.cpp\
+	$(PROCESSING_SRCDIR)/./src/common/cpu.cpp\
+	$(PROCESSING_SRCDIR)/./src/common/memory.cpp\
+	$(PROCESSING_SRCDIR)/./src/common/thread.cpp\
+	$(PROCESSING_SRCDIR)/./src/common/util.cpp\
+	$(PROCESSING_SRCDIR)/./src/common/WelsFrameWork.cpp\
+	$(PROCESSING_SRCDIR)/./src/common/WelsFrameWorkEx.cpp\
+	$(PROCESSING_SRCDIR)/./src/complexityanalysis/ComplexityAnalysis.cpp\
+	$(PROCESSING_SRCDIR)/./src/denoise/denoise.cpp\
+	$(PROCESSING_SRCDIR)/./src/denoise/denoise_filter.cpp\
+	$(PROCESSING_SRCDIR)/./src/downsample/downsample.cpp\
+	$(PROCESSING_SRCDIR)/./src/downsample/downsamplefuncs.cpp\
+	$(PROCESSING_SRCDIR)/./src/imagerotate/imagerotate.cpp\
+	$(PROCESSING_SRCDIR)/./src/imagerotate/imagerotatefuncs.cpp\
+	$(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetection.cpp\
+	$(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.cpp\
+	$(PROCESSING_SRCDIR)/./src/testbed/stdafx.cpp\
+	$(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.cpp\
+	$(PROCESSING_SRCDIR)/./src/vaacalc/vaacalculation.cpp\
+
+PROCESSING_OBJS += $(PROCESSING_CPP_SRCS:.cpp=.o)
+ifdef USE_ASM
+PROCESSING_ASM_SRCS=\
+	$(PROCESSING_SRCDIR)/./src/asm/asm_inc.asm\
+	$(PROCESSING_SRCDIR)/./src/asm/cpuid.asm\
+	$(PROCESSING_SRCDIR)/./src/asm/denoisefilter.asm\
+	$(PROCESSING_SRCDIR)/./src/asm/downsample_bilinear.asm\
+	$(PROCESSING_SRCDIR)/./src/asm/intra_pred.asm\
+	$(PROCESSING_SRCDIR)/./src/asm/sad.asm\
+	$(PROCESSING_SRCDIR)/./src/asm/vaa.asm\
+
+PROCESSING_OBJS += $(PROCESSING_ASM_SRCS:.asm=.o)
+endif
+
+OBJS += $(PROCESSING_OBJS)
+$(PROCESSING_SRCDIR)/./src/adaptivequantization/AdaptiveQuantization.o: $(PROCESSING_SRCDIR)/./src/adaptivequantization/AdaptiveQuantization.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/adaptivequantization/AdaptiveQuantization.o $(PROCESSING_SRCDIR)/./src/adaptivequantization/AdaptiveQuantization.cpp
+
+$(PROCESSING_SRCDIR)/./src/backgounddetection/BackgroundDetection.o: $(PROCESSING_SRCDIR)/./src/backgounddetection/BackgroundDetection.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/backgounddetection/BackgroundDetection.o $(PROCESSING_SRCDIR)/./src/backgounddetection/BackgroundDetection.cpp
+
+$(PROCESSING_SRCDIR)/./src/common/cpu.o: $(PROCESSING_SRCDIR)/./src/common/cpu.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/common/cpu.o $(PROCESSING_SRCDIR)/./src/common/cpu.cpp
+
+$(PROCESSING_SRCDIR)/./src/common/memory.o: $(PROCESSING_SRCDIR)/./src/common/memory.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/common/memory.o $(PROCESSING_SRCDIR)/./src/common/memory.cpp
+
+$(PROCESSING_SRCDIR)/./src/common/thread.o: $(PROCESSING_SRCDIR)/./src/common/thread.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/common/thread.o $(PROCESSING_SRCDIR)/./src/common/thread.cpp
+
+$(PROCESSING_SRCDIR)/./src/common/util.o: $(PROCESSING_SRCDIR)/./src/common/util.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/common/util.o $(PROCESSING_SRCDIR)/./src/common/util.cpp
+
+$(PROCESSING_SRCDIR)/./src/common/WelsFrameWork.o: $(PROCESSING_SRCDIR)/./src/common/WelsFrameWork.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/common/WelsFrameWork.o $(PROCESSING_SRCDIR)/./src/common/WelsFrameWork.cpp
+
+$(PROCESSING_SRCDIR)/./src/common/WelsFrameWorkEx.o: $(PROCESSING_SRCDIR)/./src/common/WelsFrameWorkEx.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/common/WelsFrameWorkEx.o $(PROCESSING_SRCDIR)/./src/common/WelsFrameWorkEx.cpp
+
+$(PROCESSING_SRCDIR)/./src/complexityanalysis/ComplexityAnalysis.o: $(PROCESSING_SRCDIR)/./src/complexityanalysis/ComplexityAnalysis.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/complexityanalysis/ComplexityAnalysis.o $(PROCESSING_SRCDIR)/./src/complexityanalysis/ComplexityAnalysis.cpp
+
+$(PROCESSING_SRCDIR)/./src/denoise/denoise.o: $(PROCESSING_SRCDIR)/./src/denoise/denoise.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/denoise/denoise.o $(PROCESSING_SRCDIR)/./src/denoise/denoise.cpp
+
+$(PROCESSING_SRCDIR)/./src/denoise/denoise_filter.o: $(PROCESSING_SRCDIR)/./src/denoise/denoise_filter.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/denoise/denoise_filter.o $(PROCESSING_SRCDIR)/./src/denoise/denoise_filter.cpp
+
+$(PROCESSING_SRCDIR)/./src/downsample/downsample.o: $(PROCESSING_SRCDIR)/./src/downsample/downsample.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/downsample/downsample.o $(PROCESSING_SRCDIR)/./src/downsample/downsample.cpp
+
+$(PROCESSING_SRCDIR)/./src/downsample/downsamplefuncs.o: $(PROCESSING_SRCDIR)/./src/downsample/downsamplefuncs.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/downsample/downsamplefuncs.o $(PROCESSING_SRCDIR)/./src/downsample/downsamplefuncs.cpp
+
+$(PROCESSING_SRCDIR)/./src/imagerotate/imagerotate.o: $(PROCESSING_SRCDIR)/./src/imagerotate/imagerotate.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/imagerotate/imagerotate.o $(PROCESSING_SRCDIR)/./src/imagerotate/imagerotate.cpp
+
+$(PROCESSING_SRCDIR)/./src/imagerotate/imagerotatefuncs.o: $(PROCESSING_SRCDIR)/./src/imagerotate/imagerotatefuncs.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/imagerotate/imagerotatefuncs.o $(PROCESSING_SRCDIR)/./src/imagerotate/imagerotatefuncs.cpp
+
+$(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetection.o: $(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetection.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetection.o $(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetection.cpp
+
+$(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.o: $(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.o $(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.cpp
+
+$(PROCESSING_SRCDIR)/./src/testbed/stdafx.o: $(PROCESSING_SRCDIR)/./src/testbed/stdafx.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/testbed/stdafx.o $(PROCESSING_SRCDIR)/./src/testbed/stdafx.cpp
+
+$(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.o: $(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.o $(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.cpp
+
+$(PROCESSING_SRCDIR)/./src/vaacalc/vaacalculation.o: $(PROCESSING_SRCDIR)/./src/vaacalc/vaacalculation.cpp
+	$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/vaacalc/vaacalculation.o $(PROCESSING_SRCDIR)/./src/vaacalc/vaacalculation.cpp
+
+$(LIBPREFIX)processing.$(LIBSUFFIX): $(PROCESSING_OBJS)
+	rm -f $(LIBPREFIX)processing.$(LIBSUFFIX)
+	ar cr $@ $(PROCESSING_OBJS)
+
+libraries: $(LIBPREFIX)processing.$(LIBSUFFIX)
+LIBRARIES += $(LIBPREFIX)processing.$(LIBSUFFIX)