Fix OneByOneVideoTest for loop-restoration
Fixes and turns on the test.
BUG=aomedia:312
Change-Id: I6c7d1970e743ec2b025a798070761d22624e796a
diff --git a/av1/common/alloccommon.c b/av1/common/alloccommon.c
index 4860ae4..bd20fcf 100644
--- a/av1/common/alloccommon.c
+++ b/av1/common/alloccommon.c
@@ -92,9 +92,9 @@
int p;
av1_alloc_restoration_struct(&cm->rst_info[0], cm->width, cm->height);
for (p = 1; p < MAX_MB_PLANE; ++p)
- av1_alloc_restoration_struct(&cm->rst_info[p],
- cm->width >> cm->subsampling_x,
- cm->height >> cm->subsampling_y);
+ av1_alloc_restoration_struct(
+ &cm->rst_info[p], ROUND_POWER_OF_TWO(cm->width, cm->subsampling_x),
+ ROUND_POWER_OF_TWO(cm->height, cm->subsampling_y));
cm->rst_internal.tmpbuf =
(int32_t *)aom_realloc(cm->rst_internal.tmpbuf, RESTORATION_TMPBUF_SIZE);
if (cm->rst_internal.tmpbuf == NULL)
diff --git a/av1/common/restoration.c b/av1/common/restoration.c
index 2921cb9..8563c09 100644
--- a/av1/common/restoration.c
+++ b/av1/common/restoration.c
@@ -1338,7 +1338,8 @@
if ((components_pattern >> AOM_PLANE_U) & 1) {
if (rsi[AOM_PLANE_U].frame_restoration_type != RESTORE_NONE) {
cm->rst_internal.ntiles = av1_get_rest_ntiles(
- cm->width >> cm->subsampling_x, cm->height >> cm->subsampling_y,
+ ROUND_POWER_OF_TWO(cm->width, cm->subsampling_x),
+ ROUND_POWER_OF_TWO(cm->height, cm->subsampling_y),
&cm->rst_internal.tile_width, &cm->rst_internal.tile_height,
&cm->rst_internal.nhtiles, &cm->rst_internal.nvtiles);
cm->rst_internal.rsi = &rsi[AOM_PLANE_U];
@@ -1365,7 +1366,8 @@
if ((components_pattern >> AOM_PLANE_V) & 1) {
if (rsi[AOM_PLANE_V].frame_restoration_type != RESTORE_NONE) {
cm->rst_internal.ntiles = av1_get_rest_ntiles(
- cm->width >> cm->subsampling_x, cm->height >> cm->subsampling_y,
+ ROUND_POWER_OF_TWO(cm->width, cm->subsampling_x),
+ ROUND_POWER_OF_TWO(cm->height, cm->subsampling_y),
&cm->rst_internal.tile_width, &cm->rst_internal.tile_height,
&cm->rst_internal.nhtiles, &cm->rst_internal.nvtiles);
cm->rst_internal.rsi = &rsi[AOM_PLANE_V];
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 25f931a..3b1d9cc 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -2534,9 +2534,10 @@
int i, p;
const int ntiles =
av1_get_rest_ntiles(cm->width, cm->height, NULL, NULL, NULL, NULL);
- const int ntiles_uv = av1_get_rest_ntiles(cm->width >> cm->subsampling_x,
- cm->height >> cm->subsampling_y,
- NULL, NULL, NULL, NULL);
+ const int ntiles_uv =
+ av1_get_rest_ntiles(ROUND_POWER_OF_TWO(cm->width, cm->subsampling_x),
+ ROUND_POWER_OF_TWO(cm->height, cm->subsampling_y),
+ NULL, NULL, NULL, NULL);
RestorationInfo *rsi = &cm->rst_info[0];
if (rsi->frame_restoration_type != RESTORE_NONE) {
if (rsi->frame_restoration_type == RESTORE_SWITCHABLE) {
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index e1641e3..0aeafc8 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -3255,9 +3255,10 @@
int i, p;
const int ntiles =
av1_get_rest_ntiles(cm->width, cm->height, NULL, NULL, NULL, NULL);
- const int ntiles_uv = av1_get_rest_ntiles(cm->width >> cm->subsampling_x,
- cm->height >> cm->subsampling_y,
- NULL, NULL, NULL, NULL);
+ const int ntiles_uv =
+ av1_get_rest_ntiles(ROUND_POWER_OF_TWO(cm->width, cm->subsampling_x),
+ ROUND_POWER_OF_TWO(cm->height, cm->subsampling_y),
+ NULL, NULL, NULL, NULL);
RestorationInfo *rsi = &cm->rst_info[0];
if (rsi->frame_restoration_type != RESTORE_NONE) {
if (rsi->frame_restoration_type == RESTORE_SWITCHABLE) {
diff --git a/test/frame_size_tests.cc b/test/frame_size_tests.cc
index 3d0ce9c..843c68b 100644
--- a/test/frame_size_tests.cc
+++ b/test/frame_size_tests.cc
@@ -84,13 +84,7 @@
#endif
}
-#if CONFIG_LOOP_RESTORATION
-// https://bugs.chromium.org/p/aomedia/issues/detail?id=312
-#define ONE_BY_ONE_VIDEO_NAME DISABLED_OneByOneVideo
-#else
-#define ONE_BY_ONE_VIDEO_NAME OneByOneVideo
-#endif
-TEST_F(AV1FrameSizeTests, ONE_BY_ONE_VIDEO_NAME) {
+TEST_F(AV1FrameSizeTests, OneByOneVideo) {
::libaom_test::RandomVideoSource video;
video.SetSize(1, 1);