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
a3d4fe50
Commit
a3d4fe50
authored
May 19, 2017
by
Debargha Mukherjee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable switchable restoration for chroma
Change-Id: I78a8a1749cd4449c61a106f413c697e4a2df0475
parent
9ac7a0f3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
45 deletions
+27
-45
av1/common/enums.h
av1/common/enums.h
+1
-1
av1/decoder/decodeframe.c
av1/decoder/decodeframe.c
+10
-15
av1/encoder/bitstream.c
av1/encoder/bitstream.c
+13
-26
av1/encoder/pickrst.c
av1/encoder/pickrst.c
+3
-3
No files found.
av1/common/enums.h
View file @
a3d4fe50
...
...
@@ -708,7 +708,7 @@ typedef enum {
RESTORE_SGRPROJ
,
RESTORE_SWITCHABLE
,
RESTORE_SWITCHABLE_TYPES
=
RESTORE_SWITCHABLE
,
RESTORE_TYPES
,
RESTORE_TYPES
=
4
,
}
RestorationType
;
#endif // CONFIG_LOOP_RESTORATION
...
...
av1/decoder/decodeframe.c
View file @
a3d4fe50
...
...
@@ -1669,34 +1669,30 @@ static void setup_segmentation(AV1_COMMON *const cm,
static
void
decode_restoration_mode
(
AV1_COMMON
*
cm
,
struct
aom_read_bit_buffer
*
rb
)
{
int
p
;
RestorationInfo
*
rsi
=
&
cm
->
rst_info
[
0
];
if
(
aom_rb_read_bit
(
rb
))
{
rsi
->
frame_restoration_type
=
aom_rb_read_bit
(
rb
)
?
RESTORE_SGRPROJ
:
RESTORE_WIENER
;
}
else
{
rsi
->
frame_restoration_type
=
aom_rb_read_bit
(
rb
)
?
RESTORE_SWITCHABLE
:
RESTORE_NONE
;
}
for
(
p
=
1
;
p
<
MAX_MB_PLANE
;
++
p
)
{
RestorationInfo
*
rsi
;
for
(
p
=
0
;
p
<
MAX_MB_PLANE
;
++
p
)
{
rsi
=
&
cm
->
rst_info
[
p
];
if
(
aom_rb_read_bit
(
rb
))
{
rsi
->
frame_restoration_type
=
aom_rb_read_bit
(
rb
)
?
RESTORE_SGRPROJ
:
RESTORE_WIENER
;
}
else
{
rsi
->
frame_restoration_type
=
RESTORE_NONE
;
rsi
->
frame_restoration_type
=
aom_rb_read_bit
(
rb
)
?
RESTORE_SWITCHABLE
:
RESTORE_NONE
;
}
}
cm
->
rst_info
[
0
].
restoration_tilesize
=
RESTORATION_TILESIZE_MAX
;
cm
->
rst_info
[
1
].
restoration_tilesize
=
RESTORATION_TILESIZE_MAX
;
cm
->
rst_info
[
2
].
restoration_tilesize
=
RESTORATION_TILESIZE_MAX
;
if
(
cm
->
rst_info
[
0
].
frame_restoration_type
!=
RESTORE_NONE
||
cm
->
rst_info
[
1
].
frame_restoration_type
!=
RESTORE_NONE
||
cm
->
rst_info
[
2
].
frame_restoration_type
!=
RESTORE_NONE
)
{
cm
->
rst_info
[
0
].
restoration_tilesize
=
RESTORATION_TILESIZE_MAX
>>
2
;
cm
->
rst_info
[
1
].
restoration_tilesize
=
RESTORATION_TILESIZE_MAX
>>
2
;
cm
->
rst_info
[
2
].
restoration_tilesize
=
RESTORATION_TILESIZE_MAX
>>
2
;
rsi
=
&
cm
->
rst_info
[
0
];
rsi
->
restoration_tilesize
>>
=
aom_rb_read_bit
(
rb
);
if
(
rsi
->
restoration_tilesize
!=
RESTORATION_TILESIZE_MAX
)
{
rsi
->
restoration_tilesize
>>
=
aom_rb_read_bit
(
rb
);
rsi
->
restoration_tilesize
<<
=
aom_rb_read_bit
(
rb
);
if
(
rsi
->
restoration_tilesize
!=
(
RESTORATION_TILESIZE_MAX
>>
2
)
)
{
rsi
->
restoration_tilesize
<<
=
aom_rb_read_bit
(
rb
);
}
}
int
s
=
AOMMIN
(
cm
->
subsampling_x
,
cm
->
subsampling_y
);
...
...
@@ -1801,7 +1797,6 @@ static void loop_restoration_read_sb_coeffs(const AV1_COMMON *const cm,
SgrprojInfo
*
sgrproj_info
=
xd
->
sgrproj_info
+
plane
;
if
(
rsi
->
frame_restoration_type
==
RESTORE_SWITCHABLE
)
{
assert
(
plane
==
0
);
rsi
->
restoration_type
[
rtile_idx
]
=
aom_read_symbol
(
r
,
xd
->
tile_ctx
->
switchable_restore_cdf
,
RESTORE_SWITCHABLE_TYPES
,
ACCT_STR
);
...
...
av1/encoder/bitstream.c
View file @
a3d4fe50
...
...
@@ -3084,30 +3084,14 @@ static void write_modes(AV1_COMP *const cpi, const TileInfo *const tile,
static
void
encode_restoration_mode
(
AV1_COMMON
*
cm
,
struct
aom_write_bit_buffer
*
wb
)
{
int
p
;
RestorationInfo
*
rsi
=
&
cm
->
rst_info
[
0
];
switch
(
rsi
->
frame_restoration_type
)
{
case
RESTORE_NONE
:
aom_wb_write_bit
(
wb
,
0
);
aom_wb_write_bit
(
wb
,
0
);
break
;
case
RESTORE_WIENER
:
aom_wb_write_bit
(
wb
,
1
);
aom_wb_write_bit
(
wb
,
0
);
break
;
case
RESTORE_SGRPROJ
:
aom_wb_write_bit
(
wb
,
1
);
aom_wb_write_bit
(
wb
,
1
);
break
;
case
RESTORE_SWITCHABLE
:
aom_wb_write_bit
(
wb
,
0
);
aom_wb_write_bit
(
wb
,
1
);
break
;
default:
assert
(
0
);
}
for
(
p
=
1
;
p
<
MAX_MB_PLANE
;
++
p
)
{
RestorationInfo
*
rsi
;
for
(
p
=
0
;
p
<
MAX_MB_PLANE
;
++
p
)
{
rsi
=
&
cm
->
rst_info
[
p
];
switch
(
rsi
->
frame_restoration_type
)
{
case
RESTORE_NONE
:
aom_wb_write_bit
(
wb
,
0
);
break
;
case
RESTORE_NONE
:
aom_wb_write_bit
(
wb
,
0
);
aom_wb_write_bit
(
wb
,
0
);
break
;
case
RESTORE_WIENER
:
aom_wb_write_bit
(
wb
,
1
);
aom_wb_write_bit
(
wb
,
0
);
...
...
@@ -3116,15 +3100,19 @@ static void encode_restoration_mode(AV1_COMMON *cm,
aom_wb_write_bit
(
wb
,
1
);
aom_wb_write_bit
(
wb
,
1
);
break
;
case
RESTORE_SWITCHABLE
:
aom_wb_write_bit
(
wb
,
0
);
aom_wb_write_bit
(
wb
,
1
);
break
;
default:
assert
(
0
);
}
}
if
(
cm
->
rst_info
[
0
].
frame_restoration_type
!=
RESTORE_NONE
||
cm
->
rst_info
[
1
].
frame_restoration_type
!=
RESTORE_NONE
||
cm
->
rst_info
[
2
].
frame_restoration_type
!=
RESTORE_NONE
)
{
rsi
=
&
cm
->
rst_info
[
0
];
aom_wb_write_bit
(
wb
,
rsi
->
restoration_tilesize
!=
RESTORATION_TILESIZE_MAX
);
if
(
rsi
->
restoration_tilesize
!=
RESTORATION_TILESIZE_MAX
)
{
aom_wb_write_bit
(
wb
,
rsi
->
restoration_tilesize
!=
(
RESTORATION_TILESIZE_MAX
>>
2
)
);
if
(
rsi
->
restoration_tilesize
!=
(
RESTORATION_TILESIZE_MAX
>>
2
)
)
{
aom_wb_write_bit
(
wb
,
rsi
->
restoration_tilesize
!=
(
RESTORATION_TILESIZE_MAX
>>
1
));
}
...
...
@@ -3219,7 +3207,6 @@ static void loop_restoration_write_sb_coeffs(const AV1_COMMON *const cm,
SgrprojInfo
*
sgrproj_info
=
xd
->
sgrproj_info
+
plane
;
if
(
rsi
->
frame_restoration_type
==
RESTORE_SWITCHABLE
)
{
assert
(
plane
==
0
);
aom_write_symbol
(
w
,
rsi
->
restoration_type
[
rtile_idx
],
xd
->
tile_ctx
->
switchable_restore_cdf
,
RESTORE_SWITCHABLE_TYPES
);
...
...
av1/encoder/pickrst.c
View file @
a3d4fe50
...
...
@@ -1435,6 +1435,7 @@ void av1_pick_filter_restoration(const YV12_BUFFER_CONFIG *src, AV1_COMP *cpi) {
}
for
(
int
plane
=
AOM_PLANE_Y
;
plane
<=
AOM_PLANE_V
;
++
plane
)
{
const
int
ntiles
=
(
plane
==
AOM_PLANE_Y
?
ntiles_y
:
ntiles_uv
);
for
(
r
=
0
;
r
<
RESTORE_SWITCHABLE_TYPES
;
++
r
)
{
cost_restore
[
r
]
=
DBL_MAX
;
if
(
force_restore_type
!=
RESTORE_TYPES
)
...
...
@@ -1443,7 +1444,7 @@ void av1_pick_filter_restoration(const YV12_BUFFER_CONFIG *src, AV1_COMP *cpi) {
src
,
cpi
,
plane
,
&
cm
->
rst_info
[
plane
],
restore_types
[
r
],
tile_cost
[
r
],
&
cpi
->
trial_frame_rst
);
}
if
(
plane
==
AOM_PLANE_Y
)
if
(
ntiles
>
1
)
cost_restore
[
RESTORE_SWITCHABLE
]
=
search_switchable_restoration
(
src
,
cpi
,
plane
,
restore_types
,
tile_cost
,
&
cm
->
rst_info
[
plane
]);
else
...
...
@@ -1463,9 +1464,8 @@ void av1_pick_filter_restoration(const YV12_BUFFER_CONFIG *src, AV1_COMP *cpi) {
assert
(
best_restore
==
force_restore_type
||
best_restore
==
RESTORE_NONE
);
if
(
best_restore
!=
RESTORE_SWITCHABLE
)
{
const
int
nt
=
(
plane
==
AOM_PLANE_Y
?
ntiles_y
:
ntiles_uv
);
memcpy
(
cm
->
rst_info
[
plane
].
restoration_type
,
restore_types
[
best_restore
],
nt
*
sizeof
(
restore_types
[
best_restore
][
0
]));
nt
iles
*
sizeof
(
restore_types
[
best_restore
][
0
]));
}
}
/*
...
...
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