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);
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -59,7 +59,7 @@ struct aom_codec_alg_priv { ...@@ -59,7 +59,7 @@ struct aom_codec_alg_priv {
// Frame parallel related. // Frame parallel related.
int frame_parallel_decode; // frame-based threading. int frame_parallel_decode; // frame-based threading.
VPxWorker *frame_workers; AVxWorker *frame_workers;
int num_frame_workers; int num_frame_workers;
int next_submit_worker_id; int next_submit_worker_id;
int last_submit_worker_id; int last_submit_worker_id;
...@@ -114,7 +114,7 @@ static aom_codec_err_t decoder_destroy(aom_codec_alg_priv_t *ctx) { ...@@ -114,7 +114,7 @@ static aom_codec_err_t decoder_destroy(aom_codec_alg_priv_t *ctx) {
if (ctx->frame_workers != NULL) { if (ctx->frame_workers != NULL) {
int i; int i;
for (i = 0; i < ctx->num_frame_workers; ++i) { for (i = 0; i < ctx->num_frame_workers; ++i) {
VPxWorker *const worker = &ctx->frame_workers[i]; AVxWorker *const worker = &ctx->frame_workers[i];
FrameWorkerData *const frame_worker_data = FrameWorkerData *const frame_worker_data =
(FrameWorkerData *)worker->data1; (FrameWorkerData *)worker->data1;
aom_get_worker_interface()->end(worker); aom_get_worker_interface()->end(worker);
...@@ -267,7 +267,7 @@ static void init_buffer_callbacks(aom_codec_alg_priv_t *ctx) { ...@@ -267,7 +267,7 @@ static void init_buffer_callbacks(aom_codec_alg_priv_t *ctx) {
int i; int i;
for (i = 0; i < ctx->num_frame_workers; ++i) { for (i = 0; i < ctx->num_frame_workers; ++i) {
VPxWorker *const worker = &ctx->frame_workers[i]; AVxWorker *const worker = &ctx->frame_workers[i];
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
AV1_COMMON *const cm = &frame_worker_data->pbi->common; AV1_COMMON *const cm = &frame_worker_data->pbi->common;
BufferPool *const pool = cm->buffer_pool; BufferPool *const pool = cm->buffer_pool;
...@@ -313,7 +313,7 @@ static int frame_worker_hook(void *arg1, void *arg2) { ...@@ -313,7 +313,7 @@ static int frame_worker_hook(void *arg1, void *arg2) {
// the compressed data. // the compressed data.
if (frame_worker_data->result != 0 || if (frame_worker_data->result != 0 ||
frame_worker_data->data + frame_worker_data->data_size - 1 > data) { frame_worker_data->data + frame_worker_data->data_size - 1 > data) {
VPxWorker *const worker = frame_worker_data->pbi->frame_worker_owner; AVxWorker *const worker = frame_worker_data->pbi->frame_worker_owner;
BufferPool *const pool = frame_worker_data->pbi->common.buffer_pool; BufferPool *const pool = frame_worker_data->pbi->common.buffer_pool;
// Signal all the other threads that are waiting for this frame. // Signal all the other threads that are waiting for this frame.
av1_frameworker_lock_stats(worker); av1_frameworker_lock_stats(worker);
...@@ -336,7 +336,7 @@ static int frame_worker_hook(void *arg1, void *arg2) { ...@@ -336,7 +336,7 @@ static int frame_worker_hook(void *arg1, void *arg2) {
static aom_codec_err_t init_decoder(aom_codec_alg_priv_t *ctx) { static aom_codec_err_t init_decoder(aom_codec_alg_priv_t *ctx) {
int i; int i;
const VPxWorkerInterface *const winterface = aom_get_worker_interface(); const AVxWorkerInterface *const winterface = aom_get_worker_interface();
ctx->last_show_frame = -1; ctx->last_show_frame = -1;
ctx->next_submit_worker_id = 0; ctx->next_submit_worker_id = 0;
...@@ -363,7 +363,7 @@ static aom_codec_err_t init_decoder(aom_codec_alg_priv_t *ctx) { ...@@ -363,7 +363,7 @@ static aom_codec_err_t init_decoder(aom_codec_alg_priv_t *ctx) {
} }
#endif #endif
ctx->frame_workers = (VPxWorker *)aom_malloc(ctx->num_frame_workers * ctx->frame_workers = (AVxWorker *)aom_malloc(ctx->num_frame_workers *
sizeof(*ctx->frame_workers)); sizeof(*ctx->frame_workers));
if (ctx->frame_workers == NULL) { if (ctx->frame_workers == NULL) {
set_error_detail(ctx, "Failed to allocate frame_workers"); set_error_detail(ctx, "Failed to allocate frame_workers");
...@@ -371,7 +371,7 @@ static aom_codec_err_t init_decoder(aom_codec_alg_priv_t *ctx) { ...@@ -371,7 +371,7 @@ static aom_codec_err_t init_decoder(aom_codec_alg_priv_t *ctx) {
} }
for (i = 0; i < ctx->num_frame_workers; ++i) { for (i = 0; i < ctx->num_frame_workers; ++i) {
VPxWorker *const worker = &ctx->frame_workers[i]; AVxWorker *const worker = &ctx->frame_workers[i];
FrameWorkerData *frame_worker_data = NULL; FrameWorkerData *frame_worker_data = NULL;
winterface->init(worker); winterface->init(worker);
worker->data1 = aom_memalign(32, sizeof(FrameWorkerData)); worker->data1 = aom_memalign(32, sizeof(FrameWorkerData));
...@@ -410,7 +410,7 @@ static aom_codec_err_t init_decoder(aom_codec_alg_priv_t *ctx) { ...@@ -410,7 +410,7 @@ static aom_codec_err_t init_decoder(aom_codec_alg_priv_t *ctx) {
frame_worker_data->pbi->inv_tile_order = ctx->invert_tile_order; frame_worker_data->pbi->inv_tile_order = ctx->invert_tile_order;
frame_worker_data->pbi->common.frame_parallel_decode = frame_worker_data->pbi->common.frame_parallel_decode =
ctx->frame_parallel_decode; ctx->frame_parallel_decode;
worker->hook = (VPxWorkerHook)frame_worker_hook; worker->hook = (AVxWorkerHook)frame_worker_hook;
if (!winterface->reset(worker)) { if (!winterface->reset(worker)) {
set_error_detail(ctx, "Frame Worker thread creation failed"); set_error_detail(ctx, "Frame Worker thread creation failed");
return AOM_CODEC_MEM_ERROR; return AOM_CODEC_MEM_ERROR;
...@@ -438,7 +438,7 @@ static INLINE void check_resync(aom_codec_alg_priv_t *const ctx, ...@@ -438,7 +438,7 @@ static INLINE void check_resync(aom_codec_alg_priv_t *const ctx,
static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx, static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx,
const uint8_t **data, unsigned int data_sz, const uint8_t **data, unsigned int data_sz,
void *user_priv, int64_t deadline) { void *user_priv, int64_t deadline) {
const VPxWorkerInterface *const winterface = aom_get_worker_interface(); const AVxWorkerInterface *const winterface = aom_get_worker_interface();
(void)deadline; (void)deadline;
// Determine the stream parameters. Note that we rely on peek_si to // Determine the stream parameters. Note that we rely on peek_si to
...@@ -455,7 +455,7 @@ static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx, ...@@ -455,7 +455,7 @@ static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx,
} }
if (!ctx->frame_parallel_decode) { if (!ctx->frame_parallel_decode) {
VPxWorker *const worker = ctx->frame_workers; AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
frame_worker_data->data = *data; frame_worker_data->data = *data;
frame_worker_data->data_size = data_sz; frame_worker_data->data_size = data_sz;
...@@ -478,7 +478,7 @@ static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx, ...@@ -478,7 +478,7 @@ static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx,
check_resync(ctx, frame_worker_data->pbi); check_resync(ctx, frame_worker_data->pbi);
} else { } else {
VPxWorker *const worker = &ctx->frame_workers[ctx->next_submit_worker_id]; AVxWorker *const worker = &ctx->frame_workers[ctx->next_submit_worker_id];
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
// Copy context from last worker thread to next worker thread. // Copy context from last worker thread to next worker thread.
if (ctx->next_submit_worker_id != ctx->last_submit_worker_id) if (ctx->next_submit_worker_id != ctx->last_submit_worker_id)
...@@ -525,8 +525,8 @@ static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx, ...@@ -525,8 +525,8 @@ static aom_codec_err_t decode_one(aom_codec_alg_priv_t *ctx,
static void wait_worker_and_cache_frame(aom_codec_alg_priv_t *ctx) { static void wait_worker_and_cache_frame(aom_codec_alg_priv_t *ctx) {
YV12_BUFFER_CONFIG sd; YV12_BUFFER_CONFIG sd;
const VPxWorkerInterface *const winterface = aom_get_worker_interface(); const AVxWorkerInterface *const winterface = aom_get_worker_interface();
VPxWorker *const worker = &ctx->frame_workers[ctx->next_output_worker_id]; AVxWorker *const worker = &ctx->frame_workers[ctx->next_output_worker_id];
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
ctx->next_output_worker_id = ctx->next_output_worker_id =
(ctx->next_output_worker_id + 1) % ctx->num_frame_workers; (ctx->next_output_worker_id + 1) % ctx->num_frame_workers;
...@@ -707,8 +707,8 @@ static aom_image_t *decoder_get_frame(aom_codec_alg_priv_t *ctx, ...@@ -707,8 +707,8 @@ static aom_image_t *decoder_get_frame(aom_codec_alg_priv_t *ctx,
if (*iter == NULL && ctx->frame_workers != NULL) { if (*iter == NULL && ctx->frame_workers != NULL) {
do { do {
YV12_BUFFER_CONFIG sd; YV12_BUFFER_CONFIG sd;
const VPxWorkerInterface *const winterface = aom_get_worker_interface(); const AVxWorkerInterface *const winterface = aom_get_worker_interface();
VPxWorker *const worker = &ctx->frame_workers[ctx->next_output_worker_id]; AVxWorker *const worker = &ctx->frame_workers[ctx->next_output_worker_id];
FrameWorkerData *const frame_worker_data = FrameWorkerData *const frame_worker_data =
(FrameWorkerData *)worker->data1; (FrameWorkerData *)worker->data1;
ctx->next_output_worker_id = ctx->next_output_worker_id =
...@@ -774,7 +774,7 @@ static aom_codec_err_t ctrl_set_reference(aom_codec_alg_priv_t *ctx, ...@@ -774,7 +774,7 @@ static aom_codec_err_t ctrl_set_reference(aom_codec_alg_priv_t *ctx,
if (data) { if (data) {
aom_ref_frame_t *const frame = (aom_ref_frame_t *)data; aom_ref_frame_t *const frame = (aom_ref_frame_t *)data;
YV12_BUFFER_CONFIG sd; YV12_BUFFER_CONFIG sd;
VPxWorker *const worker = ctx->frame_workers; AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
image2yuvconfig(&frame->img, &sd); image2yuvconfig(&frame->img, &sd);
return av1_set_reference_dec(&frame_worker_data->pbi->common, return av1_set_reference_dec(&frame_worker_data->pbi->common,
...@@ -797,7 +797,7 @@ static aom_codec_err_t ctrl_copy_reference(aom_codec_alg_priv_t *ctx, ...@@ -797,7 +797,7 @@ static aom_codec_err_t ctrl_copy_reference(aom_codec_alg_priv_t *ctx,
if (data) { if (data) {
aom_ref_frame_t *frame = (aom_ref_frame_t *)data; aom_ref_frame_t *frame = (aom_ref_frame_t *)data;
YV12_BUFFER_CONFIG sd; YV12_BUFFER_CONFIG sd;
VPxWorker *const worker = ctx->frame_workers; AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
image2yuvconfig(&frame->img, &sd); image2yuvconfig(&frame->img, &sd);
return av1_copy_reference_dec(frame_worker_data->pbi, return av1_copy_reference_dec(frame_worker_data->pbi,
...@@ -819,7 +819,7 @@ static aom_codec_err_t ctrl_get_reference(aom_codec_alg_priv_t *ctx, ...@@ -819,7 +819,7 @@ static aom_codec_err_t ctrl_get_reference(aom_codec_alg_priv_t *ctx,
if (data) { if (data) {
YV12_BUFFER_CONFIG *fb; YV12_BUFFER_CONFIG *fb;
VPxWorker *const worker = ctx->frame_workers; AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1; FrameWorkerData *const frame_worker_data = (FrameWorkerData *)worker->data1;
fb = get_ref_frame(&frame_worker_data->pbi->common, data->idx); fb = get_ref_frame(&frame_worker_data->pbi->common, data->idx);
if (fb == NULL) return AOM_CODEC_ERROR; if (fb == NULL) return AOM_CODEC_ERROR;
...@@ -856,7 +856,7 @@ static aom_codec_err_t ctrl_get_last_ref_updates(aom_codec_alg_priv_t *ctx, ...@@ -856,7 +856,7 @@ static aom_codec_err_t ctrl_get_last_ref_updates(aom_codec_alg_priv_t *ctx,
if (update_info) { if (update_info) {
if (ctx->frame_workers) { if (ctx->frame_workers) {
VPxWorker *const worker = ctx->frame_workers; AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = FrameWorkerData *const frame_worker_data =
(FrameWorkerData *)worker->data1; (FrameWorkerData *)worker->data1;
*update_info = frame_worker_data->pbi->refresh_frame_flags; *update_info = frame_worker_data->pbi->refresh_frame_flags;
...@@ -875,7 +875,7 @@ static aom_codec_err_t ctrl_get_frame_corrupted(aom_codec_alg_priv_t *ctx, ...@@ -875,7 +875,7 @@ static aom_codec_err_t ctrl_get_frame_corrupted(aom_codec_alg_priv_t *ctx,
if (corrupted) { if (corrupted) {
if (ctx->frame_workers) { if (ctx->frame_workers) {
VPxWorker *const worker = ctx->frame_workers; AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = FrameWorkerData *const frame_worker_data =
(FrameWorkerData *)worker->data1; (FrameWorkerData *)worker->data1;
RefCntBuffer *const frame_bufs = RefCntBuffer *const frame_bufs =
...@@ -905,7 +905,7 @@ static aom_codec_err_t ctrl_get_frame_size(aom_codec_alg_priv_t *ctx, ...@@ -905,7 +905,7 @@ static aom_codec_err_t ctrl_get_frame_size(aom_codec_alg_priv_t *ctx,
if (frame_size) { if (frame_size) {
if (ctx->frame_workers) { if (ctx->frame_workers) {
VPxWorker *const worker = ctx->frame_workers; AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = FrameWorkerData *const frame_worker_data =
(FrameWorkerData *)worker->data1; (FrameWorkerData *)worker->data1;
const AV1_COMMON *const cm = &frame_worker_data->pbi->common; const AV1_COMMON *const cm = &frame_worker_data->pbi->common;
...@@ -932,7 +932,7 @@ static aom_codec_err_t ctrl_get_render_size(aom_codec_alg_priv_t *ctx, ...@@ -932,7 +932,7 @@ static aom_codec_err_t ctrl_get_render_size(aom_codec_alg_priv_t *ctx,
if (render_size) { if (render_size) {
if (ctx->frame_workers) { if (ctx->frame_workers) {
VPxWorker *const worker = ctx->frame_workers; AVxWorker *const worker = ctx->frame_workers;
FrameWorkerData *const frame_worker_data = FrameWorkerData *const frame_worker_data =
(FrameWorkerData *)worker->data1; (FrameWorkerData *)worker->data1;
const AV1_COMMON *const cm = &frame_worker_data->pbi->common; const AV1_COMMON *const cm = &frame_worker_data->pbi->common;
...@@ -950,7 +950,7 @@ static aom_codec_err_t ctrl_get_render_size(aom_codec_alg_priv_t *ctx, ...@@ -950,7 +950,7 @@ static aom_codec_err_t ctrl_get_render_size(aom_codec_alg_priv_t *ctx,
static aom_codec_err_t ctrl_get_bit_depth(aom_codec_alg_priv_t *ctx, static aom_codec_err_t ctrl_get_bit_depth(aom_codec_alg_priv_t *ctx,
va_list args) { va_list args) {
unsigned int *const bit_depth = va_arg(args, unsigned int *); unsigned int *const bit_depth = va_arg(args, unsigned int *);