Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
1b60a14e
Commit
1b60a14e
authored
May 09, 2014
by
Dmitry Kovalev
Committed by
Gerrit Code Review
May 09, 2014
Browse files
Merge "Removing VP9DecoderConfig."
parents
fea5eab7
0dacecaf
Changes
5
Hide whitespace changes
Inline
Side-by-side
vp9/decoder/vp9_decodeframe.c
View file @
1b60a14e
...
...
@@ -677,7 +677,7 @@ static void setup_frame_size_with_refs(VP9_COMMON *cm,
static
void
decode_tile
(
VP9Decoder
*
pbi
,
const
TileInfo
*
const
tile
,
vp9_reader
*
r
)
{
const
int
num_threads
=
pbi
->
oxcf
.
max_threads
;
const
int
num_threads
=
pbi
->
max_threads
;
VP9_COMMON
*
const
cm
=
&
pbi
->
common
;
int
mi_row
,
mi_col
;
MACROBLOCKD
*
xd
=
&
pbi
->
mb
;
...
...
@@ -828,8 +828,7 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
// Decode tiles using data from tile_buffers
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
++
tile_row
)
{
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
++
tile_col
)
{
const
int
col
=
pbi
->
oxcf
.
inv_tile_order
?
tile_cols
-
tile_col
-
1
:
tile_col
;
const
int
col
=
pbi
->
inv_tile_order
?
tile_cols
-
tile_col
-
1
:
tile_col
;
const
int
last_tile
=
tile_row
==
tile_rows
-
1
&&
col
==
tile_cols
-
1
;
const
TileBuffer
*
const
buf
=
&
tile_buffers
[
tile_row
][
col
];
...
...
@@ -887,7 +886,7 @@ static const uint8_t *decode_tiles_mt(VP9Decoder *pbi,
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_rows
=
1
<<
cm
->
log2_tile_rows
;
const
int
num_workers
=
MIN
(
pbi
->
oxcf
.
max_threads
&
~
1
,
tile_cols
);
const
int
num_workers
=
MIN
(
pbi
->
max_threads
&
~
1
,
tile_cols
);
TileBuffer
tile_buffers
[
1
<<
6
];
int
n
;
int
final_worker
=
-
1
;
...
...
@@ -899,7 +898,7 @@ static const uint8_t *decode_tiles_mt(VP9Decoder *pbi,
// TODO(jzern): See if we can remove the restriction of passing in max
// threads to the decoder.
if
(
pbi
->
num_tile_workers
==
0
)
{
const
int
num_threads
=
pbi
->
oxcf
.
max_threads
&
~
1
;
const
int
num_threads
=
pbi
->
max_threads
&
~
1
;
int
i
;
// TODO(jzern): Allocate one less worker, as in the current code we only
// use num_threads - 1 workers.
...
...
@@ -1328,7 +1327,7 @@ int vp9_decode_frame(VP9Decoder *pbi,
CHECK_MEM_ERROR
(
cm
,
pbi
->
lf_worker
.
data1
,
vpx_memalign
(
32
,
sizeof
(
LFWorkerData
)));
pbi
->
lf_worker
.
hook
=
(
VP9WorkerHook
)
vp9_loop_filter_worker
;
if
(
pbi
->
oxcf
.
max_threads
>
1
&&
!
vp9_worker_reset
(
&
pbi
->
lf_worker
))
{
if
(
pbi
->
max_threads
>
1
&&
!
vp9_worker_reset
(
&
pbi
->
lf_worker
))
{
vpx_internal_error
(
&
cm
->
error
,
VPX_CODEC_ERROR
,
"Loop filter thread creation failed"
);
}
...
...
@@ -1353,7 +1352,7 @@ int vp9_decode_frame(VP9Decoder *pbi,
// TODO(jzern): remove frame_parallel_decoding_mode restriction for
// single-frame tile decoding.
if
(
pbi
->
oxcf
.
max_threads
>
1
&&
tile_rows
==
1
&&
tile_cols
>
1
&&
if
(
pbi
->
max_threads
>
1
&&
tile_rows
==
1
&&
tile_cols
>
1
&&
cm
->
frame_parallel_decoding_mode
)
{
*
p_data_end
=
decode_tiles_mt
(
pbi
,
data
+
first_partition_size
,
data_end
);
}
else
{
...
...
vp9/decoder/vp9_decoder.c
View file @
1b60a14e
...
...
@@ -42,7 +42,7 @@ void vp9_initialize_dec() {
}
}
VP9Decoder
*
vp9_decoder_create
(
const
VP9DecoderConfig
*
oxcf
)
{
VP9Decoder
*
vp9_decoder_create
()
{
VP9Decoder
*
const
pbi
=
vpx_memalign
(
32
,
sizeof
(
*
pbi
));
VP9_COMMON
*
const
cm
=
pbi
?
&
pbi
->
common
:
NULL
;
...
...
@@ -66,7 +66,6 @@ VP9Decoder *vp9_decoder_create(const VP9DecoderConfig *oxcf) {
vpx_memset
(
&
cm
->
ref_frame_map
,
-
1
,
sizeof
(
cm
->
ref_frame_map
));
cm
->
current_video_frame
=
0
;
pbi
->
oxcf
=
*
oxcf
;
pbi
->
ready_for_new_data
=
1
;
pbi
->
decoded_key_frame
=
0
;
...
...
vp9/decoder/vp9_decoder.h
View file @
1b60a14e
...
...
@@ -27,21 +27,11 @@
extern
"C"
{
#endif
typedef
struct
VP9DecoderConfig
{
int
width
;
int
height
;
int
version
;
int
max_threads
;
int
inv_tile_order
;
}
VP9DecoderConfig
;
typedef
struct
VP9Decoder
{
DECLARE_ALIGNED
(
16
,
MACROBLOCKD
,
mb
);
DECLARE_ALIGNED
(
16
,
VP9_COMMON
,
common
);
VP9DecoderConfig
oxcf
;
int64_t
last_time_stamp
;
int
ready_for_new_data
;
...
...
@@ -59,6 +49,9 @@ typedef struct VP9Decoder {
vpx_decrypt_cb
decrypt_cb
;
void
*
decrypt_state
;
int
max_threads
;
int
inv_tile_order
;
}
VP9Decoder
;
void
vp9_initialize_dec
();
...
...
@@ -83,8 +76,7 @@ vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm,
int
vp9_get_reference_dec
(
struct
VP9Decoder
*
pbi
,
int
index
,
YV12_BUFFER_CONFIG
**
fb
);
struct
VP9Decoder
*
vp9_decoder_create
(
const
VP9DecoderConfig
*
oxcf
);
struct
VP9Decoder
*
vp9_decoder_create
();
void
vp9_decoder_remove
(
struct
VP9Decoder
*
pbi
);
...
...
vp9/decoder/vp9_dthread.c
View file @
1b60a14e
...
...
@@ -140,7 +140,7 @@ void vp9_loop_filter_frame_mt(VP9Decoder *pbi,
// Number of superblock rows and cols
const
int
sb_rows
=
mi_cols_aligned_to_sb
(
cm
->
mi_rows
)
>>
MI_BLOCK_SIZE_LOG2
;
const
int
tile_cols
=
1
<<
cm
->
log2_tile_cols
;
const
int
num_workers
=
MIN
(
pbi
->
oxcf
.
max_threads
&
~
1
,
tile_cols
);
const
int
num_workers
=
MIN
(
pbi
->
max_threads
&
~
1
,
tile_cols
);
int
i
;
// Allocate memory used in thread synchronization.
...
...
vp9/vp9_dx_iface.c
View file @
1b60a14e
...
...
@@ -245,17 +245,13 @@ static void set_ppflags(const vpx_codec_alg_priv_t *ctx,
}
static
void
init_decoder
(
vpx_codec_alg_priv_t
*
ctx
)
{
VP9DecoderConfig
oxcf
;
oxcf
.
width
=
ctx
->
si
.
w
;
oxcf
.
height
=
ctx
->
si
.
h
;
oxcf
.
version
=
9
;
oxcf
.
max_threads
=
ctx
->
cfg
.
threads
;
oxcf
.
inv_tile_order
=
ctx
->
invert_tile_order
;
ctx
->
pbi
=
vp9_decoder_create
(
&
oxcf
);
ctx
->
pbi
=
vp9_decoder_create
();
if
(
ctx
->
pbi
==
NULL
)
return
;
ctx
->
pbi
->
max_threads
=
ctx
->
cfg
.
threads
;
ctx
->
pbi
->
inv_tile_order
=
ctx
->
invert_tile_order
;
vp9_initialize_dec
();
// If postprocessing was enabled by the application and a
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment