History

Build libsimple_encode.a separately

BUG=webm:1689

angiebird committed 6 years ago

Commit 56345d21 parent 16935394 files · +63 −9Browse files

Unified · Split

4 files
  1. libs.mk +54 −5
  2. test/simple_encode_test.cc +5 −0
  3. test/test.mk +4 −1
  4. vp9/vp9cx.mk +0 −3
libs.mk+54−5
@@ -173,7 +173,18 @@ INSTALL-LIBS-$(CONFIG_STATIC) += $(LIBSUBDIR)/libvpx.a · 172 unmodified lines
173INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a173INSTALL-LIBS-$(CONFIG_DEBUG_LIBS) += $(LIBSUBDIR)/libvpx_g.a
174endif174endif
175 175
176ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_RATE_CTRL),yesyes)
177 SIMPLE_ENCODE_SRCS := $(call enabled,CODEC_SRCS)
178 SIMPLE_ENCODE_SRCS += $(VP9_PREFIX)simple_encode.cc
179 SIMPLE_ENCODE_SRCS += $(VP9_PREFIX)simple_encode.h
180 SIMPLE_ENCODE_SRCS += ivfenc.h
181 SIMPLE_ENCODE_SRCS += ivfenc.c
182 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP9_PREFIX)simple_encode.cc
183 INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(VP9_PREFIX)simple_encode.h
184endif
185
176CODEC_SRCS=$(call enabled,CODEC_SRCS)186CODEC_SRCS=$(call enabled,CODEC_SRCS)
187
177INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(CODEC_SRCS)188INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(CODEC_SRCS)
178INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(call enabled,CODEC_EXPORTS)189INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(call enabled,CODEC_EXPORTS)
179 190
@@ -263,8 +274,8 @@ PROJECTS-yes += vp9rc.$(VCPROJ_SFX) · 83 unmodified lines
263vp9rc.$(VCPROJ_SFX): vpx_config.asm274vp9rc.$(VCPROJ_SFX): vpx_config.asm
264vp9rc.$(VCPROJ_SFX): $(RTCD)275vp9rc.$(VCPROJ_SFX): $(RTCD)
265 276
266endif277endif # ifeq ($(CONFIG_MSVS),yes)
267else278else # ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
268LIBVPX_OBJS=$(call objs, $(filter-out $(ASM_INCLUDES), $(CODEC_SRCS)))279LIBVPX_OBJS=$(call objs, $(filter-out $(ASM_INCLUDES), $(CODEC_SRCS)))
269OBJS-yes += $(LIBVPX_OBJS)280OBJS-yes += $(LIBVPX_OBJS)
270LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a281LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
@@ -377,8 +388,15 @@ ifeq ($(CONFIG_VP9_ENCODER),yes) · 106 unmodified lines
377 $(BUILD_PFX)libvp9rc_g.a: $(RC_RTC_OBJS)388 $(BUILD_PFX)libvp9rc_g.a: $(RC_RTC_OBJS)
378endif389endif
379 390
391ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_RATE_CTRL),yesyes)
392 SIMPLE_ENCODE_OBJS=$(call objs,$(SIMPLE_ENCODE_SRCS))
393 OBJS-yes += $(SIMPLE_ENCODE_OBJS)
394 LIBS-yes += $(BUILD_PFX)libsimple_encode.a $(BUILD_PFX)libsimple_encode_g.a
395 $(BUILD_PFX)libsimple_encode_g.a: $(SIMPLE_ENCODE_OBJS)
380endif396endif
381 397
398endif # ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
399
382libvpx.ver: $(call enabled,CODEC_EXPORTS)400libvpx.ver: $(call enabled,CODEC_EXPORTS)
383 @echo " [CREATE] $@"401 @echo " [CREATE] $@"
384 $(qexec)echo "{ global:" > $@402 $(qexec)echo "{ global:" > $@
@@ -434,20 +452,39 @@ ifeq ($(CONFIG_UNIT_TESTS),yes) · 49 unmodified lines
434LIBVPX_TEST_DATA_PATH ?= .452LIBVPX_TEST_DATA_PATH ?= .
435 453
436include $(SRC_PATH_BARE)/test/test.mk454include $(SRC_PATH_BARE)/test/test.mk
437LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS))455
456# addprefix_clean behaves like addprefix if the target doesn't start with "../"
457# However, if the target starts with "../", instead of adding prefix,
458# it will remove "../".
459# Using addprefix_clean, we can avoid two different targets building the
460# same file, i.e.
461# test/../ivfenc.c.d: ivfenc.o
462# ivfenc.c.d: ivfenc.o
463# Note that the other way to solve this problem is using "realpath".
464# The "realpath" is supported by make 3.81 or later.
465addprefix_clean=$(patsubst $(1)../%,%,$(addprefix $(1), $(2)))
466LIBVPX_TEST_SRCS=$(call addprefix_clean,test/,$(call enabled,LIBVPX_TEST_SRCS))
467
438LIBVPX_TEST_BIN=./test_libvpx$(EXE_SFX)468LIBVPX_TEST_BIN=./test_libvpx$(EXE_SFX)
439LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\469LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\
440 $(call enabled,LIBVPX_TEST_DATA))470 $(call enabled,LIBVPX_TEST_DATA))
441libvpx_test_data_url=https://storage.googleapis.com/downloads.webmproject.org/test_data/libvpx/$(1)471libvpx_test_data_url=https://storage.googleapis.com/downloads.webmproject.org/test_data/libvpx/$(1)
442 472
443TEST_INTRA_PRED_SPEED_BIN=./test_intra_pred_speed$(EXE_SFX)473TEST_INTRA_PRED_SPEED_BIN=./test_intra_pred_speed$(EXE_SFX)
444TEST_INTRA_PRED_SPEED_SRCS=$(addprefix test/,$(call enabled,TEST_INTRA_PRED_SPEED_SRCS))474TEST_INTRA_PRED_SPEED_SRCS=$(call addprefix_clean,test/,\
475 $(call enabled,TEST_INTRA_PRED_SPEED_SRCS))
445TEST_INTRA_PRED_SPEED_OBJS := $(sort $(call objs,$(TEST_INTRA_PRED_SPEED_SRCS)))476TEST_INTRA_PRED_SPEED_OBJS := $(sort $(call objs,$(TEST_INTRA_PRED_SPEED_SRCS)))
446 477
447RC_INTERFACE_TEST_BIN=./test_rc_interface$(EXE_SFX)478RC_INTERFACE_TEST_BIN=./test_rc_interface$(EXE_SFX)
448RC_INTERFACE_TEST_SRCS=$(addprefix test/,$(call enabled,RC_INTERFACE_TEST_SRCS))479RC_INTERFACE_TEST_SRCS=$(call addprefix_clean,test/,\
480 $(call enabled,RC_INTERFACE_TEST_SRCS))
449RC_INTERFACE_TEST_OBJS := $(sort $(call objs,$(RC_INTERFACE_TEST_SRCS)))481RC_INTERFACE_TEST_OBJS := $(sort $(call objs,$(RC_INTERFACE_TEST_SRCS)))
450 482
483SIMPLE_ENCODE_TEST_BIN=./test_simple_encode$(EXE_SFX)
484SIMPLE_ENCODE_TEST_SRCS=$(call addprefix_clean,test/,\
485 $(call enabled,SIMPLE_ENCODE_TEST_SRCS))
486SIMPLE_ENCODE_TEST_OBJS := $(sort $(call objs,$(SIMPLE_ENCODE_TEST_SRCS)))
487
451libvpx_test_srcs.txt:488libvpx_test_srcs.txt:
452 @echo " [CREATE] $@"489 @echo " [CREATE] $@"
453 @echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@490 @echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
@@ -609,6 +646,18 @@ $(eval $(call linkerxx_template,$(RC_INTERFACE_TEST_BIN), \ · 155 unmodified lines
609 -L. -lvpx -lgtest -lvp9rc $(extralibs) -lm))646 -L. -lvpx -lgtest -lvp9rc $(extralibs) -lm))
610endif # RC_INTERFACE_TEST647endif # RC_INTERFACE_TEST
611 648
649ifneq ($(strip $(SIMPLE_ENCODE_TEST_OBJS)),)
650$(SIMPLE_ENCODE_TEST_OBJS) $(SIMPLE_ENCODE_TEST_OBJS:.o=.d): \
651 CXXFLAGS += $(GTEST_INCLUDES)
652OBJS-yes += $(SIMPLE_ENCODE_TEST_OBJS)
653BINS-yes += $(SIMPLE_ENCODE_TEST_BIN)
654
655$(SIMPLE_ENCODE_TEST_BIN): $(TEST_LIBS) libsimple_encode.a
656$(eval $(call linkerxx_template,$(SIMPLE_ENCODE_TEST_BIN), \
657 $(SIMPLE_ENCODE_TEST_OBJS) \
658 -L. -lsimple_encode -lvpx -lgtest $(extralibs) -lm))
659endif # SIMPLE_ENCODE_TEST
660
612endif # CONFIG_UNIT_TESTS661endif # CONFIG_UNIT_TESTS
613 662
614# Install test sources only if codec source is included663# Install test sources only if codec source is included
test/simple_encode_test.cc+5−0
@@ -504,3 +504,8 @@ TEST_F(SimpleEncodeTest, GetFramePixelCount) { · 503 unmodified lines
504 504
505} // namespace505} // namespace
506} // namespace vp9506} // namespace vp9
507
508int main(int argc, char **argv) {
509 ::testing::InitGoogleTest(&argc, argv);
510 return RUN_ALL_TESTS();
511}
test/test.mk+4−1
@@ -58,7 +58,6 @@ LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += svc_test.cc · 57 unmodified lines
58LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += svc_test.h58LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += svc_test.h
59LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += svc_end_to_end_test.cc59LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += svc_end_to_end_test.cc
60LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += timestamp_test.cc60LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += timestamp_test.cc
61LIBVPX_TEST_SRCS-$(CONFIG_RATE_CTRL) += simple_encode_test.cc
62 61
63LIBVPX_TEST_SRCS-yes += decode_test_driver.cc62LIBVPX_TEST_SRCS-yes += decode_test_driver.cc
64LIBVPX_TEST_SRCS-yes += decode_test_driver.h63LIBVPX_TEST_SRCS-yes += decode_test_driver.h
@@ -193,6 +192,10 @@ LIBVPX_TEST_SRCS-yes += vp9_denoiser_test.cc · 128 unmodified lines
193endif192endif
194LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_arf_freq_test.cc193LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_arf_freq_test.cc
195 194
195ifeq ($(CONFIG_VP9_ENCODER),yes)
196SIMPLE_ENCODE_TEST_SRCS-$(CONFIG_RATE_CTRL) := simple_encode_test.cc
197endif
198
196endif # VP9199endif # VP9
197 200
198## Multi-codec / unconditional whitebox tests.201## Multi-codec / unconditional whitebox tests.
vp9/vp9cx.mk+0−3
@@ -18,9 +18,6 @@ VP9_CX_SRCS_REMOVE-no += $(VP9_COMMON_SRCS_REMOVE-no) · 17 unmodified lines
18VP9_CX_SRCS-yes += vp9_cx_iface.c18VP9_CX_SRCS-yes += vp9_cx_iface.c
19VP9_CX_SRCS-yes += vp9_cx_iface.h19VP9_CX_SRCS-yes += vp9_cx_iface.h
20 20
21VP9_CX_SRCS-$(CONFIG_RATE_CTRL) += simple_encode.cc
22VP9_CX_SRCS-$(CONFIG_RATE_CTRL) += simple_encode.h
23
24VP9_CX_SRCS-yes += encoder/vp9_bitstream.c21VP9_CX_SRCS-yes += encoder/vp9_bitstream.c
25VP9_CX_SRCS-yes += encoder/vp9_context_tree.c22VP9_CX_SRCS-yes += encoder/vp9_context_tree.c
26VP9_CX_SRCS-yes += encoder/vp9_context_tree.h23VP9_CX_SRCS-yes += encoder/vp9_context_tree.h

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t