Commit 54e66767 authored by Adrian Grange's avatar Adrian Grange

Replace "VPx" by "AVx"

Change-Id: If363eccaa8be7fb9f8cf41488bf3f5e6d4c00645
parent 5082a369
...@@ -406,7 +406,7 @@ typedef struct aom_codec_enc_cfg { ...@@ -406,7 +406,7 @@ typedef struct aom_codec_enc_cfg {
* trade-off is often acceptable, but for many applications is not. It can * trade-off is often acceptable, but for many applications is not. It can
* be disabled in these cases. * be disabled in these cases.
* *
* Note that not all codecs support this feature. All aom VPx codecs do. * Note that not all codecs support this feature. All aom AVx codecs do.
* For other codecs, consult the documentation for that algorithm. * For other codecs, consult the documentation for that algorithm.
* *
* This threshold is described as a percentage of the target data buffer. * This threshold is described as a percentage of the target data buffer.
...@@ -842,11 +842,11 @@ aom_codec_err_t aom_codec_enc_config_set(aom_codec_ctx_t *ctx, ...@@ -842,11 +842,11 @@ aom_codec_err_t aom_codec_enc_config_set(aom_codec_ctx_t *ctx,
aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx); aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx);
#define AOM_DL_REALTIME (1) #define AOM_DL_REALTIME (1)
/**< deadline parameter analogous to VPx REALTIME mode. */ /**< deadline parameter analogous to AVx REALTIME mode. */
#define AOM_DL_GOOD_QUALITY (1000000) #define AOM_DL_GOOD_QUALITY (1000000)
/**< deadline parameter analogous to VPx GOOD QUALITY mode. */ /**< deadline parameter analogous to AVx GOOD QUALITY mode. */
#define AOM_DL_BEST_QUALITY (0) #define AOM_DL_BEST_QUALITY (0)
/**< deadline parameter analogous to VPx BEST QUALITY mode. */ /**< deadline parameter analogous to AVx BEST QUALITY mode. */
/*!\brief Encode a frame /*!\brief Encode a frame
* *
* Encodes a video frame at the given "presentation time." The presentation * Encodes a video frame at the given "presentation time." The presentation
...@@ -858,7 +858,7 @@ aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx); ...@@ -858,7 +858,7 @@ aom_fixed_buf_t *aom_codec_get_global_headers(aom_codec_ctx_t *ctx);
* implicit that limiting the available time to encode will degrade the * implicit that limiting the available time to encode will degrade the
* output quality. The encoder can be given an unlimited time to produce the * output quality. The encoder can be given an unlimited time to produce the
* best possible frame by specifying a deadline of '0'. This deadline * best possible frame by specifying a deadline of '0'. This deadline
* supercedes the VPx notion of "best quality, good quality, realtime". * supercedes the AVx notion of "best quality, good quality, realtime".
* Applications that wish to map these former settings to the new deadline * Applications that wish to map these former settings to the new deadline
* based system can use the symbols #AOM_DL_REALTIME, #AOM_DL_GOOD_QUALITY, * based system can use the symbols #AOM_DL_REALTIME, #AOM_DL_GOOD_QUALITY,
* and #AOM_DL_BEST_QUALITY. * and #AOM_DL_BEST_QUALITY.
......
...@@ -107,9 +107,9 @@ extern aom_codec_iface_t *aom_codec_av1_cx(void); ...@@ -107,9 +107,9 @@ extern aom_codec_iface_t *aom_codec_av1_cx(void);
*/ */
#define AOM_EFLAG_NO_UPD_ENTROPY (1 << 20) #define AOM_EFLAG_NO_UPD_ENTROPY (1 << 20)
/*!\brief VPx encoder control functions /*!\brief AVx encoder control functions
* *
* This set of macros define the control functions available for VPx * This set of macros define the control functions available for AVx
* encoder interface. * encoder interface.
* *
* \sa #aom_codec_control * \sa #aom_codec_control
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
struct VPxWorkerImpl { struct AVxWorkerImpl {
pthread_mutex_t mutex_; pthread_mutex_t mutex_;
pthread_cond_t condition_; pthread_cond_t condition_;
pthread_t thread_; pthread_t thread_;
...@@ -30,10 +30,10 @@ struct VPxWorkerImpl { ...@@ -30,10 +30,10 @@ struct VPxWorkerImpl {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static void execute(VPxWorker *const worker); // Forward declaration. static void execute(AVxWorker *const worker); // Forward declaration.
static THREADFN thread_loop(void *ptr) { static THREADFN thread_loop(void *ptr) {
VPxWorker *const worker = (VPxWorker *)ptr; AVxWorker *const worker = (AVxWorker *)ptr;
int done = 0; int done = 0;
while (!done) { while (!done) {
pthread_mutex_lock(&worker->impl_->mutex_); pthread_mutex_lock(&worker->impl_->mutex_);
...@@ -54,7 +54,7 @@ static THREADFN thread_loop(void *ptr) { ...@@ -54,7 +54,7 @@ static THREADFN thread_loop(void *ptr) {
} }
// main thread state control // 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. // 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 // Checking status_ without acquiring the lock first would result in a data
// race. // race.
...@@ -79,12 +79,12 @@ static void change_state(VPxWorker *const worker, VPxWorkerStatus new_status) { ...@@ -79,12 +79,12 @@ static void change_state(VPxWorker *const worker, VPxWorkerStatus new_status) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static void init(VPxWorker *const worker) { static void init(AVxWorker *const worker) {
memset(worker, 0, sizeof(*worker)); memset(worker, 0, sizeof(*worker));
worker->status_ = NOT_OK; worker->status_ = NOT_OK;
} }
static int sync(VPxWorker *const worker) { static int sync(AVxWorker *const worker) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
change_state(worker, OK); change_state(worker, OK);
#endif #endif
...@@ -92,12 +92,12 @@ static int sync(VPxWorker *const worker) { ...@@ -92,12 +92,12 @@ static int sync(VPxWorker *const worker) {
return !worker->had_error; return !worker->had_error;
} }
static int reset(VPxWorker *const worker) { static int reset(AVxWorker *const worker) {
int ok = 1; int ok = 1;
worker->had_error = 0; worker->had_error = 0;
if (worker->status_ < OK) { if (worker->status_ < OK) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
worker->impl_ = (VPxWorkerImpl *)aom_calloc(1, sizeof(*worker->impl_)); worker->impl_ = (AVxWorkerImpl *)aom_calloc(1, sizeof(*worker->impl_));
if (worker->impl_ == NULL) { if (worker->impl_ == NULL) {
return 0; return 0;
} }
...@@ -130,13 +130,13 @@ static int reset(VPxWorker *const worker) { ...@@ -130,13 +130,13 @@ static int reset(VPxWorker *const worker) {
return ok; return ok;
} }
static void execute(VPxWorker *const worker) { static void execute(AVxWorker *const worker) {
if (worker->hook != NULL) { if (worker->hook != NULL) {
worker->had_error |= !worker->hook(worker->data1, worker->data2); worker->had_error |= !worker->hook(worker->data1, worker->data2);
} }
} }
static void launch(VPxWorker *const worker) { static void launch(AVxWorker *const worker) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
change_state(worker, WORK); change_state(worker, WORK);
#else #else
...@@ -144,7 +144,7 @@ static void launch(VPxWorker *const worker) { ...@@ -144,7 +144,7 @@ static void launch(VPxWorker *const worker) {
#endif #endif
} }
static void end(VPxWorker *const worker) { static void end(AVxWorker *const worker) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
if (worker->impl_ != NULL) { if (worker->impl_ != NULL) {
change_state(worker, NOT_OK); change_state(worker, NOT_OK);
...@@ -163,10 +163,10 @@ static void end(VPxWorker *const worker) { ...@@ -163,10 +163,10 @@ static void end(VPxWorker *const worker) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
static VPxWorkerInterface g_worker_interface = { init, reset, sync, static AVxWorkerInterface g_worker_interface = { init, reset, sync,
launch, execute, end }; launch, execute, end };
int aom_set_worker_interface(const VPxWorkerInterface *const winterface) { int aom_set_worker_interface(const AVxWorkerInterface *const winterface) {
if (winterface == NULL || winterface->init == NULL || if (winterface == NULL || winterface->init == NULL ||
winterface->reset == NULL || winterface->sync == NULL || winterface->reset == NULL || winterface->sync == NULL ||
winterface->launch == NULL || winterface->execute == NULL || winterface->launch == NULL || winterface->execute == NULL ||
...@@ -177,7 +177,7 @@ int aom_set_worker_interface(const VPxWorkerInterface *const winterface) { ...@@ -177,7 +177,7 @@ int aom_set_worker_interface(const VPxWorkerInterface *const winterface) {
return 1; return 1;
} }
const VPxWorkerInterface *aom_get_worker_interface(void) { const AVxWorkerInterface *aom_get_worker_interface(void) {
return &g_worker_interface; return &g_worker_interface;
} }
......
...@@ -158,59 +158,59 @@ typedef enum { ...@@ -158,59 +158,59 @@ typedef enum {
NOT_OK = 0, // object is unusable NOT_OK = 0, // object is unusable
OK, // ready to work OK, // ready to work
WORK // busy finishing the current task WORK // busy finishing the current task
} VPxWorkerStatus; } AVxWorkerStatus;
// Function to be called by the worker thread. Takes two opaque pointers as // 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. // 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. // 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 // Synchronization object used to launch job in the worker thread
typedef struct { typedef struct {
VPxWorkerImpl *impl_; AVxWorkerImpl *impl_;
VPxWorkerStatus status_; AVxWorkerStatus status_;
VPxWorkerHook hook; // hook to call AVxWorkerHook hook; // hook to call
void *data1; // first argument passed to 'hook' void *data1; // first argument passed to 'hook'
void *data2; // second argument passed to 'hook' void *data2; // second argument passed to 'hook'
int had_error; // return value of the last call 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 // The interface for all thread-worker related functions. All these functions
// must be implemented. // must be implemented.
typedef struct { typedef struct {
// Must be called first, before any other method. // 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. // Must be called to initialize the object and spawn the thread. Re-entrant.
// Will potentially launch the thread. Returns false in case of error. // 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 // 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. // 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 // 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 // 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(). // 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 // This function is similar to launch() except that it calls the
// hook directly instead of using a thread. Convenient to bypass the thread // 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). // 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 // Kill the thread and terminate the object. To use the object again, one
// must call reset() again. // must call reset() again.
void (*end)(VPxWorker *const worker); void (*end)(AVxWorker *const worker);
} VPxWorkerInterface; } AVxWorkerInterface;
// Install a new set of threading functions, overriding the defaults. This // 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 // 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 // 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 // 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. // not thread-safe. Return false in case of invalid pointer or methods.
int aom_set_worker_interface(const VPxWorkerInterface *const winterface); int aom_set_worker_interface(const AVxWorkerInterface *const winterface);
// Retrieve the currently set thread worker interface. // Retrieve the currently set thread worker interface.
const VPxWorkerInterface *aom_get_worker_interface(void); const AVxWorkerInterface *aom_get_worker_interface(void);
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
This diff is collapsed.
...@@ -93,7 +93,7 @@ typedef struct { ...@@ -93,7 +93,7 @@ typedef struct {
// frame_worker_owner indicates which FrameWorker owns this buffer. NULL means // frame_worker_owner indicates which FrameWorker owns this buffer. NULL means
// that no FrameWorker owns, or is decoding, this buffer. // that no FrameWorker owns, or is decoding, this buffer.
VPxWorker *frame_worker_owner; AVxWorker *frame_worker_owner;
// row and col indicate which position frame has been decoded to in real // row and col indicate which position frame has been decoded to in real
// pixel unit. They are reset to -1 when decoding begins and set to INT_MAX // pixel unit. They are reset to -1 when decoding begins and set to INT_MAX
......
...@@ -153,9 +153,9 @@ static int loop_filter_row_worker(AV1LfSync *const lf_sync, ...@@ -153,9 +153,9 @@ static int loop_filter_row_worker(AV1LfSync *const lf_sync,
static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
struct macroblockd_plane planes[MAX_MB_PLANE], struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only, int start, int stop, int y_only,
VPxWorker *workers, int nworkers, AVxWorker *workers, int nworkers,
AV1LfSync *lf_sync) { AV1LfSync *lf_sync) {
const VPxWorkerInterface *const winterface = aom_get_worker_interface(); const AVxWorkerInterface *const winterface = aom_get_worker_interface();
// Number of superblock rows and cols // Number of superblock rows and cols
const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2; const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2;
// Decoder may allocate more threads than number of tiles based on user's // Decoder may allocate more threads than number of tiles based on user's
...@@ -182,10 +182,10 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, ...@@ -182,10 +182,10 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
// because of contention. If the multithreading code changes in the future // because of contention. If the multithreading code changes in the future
// then the number of workers used by the loopfilter should be revisited. // then the number of workers used by the loopfilter should be revisited.
for (i = 0; i < num_workers; ++i) { for (i = 0; i < num_workers; ++i) {
VPxWorker *const worker = &workers[i]; AVxWorker *const worker = &workers[i];
LFWorkerData *const lf_data = &lf_sync->lfdata[i]; LFWorkerData *const lf_data = &lf_sync->lfdata[i];
worker->hook = (VPxWorkerHook)loop_filter_row_worker; worker->hook = (AVxWorkerHook)loop_filter_row_worker;
worker->data1 = lf_sync; worker->data1 = lf_sync;
worker->data2 = lf_data; worker->data2 = lf_data;
...@@ -212,7 +212,7 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, ...@@ -212,7 +212,7 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
void av1_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, void av1_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
struct macroblockd_plane planes[MAX_MB_PLANE], struct macroblockd_plane planes[MAX_MB_PLANE],
int frame_filter_level, int y_only, int frame_filter_level, int y_only,
int partial_frame, VPxWorker *workers, int partial_frame, AVxWorker *workers,
int num_workers, AV1LfSync *lf_sync) { int num_workers, AV1LfSync *lf_sync) {
int start_mi_row, end_mi_row, mi_rows_to_filter; int start_mi_row, end_mi_row, mi_rows_to_filter;
......
...@@ -51,7 +51,7 @@ void av1_loop_filter_dealloc(AV1LfSync *lf_sync); ...@@ -51,7 +51,7 @@ void av1_loop_filter_dealloc(AV1LfSync *lf_sync);
void av1_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, struct AV1Common *cm, void av1_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame, struct AV1Common *cm,
struct macroblockd_plane planes[MAX_MB_PLANE], struct macroblockd_plane planes[MAX_MB_PLANE],
int frame_filter_level, int y_only, int frame_filter_level, int y_only,
int partial_frame, VPxWorker *workers, int partial_frame, AVxWorker *workers,
int num_workers, AV1LfSync *lf_sync); int num_workers, AV1LfSync *lf_sync);
void av1_accumulate_frame_counts(struct AV1Common *cm, void av1_accumulate_frame_counts(struct AV1Common *cm,
......
...@@ -1491,7 +1491,7 @@ static void get_tile_buffers(AV1Decoder *pbi, const uint8_t *data, ...@@ -1491,7 +1491,7 @@ static void get_tile_buffers(AV1Decoder *pbi, const uint8_t *data,
static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data, static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
const uint8_t *data_end) { const uint8_t *data_end) {
AV1_COMMON *const cm = &pbi->common; AV1_COMMON *const cm = &pbi->common;
const VPxWorkerInterface *const winterface = aom_get_worker_interface(); const AVxWorkerInterface *const winterface = aom_get_worker_interface();
const int aligned_cols = mi_cols_aligned_to_sb(cm->mi_cols); const int aligned_cols = mi_cols_aligned_to_sb(cm->mi_cols);
const int tile_cols = 1 << cm->log2_tile_cols; const int tile_cols = 1 << cm->log2_tile_cols;
const int tile_rows = 1 << cm->log2_tile_rows; const int tile_rows = 1 << cm->log2_tile_rows;
...@@ -1504,7 +1504,7 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data, ...@@ -1504,7 +1504,7 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
pbi->lf_worker.data1 == NULL) { pbi->lf_worker.data1 == NULL) {
CHECK_MEM_ERROR(cm, pbi->lf_worker.data1, CHECK_MEM_ERROR(cm, pbi->lf_worker.data1,
aom_memalign(32, sizeof(LFWorkerData))); aom_memalign(32, sizeof(LFWorkerData)));
pbi->lf_worker.hook = (VPxWorkerHook)av1_loop_filter_worker; pbi->lf_worker.hook = (AVxWorkerHook)av1_loop_filter_worker;
if (pbi->max_threads > 1 && !winterface->reset(&pbi->lf_worker)) { if (pbi->max_threads > 1 && !winterface->reset(&pbi->lf_worker)) {
aom_internal_error(&cm->error, AOM_CODEC_ERROR, aom_internal_error(&cm->error, AOM_CODEC_ERROR,
"Loop filter thread creation failed"); "Loop filter thread creation failed");
...@@ -1675,7 +1675,7 @@ static int compare_tile_buffers(const void *a, const void *b) { ...@@ -1675,7 +1675,7 @@ static int compare_tile_buffers(const void *a, const void *b) {
static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data, static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data,
const uint8_t *data_end) { const uint8_t *data_end) {
AV1_COMMON *const cm = &pbi->common; AV1_COMMON *const cm = &pbi->common;
const VPxWorkerInterface *const winterface = aom_get_worker_interface(); const AVxWorkerInterface *const winterface = aom_get_worker_interface();
const uint8_t *bit_reader_end = NULL; const uint8_t *bit_reader_end = NULL;
const int aligned_mi_cols = mi_cols_aligned_to_sb(cm->mi_cols); const int aligned_mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
const int tile_cols = 1 << cm->log2_tile_cols; const int tile_cols = 1 << cm->log2_tile_cols;
...@@ -1705,7 +1705,7 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data, ...@@ -1705,7 +1705,7 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data,
CHECK_MEM_ERROR(cm, pbi->tile_worker_info, CHECK_MEM_ERROR(cm, pbi->tile_worker_info,
aom_malloc(num_threads * sizeof(*pbi->tile_worker_info))); aom_malloc(num_threads * sizeof(*pbi->tile_worker_info)));
for (i = 0; i < num_threads; ++i) { for (i = 0; i < num_threads; ++i) {
VPxWorker *const worker = &pbi->tile_workers[i]; AVxWorker *const worker = &pbi->tile_workers[i];
++pbi->num_tile_workers; ++pbi->num_tile_workers;
winterface->init(worker); winterface->init(worker);
...@@ -1718,9 +1718,9 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data, ...@@ -1718,9 +1718,9 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data,
// Reset tile decoding hook // Reset tile decoding hook
for (n = 0; n < num_workers; ++n) { for (n = 0; n < num_workers; ++n) {
VPxWorker *const worker = &pbi->tile_workers[n]; AVxWorker *const worker = &pbi->tile_workers[n];
winterface->sync(worker); winterface->sync(worker);
worker->hook = (VPxWorkerHook)tile_worker_hook; worker->hook = (AVxWorkerHook)tile_worker_hook;
worker->data1 = &pbi->tile_worker_data[n]; worker->data1 = &pbi->tile_worker_data[n];
worker->data2 = &pbi->tile_worker_info[n]; worker->data2 = &pbi->tile_worker_info[n];
} }
...@@ -1770,7 +1770,7 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data, ...@@ -1770,7 +1770,7 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data,
while (n < tile_cols) { while (n < tile_cols) {
int i; int i;
for (i = 0; i < num_workers && n < tile_cols; ++i) { for (i = 0; i < num_workers && n < tile_cols; ++i) {
VPxWorker *const worker = &pbi->tile_workers[i]; AVxWorker *const worker = &pbi->tile_workers[i];
TileWorkerData *const tile_data = (TileWorkerData *)worker->data1; TileWorkerData *const tile_data = (TileWorkerData *)worker->data1;
TileInfo *const tile = (TileInfo *)worker->data2; TileInfo *const tile = (TileInfo *)worker->data2;
TileBuffer *const buf = &tile_buffers[0][n]; TileBuffer *const buf = &tile_buffers[0][n];
...@@ -1807,7 +1807,7 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data, ...@@ -1807,7 +1807,7 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data,
} }
for (; i > 0; --i) { for (; i > 0; --i) {
VPxWorker *const worker = &pbi->tile_workers[i - 1]; AVxWorker *const worker = &pbi->tile_workers[i - 1];
// TODO(jzern): The tile may have specific error data associated with // TODO(jzern): The tile may have specific error data associated with
// its aom_internal_error_info which could be propagated to the main info // its aom_internal_error_info which could be propagated to the main info
// in cm. Additionally once the threads have been synced and an error is // in cm. Additionally once the threads have been synced and an error is
...@@ -2389,7 +2389,7 @@ void av1_decode_frame(AV1Decoder *pbi, const uint8_t *data, ...@@ -2389,7 +2389,7 @@ void av1_decode_frame(AV1Decoder *pbi, const uint8_t *data,
// the frame header. // the frame header.
if (cm->frame_parallel_decode && if (cm->frame_parallel_decode &&
cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_BACKWARD) { cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_BACKWARD) {
VPxWorker *const worker = pbi->frame_worker_owner; AVxWorker *const worker = pbi->frame_worker_owner;
FrameWorkerData *const frame_worker_data = worker->data1; FrameWorkerData *const frame_worker_data = worker->data1;
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_FORWARD) { if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_FORWARD) {
context_updated = 1; context_updated = 1;
......
...@@ -130,7 +130,7 @@ void av1_decoder_remove(AV1Decoder *pbi) { ...@@ -130,7 +130,7 @@ void av1_decoder_remove(AV1Decoder *pbi) {
aom_free(pbi->lf_worker.data1); aom_free(pbi->lf_worker.data1);
aom_free(pbi->tile_data); aom_free(pbi->tile_data);
for (i = 0; i < pbi->num_tile_workers; ++i) { for (i = 0; i < pbi->num_tile_workers; ++i) {
VPxWorker *const worker = &pbi->tile_workers[i]; AVxWorker *const worker = &pbi->tile_workers[i];
aom_get_worker_interface()->end(worker); aom_get_worker_interface()->end(worker);
} }
aom_free(pbi->tile_worker_data); aom_free(pbi->tile_worker_data);
...@@ -306,7 +306,7 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size, ...@@ -306,7 +306,7 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size,
pbi->hold_ref_buf = 0; pbi->hold_ref_buf = 0;
if (cm->frame_parallel_decode) { if (cm->frame_parallel_decode) {
VPxWorker *const worker = pbi->frame_worker_owner; AVxWorker *const worker = pbi->frame_worker_owner;
av1_frameworker_lock_stats(worker); av1_frameworker_lock_stats(worker);
frame_bufs[cm->new_fb_idx].frame_worker_owner = worker; frame_bufs[cm->new_fb_idx].frame_worker_owner = worker;
// Reset decoding progress. // Reset decoding progress.
...@@ -319,7 +319,7 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size, ...@@ -319,7 +319,7 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size,
} }
if (setjmp(cm->error.jmp)) { if (setjmp(cm->error.jmp)) {
const VPxWorkerInterface *const winterface = aom_get_worker_interface(); const AVxWorkerInterface *const winterface = aom_get_worker_interface();
int i; int i;
cm->error.setjmp = 0; cm->error.setjmp = 0;
...@@ -381,7 +381,7 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size, ...@@ -381,7 +381,7 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size,
if (cm->frame_parallel_decode) { if (cm->frame_parallel_decode) {
// Need to lock the mutex here as another thread may // Need to lock the mutex here as another thread may
// be accessing this buffer. // be accessing this buffer.
VPxWorker *const worker = pbi->frame_worker_owner; AVxWorker *const worker = pbi->frame_worker_owner;
FrameWorkerData *const frame_worker_data = worker->data1; FrameWorkerData *const frame_worker_data = worker->data1;
av1_frameworker_lock_stats(worker); av1_frameworker_lock_stats(worker);
......
...@@ -61,9 +61,9 @@ typedef struct AV1Decoder { ...@@ -61,9 +61,9 @@ typedef struct AV1Decoder {
// the same. // the same.
RefCntBuffer *cur_buf; // Current decoding frame buffer. RefCntBuffer *cur_buf; // Current decoding frame buffer.
VPxWorker *frame_worker_owner; // frame_worker that owns this pbi. AVxWorker *frame_worker_owner; // frame_worker that owns this pbi.
VPxWorker lf_worker; AVxWorker lf_worker;
VPxWorker *tile_workers; AVxWorker *tile_workers;
TileWorkerData *tile_worker_data; TileWorkerData *tile_worker_data;
TileInfo *tile_worker_info; TileInfo *tile_worker_info;
int num_tile_workers; int num_tile_workers;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// #define DEBUG_THREAD // #define DEBUG_THREAD
// TODO(hkuang): Clean up all the #ifdef in this file. // TODO(hkuang): Clean up all the #ifdef in this file.
void av1_frameworker_lock_stats(VPxWorker *const worker) { void av1_frameworker_lock_stats(AVxWorker *const worker) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
FrameWorkerData *const worker_data = worker->data1; FrameWorkerData *const worker_data = worker->data1;
pthread_mutex_lock(&worker_data->stats_mutex); pthread_mutex_lock(&worker_data->stats_mutex);
...@@ -27,7 +27,7 @@ void av1_frameworker_lock_stats(VPxWorker *const worker) { ...@@ -27,7 +27,7 @@ void av1_frameworker_lock_stats(VPxWorker *const worker) {
#endif #endif
} }
void av1_frameworker_unlock_stats(VPxWorker *const worker) { void av1_frameworker_unlock_stats(AVxWorker *const worker) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
FrameWorkerData *const worker_data = worker->data1; FrameWorkerData *const worker_data = worker->data1;
pthread_mutex_unlock(&worker_data->stats_mutex); pthread_mutex_unlock(&worker_data->stats_mutex);
...@@ -36,7 +36,7 @@ void av1_frameworker_unlock_stats(VPxWorker *const worker) { ...@@ -36,7 +36,7 @@ void av1_frameworker_unlock_stats(VPxWorker *const worker) {
#endif #endif
} }
void av1_frameworker_signal_stats(VPxWorker *const worker) { void av1_frameworker_signal_stats(AVxWorker *const worker) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
FrameWorkerData *const worker_data = worker->data1; FrameWorkerData *const worker_data = worker->data1;
...@@ -60,7 +60,7 @@ void av1_frameworker_signal_stats(VPxWorker *const worker) { ...@@ -60,7 +60,7 @@ void av1_frameworker_signal_stats(VPxWorker *const worker) {
#endif #endif
// TODO(hkuang): Remove worker parameter as it is only used in debug code. // TODO(hkuang): Remove worker parameter as it is only used in debug code.
void av1_frameworker_wait(VPxWorker *const worker, RefCntBuffer *const ref_buf, void av1_frameworker_wait(AVxWorker *const worker, RefCntBuffer *const ref_buf,
int row) { int row) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
if (!ref_buf) return; if (!ref_buf) return;
...@@ -74,7 +74,7 @@ void av1_frameworker_wait(VPxWorker *const worker, RefCntBuffer *const ref_buf, ...@@ -74,7 +74,7 @@ void av1_frameworker_wait(VPxWorker *const worker, RefCntBuffer *const ref_buf,
{ {
// Find the worker thread that owns the reference frame. If the reference // Find the worker thread that owns the reference frame. If the reference
// frame has been fully decoded, it may not have owner. // frame has been fully decoded, it may not have owner.
VPxWorker *const ref_worker = ref_buf->frame_worker_owner; AVxWorker *const ref_worker = ref_buf->frame_worker_owner;
FrameWorkerData *const ref_worker_data = FrameWorkerData *const ref_worker_data =
(FrameWorkerData *)ref_worker->data1; (FrameWorkerData *)ref_worker->data1;
const AV1Decoder *const pbi = ref_worker_data->pbi; const AV1Decoder *const pbi = ref_worker_data->pbi;
...@@ -114,7 +114,7 @@ void av1_frameworker_wait(VPxWorker *const worker, RefCntBuffer *const ref_buf, ...@@ -114,7 +114,7 @@ void av1_frameworker_wait(VPxWorker *const worker, RefCntBuffer *const ref_buf,
void av1_frameworker_broadcast(RefCntBuffer *const buf, int row) { void av1_frameworker_broadcast(RefCntBuffer *const buf, int row) {
#if CONFIG_MULTITHREAD #if CONFIG_MULTITHREAD
VPxWorker *worker = buf->frame_worker_owner; AVxWorker *worker = buf->frame_worker_owner;
#ifdef DEBUG_THREAD #ifdef DEBUG_THREAD
{