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
13253d61
Commit
13253d61
authored
Jul 19, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Jul 19, 2013
Browse files
Merge "Removing kf_{y, uv}_mode_prob arrays from VP9Common."
parents
73ff56b6
f9f453ec
Changes
6
Hide whitespace changes
Inline
Side-by-side
vp9/common/vp9_entropymode.c
View file @
13253d61
...
...
@@ -14,8 +14,8 @@
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_seg_common.h"
static
const
vp9_prob
default
_kf_uv_prob
s
[
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
-
1
]
=
{
const
vp9_prob
vp9
_kf_uv_
mode_
prob
[
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
-
1
]
=
{
{
144
,
11
,
54
,
157
,
195
,
130
,
46
,
58
,
108
}
/* y = dc */
,
{
118
,
15
,
123
,
148
,
131
,
101
,
44
,
93
,
131
}
/* y = v */
,
{
113
,
12
,
23
,
188
,
226
,
142
,
26
,
32
,
125
}
/* y = h */
,
...
...
@@ -98,9 +98,9 @@ static const vp9_prob default_partition_probs[NUM_FRAME_TYPES]
}
};
static
const
vp9_prob
default
_kf_
b
mode_prob
s
[
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
-
1
]
=
{
const
vp9_prob
vp9
_kf_
y_
mode_prob
[
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
-
1
]
=
{
{
/* above = dc */
{
137
,
30
,
42
,
148
,
151
,
207
,
70
,
52
,
91
}
/* left = dc */
,
{
92
,
45
,
102
,
136
,
116
,
180
,
74
,
90
,
100
}
/* left = v */
,
...
...
@@ -328,7 +328,6 @@ static const vp9_prob default_switchable_interp_prob[VP9_SWITCHABLE_FILTERS+1]
void
vp9_init_mbmode_probs
(
VP9_COMMON
*
cm
)
{
vp9_copy
(
cm
->
fc
.
uv_mode_prob
,
default_if_uv_probs
);
vp9_copy
(
cm
->
kf_uv_mode_prob
,
default_kf_uv_probs
);
vp9_copy
(
cm
->
fc
.
y_mode_prob
,
default_if_y_probs
);
vp9_copy
(
cm
->
fc
.
switchable_interp_prob
,
default_switchable_interp_prob
);
vp9_copy
(
cm
->
fc
.
partition_prob
,
default_partition_probs
);
...
...
@@ -583,8 +582,6 @@ void vp9_setup_past_independence(VP9_COMMON *cm, MACROBLOCKD *xd) {
vp9_default_coef_probs
(
cm
);
vp9_init_mbmode_probs
(
cm
);
vp9_copy
(
cm
->
kf_y_mode_prob
,
default_kf_bmode_probs
);
vp9_init_mv_probs
(
cm
);
// To force update of the sharpness
...
...
vp9/common/vp9_entropymode.h
View file @
13253d61
...
...
@@ -16,11 +16,13 @@
#define SUBMVREF_COUNT 5
#define TX_SIZE_CONTEXTS 2
#define VP9_MODE_UPDATE_PROB 252
#define VP9_SWITCHABLE_FILTERS 3 // number of switchable filters
// #define MODE_STATS
struct
VP9Common
;
struct
tx_probs
{
vp9_prob
p32x32
[
TX_SIZE_CONTEXTS
][
TX_SIZE_MAX_SB
-
1
];
vp9_prob
p16x16
[
TX_SIZE_CONTEXTS
][
TX_SIZE_MAX_SB
-
2
];
...
...
@@ -33,58 +35,52 @@ struct tx_counts {
unsigned
int
p8x8
[
TX_SIZE_CONTEXTS
][
TX_SIZE_MAX_SB
-
2
];
};
int
vp9_mv_cont
(
const
int_mv
*
l
,
const
int_mv
*
a
);
extern
const
vp9_prob
vp9_kf_uv_mode_prob
[
VP9_INTRA_MODES
][
VP9_INTRA_MODES
-
1
];
extern
const
vp9_prob
vp9_kf_y_mode_prob
[
VP9_INTRA_MODES
][
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
-
1
];
extern
const
vp9_tree_index
vp9_intra_mode_tree
[];
extern
const
vp9_tree_index
vp9_sb_mv_ref_tree
[];
extern
const
vp9_tree_index
vp9_sb_mv_ref_tree
[];
extern
struct
vp9_token
vp9_intra_mode_encodings
[
VP9_INTRA_MODES
];
/* Inter mode values do not start at zero */
extern
struct
vp9_token
vp9_sb_mv_ref_encoding_array
[
VP9_INTER_MODES
];
// probability models for partition information
extern
const
vp9_tree_index
vp9_partition_tree
[];
extern
const
vp9_tree_index
vp9_partition_tree
[];
extern
struct
vp9_token
vp9_partition_encodings
[
PARTITION_TYPES
];
void
vp9_entropy_mode_init
(
void
);
extern
const
INTERPOLATIONFILTERTYPE
vp9_switchable_interp
[
VP9_SWITCHABLE_FILTERS
];
struct
VP9Common
;
extern
const
int
vp9_switchable_interp_map
[
SWITCHABLE
+
1
];
extern
const
int
vp9_is_interpolating_filter
[
SWITCHABLE
+
1
];
/* sets up common features to forget past dependence */
void
vp9_setup_past_independence
(
struct
VP9Common
*
cm
,
MACROBLOCKD
*
xd
)
;
extern
const
vp9_tree_index
vp9_switchable_interp_tree
[
2
*
(
VP9_SWITCHABLE_FILTERS
-
1
)]
;
void
vp9_init_mbmode_probs
(
struct
VP9Common
*
x
);
extern
void
vp9_init_mode_contexts
(
struct
VP9Common
*
pc
);
extern
struct
vp9_token
vp9_switchable_interp_encodings
[
VP9_SWITCHABLE_FILTERS
];
extern
void
vp9_
adapt_mode_context
(
struct
VP9Common
*
pc
);
void
vp9_
entropy_mode_init
(
);
extern
void
vp9_accum_mv_refs
(
struct
VP9Common
*
pc
,
MB_PREDICTION_MODE
m
,
const
int
context
);
int
vp9_mv_cont
(
const
int_mv
*
l
,
const
int_mv
*
a
);
void
vp9_
adapt_mode_probs
(
struct
VP9Common
*
);
void
vp9_
setup_past_independence
(
struct
VP9Common
*
cm
,
MACROBLOCKD
*
xd
);
#define VP9_SWITCHABLE_FILTERS 3
/* number of switchable filters */
void
vp9_init_mbmode_probs
(
struct
VP9Common
*
x
);
extern
const
INTERPOLATIONFILTERTYPE
vp9_switchable_interp
[
VP9_SWITCHABLE_FILTERS
];
void
vp9_init_mode_contexts
(
struct
VP9Common
*
pc
);
extern
const
int
vp9_switchable_interp_map
[
SWITCHABLE
+
1
]
;
void
vp9_adapt_mode_context
(
struct
VP9Common
*
pc
)
;
extern
const
int
vp9_is_interpolating_filter
[
SWITCHABLE
+
1
]
;
void
vp9_adapt_mode_probs
(
struct
VP9Common
*
)
;
extern
const
vp9_tree_index
vp9_switchable_interp_tree
[
2
*
(
VP9_SWITCHABLE_FILTERS
-
1
)];
void
vp9_accum_mv_refs
(
struct
VP9Common
*
pc
,
MB_PREDICTION_MODE
m
,
int
context
);
extern
struct
vp9_token
vp9_switchable_interp_encodings
[
VP9_SWITCHABLE_FILTERS
];
void
tx_counts_to_branch_counts_32x32
(
unsigned
int
*
tx_count_32x32p
,
unsigned
int
(
*
ct_32x32p
)[
2
]);
void
tx_counts_to_branch_counts_16x16
(
unsigned
int
*
tx_count_16x16p
,
unsigned
int
(
*
ct_16x16p
)[
2
]);
void
tx_counts_to_branch_counts_8x8
(
unsigned
int
*
tx_count_8x8p
,
unsigned
int
(
*
ct_8x8p
)[
2
]);
extern
void
tx_counts_to_branch_counts_32x32
(
unsigned
int
*
tx_count_32x32p
,
unsigned
int
(
*
ct_32x32p
)[
2
]);
extern
void
tx_counts_to_branch_counts_16x16
(
unsigned
int
*
tx_count_16x16p
,
unsigned
int
(
*
ct_16x16p
)[
2
]);
extern
void
tx_counts_to_branch_counts_8x8
(
unsigned
int
*
tx_count_8x8p
,
unsigned
int
(
*
ct_8x8p
)[
2
]);
#endif // VP9_COMMON_VP9_ENTROPYMODE_H_
vp9/common/vp9_onyxc_int.h
View file @
13253d61
...
...
@@ -227,13 +227,6 @@ typedef struct VP9Common {
PARTITION_CONTEXT
*
above_seg_context
;
PARTITION_CONTEXT
left_seg_context
[
8
];
/* keyframe block modes are predicted by their above, left neighbors */
vp9_prob
kf_y_mode_prob
[
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
-
1
];
vp9_prob
kf_uv_mode_prob
[
VP9_INTRA_MODES
]
[
VP9_INTRA_MODES
-
1
];
// Context probabilities for reference frame prediction
int
allow_comp_inter_inter
;
MV_REFERENCE_FRAME
comp_fixed_ref
;
...
...
vp9/decoder/vp9_decodemv.c
View file @
13253d61
...
...
@@ -169,7 +169,7 @@ static void read_intra_mode_info(VP9D_COMP *pbi, MODE_INFO *m,
const
MB_PREDICTION_MODE
A
=
above_block_mode
(
m
,
0
,
mis
);
const
MB_PREDICTION_MODE
L
=
xd
->
left_available
?
left_block_mode
(
m
,
0
)
:
DC_PRED
;
mbmi
->
mode
=
read_intra_mode
(
r
,
cm
->
kf_y_mode_prob
[
A
][
L
]);
mbmi
->
mode
=
read_intra_mode
(
r
,
vp9_
kf_y_mode_prob
[
A
][
L
]);
}
else
{
// Only 4x4, 4x8, 8x4 blocks
const
int
bw
=
1
<<
b_width_log2
(
bsize
);
...
...
@@ -183,7 +183,7 @@ static void read_intra_mode_info(VP9D_COMP *pbi, MODE_INFO *m,
const
MB_PREDICTION_MODE
L
=
(
xd
->
left_available
||
idx
)
?
left_block_mode
(
m
,
ib
)
:
DC_PRED
;
const
MB_PREDICTION_MODE
b_mode
=
read_intra_mode
(
r
,
cm
->
kf_y_mode_prob
[
A
][
L
]);
vp9_
kf_y_mode_prob
[
A
][
L
]);
m
->
bmi
[
ib
].
as_mode
=
b_mode
;
if
(
bh
==
2
)
m
->
bmi
[
ib
+
2
].
as_mode
=
b_mode
;
...
...
@@ -195,7 +195,7 @@ static void read_intra_mode_info(VP9D_COMP *pbi, MODE_INFO *m,
mbmi
->
mode
=
m
->
bmi
[
3
].
as_mode
;
}
mbmi
->
uv_mode
=
read_intra_mode
(
r
,
cm
->
kf_uv_mode_prob
[
mbmi
->
mode
]);
mbmi
->
uv_mode
=
read_intra_mode
(
r
,
vp9_
kf_uv_mode_prob
[
mbmi
->
mode
]);
}
static
int
read_mv_component
(
vp9_reader
*
r
,
...
...
vp9/encoder/vp9_bitstream.c
View file @
13253d61
...
...
@@ -560,7 +560,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
const
MB_PREDICTION_MODE
A
=
above_block_mode
(
m
,
0
,
mis
);
const
MB_PREDICTION_MODE
L
=
xd
->
left_available
?
left_block_mode
(
m
,
0
)
:
DC_PRED
;
write_intra_mode
(
bc
,
ym
,
c
->
kf_y_mode_prob
[
A
][
L
]);
write_intra_mode
(
bc
,
ym
,
vp9_
kf_y_mode_prob
[
A
][
L
]);
}
else
{
int
idx
,
idy
;
int
bw
=
1
<<
b_width_log2
(
m
->
mbmi
.
sb_type
);
...
...
@@ -575,12 +575,12 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
#ifdef ENTROPY_STATS
++
intra_mode_stats
[
A
][
L
][
bm
];
#endif
write_intra_mode
(
bc
,
bm
,
c
->
kf_y_mode_prob
[
A
][
L
]);
write_intra_mode
(
bc
,
bm
,
vp9_
kf_y_mode_prob
[
A
][
L
]);
}
}
}
write_intra_mode
(
bc
,
m
->
mbmi
.
uv_mode
,
c
->
kf_uv_mode_prob
[
ym
]);
write_intra_mode
(
bc
,
m
->
mbmi
.
uv_mode
,
vp9_
kf_uv_mode_prob
[
ym
]);
}
static
void
write_modes_b
(
VP9_COMP
*
cpi
,
MODE_INFO
*
m
,
vp9_writer
*
bc
,
...
...
vp9/encoder/vp9_modecosts.c
View file @
13253d61
...
...
@@ -22,8 +22,8 @@ void vp9_init_mode_costs(VP9_COMP *c) {
for
(
i
=
0
;
i
<
VP9_INTRA_MODES
;
i
++
)
{
for
(
j
=
0
;
j
<
VP9_INTRA_MODES
;
j
++
)
{
vp9_cost_tokens
((
int
*
)
c
->
mb
.
y_mode_costs
[
i
][
j
],
x
->
kf_y_mode_prob
[
i
][
j
],
KT
);
vp9_cost_tokens
((
int
*
)
c
->
mb
.
y_mode_costs
[
i
][
j
],
vp9_kf_y_mode_prob
[
i
][
j
],
KT
);
}
}
...
...
@@ -33,7 +33,8 @@ void vp9_init_mode_costs(VP9_COMP *c) {
vp9_cost_tokens
(
c
->
mb
.
intra_uv_mode_cost
[
1
],
x
->
fc
.
uv_mode_prob
[
VP9_INTRA_MODES
-
1
],
vp9_intra_mode_tree
);
vp9_cost_tokens
(
c
->
mb
.
intra_uv_mode_cost
[
0
],
x
->
kf_uv_mode_prob
[
VP9_INTRA_MODES
-
1
],
vp9_intra_mode_tree
);
vp9_kf_uv_mode_prob
[
VP9_INTRA_MODES
-
1
],
vp9_intra_mode_tree
);
for
(
i
=
0
;
i
<=
VP9_SWITCHABLE_FILTERS
;
++
i
)
vp9_cost_tokens
((
int
*
)
c
->
mb
.
switchable_interp_costs
[
i
],
...
...
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