Port renaming changes from AOMedia
Cherry-Picked the following commits:
0defd8f Changed "WebM" to "AOMedia" & "webm" to "aomedia"
54e6676 Replace "VPx" by "AVx"
5082a36 Change "Vpx" to "Avx"
7df44f1 Replace "Vp9" w/ "Av1"
967f722 Remove kVp9CodecId
828f30c Change "Vp8" to "AOM"
030b5ff AUTHORS regenerated
2524cae Add ref-mv experimental flag
016762b Change copyright notice to AOMedia form
81e5526 Replace vp9 w/ av1
9b94565 Add missing files
fa8ca9f Change "vp9" to "av1"
ec838b7 Convert "vp8" to "aom"
80edfa0 Change "VP9" to "AV1"
d1a11fb Change "vp8" to "aom"
7b58251 Point to WebM test data
dd1a5c8 Replace "VP8" with "AOM"
ff00fc0 Change "VPX" to "AOM"
01dee0b Change "vp10" to "av1" in source code
cebe6f0 Convert "vpx" to "aom"
17b0567 rename vp10*.mk to av1_*.mk
fe5f8a8 rename files vp10_* to av1_*
Change-Id: I6fc3d18eb11fc171e46140c836ad5339cf6c9419
diff --git a/aom_util/vpx_thread.c b/aom_util/aom_thread.c
similarity index 84%
rename from aom_util/vpx_thread.c
rename to aom_util/aom_thread.c
index 01930b6..346fa6f 100644
--- a/aom_util/vpx_thread.c
+++ b/aom_util/aom_thread.c
@@ -14,12 +14,12 @@
#include <assert.h>
#include <string.h> // for memset()
-#include "./vpx_thread.h"
-#include "aom_mem/vpx_mem.h"
+#include "./aom_thread.h"
+#include "aom_mem/aom_mem.h"
#if CONFIG_MULTITHREAD
-struct VPxWorkerImpl {
+struct AVxWorkerImpl {
pthread_mutex_t mutex_;
pthread_cond_t condition_;
pthread_t thread_;
@@ -27,10 +27,10 @@
//------------------------------------------------------------------------------
-static void execute(VPxWorker *const worker); // Forward declaration.
+static void execute(AVxWorker *const worker); // Forward declaration.
static THREADFN thread_loop(void *ptr) {
- VPxWorker *const worker = (VPxWorker *)ptr;
+ AVxWorker *const worker = (AVxWorker *)ptr;
int done = 0;
while (!done) {
pthread_mutex_lock(&worker->impl_->mutex_);
@@ -51,7 +51,7 @@
}
// main thread state control
-static void change_state(VPxWorker *const worker, VPxWorkerStatus new_status) {
+static void change_state(AVxWorker *const worker, AVxWorkerStatus new_status) {
// No-op when attempting to change state on a thread that didn't come up.
// Checking status_ without acquiring the lock first would result in a data
// race.
@@ -76,12 +76,12 @@
//------------------------------------------------------------------------------
-static void init(VPxWorker *const worker) {
+static void init(AVxWorker *const worker) {
memset(worker, 0, sizeof(*worker));
worker->status_ = NOT_OK;
}
-static int sync(VPxWorker *const worker) {
+static int sync(AVxWorker *const worker) {
#if CONFIG_MULTITHREAD
change_state(worker, OK);
#endif
@@ -89,12 +89,12 @@
return !worker->had_error;
}
-static int reset(VPxWorker *const worker) {
+static int reset(AVxWorker *const worker) {
int ok = 1;
worker->had_error = 0;
if (worker->status_ < OK) {
#if CONFIG_MULTITHREAD
- worker->impl_ = (VPxWorkerImpl *)vpx_calloc(1, sizeof(*worker->impl_));
+ worker->impl_ = (AVxWorkerImpl *)aom_calloc(1, sizeof(*worker->impl_));
if (worker->impl_ == NULL) {
return 0;
}
@@ -113,7 +113,7 @@
pthread_mutex_destroy(&worker->impl_->mutex_);
pthread_cond_destroy(&worker->impl_->condition_);
Error:
- vpx_free(worker->impl_);
+ aom_free(worker->impl_);
worker->impl_ = NULL;
return 0;
}
@@ -127,13 +127,13 @@
return ok;
}
-static void execute(VPxWorker *const worker) {
+static void execute(AVxWorker *const worker) {
if (worker->hook != NULL) {
worker->had_error |= !worker->hook(worker->data1, worker->data2);
}
}
-static void launch(VPxWorker *const worker) {
+static void launch(AVxWorker *const worker) {
#if CONFIG_MULTITHREAD
change_state(worker, WORK);
#else
@@ -141,14 +141,14 @@
#endif
}
-static void end(VPxWorker *const worker) {
+static void end(AVxWorker *const worker) {
#if CONFIG_MULTITHREAD
if (worker->impl_ != NULL) {
change_state(worker, NOT_OK);
pthread_join(worker->impl_->thread_, NULL);
pthread_mutex_destroy(&worker->impl_->mutex_);
pthread_cond_destroy(&worker->impl_->condition_);
- vpx_free(worker->impl_);
+ aom_free(worker->impl_);
worker->impl_ = NULL;
}
#else
@@ -160,10 +160,10 @@
//------------------------------------------------------------------------------
-static VPxWorkerInterface g_worker_interface = { init, reset, sync,
+static AVxWorkerInterface g_worker_interface = { init, reset, sync,
launch, execute, end };
-int vpx_set_worker_interface(const VPxWorkerInterface *const winterface) {
+int aom_set_worker_interface(const AVxWorkerInterface *const winterface) {
if (winterface == NULL || winterface->init == NULL ||
winterface->reset == NULL || winterface->sync == NULL ||
winterface->launch == NULL || winterface->execute == NULL ||
@@ -174,7 +174,7 @@
return 1;
}
-const VPxWorkerInterface *vpx_get_worker_interface(void) {
+const AVxWorkerInterface *aom_get_worker_interface(void) {
return &g_worker_interface;
}
diff --git a/aom_util/vpx_thread.h b/aom_util/aom_thread.h
similarity index 94%
rename from aom_util/vpx_thread.h
rename to aom_util/aom_thread.h
index 3b852b2..799c9ff 100644
--- a/aom_util/vpx_thread.h
+++ b/aom_util/aom_thread.h
@@ -12,10 +12,10 @@
// Original source:
// https://chromium.googlesource.com/webm/libwebp
-#ifndef VPX_THREAD_H_
-#define VPX_THREAD_H_
+#ifndef AOM_THREAD_H_
+#define AOM_THREAD_H_
-#include "./vpx_config.h"
+#include "./aom_config.h"
#ifdef __cplusplus
extern "C" {
@@ -347,59 +347,59 @@
NOT_OK = 0, // object is unusable
OK, // ready to work
WORK // busy finishing the current task
-} VPxWorkerStatus;
+} AVxWorkerStatus;
// Function to be called by the worker thread. Takes two opaque pointers as
// arguments (data1 and data2), and should return false in case of error.
-typedef int (*VPxWorkerHook)(void *, void *);
+typedef int (*AVxWorkerHook)(void *, void *);
// Platform-dependent implementation details for the worker.
-typedef struct VPxWorkerImpl VPxWorkerImpl;
+typedef struct AVxWorkerImpl AVxWorkerImpl;
// Synchronization object used to launch job in the worker thread
typedef struct {
- VPxWorkerImpl *impl_;
- VPxWorkerStatus status_;
- VPxWorkerHook hook; // hook to call
+ AVxWorkerImpl *impl_;
+ AVxWorkerStatus status_;
+ AVxWorkerHook hook; // hook to call
void *data1; // first argument passed to 'hook'
void *data2; // second argument passed to 'hook'
int had_error; // return value of the last call to 'hook'
-} VPxWorker;
+} AVxWorker;
// The interface for all thread-worker related functions. All these functions
// must be implemented.
typedef struct {
// Must be called first, before any other method.
- void (*init)(VPxWorker *const worker);
+ void (*init)(AVxWorker *const worker);
// Must be called to initialize the object and spawn the thread. Re-entrant.
// Will potentially launch the thread. Returns false in case of error.
- int (*reset)(VPxWorker *const worker);
+ int (*reset)(AVxWorker *const worker);
// Makes sure the previous work is finished. Returns true if worker->had_error
// was not set and no error condition was triggered by the working thread.
- int (*sync)(VPxWorker *const worker);
+ int (*sync)(AVxWorker *const worker);
// Triggers the thread to call hook() with data1 and data2 arguments. These
// hook/data1/data2 values can be changed at any time before calling this
// function, but not be changed afterward until the next call to Sync().
- void (*launch)(VPxWorker *const worker);
+ void (*launch)(AVxWorker *const worker);
// This function is similar to launch() except that it calls the
// hook directly instead of using a thread. Convenient to bypass the thread
- // mechanism while still using the VPxWorker structs. sync() must
+ // mechanism while still using the AVxWorker structs. sync() must
// still be called afterward (for error reporting).
- void (*execute)(VPxWorker *const worker);
+ void (*execute)(AVxWorker *const worker);
// Kill the thread and terminate the object. To use the object again, one
// must call reset() again.
- void (*end)(VPxWorker *const worker);
-} VPxWorkerInterface;
+ void (*end)(AVxWorker *const worker);
+} AVxWorkerInterface;
// Install a new set of threading functions, overriding the defaults. This
// should be done before any workers are started, i.e., before any encoding or
// decoding takes place. The contents of the interface struct are copied, it
// is safe to free the corresponding memory after this call. This function is
// not thread-safe. Return false in case of invalid pointer or methods.
-int vpx_set_worker_interface(const VPxWorkerInterface *const winterface);
+int aom_set_worker_interface(const AVxWorkerInterface *const winterface);
// Retrieve the currently set thread worker interface.
-const VPxWorkerInterface *vpx_get_worker_interface(void);
+const AVxWorkerInterface *aom_get_worker_interface(void);
//------------------------------------------------------------------------------
@@ -407,4 +407,4 @@
} // extern "C"
#endif
-#endif // VPX_THREAD_H_
+#endif // AOM_THREAD_H_
diff --git a/aom_util/vpx_util.mk b/aom_util/aom_util.mk
similarity index 84%
rename from aom_util/vpx_util.mk
rename to aom_util/aom_util.mk
index 480e61f..b634f7f 100644
--- a/aom_util/vpx_util.mk
+++ b/aom_util/aom_util.mk
@@ -8,9 +8,9 @@
## be found in the AUTHORS file in the root of the source tree.
##
-UTIL_SRCS-yes += vpx_util.mk
-UTIL_SRCS-yes += vpx_thread.c
-UTIL_SRCS-yes += vpx_thread.h
+UTIL_SRCS-yes += aom_util.mk
+UTIL_SRCS-yes += aom_thread.c
+UTIL_SRCS-yes += aom_thread.h
UTIL_SRCS-yes += debug_util.c
UTIL_SRCS-yes += debug_util.h
UTIL_SRCS-yes += endian_inl.h
diff --git a/aom_util/debug_util.h b/aom_util/debug_util.h
index 0438be4..aa6896c 100644
--- a/aom_util/debug_util.h
+++ b/aom_util/debug_util.h
@@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VPX_UTIL_DEBUG_UTIL_H_
-#define VPX_UTIL_DEBUG_UTIL_H_
+#ifndef AOM_UTIL_DEBUG_UTIL_H_
+#define AOM_UTIL_DEBUG_UTIL_H_
-#include "./vpx_config.h"
+#include "./aom_config.h"
#ifdef __cplusplus
extern "C" {
@@ -40,4 +40,4 @@
} // extern "C"
#endif
-#endif // VPX_UTIL_DEBUG_UTIL_H_
+#endif // AOM_UTIL_DEBUG_UTIL_H_
diff --git a/aom_util/endian_inl.h b/aom_util/endian_inl.h
index 36b8138..9eb0e35 100644
--- a/aom_util/endian_inl.h
+++ b/aom_util/endian_inl.h
@@ -9,12 +9,12 @@
//
// Endian related functions.
-#ifndef VPX_UTIL_ENDIAN_INL_H_
-#define VPX_UTIL_ENDIAN_INL_H_
+#ifndef AOM_UTIL_ENDIAN_INL_H_
+#define AOM_UTIL_ENDIAN_INL_H_
#include <stdlib.h>
-#include "./vpx_config.h"
-#include "aom/vpx_integer.h"
+#include "./aom_config.h"
+#include "aom/aom_integer.h"
#if defined(__GNUC__)
#define LOCAL_GCC_VERSION ((__GNUC__ << 8) | __GNUC_MINOR__)
@@ -62,7 +62,7 @@
#if HAVE_MIPS32 && defined(__mips__) && !defined(__mips64) && \
defined(__mips_isa_rev) && (__mips_isa_rev >= 2) && (__mips_isa_rev < 6)
-#define VPX_USE_MIPS32_R2
+#define AOM_USE_MIPS32_R2
#endif
static INLINE uint16_t BSwap16(uint16_t x) {
@@ -77,7 +77,7 @@
}
static INLINE uint32_t BSwap32(uint32_t x) {
-#if defined(VPX_USE_MIPS32_R2)
+#if defined(AOM_USE_MIPS32_R2)
uint32_t ret;
__asm__ volatile(
"wsbh %[ret], %[x] \n\t"
@@ -115,4 +115,4 @@
#endif // HAVE_BUILTIN_BSWAP64
}
-#endif // VPX_UTIL_ENDIAN_INL_H_
+#endif // AOM_UTIL_ENDIAN_INL_H_