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
d6b159d4
Commit
d6b159d4
authored
Dec 06, 2013
by
Dmitry Kovalev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing BLOCK_TYPES and adding PLANE_TYPES constant instead.
Change-Id: Ic3bb862e93aedf6a489a33ea6f7e5097d96855ee
parent
cf4dfdc8
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
36 additions
and
38 deletions
+36
-38
vp9/common/vp9_blockd.h
vp9/common/vp9_blockd.h
+12
-12
vp9/common/vp9_entropy.c
vp9/common/vp9_entropy.c
+5
-5
vp9/common/vp9_entropy.h
vp9/common/vp9_entropy.h
+1
-3
vp9/common/vp9_onyxc_int.h
vp9/common/vp9_onyxc_int.h
+3
-3
vp9/decoder/vp9_decodeframe.c
vp9/decoder/vp9_decodeframe.c
+1
-1
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_bitstream.c
+5
-5
vp9/encoder/vp9_block.h
vp9/encoder/vp9_block.h
+1
-1
vp9/encoder/vp9_onyx_if.c
vp9/encoder/vp9_onyx_if.c
+1
-1
vp9/encoder/vp9_onyx_int.h
vp9/encoder/vp9_onyx_int.h
+3
-3
vp9/encoder/vp9_rdopt.c
vp9/encoder/vp9_rdopt.c
+4
-4
No files found.
vp9/common/vp9_blockd.h
View file @
d6b159d4
...
...
@@ -38,8 +38,9 @@
#define REF_CONTEXTS 5
typedef
enum
{
PLANE_TYPE_Y_WITH_DC
,
PLANE_TYPE_UV
,
PLANE_TYPE_Y
=
0
,
PLANE_TYPE_UV
=
1
,
PLANE_TYPES
}
PLANE_TYPE
;
typedef
char
ENTROPY_CONTEXT
;
...
...
@@ -265,37 +266,36 @@ static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type,
const
MODE_INFO
*
const
mi
=
xd
->
mi_8x8
[
0
];
const
MB_MODE_INFO
*
const
mbmi
=
&
mi
->
mbmi
;
if
(
plane_type
!=
PLANE_TYPE_Y_WITH_DC
||
xd
->
lossless
||
is_inter_block
(
mbmi
))
if
(
plane_type
!=
PLANE_TYPE_Y
||
xd
->
lossless
||
is_inter_block
(
mbmi
))
return
DCT_DCT
;
return
mode2txfm_map
[
mbmi
->
sb_type
<
BLOCK_8X8
?
mi
->
bmi
[
ib
].
as_mode
:
mbmi
->
mode
];
return
mode2txfm_map
[
mbmi
->
sb_type
<
BLOCK_8X8
?
mi
->
bmi
[
ib
].
as_mode
:
mbmi
->
mode
];
}
static
INLINE
TX_TYPE
get_tx_type_8x8
(
PLANE_TYPE
plane_type
,
const
MACROBLOCKD
*
xd
)
{
return
plane_type
==
PLANE_TYPE_Y
_WITH_DC
?
mode2txfm_map
[
xd
->
mi_8x8
[
0
]
->
mbmi
.
mode
]
:
DCT_DCT
;
return
plane_type
==
PLANE_TYPE_Y
?
mode2txfm_map
[
xd
->
mi_8x8
[
0
]
->
mbmi
.
mode
]
:
DCT_DCT
;
}
static
INLINE
TX_TYPE
get_tx_type_16x16
(
PLANE_TYPE
plane_type
,
const
MACROBLOCKD
*
xd
)
{
return
plane_type
==
PLANE_TYPE_Y
_WITH_DC
?
mode2txfm_map
[
xd
->
mi_8x8
[
0
]
->
mbmi
.
mode
]
:
DCT_DCT
;
return
plane_type
==
PLANE_TYPE_Y
?
mode2txfm_map
[
xd
->
mi_8x8
[
0
]
->
mbmi
.
mode
]
:
DCT_DCT
;
}
static
void
setup_block_dptrs
(
MACROBLOCKD
*
xd
,
int
ss_x
,
int
ss_y
)
{
int
i
;
for
(
i
=
0
;
i
<
MAX_MB_PLANE
;
i
++
)
{
xd
->
plane
[
i
].
plane_type
=
i
?
PLANE_TYPE_UV
:
PLANE_TYPE_Y
_WITH_DC
;
xd
->
plane
[
i
].
plane_type
=
i
?
PLANE_TYPE_UV
:
PLANE_TYPE_Y
;
xd
->
plane
[
i
].
subsampling_x
=
i
?
ss_x
:
0
;
xd
->
plane
[
i
].
subsampling_y
=
i
?
ss_y
:
0
;
}
#if CONFIG_ALPHA
// TODO(jkoleszar): Using the Y w/h for now
xd
->
plane
[
3
].
plane_type
=
PLANE_TYPE_Y
;
xd
->
plane
[
3
].
subsampling_x
=
0
;
xd
->
plane
[
3
].
subsampling_y
=
0
;
#endif
...
...
vp9/common/vp9_entropy.c
View file @
d6b159d4
...
...
@@ -391,7 +391,7 @@ const vp9_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
{
255
,
246
,
247
,
255
,
239
,
255
,
253
,
255
},
};
static
const
vp9_coeff_probs_model
default_coef_probs_4x4
[
BLOCK
_TYPES
]
=
{
static
const
vp9_coeff_probs_model
default_coef_probs_4x4
[
PLANE
_TYPES
]
=
{
{
// Y plane
{
// Intra
{
// Band 0
...
...
@@ -475,7 +475,7 @@ static const vp9_coeff_probs_model default_coef_probs_4x4[BLOCK_TYPES] = {
}
};
static
const
vp9_coeff_probs_model
default_coef_probs_8x8
[
BLOCK
_TYPES
]
=
{
static
const
vp9_coeff_probs_model
default_coef_probs_8x8
[
PLANE
_TYPES
]
=
{
{
// Y plane
{
// Intra
{
// Band 0
...
...
@@ -559,7 +559,7 @@ static const vp9_coeff_probs_model default_coef_probs_8x8[BLOCK_TYPES] = {
}
};
static
const
vp9_coeff_probs_model
default_coef_probs_16x16
[
BLOCK
_TYPES
]
=
{
static
const
vp9_coeff_probs_model
default_coef_probs_16x16
[
PLANE
_TYPES
]
=
{
{
// Y plane
{
// Intra
{
// Band 0
...
...
@@ -643,7 +643,7 @@ static const vp9_coeff_probs_model default_coef_probs_16x16[BLOCK_TYPES] = {
}
};
static
const
vp9_coeff_probs_model
default_coef_probs_32x32
[
BLOCK
_TYPES
]
=
{
static
const
vp9_coeff_probs_model
default_coef_probs_32x32
[
PLANE
_TYPES
]
=
{
{
// Y plane
{
// Intra
{
// Band 0
...
...
@@ -763,7 +763,7 @@ static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE tx_size,
cm
->
counts
.
eob_branch
[
tx_size
];
int
i
,
j
,
k
,
l
,
m
;
for
(
i
=
0
;
i
<
BLOCK
_TYPES
;
++
i
)
for
(
i
=
0
;
i
<
PLANE
_TYPES
;
++
i
)
for
(
j
=
0
;
j
<
REF_TYPES
;
++
j
)
for
(
k
=
0
;
k
<
COEF_BANDS
;
++
k
)
for
(
l
=
0
;
l
<
BAND_COEFF_CONTEXTS
(
k
);
++
l
)
{
...
...
vp9/common/vp9_entropy.h
View file @
d6b159d4
...
...
@@ -59,8 +59,6 @@ extern const vp9_extra_bit vp9_extra_bits[ENTROPY_TOKENS];
/* Coefficients are predicted via a 3-dimensional probability table. */
/* Outside dimension. 0 = Y with DC, 1 = UV */
#define BLOCK_TYPES 2
#define REF_TYPES 2 // intra=0, inter=1
/* Middle dimension reflects the coefficient position within the transform. */
...
...
@@ -179,7 +177,7 @@ static const scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
const
MODE_INFO
*
const
mi
=
xd
->
mi_8x8
[
0
];
const
MB_MODE_INFO
*
const
mbmi
=
&
mi
->
mbmi
;
if
(
is_inter_block
(
mbmi
)
||
type
!=
PLANE_TYPE_Y
_WITH_DC
||
xd
->
lossless
)
{
if
(
is_inter_block
(
mbmi
)
||
type
!=
PLANE_TYPE_Y
||
xd
->
lossless
)
{
return
&
vp9_default_scan_orders
[
tx_size
];
}
else
{
const
MB_PREDICTION_MODE
mode
=
...
...
vp9/common/vp9_onyxc_int.h
View file @
d6b159d4
...
...
@@ -47,7 +47,7 @@ typedef struct frame_contexts {
vp9_prob
y_mode_prob
[
BLOCK_SIZE_GROUPS
][
INTRA_MODES
-
1
];
vp9_prob
uv_mode_prob
[
INTRA_MODES
][
INTRA_MODES
-
1
];
vp9_prob
partition_prob
[
PARTITION_CONTEXTS
][
PARTITION_TYPES
-
1
];
vp9_coeff_probs_model
coef_probs
[
TX_SIZES
][
BLOCK
_TYPES
];
vp9_coeff_probs_model
coef_probs
[
TX_SIZES
][
PLANE
_TYPES
];
vp9_prob
switchable_interp_prob
[
SWITCHABLE_FILTER_CONTEXTS
]
[
SWITCHABLE_FILTERS
-
1
];
vp9_prob
inter_mode_probs
[
INTER_MODE_CONTEXTS
][
INTER_MODES
-
1
];
...
...
@@ -64,8 +64,8 @@ typedef struct {
unsigned
int
y_mode
[
BLOCK_SIZE_GROUPS
][
INTRA_MODES
];
unsigned
int
uv_mode
[
INTRA_MODES
][
INTRA_MODES
];
unsigned
int
partition
[
PARTITION_CONTEXTS
][
PARTITION_TYPES
];
vp9_coeff_count_model
coef
[
TX_SIZES
][
BLOCK
_TYPES
];
unsigned
int
eob_branch
[
TX_SIZES
][
BLOCK
_TYPES
][
REF_TYPES
]
vp9_coeff_count_model
coef
[
TX_SIZES
][
PLANE
_TYPES
];
unsigned
int
eob_branch
[
TX_SIZES
][
PLANE
_TYPES
][
REF_TYPES
]
[
COEF_BANDS
][
COEFF_CONTEXTS
];
unsigned
int
switchable_interp
[
SWITCHABLE_FILTER_CONTEXTS
]
[
SWITCHABLE_FILTERS
];
...
...
vp9/decoder/vp9_decodeframe.c
View file @
d6b159d4
...
...
@@ -537,7 +537,7 @@ static void read_coef_probs_common(vp9_coeff_probs_model *coef_probs,
int
i
,
j
,
k
,
l
,
m
;
if
(
vp9_read_bit
(
r
))
for
(
i
=
0
;
i
<
BLOCK
_TYPES
;
++
i
)
for
(
i
=
0
;
i
<
PLANE
_TYPES
;
++
i
)
for
(
j
=
0
;
j
<
REF_TYPES
;
++
j
)
for
(
k
=
0
;
k
<
COEF_BANDS
;
++
k
)
for
(
l
=
0
;
l
<
BAND_COEFF_CONTEXTS
(
k
);
++
l
)
...
...
vp9/encoder/vp9_bitstream.c
View file @
d6b159d4
...
...
@@ -44,7 +44,7 @@ unsigned __int64 Sectionbits[500];
int
intra_mode_stats
[
INTRA_MODES
]
[
INTRA_MODES
]
[
INTRA_MODES
];
vp9_coeff_stats
tree_update_hist
[
TX_SIZES
][
BLOCK
_TYPES
];
vp9_coeff_stats
tree_update_hist
[
TX_SIZES
][
PLANE
_TYPES
];
extern
unsigned
int
active_section
;
#endif
...
...
@@ -557,7 +557,7 @@ static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE tx_size) {
vp9_coeff_stats
*
coef_branch_ct
=
cpi
->
frame_branch_ct
[
tx_size
];
int
i
,
j
,
k
,
l
,
m
;
for
(
i
=
0
;
i
<
BLOCK
_TYPES
;
++
i
)
{
for
(
i
=
0
;
i
<
PLANE
_TYPES
;
++
i
)
{
for
(
j
=
0
;
j
<
REF_TYPES
;
++
j
)
{
for
(
k
=
0
;
k
<
COEF_BANDS
;
++
k
)
{
for
(
l
=
0
;
l
<
BAND_COEFF_CONTEXTS
(
k
);
++
l
)
{
...
...
@@ -600,7 +600,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
/* dry run to see if there is any udpate at all needed */
int
savings
=
0
;
int
update
[
2
]
=
{
0
,
0
};
for
(
i
=
0
;
i
<
BLOCK
_TYPES
;
++
i
)
{
for
(
i
=
0
;
i
<
PLANE
_TYPES
;
++
i
)
{
for
(
j
=
0
;
j
<
REF_TYPES
;
++
j
)
{
for
(
k
=
0
;
k
<
COEF_BANDS
;
++
k
)
{
for
(
l
=
0
;
l
<
BAND_COEFF_CONTEXTS
(
k
);
++
l
)
{
...
...
@@ -636,7 +636,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
return
;
}
vp9_write_bit
(
bc
,
1
);
for
(
i
=
0
;
i
<
BLOCK
_TYPES
;
++
i
)
{
for
(
i
=
0
;
i
<
PLANE
_TYPES
;
++
i
)
{
for
(
j
=
0
;
j
<
REF_TYPES
;
++
j
)
{
for
(
k
=
0
;
k
<
COEF_BANDS
;
++
k
)
{
for
(
l
=
0
;
l
<
BAND_COEFF_CONTEXTS
(
k
);
++
l
)
{
...
...
@@ -685,7 +685,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
:
COEF_BANDS
;
int
updates
=
0
;
int
noupdates_before_first
=
0
;
for
(
i
=
0
;
i
<
BLOCK
_TYPES
;
++
i
)
{
for
(
i
=
0
;
i
<
PLANE
_TYPES
;
++
i
)
{
for
(
j
=
0
;
j
<
REF_TYPES
;
++
j
)
{
for
(
k
=
0
;
k
<
COEF_BANDS
;
++
k
)
{
for
(
l
=
0
;
l
<
BAND_COEFF_CONTEXTS
(
k
);
++
l
)
{
...
...
vp9/encoder/vp9_block.h
View file @
d6b159d4
...
...
@@ -86,7 +86,7 @@ struct macroblock_plane {
/* The [2] dimension is for whether we skip the EOB node (i.e. if previous
* coefficient in this block was zero) or not. */
typedef
unsigned
int
vp9_coeff_cost
[
BLOCK
_TYPES
][
REF_TYPES
][
COEF_BANDS
][
2
]
typedef
unsigned
int
vp9_coeff_cost
[
PLANE
_TYPES
][
REF_TYPES
][
COEF_BANDS
][
2
]
[
COEFF_CONTEXTS
][
ENTROPY_TOKENS
];
typedef
struct
macroblock
MACROBLOCK
;
...
...
vp9/encoder/vp9_onyx_if.c
View file @
d6b159d4
...
...
@@ -2597,7 +2597,7 @@ static void full_to_model_counts(vp9_coeff_count_model *model_count,
vp9_coeff_count
*
full_count
)
{
int
i
,
j
,
k
,
l
;
for
(
i
=
0
;
i
<
BLOCK
_TYPES
;
++
i
)
for
(
i
=
0
;
i
<
PLANE
_TYPES
;
++
i
)
for
(
j
=
0
;
j
<
REF_TYPES
;
++
j
)
for
(
k
=
0
;
k
<
COEF_BANDS
;
++
k
)
for
(
l
=
0
;
l
<
BAND_COEFF_CONTEXTS
(
k
);
++
l
)
...
...
vp9/encoder/vp9_onyx_int.h
View file @
d6b159d4
...
...
@@ -469,9 +469,9 @@ typedef struct VP9_COMP {
nmv_context_counts
NMVcount
;
vp9_coeff_count
coef_counts
[
TX_SIZES
][
BLOCK
_TYPES
];
vp9_coeff_probs_model
frame_coef_probs
[
TX_SIZES
][
BLOCK
_TYPES
];
vp9_coeff_stats
frame_branch_ct
[
TX_SIZES
][
BLOCK
_TYPES
];
vp9_coeff_count
coef_counts
[
TX_SIZES
][
PLANE
_TYPES
];
vp9_coeff_probs_model
frame_coef_probs
[
TX_SIZES
][
PLANE
_TYPES
];
vp9_coeff_stats
frame_branch_ct
[
TX_SIZES
][
PLANE
_TYPES
];
int
kf_zeromotion_pct
;
int
gf_zeromotion_pct
;
...
...
vp9/encoder/vp9_rdopt.c
View file @
d6b159d4
...
...
@@ -151,11 +151,11 @@ static void fill_mode_costs(VP9_COMP *c) {
}
static
void
fill_token_costs
(
vp9_coeff_cost
*
c
,
vp9_coeff_probs_model
(
*
p
)[
BLOCK
_TYPES
])
{
vp9_coeff_probs_model
(
*
p
)[
PLANE
_TYPES
])
{
int
i
,
j
,
k
,
l
;
TX_SIZE
t
;
for
(
t
=
TX_4X4
;
t
<=
TX_32X32
;
++
t
)
for
(
i
=
0
;
i
<
BLOCK
_TYPES
;
++
i
)
for
(
i
=
0
;
i
<
PLANE
_TYPES
;
++
i
)
for
(
j
=
0
;
j
<
REF_TYPES
;
++
j
)
for
(
k
=
0
;
k
<
COEF_BANDS
;
++
k
)
for
(
l
=
0
;
l
<
BAND_COEFF_CONTEXTS
(
k
);
++
l
)
{
...
...
@@ -536,7 +536,7 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
int
c
,
cost
;
// Check for consistency of tx_size with mode info
assert
(
type
==
PLANE_TYPE_Y
_WITH_DC
?
mbmi
->
tx_size
==
tx_size
assert
(
type
==
PLANE_TYPE_Y
?
mbmi
->
tx_size
==
tx_size
:
get_uv_tx_size
(
mbmi
)
==
tx_size
);
if
(
eob
==
0
)
{
...
...
@@ -1047,7 +1047,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
src
,
src_stride
,
dst
,
dst_stride
);
tx_type
=
get_tx_type_4x4
(
PLANE_TYPE_Y
_WITH_DC
,
xd
,
block
);
tx_type
=
get_tx_type_4x4
(
PLANE_TYPE_Y
,
xd
,
block
);
so
=
&
vp9_scan_orders
[
TX_4X4
][
tx_type
];
if
(
tx_type
!=
DCT_DCT
)
...
...
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