diff --git a/examples.mk b/examples.mk index 5fcf6a350..85b84577c 100644 --- a/examples.mk +++ b/examples.mk @@ -19,6 +19,8 @@ LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \ # 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/mem_ops.h +vpxdec.SRCS += vpx_ports/mem_ops_aligned.h vpxdec.SRCS += vpx_ports/vpx_timer.h vpxdec.SRCS += vpx/vpx_integer.h vpxdec.SRCS += args.c args.h @@ -85,12 +87,16 @@ 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.SRCS += vpx_ports/mem_ops.h +simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h 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.SRCS += vpx_ports/mem_ops.h +postproc.SRCS += vpx_ports/mem_ops_aligned.h postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7 postproc.DESCRIPTION = Decoder postprocessor control EXAMPLES-$(CONFIG_VP8_DECODER) += decode_to_md5.c @@ -99,6 +105,8 @@ 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.SRCS += vpx_ports/mem_ops.h +decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h 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 @@ -124,6 +132,8 @@ 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 +decode_with_drops.SRCS += vpx_ports/mem_ops.h +decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h endif decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26 decode_with_drops.DESCRIPTION = Drops frames while decoding diff --git a/ivfdec.c b/ivfdec.c index 40394a81a..6dcd66f73 100644 --- a/ivfdec.c +++ b/ivfdec.c @@ -12,6 +12,8 @@ #include #include +#include "vpx_ports/mem_ops.h" + #include "./ivfdec.h" static const char *IVF_SIGNATURE = "DKIF"; diff --git a/tools_common.c b/tools_common.c index f0e160697..667432027 100644 --- a/tools_common.c +++ b/tools_common.c @@ -77,26 +77,6 @@ void die_codec(vpx_codec_ctx_t *ctx, const char *s) { exit(EXIT_FAILURE); } -uint16_t mem_get_le16(const void *data) { - uint16_t val; - const uint8_t *mem = (const uint8_t*)data; - - val = mem[1] << 8; - val |= mem[0]; - return val; -} - -uint32_t mem_get_le32(const void *data) { - uint32_t val; - const uint8_t *mem = (const uint8_t*)data; - - val = mem[3] << 24; - val |= mem[2] << 16; - val |= mem[1] << 8; - val |= mem[0]; - return val; -} - int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame) { FILE *f = input_ctx->file; struct FileTypeDetectionBuffer *detect = &input_ctx->detect; diff --git a/tools_common.h b/tools_common.h index 2e9025915..b60825cef 100644 --- a/tools_common.h +++ b/tools_common.h @@ -118,9 +118,6 @@ void die_codec(vpx_codec_ctx_t *ctx, const char *s); /* The tool including this file must define usage_exit() */ void usage_exit(); -uint16_t mem_get_le16(const void *data); -uint32_t mem_get_le32(const void *data); - int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame); typedef struct VpxInterface { diff --git a/video_reader.c b/video_reader.c index 4be7483d3..39c7edba1 100644 --- a/video_reader.c +++ b/video_reader.c @@ -14,6 +14,8 @@ #include "./ivfdec.h" #include "./video_reader.h" +#include "vpx_ports/mem_ops.h" + static const char *const kIVFSignature = "DKIF"; struct VpxVideoReaderStruct { diff --git a/vpx_ports/mem_ops_aligned.h b/vpx_ports/mem_ops_aligned.h index da7c65d96..24743c8d6 100644 --- a/vpx_ports/mem_ops_aligned.h +++ b/vpx_ports/mem_ops_aligned.h @@ -11,6 +11,8 @@ #ifndef VPX_PORTS_MEM_OPS_ALIGNED_H_ #define VPX_PORTS_MEM_OPS_ALIGNED_H_ +#include "vpx/vpx_integer.h" + /* \file * \brief Provides portable memory access primitives for operating on aligned * data diff --git a/vpxdec.c b/vpxdec.c index d99b5aa93..b69e55eeb 100644 --- a/vpxdec.c +++ b/vpxdec.c @@ -23,6 +23,7 @@ #define VPX_CODEC_DISABLE_COMPAT 1 #include "./vpx_config.h" #include "vpx/vpx_decoder.h" +#include "vpx_ports/mem_ops.h" #include "vpx_ports/vpx_timer.h" #if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER