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
Yushin Cho
aom-rav1e
Commits
a0d8ec7b
Commit
a0d8ec7b
authored
Oct 14, 2013
by
Jingning Han
Committed by
Gerrit Code Review
Oct 14, 2013
Browse files
Merge "Move token_cache from cost_coeffs to MACROBLOCK"
parents
706d4a7c
f60a3910
Changes
2
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_block.h
View file @
a0d8ec7b
...
...
@@ -135,6 +135,7 @@ struct macroblock {
// note that token_costs is the cost when eob node is skipped
vp9_coeff_cost
token_costs
[
TX_SIZES
];
uint8_t
token_cache
[
1024
];
int
optimize
;
...
...
vp9/encoder/vp9_rdopt.c
View file @
a0d8ec7b
...
...
@@ -476,12 +476,12 @@ static const int16_t band_counts[TX_SIZES][8] = {
{
1
,
2
,
3
,
4
,
11
,
1024
-
21
,
0
},
};
static
INLINE
int
cost_coeffs
(
MACROBLOCK
*
mb
,
static
INLINE
int
cost_coeffs
(
MACROBLOCK
*
x
,
int
plane
,
int
block
,
ENTROPY_CONTEXT
*
A
,
ENTROPY_CONTEXT
*
L
,
TX_SIZE
tx_size
,
const
int16_t
*
scan
,
const
int16_t
*
nb
)
{
MACROBLOCKD
*
const
xd
=
&
mb
->
e_mbd
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
MB_MODE_INFO
*
mbmi
=
&
xd
->
this_mi
->
mbmi
;
struct
macroblockd_plane
*
pd
=
&
xd
->
plane
[
plane
];
const
PLANE_TYPE
type
=
pd
->
plane_type
;
...
...
@@ -490,9 +490,9 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
const
int16_t
*
const
qcoeff_ptr
=
BLOCK_OFFSET
(
pd
->
qcoeff
,
block
);
const
int
ref
=
mbmi
->
ref_frame
[
0
]
!=
INTRA_FRAME
;
unsigned
int
(
*
token_costs
)[
2
][
PREV_COEF_CONTEXTS
][
MAX_ENTROPY_TOKENS
]
=
mb
->
token_costs
[
tx_size
][
type
][
ref
];
x
->
token_costs
[
tx_size
][
type
][
ref
];
const
ENTROPY_CONTEXT
above_ec
=
!!*
A
,
left_ec
=
!!*
L
;
uint8_t
token_cache
[
1024
]
;
uint8_t
*
p_tok
=
x
->
token_cache
;
int
pt
=
combine_entropy_contexts
(
above_ec
,
left_ec
);
int
c
,
cost
;
...
...
@@ -511,7 +511,7 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
int
v
=
qcoeff_ptr
[
0
];
int
prev_t
=
vp9_dct_value_tokens_ptr
[
v
].
token
;
cost
=
(
*
token_costs
)[
0
][
pt
][
prev_t
]
+
vp9_dct_value_cost_ptr
[
v
];
tok
en_cache
[
0
]
=
vp9_pt_energy_class
[
prev_t
];
p_
tok
[
0
]
=
vp9_pt_energy_class
[
prev_t
];
++
token_costs
;
// ac tokens
...
...
@@ -521,9 +521,9 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
v
=
qcoeff_ptr
[
rc
];
t
=
vp9_dct_value_tokens_ptr
[
v
].
token
;
pt
=
get_coef_context
(
nb
,
tok
en_cache
,
c
);
pt
=
get_coef_context
(
nb
,
p_
tok
,
c
);
cost
+=
(
*
token_costs
)[
!
prev_t
][
pt
][
t
]
+
vp9_dct_value_cost_ptr
[
v
];
tok
en_cache
[
rc
]
=
vp9_pt_energy_class
[
t
];
p_
tok
[
rc
]
=
vp9_pt_energy_class
[
t
];
prev_t
=
t
;
if
(
!--
band_left
)
{
band_left
=
*
band_count
++
;
...
...
@@ -533,7 +533,7 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
// eob token
if
(
band_left
)
{
pt
=
get_coef_context
(
nb
,
tok
en_cache
,
c
);
pt
=
get_coef_context
(
nb
,
p_
tok
,
c
);
cost
+=
(
*
token_costs
)[
0
][
pt
][
DCT_EOB_TOKEN
];
}
}
...
...
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