Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
eab6a421
Commit
eab6a421
authored
May 09, 2013
by
John Koleszar
Committed by
Gerrit Code Review
May 09, 2013
Browse files
Merge "Use common get_uv_tx_size()" into experimental
parents
8525c02e
1fec23be
Changes
2
Hide whitespace changes
Inline
Side-by-side
vp9/common/vp9_blockd.h
View file @
eab6a421
...
...
@@ -759,7 +759,9 @@ static INLINE void foreach_transformed_block_in_plane(
// block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
// 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
const
TX_SIZE
tx_size
=
xd
->
mode_info_context
->
mbmi
.
txfm_size
;
// transform size varies per plane, look it up in a common way.
const
TX_SIZE
tx_size
=
plane
?
get_uv_tx_size
(
xd
)
:
xd
->
mode_info_context
->
mbmi
.
txfm_size
;
const
int
block_size_b
=
bw
+
bh
;
const
int
txfrm_size_b
=
tx_size
*
2
;
...
...
@@ -768,21 +770,14 @@ static INLINE void foreach_transformed_block_in_plane(
xd
->
plane
[
plane
].
subsampling_y
;
const
int
ss_block_size
=
block_size_b
-
ss_sum
;
// size of the transform to use. scale the transform down if it's larger
// than the size of the subsampled data, or forced externally by the mb mode.
const
int
ss_max
=
MAX
(
xd
->
plane
[
plane
].
subsampling_x
,
xd
->
plane
[
plane
].
subsampling_y
);
const
int
ss_txfrm_size
=
txfrm_size_b
>
ss_block_size
?
txfrm_size_b
-
ss_max
*
2
:
txfrm_size_b
;
const
int
step
=
1
<<
ss_txfrm_size
;
const
int
step
=
1
<<
txfrm_size_b
;
int
i
;
assert
(
txfrm_size_b
<=
block_size_b
);
assert
(
ss_
txfrm_size
<=
ss_block_size
);
assert
(
txfrm_size
_b
<=
ss_block_size
);
for
(
i
=
0
;
i
<
(
1
<<
ss_block_size
);
i
+=
step
)
{
visit
(
plane
,
i
,
bsize
,
ss_
txfrm_size
,
arg
);
visit
(
plane
,
i
,
bsize
,
txfrm_size
_b
,
arg
);
}
}
...
...
@@ -917,34 +912,4 @@ static void txfrm_block_to_raster_xy(MACROBLOCKD *xd,
*
y
=
raster_mb
>>
tx_cols_lg2
<<
(
txwl
);
}
static
TX_SIZE
tx_size_for_plane
(
MACROBLOCKD
*
xd
,
BLOCK_SIZE_TYPE
bsize
,
int
plane
)
{
// TODO(jkoleszar): This duplicates a ton of code, but we're going to be
// moving this to a per-plane lookup shortly, and this will go away then.
if
(
!
plane
)
{
return
xd
->
mode_info_context
->
mbmi
.
txfm_size
;
}
else
{
const
int
bw
=
b_width_log2
(
bsize
),
bh
=
b_height_log2
(
bsize
);
// block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
// 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
const
TX_SIZE
tx_size
=
xd
->
mode_info_context
->
mbmi
.
txfm_size
;
const
int
block_size_b
=
bw
+
bh
;
const
int
txfrm_size_b
=
tx_size
*
2
;
// subsampled size of the block
const
int
ss_sum
=
xd
->
plane
[
plane
].
subsampling_x
+
xd
->
plane
[
plane
].
subsampling_y
;
const
int
ss_block_size
=
block_size_b
-
ss_sum
;
// size of the transform to use. scale the transform down if it's larger
// than the size of the subsampled data, or forced externally by the mb mode
const
int
ss_max
=
MAX
(
xd
->
plane
[
plane
].
subsampling_x
,
xd
->
plane
[
plane
].
subsampling_y
);
const
int
ss_txfrm_size
=
txfrm_size_b
>
ss_block_size
?
txfrm_size_b
-
ss_max
*
2
:
txfrm_size_b
;
return
(
TX_SIZE
)(
ss_txfrm_size
/
2
);
}
}
#endif // VP9_COMMON_VP9_BLOCKD_H_
vp9/encoder/vp9_encodemb.c
View file @
eab6a421
...
...
@@ -378,7 +378,8 @@ void vp9_optimize_init(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize,
const
struct
macroblockd_plane
*
const
plane
=
&
xd
->
plane
[
p
];
const
int
bwl
=
b_width_log2
(
bsize
)
-
plane
->
subsampling_x
;
const
int
bhl
=
b_height_log2
(
bsize
)
-
plane
->
subsampling_y
;
const
TX_SIZE
tx_size
=
tx_size_for_plane
(
xd
,
bsize
,
p
);
const
TX_SIZE
tx_size
=
p
?
get_uv_tx_size
(
xd
)
:
xd
->
mode_info_context
->
mbmi
.
txfm_size
;
int
i
,
j
;
for
(
i
=
0
;
i
<
1
<<
bwl
;
i
+=
1
<<
tx_size
)
{
...
...
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