Skip to content
GitLab
Menu
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
14e7203e
Commit
14e7203e
authored
Apr 15, 2015
by
Yunqing Wang
Committed by
Gerrit Code Review
Apr 15, 2015
Browse files
Merge "Fix Tsan errors"
parents
3cba8dc3
63c5bf2b
Changes
4
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_encodeframe.c
View file @
14e7203e
...
...
@@ -458,8 +458,7 @@ static int set_vt_partitioning(VP9_COMP *cpi,
return
0
;
}
void
vp9_set_vbp_thresholds
(
VP9_COMP
*
cpi
,
int64_t
thresholds
[],
int
q
)
{
void
vp9_set_vbp_thresholds
(
VP9_COMP
*
cpi
,
int
q
)
{
SPEED_FEATURES
*
const
sf
=
&
cpi
->
sf
;
if
(
sf
->
partition_search_type
!=
VAR_BASED_PARTITION
&&
sf
->
partition_search_type
!=
REFERENCE_PARTITION
)
{
...
...
@@ -480,25 +479,41 @@ void vp9_set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q) {
// Array index: 0 - threshold_64x64; 1 - threshold_32x32;
// 2 - threshold_16x16; 3 - vbp_threshold_8x8;
if
(
is_key_frame
)
{
thresholds
[
0
]
=
threshold_base
;
thresholds
[
1
]
=
threshold_base
>>
2
;
thresholds
[
2
]
=
threshold_base
>>
2
;
thresholds
[
3
]
=
threshold_base
<<
2
;
cpi
->
vbp_
thresholds
[
0
]
=
threshold_base
;
cpi
->
vbp_
thresholds
[
1
]
=
threshold_base
>>
2
;
cpi
->
vbp_
thresholds
[
2
]
=
threshold_base
>>
2
;
cpi
->
vbp_
thresholds
[
3
]
=
threshold_base
<<
2
;
cpi
->
vbp_bsize_min
=
BLOCK_8X8
;
}
else
{
thresholds
[
1
]
=
threshold_base
;
cpi
->
vbp_
thresholds
[
1
]
=
threshold_base
;
if
(
cm
->
width
<=
352
&&
cm
->
height
<=
288
)
{
thresholds
[
0
]
=
threshold_base
>>
2
;
thresholds
[
2
]
=
threshold_base
<<
3
;
cpi
->
vbp_
thresholds
[
0
]
=
threshold_base
>>
2
;
cpi
->
vbp_
thresholds
[
2
]
=
threshold_base
<<
3
;
}
else
{
thresholds
[
0
]
=
threshold_base
;
thresholds
[
2
]
=
threshold_base
<<
cpi
->
oxcf
.
speed
;
cpi
->
vbp_
thresholds
[
0
]
=
threshold_base
;
cpi
->
vbp_
thresholds
[
2
]
=
threshold_base
<<
cpi
->
oxcf
.
speed
;
}
cpi
->
vbp_bsize_min
=
BLOCK_16X16
;
}
}
}
static
void
modify_vbp_thresholds
(
VP9_COMP
*
cpi
,
int64_t
thresholds
[],
int
q
)
{
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
const
int64_t
threshold_base
=
(
int64_t
)(
cpi
->
y_dequant
[
q
][
1
]);
// Array index: 0 - threshold_64x64; 1 - threshold_32x32;
// 2 - threshold_16x16; 3 - vbp_threshold_8x8;
thresholds
[
1
]
=
threshold_base
;
if
(
cm
->
width
<=
352
&&
cm
->
height
<=
288
)
{
thresholds
[
0
]
=
threshold_base
>>
2
;
thresholds
[
2
]
=
threshold_base
<<
3
;
}
else
{
thresholds
[
0
]
=
threshold_base
;
thresholds
[
2
]
=
threshold_base
<<
cpi
->
oxcf
.
speed
;
}
}
static
void
fill_variance_4x4avg
(
const
uint8_t
*
s
,
int
sp
,
const
uint8_t
*
d
,
int
dp
,
int
x8_idx
,
int
y8_idx
,
v8x8
*
vst
,
#if CONFIG_VP9_HIGHBITDEPTH
...
...
@@ -611,7 +626,7 @@ static void choose_partitioning(VP9_COMP *cpi,
if
(
cyclic_refresh_segment_id_boosted
(
segment_id
))
{
int
q
=
vp9_get_qindex
(
&
cm
->
seg
,
segment_id
,
cm
->
base_qindex
);
vp9_set
_vbp_thresholds
(
cpi
,
thresholds
,
q
);
modify
_vbp_thresholds
(
cpi
,
thresholds
,
q
);
}
}
...
...
@@ -3854,6 +3869,9 @@ static void encode_frame_internal(VP9_COMP *cpi) {
}
vp9_zero
(
x
->
zcoeff_blk
);
if
(
cm
->
frame_type
!=
KEY_FRAME
&&
cpi
->
rc
.
frames_since_golden
==
0
)
cpi
->
ref_frame_flags
&=
(
~
VP9_GOLD_FLAG
);
if
(
sf
->
partition_search_type
==
SOURCE_VAR_BASED_PARTITION
)
source_var_based_partition_search_method
(
cpi
);
}
...
...
vp9/encoder/vp9_encodeframe.h
View file @
14e7203e
...
...
@@ -40,7 +40,7 @@ void vp9_init_tile_data(struct VP9_COMP *cpi);
void
vp9_encode_tile
(
struct
VP9_COMP
*
cpi
,
struct
ThreadData
*
td
,
int
tile_row
,
int
tile_col
);
void
vp9_set_vbp_thresholds
(
struct
VP9_COMP
*
cpi
,
int64_t
thresholds
[],
int
q
);
void
vp9_set_vbp_thresholds
(
struct
VP9_COMP
*
cpi
,
int
q
);
#ifdef __cplusplus
}
// extern "C"
...
...
vp9/encoder/vp9_encoder.c
View file @
14e7203e
...
...
@@ -2960,7 +2960,7 @@ static void encode_without_recode_loop(VP9_COMP *cpi) {
set_size_dependent_vars
(
cpi
,
&
q
,
&
bottom_index
,
&
top_index
);
vp9_set_quantizer
(
cm
,
q
);
vp9_set_vbp_thresholds
(
cpi
,
cpi
->
vbp_thresholds
,
q
);
vp9_set_vbp_thresholds
(
cpi
,
q
);
setup_frame
(
cpi
);
...
...
vp9/encoder/vp9_pickmode.c
View file @
14e7203e
...
...
@@ -1125,7 +1125,6 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
#endif
if
(
cpi
->
rc
.
frames_since_golden
==
0
)
{
cpi
->
ref_frame_flags
&=
(
~
VP9_GOLD_FLAG
);
usable_ref_frame
=
LAST_FRAME
;
}
else
{
usable_ref_frame
=
GOLDEN_FRAME
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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