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
bb22bbf0
Commit
bb22bbf0
authored
Oct 24, 2016
by
Jingning Han
Committed by
Gerrit Code Review
Oct 24, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Allow frame level tx_mode switch" into nextgenv2
parents
57d09379
9777afc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
av1/encoder/block.h
av1/encoder/block.h
+4
-0
av1/encoder/encodeframe.c
av1/encoder/encodeframe.c
+25
-12
No files found.
av1/encoder/block.h
View file @
bb22bbf0
...
...
@@ -98,6 +98,10 @@ struct macroblock {
int
*
m_search_count_ptr
;
int
*
ex_search_count_ptr
;
#if CONFIG_VAR_TX
unsigned
int
txb_split_count
;
#endif
// These are set to their default values at the beginning, and then adjusted
// further in the encoding process.
BLOCK_SIZE
min_partition_size
;
...
...
av1/encoder/encodeframe.c
View file @
bb22bbf0
...
...
@@ -4720,6 +4720,7 @@ static void encode_frame_internal(AV1_COMP *cpi) {
cm
->
use_prev_frame_mvs
?
cm
->
prev_mip
+
cm
->
mi_stride
+
1
:
NULL
;
#if CONFIG_VAR_TX
x
->
txb_split_count
=
0
;
#if CONFIG_REF_MV
av1_zero
(
x
->
blk_skip_drl
);
#endif
...
...
@@ -4853,7 +4854,10 @@ void av1_encode_frame(AV1_COMP *cpi) {
}
}
#if !CONFIG_VAR_TX
#if CONFIG_VAR_TX
if
(
cm
->
tx_mode
==
TX_MODE_SELECT
&&
cpi
->
td
.
mb
.
txb_split_count
==
0
)
cm
->
tx_mode
=
ALLOW_32X32
;
#else
if
(
cm
->
tx_mode
==
TX_MODE_SELECT
)
{
int
count4x4
=
0
;
int
count8x8_lp
=
0
,
count8x8_8x8p
=
0
;
...
...
@@ -4956,8 +4960,9 @@ static void sum_intra_stats(FRAME_COUNTS *counts, const MODE_INFO *mi,
}
#if CONFIG_VAR_TX
static
void
update_txfm_count
(
MACROBLOCKD
*
xd
,
FRAME_COUNTS
*
counts
,
TX_SIZE
tx_size
,
int
blk_row
,
int
blk_col
)
{
static
void
update_txfm_count
(
MACROBLOCK
*
x
,
MACROBLOCKD
*
xd
,
FRAME_COUNTS
*
counts
,
TX_SIZE
tx_size
,
int
blk_row
,
int
blk_col
)
{
MB_MODE_INFO
*
mbmi
=
&
xd
->
mi
[
0
]
->
mbmi
;
const
int
tx_row
=
blk_row
>>
1
;
const
int
tx_col
=
blk_col
>>
1
;
...
...
@@ -4982,6 +4987,7 @@ static void update_txfm_count(MACROBLOCKD *xd, FRAME_COUNTS *counts,
int
bh
=
num_4x4_blocks_high_lookup
[
bsize
];
int
i
;
++
counts
->
txfm_partition
[
ctx
][
1
];
++
x
->
txb_split_count
;
if
(
tx_size
==
TX_8X8
)
{
mbmi
->
inter_tx_size
[
tx_row
][
tx_col
]
=
TX_4X4
;
...
...
@@ -4994,16 +5000,16 @@ static void update_txfm_count(MACROBLOCKD *xd, FRAME_COUNTS *counts,
for
(
i
=
0
;
i
<
4
;
++
i
)
{
int
offsetr
=
(
i
>>
1
)
*
bh
/
2
;
int
offsetc
=
(
i
&
0x01
)
*
bh
/
2
;
update_txfm_count
(
xd
,
counts
,
tx_size
-
1
,
blk_row
+
offsetr
,
update_txfm_count
(
x
,
x
d
,
counts
,
tx_size
-
1
,
blk_row
+
offsetr
,
blk_col
+
offsetc
);
}
}
}
static
void
tx_partition_count_update
(
const
AV1_COMMON
*
const
cm
,
MACROBLOCKD
*
xd
,
BLOCK_SIZE
plane_bsize
,
int
mi_
row
,
int
mi_col
,
FRAME_COUNTS
*
td_counts
)
{
static
void
tx_partition_count_update
(
const
AV1_COMMON
*
const
cm
,
MACROBLOCK
*
x
,
BLOCK_SIZE
plane_bsize
,
int
mi_row
,
int
mi_
col
,
FRAME_COUNTS
*
td_counts
)
{
MACROBLOCKD
*
xd
=
&
x
->
e_mbd
;
const
int
mi_width
=
num_4x4_blocks_wide_lookup
[
plane_bsize
];
const
int
mi_height
=
num_4x4_blocks_high_lookup
[
plane_bsize
];
TX_SIZE
max_tx_size
=
max_txsize_lookup
[
plane_bsize
];
...
...
@@ -5017,7 +5023,7 @@ static void tx_partition_count_update(const AV1_COMMON *const cm,
for
(
idy
=
0
;
idy
<
mi_height
;
idy
+=
bh
)
for
(
idx
=
0
;
idx
<
mi_width
;
idx
+=
bh
)
update_txfm_count
(
xd
,
td_counts
,
max_tx_size
,
idy
,
idx
);
update_txfm_count
(
x
,
x
d
,
td_counts
,
max_tx_size
,
idy
,
idx
);
}
static
void
set_txfm_context
(
MACROBLOCKD
*
xd
,
TX_SIZE
tx_size
,
int
blk_row
,
...
...
@@ -5259,10 +5265,12 @@ static void encode_superblock(const AV1_COMP *const cpi, ThreadData *td,
}
if
(
!
is_rect_tx_allowed
(
xd
,
mbmi
)
||
!
is_rect_tx
(
mbmi
->
tx_size
))
{
#endif // CONFIG_EXT_TX && CONFIG_RECT_TX
if
(
is_inter
)
tx_partition_count_update
(
cm
,
x
d
,
bsize
,
mi_row
,
mi_col
,
td
->
counts
);
else
if
(
is_inter
)
{
tx_partition_count_update
(
cm
,
x
,
bsize
,
mi_row
,
mi_col
,
td
->
counts
);
}
else
{
++
td
->
counts
->
tx_size
[
tx_size_cat
][
tx_size_ctx
][
coded_tx_size
];
if
(
mbmi
->
tx_size
!=
max_txsize_lookup
[
bsize
])
++
x
->
txb_split_count
;
}
#if CONFIG_EXT_TX && CONFIG_RECT_TX
}
#endif
...
...
@@ -5292,7 +5300,12 @@ static void encode_superblock(const AV1_COMP *const cpi, ThreadData *td,
for
(
i
=
0
;
i
<
mi_width
;
i
++
)
if
(
mi_col
+
i
<
cm
->
mi_cols
&&
mi_row
+
j
<
cm
->
mi_rows
)
mi_8x8
[
mis
*
j
+
i
]
->
mbmi
.
tx_size
=
tx_size
;
#if CONFIG_VAR_TX
if
(
mbmi
->
tx_size
!=
max_txsize_lookup
[
bsize
])
++
x
->
txb_split_count
;
#endif
}
++
td
->
counts
->
tx_size_totals
[
txsize_sqr_map
[
mbmi
->
tx_size
]];
++
td
->
counts
->
tx_size_totals
[
txsize_sqr_map
[
get_uv_tx_size
(
mbmi
,
&
xd
->
plane
[
1
])]];
...
...
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