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
807885b5
Commit
807885b5
authored
Nov 13, 2014
by
Yunqing Wang
Committed by
Gerrit Code Review
Nov 13, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge "vp9_ethread: modify the cyclic refresh struct"
parents
e4e85ad4
8ee605f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
24 deletions
+12
-24
vp9/encoder/vp9_aq_cyclicrefresh.c
vp9/encoder/vp9_aq_cyclicrefresh.c
+7
-13
vp9/encoder/vp9_aq_cyclicrefresh.h
vp9/encoder/vp9_aq_cyclicrefresh.h
+2
-4
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodeframe.c
+3
-7
No files found.
vp9/encoder/vp9_aq_cyclicrefresh.c
View file @
807885b5
...
...
@@ -38,9 +38,6 @@ struct CYCLIC_REFRESH {
int
rdmult
;
// Cyclic refresh map.
signed
char
*
map
;
// Projected rate and distortion for the current superblock.
int64_t
projected_rate_sb
;
int64_t
projected_dist_sb
;
// Thresholds applied to projected rate/distortion of the superblock.
int64_t
thresh_rate_sb
;
int64_t
thresh_dist_sb
;
...
...
@@ -92,12 +89,13 @@ static int apply_cyclic_refresh_bitrate(const VP9_COMMON *cm,
// mode, and rate/distortion.
static
int
candidate_refresh_aq
(
const
CYCLIC_REFRESH
*
cr
,
const
MB_MODE_INFO
*
mbmi
,
BLOCK_SIZE
bsize
,
int
use_rd
)
{
BLOCK_SIZE
bsize
,
int
use_rd
,
int64_t
rate_sb
)
{
if
(
use_rd
)
{
MV
mv
=
mbmi
->
mv
[
0
].
as_mv
;
// If projected rate is below the thresh_rate (well below target,
// so undershoot expected), accept it for lower-qp coding.
if
(
cr
->
projected_
rate_sb
<
cr
->
thresh_rate_sb
)
if
(
rate_sb
<
cr
->
thresh_rate_sb
)
return
1
;
// Otherwise, reject the block for lower-qp coding if any of the following:
// 1) mode uses large mv
...
...
@@ -125,7 +123,8 @@ static int candidate_refresh_aq(const CYCLIC_REFRESH *cr,
void
vp9_cyclic_refresh_update_segment
(
VP9_COMP
*
const
cpi
,
MB_MODE_INFO
*
const
mbmi
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
,
int
use_rd
)
{
BLOCK_SIZE
bsize
,
int
use_rd
,
int64_t
rate_sb
)
{
const
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
CYCLIC_REFRESH
*
const
cr
=
cpi
->
cyclic_refresh
;
const
int
bw
=
num_8x8_blocks_wide_lookup
[
bsize
];
...
...
@@ -133,7 +132,8 @@ void vp9_cyclic_refresh_update_segment(VP9_COMP *const cpi,
const
int
xmis
=
MIN
(
cm
->
mi_cols
-
mi_col
,
bw
);
const
int
ymis
=
MIN
(
cm
->
mi_rows
-
mi_row
,
bh
);
const
int
block_index
=
mi_row
*
cm
->
mi_cols
+
mi_col
;
const
int
refresh_this_block
=
candidate_refresh_aq
(
cr
,
mbmi
,
bsize
,
use_rd
);
const
int
refresh_this_block
=
candidate_refresh_aq
(
cr
,
mbmi
,
bsize
,
use_rd
,
rate_sb
);
// Default is to not update the refresh map.
int
new_map_value
=
cr
->
map
[
block_index
];
int
x
=
0
;
int
y
=
0
;
...
...
@@ -311,12 +311,6 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
}
}
void
vp9_cyclic_refresh_set_rate_and_dist_sb
(
CYCLIC_REFRESH
*
cr
,
int64_t
rate_sb
,
int64_t
dist_sb
)
{
cr
->
projected_rate_sb
=
rate_sb
;
cr
->
projected_dist_sb
=
dist_sb
;
}
int
vp9_cyclic_refresh_get_rdmult
(
const
CYCLIC_REFRESH
*
cr
)
{
return
cr
->
rdmult
;
}
vp9/encoder/vp9_aq_cyclicrefresh.h
View file @
807885b5
...
...
@@ -33,14 +33,12 @@ void vp9_cyclic_refresh_free(CYCLIC_REFRESH *cr);
void
vp9_cyclic_refresh_update_segment
(
struct
VP9_COMP
*
const
cpi
,
MB_MODE_INFO
*
const
mbmi
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
,
int
use_rd
);
BLOCK_SIZE
bsize
,
int
use_rd
,
int64_t
rate_sb
);
// Setup cyclic background refresh: set delta q and segmentation map.
void
vp9_cyclic_refresh_setup
(
struct
VP9_COMP
*
const
cpi
);
void
vp9_cyclic_refresh_set_rate_and_dist_sb
(
CYCLIC_REFRESH
*
cr
,
int64_t
rate_sb
,
int64_t
dist_sb
);
int
vp9_cyclic_refresh_get_rdmult
(
const
CYCLIC_REFRESH
*
cr
);
#ifdef __cplusplus
...
...
vp9/encoder/vp9_encodeframe.c
View file @
807885b5
...
...
@@ -641,11 +641,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
// Else for cyclic refresh mode update the segment map, set the segment id
// and then update the quantizer.
if
(
cpi
->
oxcf
.
aq_mode
==
CYCLIC_REFRESH_AQ
)
{
vp9_cyclic_refresh_set_rate_and_dist_sb
(
cpi
->
cyclic_refresh
,
ctx
->
rate
,
ctx
->
dist
);
vp9_cyclic_refresh_update_segment
(
cpi
,
&
xd
->
mi
[
0
].
src_mi
->
mbmi
,
mi_row
,
mi_col
,
bsize
,
1
);
mi_row
,
mi_col
,
bsize
,
1
,
ctx
->
rate
);
}
}
...
...
@@ -1310,10 +1307,9 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
:
cm
->
last_frame_seg_map
;
mbmi
->
segment_id
=
vp9_get_segment_id
(
cm
,
map
,
bsize
,
mi_row
,
mi_col
);
}
else
{
vp9_cyclic_refresh_set_rate_and_dist_sb
(
cpi
->
cyclic_refresh
,
ctx
->
rate
,
ctx
->
dist
);
// Setting segmentation map for cyclic_refresh
vp9_cyclic_refresh_update_segment
(
cpi
,
mbmi
,
mi_row
,
mi_col
,
bsize
,
1
);
vp9_cyclic_refresh_update_segment
(
cpi
,
mbmi
,
mi_row
,
mi_col
,
bsize
,
1
,
ctx
->
rate
);
}
vp9_init_plane_quantizers
(
cpi
,
x
);
}
...
...
Write
Preview
Markdown
is supported
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