Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
1048a7e3
Commit
1048a7e3
authored
Dec 10, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Dec 10, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Cleaning up skip context calculation."
parents
bcee73f7
2dd20e46
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
43 deletions
+26
-43
vp9/common/vp9_pred_common.h
vp9/common/vp9_pred_common.h
+7
-9
vp9/decoder/vp9_decodemv.c
vp9/decoder/vp9_decodemv.c
+1
-1
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_bitstream.c
+3
-3
vp9/encoder/vp9_rdopt.c
vp9/encoder/vp9_rdopt.c
+12
-27
vp9/encoder/vp9_tokenize.c
vp9/encoder/vp9_tokenize.c
+3
-3
No files found.
vp9/common/vp9_pred_common.h
View file @
1048a7e3
...
...
@@ -40,19 +40,17 @@ static INLINE vp9_prob vp9_get_pred_prob_seg_id(struct segmentation *seg,
return
seg
->
pred_probs
[
vp9_get_pred_context_seg_id
(
xd
)];
}
static
INLINE
int
vp9_get_
pred_context_mbskip
(
const
MACROBLOCKD
*
xd
)
{
static
INLINE
int
vp9_get_
skip_context
(
const
MACROBLOCKD
*
xd
)
{
const
MODE_INFO
*
const
above_mi
=
get_above_mi
(
xd
);
const
MODE_INFO
*
const
left_mi
=
get_left_mi
(
xd
);
const
int
above_skip_coeff
=
(
above_mi
!=
NULL
)
?
above_mi
->
mbmi
.
skip_coeff
:
0
;
const
int
left_skip_coeff
=
(
left_mi
!=
NULL
)
?
left_mi
->
mbmi
.
skip_coeff
:
0
;
return
above_skip_coeff
+
left_skip_coeff
;
const
int
above_skip
=
(
above_mi
!=
NULL
)
?
above_mi
->
mbmi
.
skip_coeff
:
0
;
const
int
left_skip
=
(
left_mi
!=
NULL
)
?
left_mi
->
mbmi
.
skip_coeff
:
0
;
return
above_skip
+
left_skip
;
}
static
INLINE
vp9_prob
vp9_get_
pred_prob_mbskip
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
cm
->
fc
.
mbskip_probs
[
vp9_get_
pred_context_mbskip
(
xd
)];
static
INLINE
vp9_prob
vp9_get_
skip_prob
(
const
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
cm
->
fc
.
mbskip_probs
[
vp9_get_
skip_context
(
xd
)];
}
int
vp9_get_pred_context_switchable_interp
(
const
MACROBLOCKD
*
xd
);
...
...
vp9/decoder/vp9_decodemv.c
View file @
1048a7e3
...
...
@@ -152,7 +152,7 @@ static int read_skip_coeff(VP9_COMMON *cm, const MACROBLOCKD *xd,
if
(
vp9_segfeature_active
(
&
cm
->
seg
,
segment_id
,
SEG_LVL_SKIP
))
{
return
1
;
}
else
{
const
int
ctx
=
vp9_get_
pred_context_mbskip
(
xd
);
const
int
ctx
=
vp9_get_
skip_context
(
xd
);
const
int
skip
=
vp9_read
(
r
,
cm
->
fc
.
mbskip_probs
[
ctx
]);
if
(
!
cm
->
frame_parallel_decoding_mode
)
++
cm
->
counts
.
mbskip
[
ctx
][
skip
];
...
...
vp9/encoder/vp9_bitstream.c
View file @
1048a7e3
...
...
@@ -121,9 +121,9 @@ static int write_skip_coeff(const VP9_COMP *cpi, int segment_id, MODE_INFO *m,
if
(
vp9_segfeature_active
(
&
cpi
->
common
.
seg
,
segment_id
,
SEG_LVL_SKIP
))
{
return
1
;
}
else
{
const
int
skip
_coeff
=
m
->
mbmi
.
skip_coeff
;
vp9_write
(
w
,
skip
_coeff
,
vp9_get_pred_prob_mbskip
(
&
cpi
->
common
,
xd
));
return
skip
_coeff
;
const
int
skip
=
m
->
mbmi
.
skip_coeff
;
vp9_write
(
w
,
skip
,
vp9_get_skip_prob
(
&
cpi
->
common
,
xd
));
return
skip
;
}
}
...
...
vp9/encoder/vp9_rdopt.c
View file @
1048a7e3
...
...
@@ -772,7 +772,7 @@ static void choose_txfm_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x,
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
MB_MODE_INFO
*
const
mbmi
=
&
xd
->
mi_8x8
[
0
]
->
mbmi
;
vp9_prob
skip_prob
=
vp9_get_
pred_prob_mbskip
(
cm
,
xd
);
vp9_prob
skip_prob
=
vp9_get_
skip_prob
(
cm
,
xd
);
int64_t
rd
[
TX_SIZES
][
2
];
int
n
,
m
;
int
s0
,
s1
;
...
...
@@ -847,7 +847,7 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
MB_MODE_INFO
*
const
mbmi
=
&
xd
->
mi_8x8
[
0
]
->
mbmi
;
vp9_prob
skip_prob
=
vp9_get_
pred_prob_mbskip
(
cm
,
xd
);
vp9_prob
skip_prob
=
vp9_get_
skip_prob
(
cm
,
xd
);
int64_t
rd
[
TX_SIZES
][
2
];
int
n
,
m
;
int
s0
,
s1
;
...
...
@@ -2934,7 +2934,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
x
->
skip
=
1
;
// The cost of skip bit needs to be added.
*
rate2
+=
vp9_cost_bit
(
vp9_get_
pred_prob_mbskip
(
cm
,
xd
),
1
);
*
rate2
+=
vp9_cost_bit
(
vp9_get_
skip_prob
(
cm
,
xd
),
1
);
// Scaling factor for SSE from spatial domain to frequency domain
// is 16. Adjust distortion accordingly.
...
...
@@ -3053,13 +3053,12 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
if
(
y_skip
&&
uv_skip
)
{
*
returnrate
=
rate_y
+
rate_uv
-
rate_y_tokenonly
-
rate_uv_tokenonly
+
vp9_cost_bit
(
vp9_get_
pred_prob_mbskip
(
cm
,
xd
),
1
);
vp9_cost_bit
(
vp9_get_
skip_prob
(
cm
,
xd
),
1
);
*
returndist
=
dist_y
+
dist_uv
;
vp9_zero
(
ctx
->
tx_rd_diff
);
}
else
{
int
i
;
*
returnrate
=
rate_y
+
rate_uv
+
vp9_cost_bit
(
vp9_get_pred_prob_mbskip
(
cm
,
xd
),
0
);
*
returnrate
=
rate_y
+
rate_uv
+
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
0
);
*
returndist
=
dist_y
+
dist_uv
;
if
(
cpi
->
sf
.
tx_size_search_method
==
USE_FULL_RD
)
for
(
i
=
0
;
i
<
TX_MODES
;
i
++
)
{
...
...
@@ -3470,9 +3469,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
int
prob_skip_cost
;
// Cost the skip mb case
vp9_prob
skip_prob
=
vp9_get_pred_prob_mbskip
(
cm
,
xd
);
vp9_prob
skip_prob
=
vp9_get_skip_prob
(
cm
,
xd
);
if
(
skip_prob
)
{
prob_skip_cost
=
vp9_cost_bit
(
skip_prob
,
1
);
rate2
+=
prob_skip_cost
;
...
...
@@ -3482,14 +3479,10 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
if
(
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
rate_y
+
rate_uv
,
distortion2
)
<
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
0
,
total_sse
))
{
// Add in the cost of the no skip flag.
int
prob_skip_cost
=
vp9_cost_bit
(
vp9_get_pred_prob_mbskip
(
cm
,
xd
),
0
);
rate2
+=
prob_skip_cost
;
rate2
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
0
);
}
else
{
// FIXME(rbultje) make this work for splitmv also
int
prob_skip_cost
=
vp9_cost_bit
(
vp9_get_pred_prob_mbskip
(
cm
,
xd
),
1
);
rate2
+=
prob_skip_cost
;
rate2
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
1
);
distortion2
=
total_sse
;
assert
(
total_sse
>=
0
);
rate2
-=
(
rate_y
+
rate_uv
);
...
...
@@ -3499,9 +3492,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
}
}
else
if
(
mb_skip_allowed
)
{
// Add in the cost of the no skip flag.
int
prob_skip_cost
=
vp9_cost_bit
(
vp9_get_pred_prob_mbskip
(
cm
,
xd
),
0
);
rate2
+=
prob_skip_cost
;
rate2
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
0
);
}
// Calculate the final RD estimate for this mode.
...
...
@@ -4244,14 +4235,10 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
if
(
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
rate_y
+
rate_uv
,
distortion2
)
<
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
0
,
total_sse
))
{
// Add in the cost of the no skip flag.
int
prob_skip_cost
=
vp9_cost_bit
(
vp9_get_pred_prob_mbskip
(
cm
,
xd
),
0
);
rate2
+=
prob_skip_cost
;
rate2
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
0
);
}
else
{
// FIXME(rbultje) make this work for splitmv also
int
prob_skip_cost
=
vp9_cost_bit
(
vp9_get_pred_prob_mbskip
(
cm
,
xd
),
1
);
rate2
+=
prob_skip_cost
;
rate2
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
1
);
distortion2
=
total_sse
;
assert
(
total_sse
>=
0
);
rate2
-=
(
rate_y
+
rate_uv
);
...
...
@@ -4261,9 +4248,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
}
}
else
if
(
mb_skip_allowed
)
{
// Add in the cost of the no skip flag.
int
prob_skip_cost
=
vp9_cost_bit
(
vp9_get_pred_prob_mbskip
(
cm
,
xd
),
0
);
rate2
+=
prob_skip_cost
;
rate2
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
0
);
}
// Calculate the final RD estimate for this mode.
...
...
vp9/encoder/vp9_tokenize.c
View file @
1048a7e3
...
...
@@ -281,7 +281,7 @@ void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
MACROBLOCKD
*
const
xd
=
&
cpi
->
mb
.
e_mbd
;
MB_MODE_INFO
*
const
mbmi
=
&
xd
->
mi_8x8
[
0
]
->
mbmi
;
TOKENEXTRA
*
t_backup
=
*
t
;
const
int
mb_skip_context
=
vp9_get_pred_context_mbskip
(
xd
);
const
int
ctx
=
vp9_get_skip_context
(
xd
);
const
int
skip_inc
=
!
vp9_segfeature_active
(
&
cm
->
seg
,
mbmi
->
segment_id
,
SEG_LVL_SKIP
);
struct
tokenize_b_args
arg
=
{
cpi
,
xd
,
t
,
mbmi
->
tx_size
,
cpi
->
mb
.
token_cache
};
...
...
@@ -289,7 +289,7 @@ void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
mbmi
->
skip_coeff
=
sb_is_skippable
(
&
cpi
->
mb
,
bsize
);
if
(
mbmi
->
skip_coeff
)
{
if
(
!
dry_run
)
cm
->
counts
.
mbskip
[
mb_skip_context
][
1
]
+=
skip_inc
;
cm
->
counts
.
mbskip
[
ctx
][
1
]
+=
skip_inc
;
reset_skip_context
(
xd
,
bsize
);
if
(
dry_run
)
*
t
=
t_backup
;
...
...
@@ -297,7 +297,7 @@ void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
}
if
(
!
dry_run
)
{
cm
->
counts
.
mbskip
[
mb_skip_context
][
0
]
+=
skip_inc
;
cm
->
counts
.
mbskip
[
ctx
][
0
]
+=
skip_inc
;
foreach_transformed_block
(
xd
,
bsize
,
tokenize_b
,
&
arg
);
}
else
{
foreach_transformed_block
(
xd
,
bsize
,
set_entropy_context_b
,
&
arg
);
...
...
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