Commit 1a0ae84d authored by Debargha Mukherjee's avatar Debargha Mukherjee

Fix OneByOneVideoTest for loop-restoration

Fixes and turns on the test.

BUG=aomedia:312

Change-Id: I6c7d1970e743ec2b025a798070761d22624e796a
parent 04305c68
......@@ -92,9 +92,9 @@ void av1_alloc_restoration_buffers(AV1_COMMON *cm) {
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)
......
......@@ -1338,7 +1338,8 @@ static void loop_restoration_rows(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
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 @@ static void loop_restoration_rows(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
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];
......
......@@ -2534,9 +2534,10 @@ static void decode_restoration(AV1_COMMON *cm, aom_reader *rb) {
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) {
......
......@@ -3255,9 +3255,10 @@ static void encode_restoration(AV1_COMMON *cm, aom_writer *wb) {
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) {
......
......@@ -84,13 +84,7 @@ TEST_F(AV1FrameSizeTests, LargeValidSizes) {
#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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment