Commit 6c056de8 authored by Debargha Mukherjee's avatar Debargha Mukherjee Committed by Gerrit Code Review
Browse files

Merge "Test tile row independence." into nextgenv2

parents e88ce744 1982d677
......@@ -21,13 +21,15 @@
namespace {
class TileIndependenceTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<int> {
public ::libvpx_test::CodecTestWith2Params<int,
int> {
protected:
TileIndependenceTest()
: EncoderTest(GET_PARAM(0)),
md5_fw_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;
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
cfg.w = 704;
......@@ -55,7 +57,8 @@ class TileIndependenceTest : public ::libvpx_test::EncoderTest,
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) {
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_;
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
......@@ -93,7 +97,7 @@ TEST_P(TileIndependenceTest, MD5Match) {
cfg_.g_lag_in_frames = 12;
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);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
......@@ -106,11 +110,14 @@ TEST_P(TileIndependenceTest, MD5Match) {
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
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
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
} // namespace
......@@ -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_end = single_col ? tile_cols_start + 1 : tile_cols;
const int inv_col_order = pbi->inv_tile_order && !single_col;
const int inv_row_order = pbi->inv_tile_order && !single_row;
#else
const int tile_rows_start = 0;
const int tile_rows_end = tile_rows;
const int tile_cols_start = 0;
const int tile_cols_end = tile_cols;
const int inv_col_order = pbi->inv_tile_order;
const int inv_row_order = pbi->inv_tile_order;
#endif // CONFIG_EXT_TILE
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) {
const int row = inv_row_order ? tile_rows - 1 - tile_row : tile_row;
int mi_row = 0;
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) {
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);
......
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