include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk
CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
+include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk
+CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS))
+
+ ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),)
+ VP8_PREFIX=vp8/
+ include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8_common.mk
+ endif
ifeq ($(CONFIG_VP8_ENCODER),yes)
- VP8_PREFIX=vp8/
include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk
CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS))
INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
endif
-# If this is a universal (fat) binary, then all the subarchitectures have
-# already been built and our job is to stitch them together. The
-# BUILD_LIBVPX variable indicates whether we should be building
-# (compiling, linking) the library. The LIPO_LIBVPX variable indicates
-# that we're stitching.
-$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
-
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
-CODEC_SRCS-$(BUILD_LIBVPX) += vpx/vpx_integer.h
-CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/asm_offsets.h
+ CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h
+ CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h
-CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_timer.h
-CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem.h
CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
-ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
-CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emms.asm
-CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86.h
-CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86_abi_support.asm
+ CODEC_SRCS-$(BUILD_LIBVPX) += third_party/x86inc/x86inc.asm
-CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86_cpuid.c
-endif
-CODEC_SRCS-$(ARCH_ARM) += vpx_ports/arm_cpudetect.c
-CODEC_SRCS-$(ARCH_ARM) += vpx_ports/arm.h
CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com
CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
$(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h)
CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
- #
- # Rule to generate runtime cpu detection files
- #
- $(BUILD_PFX)vpx_rtcd.h: $(SRC_PATH_BARE)/$(sort $(filter %rtcd_defs.sh,$(CODEC_SRCS)))
- @echo " [CREATE] $@"
- $(qexec)$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$(TGT_ISA) \
- --sym=vpx_rtcd \
- --config=$(target)$(if $(FAT_ARCHS),,-$(TOOLCHAIN)).mk \
- $(RTCD_OPTIONS) $^ > $@
- CLEAN-OBJS += $(BUILD_PFX)vpx_rtcd.h
-CODEC_DOC_SRCS += vpx/vpx_codec.h \
- vpx/vpx_decoder.h \
- vpx/vpx_encoder.h \
- vpx/vpx_image.h
##
## libvpx test directives
static void get_cx_data(struct stream_state *stream,
struct global_config *global,
- int *got_data)
- {
- const vpx_codec_cx_pkt_t *pkt;
- const struct vpx_codec_enc_cfg *cfg = &stream->config.cfg;
- vpx_codec_iter_t iter = NULL;
+ int *got_data) {
+ const vpx_codec_cx_pkt_t *pkt;
+ const struct vpx_codec_enc_cfg *cfg = &stream->config.cfg;
+ vpx_codec_iter_t iter = NULL;
+
+ *got_data = 0;
+ while ((pkt = vpx_codec_get_cx_data(&stream->encoder, &iter))) {
+ static size_t fsize = 0;
+ static off_t ivf_header_pos = 0;
+
+ switch (pkt->kind) {
+ case VPX_CODEC_CX_FRAME_PKT:
+ if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) {
+ stream->frames_out++;
+ }
+ if (!global->quiet)
+ fprintf(stderr, " %6luF",
+ (unsigned long)pkt->data.frame.sz);
+
+ update_rate_histogram(&stream->rate_hist, cfg, pkt);
+ if (stream->config.write_webm) {
+ /* Update the hash */
+ if (!stream->ebml.debug)
+ stream->hash = murmur(pkt->data.frame.buf,
+ (int)pkt->data.frame.sz,
+ stream->hash);
+
+ write_webm_block(&stream->ebml, cfg, pkt);
+ } else {
+ if (pkt->data.frame.partition_id <= 0) {
+ ivf_header_pos = ftello(stream->file);
+ fsize = pkt->data.frame.sz;
+
+ write_ivf_frame_header(stream->file, pkt);
+ } else {
+ fsize += pkt->data.frame.sz;
+
+ if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) {
+ off_t currpos = ftello(stream->file);
+ fseeko(stream->file, ivf_header_pos, SEEK_SET);
+ write_ivf_frame_size(stream->file, fsize);
+ fseeko(stream->file, currpos, SEEK_SET);
+ }
+ }
- while ((pkt = vpx_codec_get_cx_data(&stream->encoder, &iter)))
- {
- static size_t fsize = 0;
- static off_t ivf_header_pos = 0;
+ (void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
+ stream->file);
+ }
+ stream->nbytes += pkt->data.raw.sz;
*got_data = 1;
-
- switch (pkt->kind)
- {
- case VPX_CODEC_CX_FRAME_PKT:
- if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT))
- {
- stream->frames_out++;
- }
- if (!global->quiet)
- fprintf(stderr, " %6luF",
- (unsigned long)pkt->data.frame.sz);
-
- update_rate_histogram(&stream->rate_hist, cfg, pkt);
- if(stream->config.write_webm)
- {
- /* Update the hash */
- if(!stream->ebml.debug)
- stream->hash = murmur(pkt->data.frame.buf,
- (int)pkt->data.frame.sz,
- stream->hash);
-
- write_webm_block(&stream->ebml, cfg, pkt);
- }
- else
- {
- if (pkt->data.frame.partition_id <= 0)
- {
- ivf_header_pos = ftello(stream->file);
- fsize = pkt->data.frame.sz;
-
- write_ivf_frame_header(stream->file, pkt);
- }
- else
- {
- fsize += pkt->data.frame.sz;
-
- if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT))
- {
- off_t currpos = ftello(stream->file);
- fseeko(stream->file, ivf_header_pos, SEEK_SET);
- write_ivf_frame_size(stream->file, fsize);
- fseeko(stream->file, currpos, SEEK_SET);
- }
- }
-
- (void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
- stream->file);
- }
- stream->nbytes += pkt->data.raw.sz;
- break;
- case VPX_CODEC_STATS_PKT:
- stream->frames_out++;
+ #if CONFIG_DECODERS
+ if (global->test_decode) {
+ vpx_codec_decode(&stream->decoder, pkt->data.frame.buf,
+ pkt->data.frame.sz, NULL, 0);
+ ctx_exit_on_error(&stream->decoder, "Failed to decode frame");
+ }
+ #endif
+ break;
+ case VPX_CODEC_STATS_PKT:
+ stream->frames_out++;
- fprintf(stderr, " %6luS",
- (unsigned long)pkt->data.twopass_stats.sz);
++ if (!global->quiet)
++ fprintf(stderr, " %6luS",
++ (unsigned long)pkt->data.twopass_stats.sz);
+ stats_write(&stream->stats,
+ pkt->data.twopass_stats.buf,
+ pkt->data.twopass_stats.sz);
+ stream->nbytes += pkt->data.raw.sz;
+ break;
+ case VPX_CODEC_PSNR_PKT:
+
+ if (global->show_psnr) {
+ int i;
+
+ stream->psnr_sse_total += pkt->data.psnr.sse[0];
+ stream->psnr_samples_total += pkt->data.psnr.samples[0];
+ for (i = 0; i < 4; i++) {
if (!global->quiet)
- fprintf(stderr, " %6luS",
- (unsigned long)pkt->data.twopass_stats.sz);
- stats_write(&stream->stats,
- pkt->data.twopass_stats.buf,
- pkt->data.twopass_stats.sz);
- stream->nbytes += pkt->data.raw.sz;
- break;
- case VPX_CODEC_PSNR_PKT:
-
- if (global->show_psnr)
- {
- int i;
-
- stream->psnr_sse_total += pkt->data.psnr.sse[0];
- stream->psnr_samples_total += pkt->data.psnr.samples[0];
- for (i = 0; i < 4; i++)
- {
- if (!global->quiet)
- fprintf(stderr, "%.3f ", pkt->data.psnr.psnr[i]);
- stream->psnr_totals[i] += pkt->data.psnr.psnr[i];
- }
- stream->psnr_count++;
- }
-
- break;
- default:
- break;
+ fprintf(stderr, "%.3f ", pkt->data.psnr.psnr[i]);
+ stream->psnr_totals[i] += pkt->data.psnr.psnr[i];
+ }
+ stream->psnr_count++;
}
+
+ break;
+ default:
+ break;
}
+ }
}