Commit 4334c073 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Reusing mem_get_le{16, 32} defined in vpx_ports/mem_opts.h.

Change-Id: If4b5209ac14aaba6f1c1014bc0497baa8eabfaff
parent 4632a96d
......@@ -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
......
......@@ -12,6 +12,8 @@
#include <stdlib.h>
#include <string.h>
#include "vpx_ports/mem_ops.h"
#include "./ivfdec.h"
static const char *IVF_SIGNATURE = "DKIF";
......
......@@ -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;
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment