Commit 7790213a authored by Tom Finegan's avatar Tom Finegan

Tree clean up.

Relocate C source and include files from the root of the
repository to more appropriate places. Helps quiet linters.

- Move common app support sources and includes to common/
- Move apps to apps/
- Move stats support to stats/
- Drop unnecessary includes of aom_config.h where appropriate
- Clean up include order where appropriate
- Change CMake build to accomodate the above
- Fix resize_util and add it to app targets.

Change-Id: I268838e93400c67eb365aba9d2ecb2891538fc07
parent dcd1ea8a
......@@ -158,44 +158,47 @@ list(APPEND AOM_SOURCES
"${AOM_ROOT}/aom/src/aom_image.c"
"${AOM_ROOT}/aom/src/aom_integer.c")
list(APPEND AOM_COMMON_APP_UTIL_SOURCES "${AOM_ROOT}/args.c"
"${AOM_ROOT}/args.h" "${AOM_ROOT}/md5_utils.c"
"${AOM_ROOT}/md5_utils.h" "${AOM_ROOT}/tools_common.c"
"${AOM_ROOT}/tools_common.h" "${AOM_ROOT}/video_common.h"
"${AOM_ROOT}/y4menc.c" "${AOM_ROOT}/y4menc.h")
list(APPEND AOM_DECODER_APP_UTIL_SOURCES "${AOM_ROOT}/ivfdec.c"
"${AOM_ROOT}/ivfdec.h" "${AOM_ROOT}/obudec.c"
"${AOM_ROOT}/obudec.h" "${AOM_ROOT}/video_reader.c"
"${AOM_ROOT}/video_reader.h")
list(APPEND AOM_COMMON_APP_UTIL_SOURCES "${AOM_ROOT}/common/args.c"
"${AOM_ROOT}/common/args.h" "${AOM_ROOT}/common/md5_utils.c"
"${AOM_ROOT}/common/md5_utils.h"
"${AOM_ROOT}/common/tools_common.c"
"${AOM_ROOT}/common/tools_common.h"
"${AOM_ROOT}/common/video_common.h" "${AOM_ROOT}/common/y4menc.c"
"${AOM_ROOT}/common/y4menc.h")
list(APPEND AOM_DECODER_APP_UTIL_SOURCES "${AOM_ROOT}/common/ivfdec.c"
"${AOM_ROOT}/common/ivfdec.h" "${AOM_ROOT}/common/obudec.c"
"${AOM_ROOT}/common/obudec.h" "${AOM_ROOT}/common/video_reader.c"
"${AOM_ROOT}/common/video_reader.h")
list(APPEND AOM_ENCODER_APP_UTIL_SOURCES
"${AOM_ROOT}/ivfenc.c"
"${AOM_ROOT}/ivfenc.h"
"${AOM_ROOT}/video_writer.c"
"${AOM_ROOT}/video_writer.h"
"${AOM_ROOT}/warnings.c"
"${AOM_ROOT}/warnings.h"
"${AOM_ROOT}/y4minput.c"
"${AOM_ROOT}/y4minput.h"
"${AOM_ROOT}/common/ivfenc.c"
"${AOM_ROOT}/common/ivfenc.h"
"${AOM_ROOT}/common/video_writer.c"
"${AOM_ROOT}/common/video_writer.h"
"${AOM_ROOT}/common/warnings.c"
"${AOM_ROOT}/common/warnings.h"
"${AOM_ROOT}/common/y4minput.c"
"${AOM_ROOT}/common/y4minput.h"
"${AOM_ROOT}/examples/encoder_util.h"
"${AOM_ROOT}/examples/encoder_util.c")
list(APPEND AOM_ENCODER_STATS_SOURCES "${AOM_ROOT}/aomstats.c"
"${AOM_ROOT}/aomstats.h" "${AOM_ROOT}/rate_hist.c"
"${AOM_ROOT}/rate_hist.h")
list(APPEND AOM_ENCODER_STATS_SOURCES "${AOM_ROOT}/stats/aomstats.c"
"${AOM_ROOT}/stats/aomstats.h" "${AOM_ROOT}/stats/rate_hist.c"
"${AOM_ROOT}/stats/rate_hist.h")
list(APPEND AOM_PKG_CONFIG_SOURCES "${AOM_CONFIG_DIR}/aom.pc")
list(APPEND AOM_VERSION_SOURCES "${AOM_CONFIG_DIR}/aom_version.h")
list(APPEND AOM_WEBM_DECODER_SOURCES "${AOM_ROOT}/webmdec.cc"
"${AOM_ROOT}/webmdec.h")
list(APPEND AOM_WEBM_DECODER_SOURCES "${AOM_ROOT}/common/webmdec.cc"
"${AOM_ROOT}/common/webmdec.h")
list(APPEND AOM_WEBM_ENCODER_SOURCES "${AOM_ROOT}/webmenc.cc"
"${AOM_ROOT}/webmenc.h")
list(APPEND AOM_WEBM_ENCODER_SOURCES "${AOM_ROOT}/common/webmenc.cc"
"${AOM_ROOT}/common/webmenc.h")
include_directories(${AOM_ROOT} ${AOM_CONFIG_DIR})
include_directories(${AOM_ROOT} ${AOM_CONFIG_DIR} ${AOM_ROOT}/apps
${AOM_ROOT}/common ${AOM_ROOT}/examples ${AOM_ROOT}/stats)
# Targets
add_library(aom_version ${AOM_VERSION_SOURCES})
......@@ -298,8 +301,14 @@ if(CONFIG_UNIT_TESTS OR ENABLE_EXAMPLES OR ENABLE_TOOLS)
endif()
endif()
if((CONFIG_AV1_DECODER OR CONFIG_AV1_ENCODER) AND ENABLE_EXAMPLES)
add_executable(resize_util "${AOM_ROOT}/examples/resize_util.c"
$<TARGET_OBJECTS:aom_common_app_util>)
list(APPEND AOM_APP_TARGETS resize_util)
endif()
if(CONFIG_AV1_DECODER AND ENABLE_EXAMPLES)
add_executable(aomdec "${AOM_ROOT}/aomdec.c"
add_executable(aomdec "${AOM_ROOT}/apps/aomdec.c"
$<TARGET_OBJECTS:aom_common_app_util>
$<TARGET_OBJECTS:aom_decoder_app_util>)
add_executable(decode_to_md5 "${AOM_ROOT}/examples/decode_to_md5.c"
......@@ -358,7 +367,7 @@ endif()
if(CONFIG_AV1_ENCODER)
if(ENABLE_EXAMPLES)
add_executable(aomenc "${AOM_ROOT}/aomenc.c"
add_executable(aomenc "${AOM_ROOT}/apps/aomenc.c"
$<TARGET_OBJECTS:aom_common_app_util>
$<TARGET_OBJECTS:aom_encoder_app_util>
$<TARGET_OBJECTS:aom_encoder_stats>)
......
......@@ -16,7 +16,7 @@
#include <string.h>
#include <limits.h>
#include "./aom_config.h"
#include "aom_config.h"
#if CONFIG_OS_SUPPORT
#if HAVE_UNISTD_H
......@@ -26,31 +26,26 @@
#endif
#endif
#if CONFIG_LIBYUV
#include "third_party/libyuv/include/libyuv/scale.h"
#endif
#include "./args.h"
#include "./ivfdec.h"
#include "aom/aom_decoder.h"
#include "aom_ports/mem_ops.h"
#include "aom/aomdx.h"
#include "aom_ports/aom_timer.h"
#include "aom_ports/mem_ops.h"
#include "common/args.h"
#include "common/ivfdec.h"
#include "common/md5_utils.h"
#include "common/obudec.h"
#include "common/tools_common.h"
#if CONFIG_AV1_DECODER
#include "aom/aomdx.h"
#if CONFIG_WEBM_IO
#include "common/webmdec.h"
#endif
#include "./md5_utils.h"
#include "./obudec.h"
#include "./tools_common.h"
#include "common/y4menc.h"
#if CONFIG_WEBM_IO
#include "./webmdec.h"
#if CONFIG_LIBYUV
#include "third_party/libyuv/include/libyuv/scale.h"
#endif
#include "./y4menc.h"
static const char *exec_name;
struct AvxDecInputContext {
......
......@@ -9,7 +9,7 @@
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#include "./aomenc.h"
#include "aomenc.h"
#include "./aom_config.h"
#include <assert.h>
......@@ -20,38 +20,34 @@
#include <stdlib.h>
#include <string.h>
#if CONFIG_LIBYUV
#include "third_party/libyuv/include/libyuv/scale.h"
#endif
#include "aom/aom_encoder.h"
#if CONFIG_AV1_DECODER
#include "aom/aom_decoder.h"
#endif
#include "./args.h"
#include "./ivfenc.h"
#include "./tools_common.h"
#include "examples/encoder_util.h"
#if CONFIG_AV1_ENCODER
#include "aom/aomcx.h"
#endif
#if CONFIG_AV1_DECODER
#include "aom/aomdx.h"
#endif
#include "./aomstats.h"
#include "./rate_hist.h"
#include "./warnings.h"
#include "aom/aom_encoder.h"
#include "aom/aom_integer.h"
#include "aom/aomcx.h"
#include "aom_dsp/aom_dsp_common.h"
#include "aom_ports/aom_timer.h"
#include "aom_ports/mem_ops.h"
#include "common/args.h"
#include "common/ivfenc.h"
#include "common/tools_common.h"
#include "common/warnings.h"
#if CONFIG_WEBM_IO
#include "./webmenc.h"
#include "common/webmenc.h"
#endif
#include "common/y4minput.h"
#include "examples/encoder_util.h"
#include "stats/aomstats.h"
#include "stats/rate_hist.h"
#if CONFIG_LIBYUV
#include "third_party/libyuv/include/libyuv/scale.h"
#endif
#include "./y4minput.h"
/* Swallow warnings about unused results of fread/fwrite */
static size_t wrap_fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
......
......@@ -22,7 +22,7 @@
#include <string.h> /* for memcpy() */
#include "md5_utils.h"
#include "common/md5_utils.h"
static void byteSwap(UWORD32 *buf, unsigned words) {
md5byte *p;
......
......@@ -27,7 +27,7 @@ set(AOM_DOXYGEN_SOURCES "${AOM_ROOT}/aom/aom.h" "${AOM_ROOT}/aom/aom_codec.h"
if(CONFIG_AV1_DECODER)
set(AOM_DOXYGEN_EXAMPLE_SOURCES ${AOM_DOXYGEN_EXAMPLE_SOURCES}
"${AOM_ROOT}/aomdec.c" "${AOM_ROOT}/examples/decode_to_md5.c"
"${AOM_ROOT}/apps/aomdec.c" "${AOM_ROOT}/examples/decode_to_md5.c"
"${AOM_ROOT}/examples/decode_with_drops.c"
"${AOM_ROOT}/examples/simple_decoder.c")
......@@ -60,7 +60,7 @@ endif()
if(CONFIG_AV1_ENCODER)
set(AOM_DOXYGEN_EXAMPLE_SOURCES ${AOM_DOXYGEN_EXAMPLE_SOURCES}
"${AOM_ROOT}/aomenc.c" "${AOM_ROOT}/examples/lossless_encoder.c"
"${AOM_ROOT}/apps/aomenc.c" "${AOM_ROOT}/examples/lossless_encoder.c"
"${AOM_ROOT}/examples/set_maps.c" "${AOM_ROOT}/examples/simple_encoder.c"
"${AOM_ROOT}/examples/twopass_encoder.c")
......
......@@ -12,13 +12,14 @@
#include <wx/aboutdlg.h>
#include <wx/cmdline.h>
#include <wx/dcbuffer.h>
#include "./tools_common.h"
#include "./video_reader.h"
#include "aom/aom_decoder.h"
#include "aom/aomdx.h"
#include "av1/decoder/accounting.h"
#include "av1/common/onyxc_int.h"
#include "av1/decoder/accounting.h"
#include "av1/decoder/inspection.h"
#include "common/tools_common.h"
#include "common/video_reader.h"
#define OD_SIGNMASK(a) (-((a) < 0))
#define OD_FLIPSIGNI(a, b) (((a) + OD_SIGNMASK(b)) ^ OD_SIGNMASK(b))
......
......@@ -51,12 +51,12 @@
#include <stdlib.h>
#include <string.h>
#include "aom/aomcx.h"
#include "aom/aom_decoder.h"
#include "aom/aom_encoder.h"
#include "aom/aomcx.h"
#include "common/tools_common.h"
#include "common/video_writer.h"
#include "examples/encoder_util.h"
#include "./tools_common.h"
#include "./video_writer.h"
#define AOM_BORDER_IN_PIXELS 288
......
......@@ -34,13 +34,11 @@
#include <stdlib.h>
#include <string.h>
#include "aom/aomdx.h"
#include "aom/aom_decoder.h"
#include "../md5_utils.h"
#include "../tools_common.h"
#include "../video_reader.h"
#include "./aom_config.h"
#include "aom/aomdx.h"
#include "common/md5_utils.h"
#include "common/tools_common.h"
#include "common/video_reader.h"
static void get_image_md5(const aom_image_t *img, unsigned char digest[16]) {
int plane, y;
......
......@@ -57,12 +57,10 @@
#include <stdlib.h>
#include <string.h>
#include "aom/aomdx.h"
#include "aom/aom_decoder.h"
#include "../tools_common.h"
#include "../video_reader.h"
#include "./aom_config.h"
#include "aom/aomdx.h"
#include "common/tools_common.h"
#include "common/video_reader.h"
static const char *exec_name;
......
......@@ -11,10 +11,11 @@
// Utility functions used by encoder binaries.
#include "encoder_util.h"
#include <assert.h>
#include <string.h>
#include "./encoder_util.h"
#include "aom/aom_integer.h"
#define mmin(a, b) ((a) < (b) ? (a) : (b))
......
......@@ -14,7 +14,6 @@
#ifndef EXAMPLES_ENCODER_UTIL_H_
#define EXAMPLES_ENCODER_UTIL_H_
#include "./aom_config.h"
#include "aom/aom_image.h"
// Returns mismatch location (?loc[0],?loc[1]) and the values at that location
......
......@@ -19,27 +19,27 @@
#include <stdlib.h>
#include <string.h>
#include "./args.h"
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#else
#define EMSCRIPTEN_KEEPALIVE
#endif
#include "aom/aom_decoder.h"
#include "./aom_config.h"
#if CONFIG_ACCOUNTING
#include "../av1/decoder/accounting.h"
#endif
#include "../av1/decoder/inspection.h"
#include "aom/aom_decoder.h"
#include "aom/aomdx.h"
#include "av1/common/onyxc_int.h"
#include "../tools_common.h"
#include "../video_reader.h"
// #include "av1/av1_dx_iface.c"
#include "../av1/common/onyxc_int.h"
#if CONFIG_ACCOUNTING
#include "av1/decoder/accounting.h"
#endif
#include "../video_common.h"
#include "av1/decoder/inspection.h"
#include "common/args.h"
#include "common/tools_common.h"
#include "common/video_common.h"
#include "common/video_reader.h"
// Max JSON buffer size.
const int MAX_BUFFER = 1024 * 1024 * 32;
......
......@@ -29,10 +29,8 @@
#include "aom/aom_decoder.h"
#include "aom/aomdx.h"
#include "../tools_common.h"
#include "../video_reader.h"
#include "./aom_config.h"
#include "common/tools_common.h"
#include "common/video_reader.h"
static const char *exec_name;
......
......@@ -39,8 +39,8 @@
#include "aom/aomcx.h"
#include "av1/common/enums.h"
#include "../tools_common.h"
#include "../video_writer.h"
#include "common/tools_common.h"
#include "common/video_writer.h"
static const char *exec_name;
......
......@@ -15,9 +15,8 @@
#include "aom/aom_encoder.h"
#include "aom/aomcx.h"
#include "../tools_common.h"
#include "../video_writer.h"
#include "common/tools_common.h"
#include "common/video_writer.h"
static const char *exec_name;
......
......@@ -24,18 +24,20 @@
#include <stdlib.h>
#include <string.h>
#include "../args.h"
#include "../tools_common.h"
#include "../video_writer.h"
#include "aom/aom_encoder.h"
#include "aom_dsp/aom_dsp_common.h"
#if CONFIG_AV1_DECODER
#include "aom_dsp/grain_synthesis.h"
#endif
#include "aom_dsp/grain_table.h"
#include "aom_dsp/noise_model.h"
#include "aom_dsp/noise_util.h"
#include "aom_mem/aom_mem.h"
#include "common/args.h"
#include "common/tools_common.h"
#include "common/video_writer.h"
static const char *exec_name;
......
......@@ -16,8 +16,8 @@
#include <stdlib.h>
#include <string.h>
#include "../tools_common.h"
#include "../av1/encoder/av1_resize.h"
#include "av1/common/resize.h"
#include "common/tools_common.h"
static const char *exec_name = NULL;
......
......@@ -75,11 +75,9 @@
#include <string.h>
#include "aom/aom_decoder.h"
#include "../tools_common.h"
#include "../video_reader.h"
#include "./aom_config.h"
#include "./obudec.h"
#include "common/obudec.h"
#include "common/tools_common.h"
#include "common/video_reader.h"
static const char *exec_name;
......
......@@ -76,9 +76,8 @@
#include "aom/aom_encoder.h"
#include "aom/aomcx.h"
#include "av1/common/enums.h"
#include "../tools_common.h"
#include "../video_writer.h"
#include "common/tools_common.h"
#include "common/video_writer.h"
static const char *exec_name;
......
......@@ -47,11 +47,10 @@
#include <stdlib.h>
#include <string.h>
#include "aom/aomcx.h"
#include "aom/aom_encoder.h"
#include "../tools_common.h"
#include "../video_writer.h"
#include "aom/aomcx.h"
#include "common/tools_common.h"
#include "common/video_writer.h"
static const char *exec_name;
......
......@@ -79,10 +79,8 @@
#include <string.h>
#include "aom/aom_decoder.h"
#include "../tools_common.h"
#include "../video_reader.h"
#include "./aom_config.h"
#include "common/tools_common.h"
#include "common/video_reader.h"
static const char *exec_name;
......
......@@ -100,9 +100,8 @@
#include <string.h>
#include "aom/aom_encoder.h"
#include "../tools_common.h"
#include "../video_writer.h"
#include "common/tools_common.h"
#include "common/video_writer.h"
static const char *exec_name;
......
......@@ -52,9 +52,8 @@
#include <string.h>
#include "aom/aom_encoder.h"
#include "../tools_common.h"
#include "../video_writer.h"
#include "common/tools_common.h"
#include "common/video_writer.h"
static const char *exec_name;
......
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