shithub: openh264

Download patch

ref: 0fe477625ca1f119f1b686c9e36c2faba540f0c2
parent: 6b64efbf92476e1f1740ff8242131ba832ba976c
author: zhuiling <lingzhu2@cisco.com>
date: Fri Sep 12 06:25:46 EDT 2014

improve py, and change mk according to mk

--- a/build/mktargets.py
+++ b/build/mktargets.py
@@ -134,7 +134,8 @@
     for cfile in cfiles:
         f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, cfile))
     f.write("\n")
-    f.write("%s_OBJS += $(%s_C_SRCS:.c=.$(OBJ))\n\n"%(PREFIX, PREFIX))
+    f.write("%s_OBJS += $(%s_C_SRCS:.c=.$(OBJ))\n"%(PREFIX, PREFIX))
+   
 
 if len(asm) > 0:
     f.write("%s_ASM_SRCS=\\\n"%(PREFIX))
@@ -141,10 +142,11 @@
     for c in asm:
         f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
     f.write("\n")
-    f.write("%s_OBJSASM += $(%s_ASM_SRCS:.asm=.$(OBJ))\n\n"%(PREFIX, PREFIX))
+    f.write("%s_OBJSASM += $(%s_ASM_SRCS:.asm=.$(OBJ))\n"%(PREFIX, PREFIX))
     f.write("ifeq ($(ASM_ARCH), x86)\n")
     f.write("%s_OBJS += $(%s_OBJSASM)\n"%(PREFIX,PREFIX))
-    f.write("endif\n\n")
+    f.write("endif\n")
+    f.write("OBJS += $(%s_OBJSASM)\n\n"%(PREFIX))
 
 if len(armfiles) > 0:
     f.write("%s_ASM_ARM_SRCS=\\\n"%(PREFIX))
@@ -151,10 +153,11 @@
     for c in armfiles:
         f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
     f.write("\n")
-    f.write("%s_OBJSARM += $(%s_ASM_ARM_SRCS:.S=.$(OBJ))\n\n"%(PREFIX, PREFIX))
+    f.write("%s_OBJSARM += $(%s_ASM_ARM_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
     f.write("ifeq ($(ASM_ARCH), arm)\n")
     f.write("%s_OBJS += $(%s_OBJSARM)\n"%(PREFIX,PREFIX))
-    f.write("endif\n\n")
+    f.write("endif\n")
+    f.write("OBJS += $(%s_OBJSARM)\n\n"%(PREFIX))
 
 if len(arm64files) > 0:
     f.write("%s_ASM_ARM64_SRCS=\\\n"%(PREFIX))
@@ -161,16 +164,13 @@
     for c in arm64files:
         f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c))
     f.write("\n")
-    f.write("%s_OBJSARM64 += $(%s_ASM_ARM64_SRCS:.S=.$(OBJ))\n\n"%(PREFIX, PREFIX))
+    f.write("%s_OBJSARM64 += $(%s_ASM_ARM64_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX))
     f.write("ifeq ($(ASM_ARCH), arm64)\n")
     f.write("%s_OBJS += $(%s_OBJSARM64)\n"%(PREFIX,PREFIX))
-    f.write("endif\n\n")
-
-f.write("OBJS += $(%s_OBJSASM)\n"%(PREFIX))
-f.write("OBJS += $(%s_OBJSARM)\n"%(PREFIX))
-f.write("OBJS += $(%s_OBJSARM64)\n"%(PREFIX))
-f.write("OBJS += $(%s_OBJS)\n"%(PREFIX))
-
+    f.write("endif\n")
+    f.write("OBJS += $(%s_OBJSARM64)\n\n"%(PREFIX))
+    
+f.write("OBJS += $(%s_OBJS)\n\n"%(PREFIX))    
 write_cpp_rule_pattern(f)
 
 if len(cfiles) > 0:
--- a/codec/common/targets.mk
+++ b/codec/common/targets.mk
@@ -13,7 +13,6 @@
 
 COMMON_OBJS += $(COMMON_CPP_SRCS:.cpp=.$(OBJ))
 
-ifeq ($(ASM_ARCH), x86)
 COMMON_ASM_SRCS=\
 	$(COMMON_SRCDIR)/x86/cpuid.asm\
 	$(COMMON_SRCDIR)/x86/deblock.asm\
@@ -24,10 +23,12 @@
 	$(COMMON_SRCDIR)/x86/satd_sad.asm\
 	$(COMMON_SRCDIR)/x86/vaa.asm\
 
-COMMON_OBJS += $(COMMON_ASM_SRCS:.asm=.$(OBJ))
+COMMON_OBJSASM += $(COMMON_ASM_SRCS:.asm=.$(OBJ))
+ifeq ($(ASM_ARCH), x86)
+COMMON_OBJS += $(COMMON_OBJSASM)
 endif
+OBJS += $(COMMON_OBJSASM)
 
-ifeq ($(ASM_ARCH), arm)
 COMMON_ASM_ARM_SRCS=\
 	$(COMMON_SRCDIR)/arm/copy_mb_neon.S\
 	$(COMMON_SRCDIR)/arm/deblocking_neon.S\
@@ -34,10 +35,12 @@
 	$(COMMON_SRCDIR)/arm/expand_picture_neon.S\
 	$(COMMON_SRCDIR)/arm/mc_neon.S\
 
-COMMON_OBJS += $(COMMON_ASM_ARM_SRCS:.S=.$(OBJ))
+COMMON_OBJSARM += $(COMMON_ASM_ARM_SRCS:.S=.$(OBJ))
+ifeq ($(ASM_ARCH), arm)
+COMMON_OBJS += $(COMMON_OBJSARM)
 endif
+OBJS += $(COMMON_OBJSARM)
 
-ifeq ($(ASM_ARCH), arm64)
 COMMON_ASM_ARM64_SRCS=\
 	$(COMMON_SRCDIR)/arm64/copy_mb_aarch64_neon.S\
 	$(COMMON_SRCDIR)/arm64/deblocking_aarch64_neon.S\
@@ -44,10 +47,14 @@
 	$(COMMON_SRCDIR)/arm64/expand_picture_aarch64_neon.S\
 	$(COMMON_SRCDIR)/arm64/mc_aarch64_neon.S\
 
-COMMON_OBJS += $(COMMON_ASM_ARM64_SRCS:.S=.$(OBJ))
+COMMON_OBJSARM64 += $(COMMON_ASM_ARM64_SRCS:.S=.$(OBJ))
+ifeq ($(ASM_ARCH), arm64)
+COMMON_OBJS += $(COMMON_OBJSARM64)
 endif
+OBJS += $(COMMON_OBJSARM64)
 
 OBJS += $(COMMON_OBJS)
+
 $(COMMON_SRCDIR)/%.$(OBJ): $(COMMON_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c $(CXX_O) $<
 
--- a/codec/console/common/targets.mk
+++ b/codec/console/common/targets.mk
@@ -5,6 +5,7 @@
 CONSOLE_COMMON_OBJS += $(CONSOLE_COMMON_CPP_SRCS:.cpp=.$(OBJ))
 
 OBJS += $(CONSOLE_COMMON_OBJS)
+
 $(CONSOLE_COMMON_SRCDIR)/%.$(OBJ): $(CONSOLE_COMMON_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(CONSOLE_COMMON_CFLAGS) $(CONSOLE_COMMON_INCLUDES) -c $(CXX_O) $<
 
--- a/codec/console/dec/targets.mk
+++ b/codec/console/dec/targets.mk
@@ -6,6 +6,7 @@
 H264DEC_OBJS += $(H264DEC_CPP_SRCS:.cpp=.$(OBJ))
 
 OBJS += $(H264DEC_OBJS)
+
 $(H264DEC_SRCDIR)/%.$(OBJ): $(H264DEC_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264DEC_CFLAGS) $(H264DEC_INCLUDES) -c $(CXX_O) $<
 
--- a/codec/console/enc/targets.mk
+++ b/codec/console/enc/targets.mk
@@ -5,6 +5,7 @@
 H264ENC_OBJS += $(H264ENC_CPP_SRCS:.cpp=.$(OBJ))
 
 OBJS += $(H264ENC_OBJS)
+
 $(H264ENC_SRCDIR)/%.$(OBJ): $(H264ENC_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(H264ENC_CFLAGS) $(H264ENC_INCLUDES) -c $(CXX_O) $<
 
--- a/codec/decoder/targets.mk
+++ b/codec/decoder/targets.mk
@@ -23,31 +23,38 @@
 
 DECODER_OBJS += $(DECODER_CPP_SRCS:.cpp=.$(OBJ))
 
-ifeq ($(ASM_ARCH), x86)
 DECODER_ASM_SRCS=\
 	$(DECODER_SRCDIR)/core/x86/dct.asm\
 	$(DECODER_SRCDIR)/core/x86/intra_pred.asm\
 
-DECODER_OBJS += $(DECODER_ASM_SRCS:.asm=.$(OBJ))
+DECODER_OBJSASM += $(DECODER_ASM_SRCS:.asm=.$(OBJ))
+ifeq ($(ASM_ARCH), x86)
+DECODER_OBJS += $(DECODER_OBJSASM)
 endif
+OBJS += $(DECODER_OBJSASM)
 
-ifeq ($(ASM_ARCH), arm)
 DECODER_ASM_ARM_SRCS=\
 	$(DECODER_SRCDIR)/core/arm/block_add_neon.S\
 	$(DECODER_SRCDIR)/core/arm/intra_pred_neon.S\
 
-DECODER_OBJS += $(DECODER_ASM_ARM_SRCS:.S=.$(OBJ))
+DECODER_OBJSARM += $(DECODER_ASM_ARM_SRCS:.S=.$(OBJ))
+ifeq ($(ASM_ARCH), arm)
+DECODER_OBJS += $(DECODER_OBJSARM)
 endif
+OBJS += $(DECODER_OBJSARM)
 
-ifeq ($(ASM_ARCH), arm64)
 DECODER_ASM_ARM64_SRCS=\
 	$(DECODER_SRCDIR)/core/arm64/block_add_aarch64_neon.S\
 	$(DECODER_SRCDIR)/core/arm64/intra_pred_aarch64_neon.S\
 
-DECODER_OBJS += $(DECODER_ASM_ARM64_SRCS:.S=.$(OBJ))
+DECODER_OBJSARM64 += $(DECODER_ASM_ARM64_SRCS:.S=.$(OBJ))
+ifeq ($(ASM_ARCH), arm64)
+DECODER_OBJS += $(DECODER_OBJSARM64)
 endif
+OBJS += $(DECODER_OBJSARM64)
 
 OBJS += $(DECODER_OBJS)
+
 $(DECODER_SRCDIR)/%.$(OBJ): $(DECODER_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_CFLAGS) $(DECODER_INCLUDES) -c $(CXX_O) $<
 
--- a/codec/encoder/targets.mk
+++ b/codec/encoder/targets.mk
@@ -32,7 +32,6 @@
 
 ENCODER_OBJS += $(ENCODER_CPP_SRCS:.cpp=.$(OBJ))
 
-ifeq ($(ASM_ARCH), x86)
 ENCODER_ASM_SRCS=\
 	$(ENCODER_SRCDIR)/core/x86/coeff.asm\
 	$(ENCODER_SRCDIR)/core/x86/dct.asm\
@@ -43,10 +42,12 @@
 	$(ENCODER_SRCDIR)/core/x86/sample_sc.asm\
 	$(ENCODER_SRCDIR)/core/x86/score.asm\
 
-ENCODER_OBJS += $(ENCODER_ASM_SRCS:.asm=.$(OBJ))
+ENCODER_OBJSASM += $(ENCODER_ASM_SRCS:.asm=.$(OBJ))
+ifeq ($(ASM_ARCH), x86)
+ENCODER_OBJS += $(ENCODER_OBJSASM)
 endif
+OBJS += $(ENCODER_OBJSASM)
 
-ifeq ($(ASM_ARCH), arm)
 ENCODER_ASM_ARM_SRCS=\
 	$(ENCODER_SRCDIR)/core/arm/intra_pred_neon.S\
 	$(ENCODER_SRCDIR)/core/arm/intra_pred_sad_3_opt_neon.S\
@@ -55,10 +56,12 @@
 	$(ENCODER_SRCDIR)/core/arm/reconstruct_neon.S\
 	$(ENCODER_SRCDIR)/core/arm/svc_motion_estimation.S\
 
-ENCODER_OBJS += $(ENCODER_ASM_ARM_SRCS:.S=.$(OBJ))
+ENCODER_OBJSARM += $(ENCODER_ASM_ARM_SRCS:.S=.$(OBJ))
+ifeq ($(ASM_ARCH), arm)
+ENCODER_OBJS += $(ENCODER_OBJSARM)
 endif
+OBJS += $(ENCODER_OBJSARM)
 
-ifeq ($(ASM_ARCH), arm64)
 ENCODER_ASM_ARM64_SRCS=\
 	$(ENCODER_SRCDIR)/core/arm64/intra_pred_aarch64_neon.S\
 	$(ENCODER_SRCDIR)/core/arm64/intra_pred_sad_3_opt_aarch64_neon.S\
@@ -67,10 +70,14 @@
 	$(ENCODER_SRCDIR)/core/arm64/reconstruct_aarch64_neon.S\
 	$(ENCODER_SRCDIR)/core/arm64/svc_motion_estimation_aarch64_neon.S\
 
-ENCODER_OBJS += $(ENCODER_ASM_ARM64_SRCS:.S=.$(OBJ))
+ENCODER_OBJSARM64 += $(ENCODER_ASM_ARM64_SRCS:.S=.$(OBJ))
+ifeq ($(ASM_ARCH), arm64)
+ENCODER_OBJS += $(ENCODER_OBJSARM64)
 endif
+OBJS += $(ENCODER_OBJSARM64)
 
 OBJS += $(ENCODER_OBJS)
+
 $(ENCODER_SRCDIR)/%.$(OBJ): $(ENCODER_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_CFLAGS) $(ENCODER_INCLUDES) -c $(CXX_O) $<
 
--- a/codec/processing/targets.mk
+++ b/codec/processing/targets.mk
@@ -21,16 +21,17 @@
 
 PROCESSING_OBJS += $(PROCESSING_CPP_SRCS:.cpp=.$(OBJ))
 
-ifeq ($(ASM_ARCH), x86)
 PROCESSING_ASM_SRCS=\
 	$(PROCESSING_SRCDIR)/src/x86/denoisefilter.asm\
 	$(PROCESSING_SRCDIR)/src/x86/downsample_bilinear.asm\
 	$(PROCESSING_SRCDIR)/src/x86/vaa.asm\
 
-PROCESSING_OBJS += $(PROCESSING_ASM_SRCS:.asm=.$(OBJ))
+PROCESSING_OBJSASM += $(PROCESSING_ASM_SRCS:.asm=.$(OBJ))
+ifeq ($(ASM_ARCH), x86)
+PROCESSING_OBJS += $(PROCESSING_OBJSASM)
 endif
+OBJS += $(PROCESSING_OBJSASM)
 
-ifeq ($(ASM_ARCH), arm)
 PROCESSING_ASM_ARM_SRCS=\
 	$(PROCESSING_SRCDIR)/src/arm/adaptive_quantization.S\
 	$(PROCESSING_SRCDIR)/src/arm/down_sample_neon.S\
@@ -37,10 +38,12 @@
 	$(PROCESSING_SRCDIR)/src/arm/pixel_sad_neon.S\
 	$(PROCESSING_SRCDIR)/src/arm/vaa_calc_neon.S\
 
-PROCESSING_OBJS += $(PROCESSING_ASM_ARM_SRCS:.S=.$(OBJ))
+PROCESSING_OBJSARM += $(PROCESSING_ASM_ARM_SRCS:.S=.$(OBJ))
+ifeq ($(ASM_ARCH), arm)
+PROCESSING_OBJS += $(PROCESSING_OBJSARM)
 endif
+OBJS += $(PROCESSING_OBJSARM)
 
-ifeq ($(ASM_ARCH), arm64)
 PROCESSING_ASM_ARM64_SRCS=\
 	$(PROCESSING_SRCDIR)/src/arm64/adaptive_quantization_aarch64_neon.S\
 	$(PROCESSING_SRCDIR)/src/arm64/down_sample_aarch64_neon.S\
@@ -47,10 +50,14 @@
 	$(PROCESSING_SRCDIR)/src/arm64/pixel_sad_aarch64_neon.S\
 	$(PROCESSING_SRCDIR)/src/arm64/vaa_calc_aarch64_neon.S\
 
-PROCESSING_OBJS += $(PROCESSING_ASM_ARM64_SRCS:.S=.$(OBJ))
+PROCESSING_OBJSARM64 += $(PROCESSING_ASM_ARM64_SRCS:.S=.$(OBJ))
+ifeq ($(ASM_ARCH), arm64)
+PROCESSING_OBJS += $(PROCESSING_OBJSARM64)
 endif
+OBJS += $(PROCESSING_OBJSARM64)
 
 OBJS += $(PROCESSING_OBJS)
+
 $(PROCESSING_SRCDIR)/%.$(OBJ): $(PROCESSING_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c $(CXX_O) $<
 
--- a/module/targets.mk
+++ b/module/targets.mk
@@ -5,6 +5,7 @@
 MODULE_OBJS += $(MODULE_CPP_SRCS:.cpp=.$(OBJ))
 
 OBJS += $(MODULE_OBJS)
+
 $(MODULE_SRCDIR)/%.$(OBJ): $(MODULE_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(MODULE_CFLAGS) $(MODULE_INCLUDES) -c $(CXX_O) $<
 
--- a/test/api/targets.mk
+++ b/test/api/targets.mk
@@ -17,8 +17,8 @@
 	$(API_TEST_SRCDIR)/sha1.c\
 
 API_TEST_OBJS += $(API_TEST_C_SRCS:.c=.$(OBJ))
-
 OBJS += $(API_TEST_OBJS)
+
 $(API_TEST_SRCDIR)/%.$(OBJ): $(API_TEST_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(API_TEST_CFLAGS) $(API_TEST_INCLUDES) -c $(CXX_O) $<
 
--- a/test/common/targets.mk
+++ b/test/common/targets.mk
@@ -5,6 +5,7 @@
 COMMON_UNITTEST_OBJS += $(COMMON_UNITTEST_CPP_SRCS:.cpp=.$(OBJ))
 
 OBJS += $(COMMON_UNITTEST_OBJS)
+
 $(COMMON_UNITTEST_SRCDIR)/%.$(OBJ): $(COMMON_UNITTEST_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(COMMON_UNITTEST_CFLAGS) $(COMMON_UNITTEST_INCLUDES) -c $(CXX_O) $<
 
--- a/test/decoder/targets.mk
+++ b/test/decoder/targets.mk
@@ -11,6 +11,7 @@
 DECODER_UNITTEST_OBJS += $(DECODER_UNITTEST_CPP_SRCS:.cpp=.$(OBJ))
 
 OBJS += $(DECODER_UNITTEST_OBJS)
+
 $(DECODER_UNITTEST_SRCDIR)/%.$(OBJ): $(DECODER_UNITTEST_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(DECODER_UNITTEST_CFLAGS) $(DECODER_UNITTEST_INCLUDES) -c $(CXX_O) $<
 
--- a/test/encoder/targets.mk
+++ b/test/encoder/targets.mk
@@ -18,6 +18,7 @@
 ENCODER_UNITTEST_OBJS += $(ENCODER_UNITTEST_CPP_SRCS:.cpp=.$(OBJ))
 
 OBJS += $(ENCODER_UNITTEST_OBJS)
+
 $(ENCODER_UNITTEST_SRCDIR)/%.$(OBJ): $(ENCODER_UNITTEST_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(ENCODER_UNITTEST_CFLAGS) $(ENCODER_UNITTEST_INCLUDES) -c $(CXX_O) $<
 
--- a/test/processing/targets.mk
+++ b/test/processing/targets.mk
@@ -8,6 +8,7 @@
 PROCESSING_UNITTEST_OBJS += $(PROCESSING_UNITTEST_CPP_SRCS:.cpp=.$(OBJ))
 
 OBJS += $(PROCESSING_UNITTEST_OBJS)
+
 $(PROCESSING_UNITTEST_SRCDIR)/%.$(OBJ): $(PROCESSING_UNITTEST_SRCDIR)/%.cpp
 	$(QUIET_CXX)$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_UNITTEST_CFLAGS) $(PROCESSING_UNITTEST_INCLUDES) -c $(CXX_O) $<