Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / source / libvpx / examples.mk
index fe36c4f..5f12b6b 100644 (file)
@@ -15,9 +15,8 @@ LIBYUV_SRCS +=  third_party/libyuv/include/libyuv/basic_types.h  \
                 third_party/libyuv/source/scale.c  \
                 third_party/libyuv/source/cpu_id.c
 
-# List of examples to build. UTILS are files that are taken from the source
-# tree directly, and GEN_EXAMPLES are files that are created from the
-# examples folder.
+# List of examples to build. UTILS are tools meant for distribution
+# while EXAMPLES demonstrate specific portions of the API.
 UTILS-$(CONFIG_DECODERS)    += vpxdec.c
 vpxdec.SRCS                 += md5_utils.c md5_utils.h
 vpxdec.SRCS                 += vpx_ports/vpx_timer.h
@@ -26,6 +25,7 @@ vpxdec.SRCS                 += args.c args.h
 vpxdec.SRCS                 += ivfdec.c ivfdec.h
 vpxdec.SRCS                 += tools_common.c tools_common.h
 vpxdec.SRCS                 += webmdec.c webmdec.h
+vpxdec.SRCS                 += y4menc.c y4menc.h
 vpxdec.SRCS                 += nestegg/halloc/halloc.h
 vpxdec.SRCS                 += nestegg/halloc/src/align.h
 vpxdec.SRCS                 += nestegg/halloc/src/halloc.c
@@ -40,6 +40,7 @@ UTILS-$(CONFIG_ENCODERS)    += vpxenc.c
 vpxenc.SRCS                 += args.c args.h y4minput.c y4minput.h vpxenc.h
 vpxenc.SRCS                 += ivfdec.c ivfdec.h
 vpxenc.SRCS                 += ivfenc.c ivfenc.h
+vpxenc.SRCS                 += rate_hist.c rate_hist.h
 vpxenc.SRCS                 += tools_common.c tools_common.h
 vpxenc.SRCS                 += warnings.c warnings.h
 vpxenc.SRCS                 += webmenc.c webmenc.h
@@ -53,67 +54,102 @@ vpxenc.SRCS                 += third_party/libmkv/EbmlWriter.h
 vpxenc.SRCS                 += $(LIBYUV_SRCS)
 vpxenc.GUID                  = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
 vpxenc.DESCRIPTION           = Full featured encoder
-UTILS-$(CONFIG_VP8_ENCODER)    += vp8_scalable_patterns.c
-vp8_scalable_patterns.GUID   = 0D6A210B-F482-4D6F-8570-4A9C01ACC88C
-vp8_scalable_patterns.DESCRIPTION = Temporal Scalability Encoder
 UTILS-$(CONFIG_VP9_ENCODER)    += vp9_spatial_scalable_encoder.c
 vp9_spatial_scalable_encoder.SRCS += args.c args.h
 vp9_spatial_scalable_encoder.SRCS += ivfenc.c ivfenc.h
 vp9_spatial_scalable_encoder.SRCS += tools_common.c tools_common.h
+vp9_spatial_scalable_encoder.SRCS += video_common.h
+vp9_spatial_scalable_encoder.SRCS += video_writer.h video_writer.c
 vp9_spatial_scalable_encoder.GUID   = 4A38598D-627D-4505-9C7B-D4020C84100D
 vp9_spatial_scalable_encoder.DESCRIPTION = Spatial Scalable Encoder
 
+ifeq ($(CONFIG_SHARED),no)
+UTILS-$(CONFIG_VP9_ENCODER)    += resize_util.c
+endif
+
 # XMA example disabled for now, not used in VP8
 #UTILS-$(CONFIG_DECODERS)    += example_xma.c
 #example_xma.GUID             = A955FC4A-73F1-44F7-135E-30D84D32F022
 #example_xma.DESCRIPTION      = External Memory Allocation mode usage
 
-GEN_EXAMPLES-$(CONFIG_VP8_DECODER) += simple_decoder.c
-simple_decoder.GUID              = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC
-simple_decoder.DESCRIPTION       = Simplified decoder loop
-GEN_EXAMPLES-$(CONFIG_VP8_DECODER) += postproc.c
-postproc.GUID                    = 65E33355-F35E-4088-884D-3FD4905881D7
-postproc.DESCRIPTION             = Decoder postprocessor control
-GEN_EXAMPLES-$(CONFIG_VP8_DECODER) += decode_to_md5.c
-decode_to_md5.SRCS              += md5_utils.h md5_utils.c
-decode_to_md5.GUID               = 59120B9B-2735-4BFE-B022-146CA340FE42
-decode_to_md5.DESCRIPTION        = Frame by frame MD5 checksum
-
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += simple_encoder.c
+EXAMPLES-$(CONFIG_ENCODERS)         += vpx_temporal_scalable_patterns.c
+vpx_temporal_scalable_patterns.SRCS += ivfenc.c ivfenc.h
+vpx_temporal_scalable_patterns.SRCS += tools_common.c tools_common.h
+vpx_temporal_scalable_patterns.SRCS += video_common.h
+vpx_temporal_scalable_patterns.SRCS += video_writer.h video_writer.c
+vpx_temporal_scalable_patterns.GUID  = B18C08F2-A439-4502-A78E-849BE3D60947
+vpx_temporal_scalable_patterns.DESCRIPTION = Temporal Scalability Encoder
+EXAMPLES-$(CONFIG_VP8_DECODER)     += simple_decoder.c
+simple_decoder.GUID                 = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC
+simple_decoder.SRCS                += ivfdec.h ivfdec.c
+simple_decoder.SRCS                += tools_common.h tools_common.c
+simple_decoder.SRCS                += video_common.h
+simple_decoder.SRCS                += video_reader.h video_reader.c
+simple_decoder.DESCRIPTION          = Simplified decoder loop
+EXAMPLES-$(CONFIG_VP8_DECODER)     += postproc.c
+postproc.SRCS                      += ivfdec.h ivfdec.c
+postproc.SRCS                      += tools_common.h tools_common.c
+postproc.SRCS                      += video_common.h
+postproc.SRCS                      += video_reader.h video_reader.c
+postproc.GUID                       = 65E33355-F35E-4088-884D-3FD4905881D7
+postproc.DESCRIPTION                = Decoder postprocessor control
+EXAMPLES-$(CONFIG_VP8_DECODER)     += decode_to_md5.c
+decode_to_md5.SRCS                 += md5_utils.h md5_utils.c
+decode_to_md5.SRCS                 += ivfdec.h ivfdec.c
+decode_to_md5.SRCS                 += tools_common.h tools_common.c
+decode_to_md5.SRCS                 += video_common.h
+decode_to_md5.SRCS                 += video_reader.h video_reader.c
+decode_to_md5.GUID                  = 59120B9B-2735-4BFE-B022-146CA340FE42
+decode_to_md5.DESCRIPTION           = Frame by frame MD5 checksum
+EXAMPLES-$(CONFIG_VP8_ENCODER)  += simple_encoder.c
+simple_encoder.SRCS             += ivfenc.h ivfenc.c
+simple_encoder.SRCS             += tools_common.h tools_common.c
+simple_encoder.SRCS             += video_common.h
+simple_encoder.SRCS             += video_writer.h video_writer.c
 simple_encoder.GUID              = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
 simple_encoder.DESCRIPTION       = Simplified encoder loop
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += twopass_encoder.c
+EXAMPLES-$(CONFIG_VP8_ENCODER)  += twopass_encoder.c
+twopass_encoder.SRCS            += ivfenc.h ivfenc.c
+twopass_encoder.SRCS            += tools_common.h tools_common.c
+twopass_encoder.SRCS            += video_common.h
+twopass_encoder.SRCS            += video_writer.h video_writer.c
 twopass_encoder.GUID             = 73494FA6-4AF9-4763-8FBB-265C92402FD8
 twopass_encoder.DESCRIPTION      = Two-pass encoder loop
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += force_keyframe.c
+EXAMPLES-$(CONFIG_VP8_ENCODER)  += force_keyframe.c
 force_keyframe.GUID              = 3C67CADF-029F-4C86-81F5-D6D4F51177F0
 force_keyframe.DESCRIPTION       = Force generation of keyframes
 ifeq ($(CONFIG_DECODERS),yes)
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += decode_with_drops.c
+EXAMPLES-$(CONFIG_VP8_ENCODER)  += decode_with_drops.c
+decode_with_drops.SRCS          += ivfdec.h ivfdec.c
+decode_with_drops.SRCS          += tools_common.h tools_common.c
+decode_with_drops.SRCS          += video_common.h
+decode_with_drops.SRCS          += video_reader.h video_reader.c
 endif
 decode_with_drops.GUID           = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26
 decode_with_drops.DESCRIPTION    = Drops frames while decoding
 ifeq ($(CONFIG_VP8_DECODER),yes)
-GEN_EXAMPLES-$(CONFIG_ERROR_CONCEALMENT) += decode_with_partial_drops.c
+EXAMPLES-$(CONFIG_ERROR_CONCEALMENT)    += decode_with_partial_drops.c
 endif
 decode_with_partial_drops.GUID           = 61C2D026-5754-46AC-916F-1343ECC5537E
 decode_with_partial_drops.DESCRIPTION    = Drops parts of frames while decoding
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += error_resilient.c
+EXAMPLES-$(CONFIG_VP8_ENCODER)  += error_resilient.c
 error_resilient.GUID             = DF5837B9-4145-4F92-A031-44E4F832E00C
 error_resilient.DESCRIPTION      = Error Resiliency Feature
 
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8_set_maps.c
+EXAMPLES-$(CONFIG_VP8_ENCODER)     += vp8_set_maps.c
 vp8_set_maps.GUID                   = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
 vp8_set_maps.DESCRIPTION            = VP8 set active and ROI maps
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c
+EXAMPLES-$(CONFIG_VP8_ENCODER)     += vp8cx_set_ref.c
 vp8cx_set_ref.GUID                  = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A
 vp8cx_set_ref.DESCRIPTION           = VP8 set encoder reference frame
 
-# C file is provided, not generated automatically.
-UTILS-$(CONFIG_MULTI_RES_ENCODING) += vp8_multi_resolution_encoder.c
-vp8_multi_resolution_encoder.SRCS         += $(LIBYUV_SRCS)
-vp8_multi_resolution_encoder.GUID         = 04f8738e-63c8-423b-90fa-7c2703a374de
-vp8_multi_resolution_encoder.DESCRIPTION  = VP8 Multiple-resolution Encoding
+
+ifeq ($(CONFIG_MULTI_RES_ENCODING),yes)
+EXAMPLES-$(CONFIG_VP8_DECODER)          += vp8_multi_resolution_encoder.c
+vp8_multi_resolution_encoder.SRCS       += $(LIBYUV_SRCS)
+vp8_multi_resolution_encoder.GUID        = 04f8738e-63c8-423b-90fa-7c2703a374de
+vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
+endif
 
 # Handle extra library flags depending on codec configuration
 
@@ -155,17 +191,17 @@ INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH))
 
 # Expand list of selected examples to build (as specified above)
 UTILS           = $(call enabled,UTILS)
-GEN_EXAMPLES    = $(call enabled,GEN_EXAMPLES)
-ALL_EXAMPLES    = $(UTILS) $(GEN_EXAMPLES)
+EXAMPLES        = $(addprefix examples/,$(call enabled,EXAMPLES))
+ALL_EXAMPLES    = $(UTILS) $(EXAMPLES)
 UTIL_SRCS       = $(foreach ex,$(UTILS),$($(ex:.c=).SRCS))
-ALL_SRCS        = $(foreach ex,$(ALL_EXAMPLES),$($(ex:.c=).SRCS))
+ALL_SRCS        = $(foreach ex,$(ALL_EXAMPLES),$($(notdir $(ex:.c=)).SRCS))
 CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS))
 
 
 # Expand all example sources into a variable containing all sources
-# for that example (not just them main one specified in UTILS/GEN_EXAMPLES)
+# for that example (not just them main one specified in UTILS/EXAMPLES)
 # and add this file to the list (for MSVS workspace generation)
-$(foreach ex,$(ALL_EXAMPLES),$(eval $(ex:.c=).SRCS += $(ex) examples.mk))
+$(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk))
 
 
 # If this is a universal (fat) binary, then all the subarchitectures have
@@ -202,14 +238,6 @@ $(foreach bin,$(BINS-yes),\
     )
 
 
-# Rules to generate the GEN_EXAMPLES sources
-.PRECIOUS: %.c
-CLEAN-OBJS += $(GEN_EXAMPLES)
-%.c: examples/%.txt
-       @echo "    [EXAMPLE] $@"
-       @$(SRC_PATH_BARE)/examples/gen_example_code.sh $< > $@
-
-
 # The following pairs define a mapping of locations in the distribution
 # tree to locations in the source/build trees.
 INSTALL_MAPS += src/%.c   %.c
@@ -247,50 +275,9 @@ $(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
             --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
             $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) $$^
 endef
-PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES:.c=.$(VCPROJ_SFX))
+ALL_EXAMPLES_BASENAME := $(notdir $(ALL_EXAMPLES))
+PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES_BASENAME:.c=.$(VCPROJ_SFX))
 INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\
-                               $(addprefix bin/$(p)/,$(ALL_EXAMPLES:.c=.exe)))
+                               $(addprefix bin/$(p)/,$(ALL_EXAMPLES_BASENAME:.c=.exe)))
 $(foreach proj,$(call enabled,PROJECTS),\
     $(eval $(call vcproj_template,$(proj))))
-
-
-
-#
-# Documentation Rules
-#
-%.dox: examples/%.txt
-       @echo "    [DOXY] $@"
-       @$(SRC_PATH_BARE)/examples/gen_example_text.sh $< | \
-         $(SRC_PATH_BARE)/examples/gen_example_doxy.php \
-             example_$(@:.dox=)  $(@:.dox=.c) > $@
-
-%.dox: %.c
-       @echo "    [DOXY] $@"
-       @echo "/*!\page example_$(@:.dox=) $(@:.dox=)" > $@
-       @echo "   \includelineno $(notdir $<)" >> $@
-       @echo "*/" >> $@
-
-samples.dox: examples.mk
-       @echo "    [DOXY] $@"
-       @echo "/*!\page samples Sample Code" > $@
-       @echo "    This SDK includes a number of sample applications."\
-             "each sample documents a feature of the SDK in both prose"\
-             "and the associated C code. In general, later samples"\
-             "build upon prior samples, so it is best to work through the"\
-             "list in order. The following samples are included: ">>$@
-       @$(foreach ex,$(GEN_EXAMPLES:.c=),\
-          echo "     - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
-       @echo >> $@
-       @echo "    In addition, the SDK contains a number of utilities."\
-              "Since these utilities are built upon the concepts described"\
-              "in the sample code listed above, they are not documented in"\
-              "pieces like the samples are. Thir sourcre is included here"\
-              "for reference. The following utilities are included:" >> $@
-       @$(foreach ex,$(UTILS:.c=),\
-          echo "     - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
-       @echo "*/" >> $@
-
-CLEAN-OBJS += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox)
-DOCS-yes += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox)
-examples.doxy: samples.dox $(ALL_EXAMPLES:.c=.dox)
-       @echo "INPUT += $^" > $@