Test tile row independence.

Tile rows should now be independent, so make pbi->inv_tile_order
invert the decoding order of tile rows as well as tile columns.
This should improve test coverage. Also added more tile configurations
to the tile_independence_tests.

Change-Id: I14b0f2fa9241c1acaf9e2a07071952cb33feca77
This commit is contained in:
Geza Lore 2016-05-03 13:55:25 +01:00
parent 67a2ff7f90
commit 1982d67774
2 changed files with 20 additions and 10 deletions

View File

@ -21,13 +21,15 @@
namespace { namespace {
class TileIndependenceTest : public ::libvpx_test::EncoderTest, class TileIndependenceTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<int> { public ::libvpx_test::CodecTestWith2Params<int,
int> {
protected: protected:
TileIndependenceTest() TileIndependenceTest()
: EncoderTest(GET_PARAM(0)), : EncoderTest(GET_PARAM(0)),
md5_fw_order_(), md5_fw_order_(),
md5_inv_order_(), md5_inv_order_(),
n_tiles_(GET_PARAM(1)) { n_tile_cols_(GET_PARAM(1)),
n_tile_rows_(GET_PARAM(2)) {
init_flags_ = VPX_CODEC_USE_PSNR; init_flags_ = VPX_CODEC_USE_PSNR;
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t(); vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
cfg.w = 704; cfg.w = 704;
@ -55,7 +57,8 @@ class TileIndependenceTest : public ::libvpx_test::EncoderTest,
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video, virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) { libvpx_test::Encoder *encoder) {
if (video->frame() == 1) { if (video->frame() == 1) {
encoder->Control(VP9E_SET_TILE_COLUMNS, n_tiles_); encoder->Control(VP9E_SET_TILE_COLUMNS, n_tile_cols_);
encoder->Control(VP9E_SET_TILE_ROWS, n_tile_rows_);
} }
} }
@ -80,7 +83,8 @@ class TileIndependenceTest : public ::libvpx_test::EncoderTest,
::libvpx_test::Decoder *fw_dec_, *inv_dec_; ::libvpx_test::Decoder *fw_dec_, *inv_dec_;
private: private:
int n_tiles_; int n_tile_cols_;
int n_tile_rows_;
}; };
// run an encode with 2 or 4 tiles, and do the decode both in normal and // run an encode with 2 or 4 tiles, and do the decode both in normal and
@ -93,7 +97,7 @@ TEST_P(TileIndependenceTest, MD5Match) {
cfg_.g_lag_in_frames = 12; cfg_.g_lag_in_frames = 12;
cfg_.rc_end_usage = VPX_VBR; cfg_.rc_end_usage = VPX_VBR;
libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 704, 144, libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 704, 576,
timebase.den, timebase.num, 0, 15); timebase.den, timebase.num, 0, 15);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
@ -106,11 +110,14 @@ TEST_P(TileIndependenceTest, MD5Match) {
ASSERT_STREQ(md5_fw_str, md5_inv_str); ASSERT_STREQ(md5_fw_str, md5_inv_str);
} }
VP9_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 2, 1)); VP9_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 2, 1),
::testing::Values(0));
#if CONFIG_EXT_TILE #if CONFIG_EXT_TILE
VP10_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Values(1, 2, 32)); VP10_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Values(1, 2, 32),
::testing::Values(1, 2, 32));
#else #else
VP10_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 1, 1)); VP10_INSTANTIATE_TEST_CASE(TileIndependenceTest, ::testing::Range(0, 1, 1),
::testing::Range(0, 1, 1));
#endif // CONFIG_EXT_TILE #endif // CONFIG_EXT_TILE
} // namespace } // namespace

View File

@ -3098,12 +3098,14 @@ static const uint8_t *decode_tiles(VP10Decoder *pbi,
const int tile_cols_start = single_col ? dec_tile_col : 0; const int tile_cols_start = single_col ? dec_tile_col : 0;
const int tile_cols_end = single_col ? tile_cols_start + 1 : tile_cols; const int tile_cols_end = single_col ? tile_cols_start + 1 : tile_cols;
const int inv_col_order = pbi->inv_tile_order && !single_col; const int inv_col_order = pbi->inv_tile_order && !single_col;
const int inv_row_order = pbi->inv_tile_order && !single_row;
#else #else
const int tile_rows_start = 0; const int tile_rows_start = 0;
const int tile_rows_end = tile_rows; const int tile_rows_end = tile_rows;
const int tile_cols_start = 0; const int tile_cols_start = 0;
const int tile_cols_end = tile_cols; const int tile_cols_end = tile_cols;
const int inv_col_order = pbi->inv_tile_order; const int inv_col_order = pbi->inv_tile_order;
const int inv_row_order = pbi->inv_tile_order;
#endif // CONFIG_EXT_TILE #endif // CONFIG_EXT_TILE
int tile_row, tile_col; int tile_row, tile_col;
@ -3175,14 +3177,15 @@ static const uint8_t *decode_tiles(VP10Decoder *pbi,
} }
for (tile_row = tile_rows_start; tile_row < tile_rows_end; ++tile_row) { for (tile_row = tile_rows_start; tile_row < tile_rows_end; ++tile_row) {
const int row = inv_row_order ? tile_rows - 1 - tile_row : tile_row;
int mi_row = 0; int mi_row = 0;
TileInfo tile_info; TileInfo tile_info;
vp10_tile_set_row(&tile_info, cm, tile_row); vp10_tile_set_row(&tile_info, cm, row);
for (tile_col = tile_cols_start; tile_col < tile_cols_end; ++tile_col) { for (tile_col = tile_cols_start; tile_col < tile_cols_end; ++tile_col) {
const int col = inv_col_order ? tile_cols - 1 - tile_col : tile_col; const int col = inv_col_order ? tile_cols - 1 - tile_col : tile_col;
TileData *const td = pbi->tile_data + tile_cols * tile_row + col; TileData *const td = pbi->tile_data + tile_cols * row + col;
vp10_tile_set_col(&tile_info, cm, col); vp10_tile_set_col(&tile_info, cm, col);