Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
54e66767
Commit
54e66767
authored
Mar 29, 2016
by
Adrian Grange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace "VPx" by "AVx"
Change-Id: If363eccaa8be7fb9f8cf41488bf3f5e6d4c00645
parent
5082a369
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
118 additions
and
118 deletions
+118
-118
aom/aom_encoder.h
aom/aom_encoder.h
+5
-5
aom/aomcx.h
aom/aomcx.h
+2
-2
aom_util/aom_thread.c
aom_util/aom_thread.c
+14
-14
aom_util/aom_thread.h
aom_util/aom_thread.h
+17
-17
av1/av1_dx_iface.c
av1/av1_dx_iface.c
+25
-25
av1/common/onyxc_int.h
av1/common/onyxc_int.h
+1
-1
av1/common/thread_common.c
av1/common/thread_common.c
+5
-5
av1/common/thread_common.h
av1/common/thread_common.h
+1
-1
av1/decoder/decodeframe.c
av1/decoder/decodeframe.c
+9
-9
av1/decoder/decoder.c
av1/decoder/decoder.c
+4
-4
av1/decoder/decoder.h
av1/decoder/decoder.h
+3
-3
av1/decoder/dthread.c
av1/decoder/dthread.c
+8
-8
av1/decoder/dthread.h
av1/decoder/dthread.h
+6
-6
av1/encoder/encoder.c
av1/encoder/encoder.c
+1
-1
av1/encoder/encoder.h
av1/encoder/encoder.h
+1
-1
av1/encoder/ethread.c
av1/encoder/ethread.c
+7
-7
build/make/iosbuild.sh
build/make/iosbuild.sh
+1
-1
examples/aom_temporal_svc_encoder.c
examples/aom_temporal_svc_encoder.c
+1
-1
examples/simple_decoder.c
examples/simple_decoder.c
+1
-1
libs.mk
libs.mk
+1
-1
test/ethread_test.cc
test/ethread_test.cc
+5
-5
No files found.
aom/aom_encoder.h
View file @
54e66767
...
@@ -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 V
P
x codecs do.
* Note that not all codecs support this feature. All aom
A
Vx 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 V
P
x REALTIME mode. */
/**< deadline parameter analogous to
A
Vx REALTIME mode. */
#define AOM_DL_GOOD_QUALITY (1000000)
#define AOM_DL_GOOD_QUALITY (1000000)
/**< deadline parameter analogous to V
P
x GOOD QUALITY mode. */
/**< deadline parameter analogous to
A
Vx GOOD QUALITY mode. */
#define AOM_DL_BEST_QUALITY (0)
#define AOM_DL_BEST_QUALITY (0)
/**< deadline parameter analogous to V
P
x BEST QUALITY mode. */
/**< deadline parameter analogous to
A
Vx 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 V
P
x notion of "best quality, good quality, realtime".
* supercedes the
A
Vx 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.
...
...
aom/aomcx.h
View file @
54e66767
...
@@ -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 V
P
x encoder control functions
/*!\brief
A
Vx encoder control functions
*
*
* This set of macros define the control functions available for V
P
x
* This set of macros define the control functions available for
A
Vx
* encoder interface.
* encoder interface.
*
*
* \sa #aom_codec_control
* \sa #aom_codec_control
...
...
aom_util/aom_thread.c
View file @
54e66767
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#if CONFIG_MULTITHREAD
#if CONFIG_MULTITHREAD
struct
V
P
xWorkerImpl
{
struct
A
VxWorkerImpl
{
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
(
V
P
xWorker
*
const
worker
);
// Forward declaration.
static
void
execute
(
A
VxWorker
*
const
worker
);
// Forward declaration.
static
THREADFN
thread_loop
(
void
*
ptr
)
{
static
THREADFN
thread_loop
(
void
*
ptr
)
{
V
P
xWorker
*
const
worker
=
(
V
P
xWorker
*
)
ptr
;
A
VxWorker
*
const
worker
=
(
A
VxWorker
*
)
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
(
V
P
xWorker
*
const
worker
,
V
P
xWorkerStatus
new_status
)
{
static
void
change_state
(
A
VxWorker
*
const
worker
,
A
VxWorkerStatus
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
(
V
P
xWorker
*
const
worker
)
{
static
void
init
(
A
VxWorker
*
const
worker
)
{
memset
(
worker
,
0
,
sizeof
(
*
worker
));
memset
(
worker
,
0
,
sizeof
(
*
worker
));
worker
->
status_
=
NOT_OK
;
worker
->
status_
=
NOT_OK
;
}
}
static
int
sync
(
V
P
xWorker
*
const
worker
)
{
static
int
sync
(
A
VxWorker
*
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
(
V
P
xWorker
*
const
worker
)
{
static
int
reset
(
A
VxWorker
*
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_
=
(
V
P
xWorkerImpl
*
)
aom_calloc
(
1
,
sizeof
(
*
worker
->
impl_
));
worker
->
impl_
=
(
A
VxWorkerImpl
*
)
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
(
V
P
xWorker
*
const
worker
)
{
static
void
execute
(
A
VxWorker
*
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
(
V
P
xWorker
*
const
worker
)
{
static
void
launch
(
A
VxWorker
*
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
(
V
P
xWorker
*
const
worker
)
{
static
void
end
(
A
VxWorker
*
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
V
P
xWorkerInterface
g_worker_interface
=
{
init
,
reset
,
sync
,
static
A
VxWorkerInterface
g_worker_interface
=
{
init
,
reset
,
sync
,
launch
,
execute
,
end
};
launch
,
execute
,
end
};
int
aom_set_worker_interface
(
const
V
P
xWorkerInterface
*
const
winterface
)
{
int
aom_set_worker_interface
(
const
A
VxWorkerInterface
*
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
V
P
xWorkerInterface
*
aom_get_worker_interface
(
void
)
{
const
A
VxWorkerInterface
*
aom_get_worker_interface
(
void
)
{
return
&
g_worker_interface
;
return
&
g_worker_interface
;
}
}
...
...
aom_util/aom_thread.h
View file @
54e66767
...
@@ -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
}
V
P
xWorkerStatus
;
}
A
VxWorkerStatus
;
// 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
(
*
V
P
xWorkerHook
)(
void
*
,
void
*
);
typedef
int
(
*
A
VxWorkerHook
)(
void
*
,
void
*
);
// Platform-dependent implementation details for the worker.
// Platform-dependent implementation details for the worker.
typedef
struct
V
P
xWorkerImpl
V
P
xWorkerImpl
;
typedef
struct
A
VxWorkerImpl
A
VxWorkerImpl
;
// Synchronization object used to launch job in the worker thread
// Synchronization object used to launch job in the worker thread
typedef
struct
{
typedef
struct
{
V
P
xWorkerImpl
*
impl_
;
A
VxWorkerImpl
*
impl_
;
V
P
xWorkerStatus
status_
;
A
VxWorkerStatus
status_
;
V
P
xWorkerHook
hook
;
// hook to call
A
VxWorkerHook
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'
}
V
P
xWorker
;
}
A
VxWorker
;
// 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
)(
V
P
xWorker
*
const
worker
);
void
(
*
init
)(
A
VxWorker
*
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
)(
V
P
xWorker
*
const
worker
);
int
(
*
reset
)(
A
VxWorker
*
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
)(
V
P
xWorker
*
const
worker
);
int
(
*
sync
)(
A
VxWorker
*
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
)(
V
P
xWorker
*
const
worker
);
void
(
*
launch
)(
A
VxWorker
*
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 V
P
xWorker structs. sync() must
// mechanism while still using the
A
VxWorker structs. sync() must
// still be called afterward (for error reporting).
// still be called afterward (for error reporting).
void
(
*
execute
)(
V
P
xWorker
*
const
worker
);
void
(
*
execute
)(
A
VxWorker
*
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
)(
V
P
xWorker
*
const
worker
);
void
(
*
end
)(
A
VxWorker
*
const
worker
);
}
V
P
xWorkerInterface
;
}
A
VxWorkerInterface
;
// 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
V
P
xWorkerInterface
*
const
winterface
);
int
aom_set_worker_interface
(
const
A
VxWorkerInterface
*
const
winterface
);
// Retrieve the currently set thread worker interface.
// Retrieve the currently set thread worker interface.
const
V
P
xWorkerInterface
*
aom_get_worker_interface
(
void
);
const
A
VxWorkerInterface
*
aom_get_worker_interface
(
void
);
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
...
av1/av1_dx_iface.c
View file @
54e66767
...
@@ -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.
V
P
xWorker
*
frame_workers
;
A
VxWorker
*
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
)
{
V
P
xWorker
*
const
worker
=
&
ctx
->
frame_workers
[
i
];
A
VxWorker
*
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
)
{
V
P
xWorker
*
const
worker
=
&
ctx
->
frame_workers
[
i
];
A
VxWorker
*
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
)
{
V
P
xWorker
*
const
worker
=
frame_worker_data
->
pbi
->
frame_worker_owner
;
A
VxWorker
*
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
V
P
xWorkerInterface
*
const
winterface
=
aom_get_worker_interface
();
const
A
VxWorkerInterface
*
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
=
(
V
P
xWorker
*
)
aom_malloc
(
ctx
->
num_frame_workers
*
ctx
->
frame_workers
=
(
A
VxWorker
*
)
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
)
{
V
P
xWorker
*
const
worker
=
&
ctx
->
frame_workers
[
i
];
A
VxWorker
*
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
=
(
V
P
xWorkerHook
)
frame_worker_hook
;
worker
->
hook
=
(
A
VxWorkerHook
)
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
V
P
xWorkerInterface
*
const
winterface
=
aom_get_worker_interface
();
const
A
VxWorkerInterface
*
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
)
{
V
P
xWorker
*
const
worker
=
ctx
->
frame_workers
;
A
VxWorker
*
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
{
V
P
xWorker
*
const
worker
=
&
ctx
->
frame_workers
[
ctx
->
next_submit_worker_id
];
A
VxWorker
*
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
V
P
xWorkerInterface
*
const
winterface
=
aom_get_worker_interface
();
const
A
VxWorkerInterface
*
const
winterface
=
aom_get_worker_interface
();
V
P
xWorker
*
const
worker
=
&
ctx
->
frame_workers
[
ctx
->
next_output_worker_id
];
A
VxWorker
*
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
V
P
xWorkerInterface
*
const
winterface
=
aom_get_worker_interface
();
const
A
VxWorkerInterface
*
const
winterface
=
aom_get_worker_interface
();
V
P
xWorker
*
const
worker
=
&
ctx
->
frame_workers
[
ctx
->
next_output_worker_id
];
A
VxWorker
*
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
;
V
P
xWorker
*
const
worker
=
ctx
->
frame_workers
;
A
VxWorker
*
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
;
V
P
xWorker
*
const
worker
=
ctx
->
frame_workers
;
A
VxWorker
*
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
;
V
P
xWorker
*
const
worker
=
ctx
->
frame_workers
;
A
VxWorker
*
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
)
{
V
P
xWorker
*
const
worker
=
ctx
->
frame_workers
;
A
VxWorker
*
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
)
{
V
P
xWorker
*
const
worker
=
ctx
->
frame_workers
;
A
VxWorker
*
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
)
{
V
P
xWorker
*
const
worker
=
ctx
->
frame_workers
;
A
VxWorker
*
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
)
{
V
P
xWorker
*
const
worker
=
ctx
->
frame_workers
;
A
VxWorker
*
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
*
);