[WIP] Add column-based tiling.
This patch adds column-based tiling. The idea is to make each tile independently decodable (after reading the common frame header) and also independendly encodable (minus within-frame cost adjustments in the RD loop) to speed-up hardware & software en/decoders if they used multi-threading. Column-based tiling has the added advantage (over other tiling methods) that it minimizes realtime use-case latency, since all threads can start encoding data as soon as the first SB-row worth of data is available to the encoder. There is some test code that does random tile ordering in the decoder, to confirm that each tile is indeed independently decodable from other tiles in the same frame. At tile edges, all contexts assume default values (i.e. 0, 0 motion vector, no coefficients, DC intra4x4 mode), and motion vector search and ordering do not cross tiles in the same frame. t log Tile independence is not maintained between frames ATM, i.e. tile 0 of frame 1 is free to use motion vectors that point into any tile of frame 0. We support 1 (i.e. no tiling), 2 or 4 column-tiles. The loopfilter crosses tile boundaries. I discussed this briefly with Aki and he says that's OK. An in-loop loopfilter would need to do some sync between tile threads, but that shouldn't be a big issue. Resuls: with tiling disabled, we go up slightly because of improved edge use in the intra4x4 prediction. With 2 tiles, we lose about ~1% on derf, ~0.35% on HD and ~0.55% on STD/HD. With 4 tiles, we lose another ~1.5% on derf ~0.77% on HD and ~0.85% on STD/HD. Most of this loss is concentrated in the low-bitrate end of clips, and most of it is because of the loss of edges at tile boundaries and the resulting loss of intra predictors. TODO: - more tiles (perhaps allow row-based tiling also, and max. 8 tiles)? - maybe optionally (for EC purposes), motion vectors themselves should not cross tile edges, or we should emulate such borders as if they were off-frame, to limit error propagation to within one tile only. This doesn't have to be the default behaviour but could be an optional bitstream flag. Change-Id: I5951c3a0742a767b20bc9fb5af685d9892c2c96f
This commit is contained in:
@@ -16,15 +16,11 @@
|
||||
#include "test/decode_test_driver.h"
|
||||
#include "test/ivf_video_source.h"
|
||||
#include "test/util.h"
|
||||
#include "test/md5_helper.h"
|
||||
extern "C" {
|
||||
#include "./md5_utils.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define snprintf sprintf_s
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
// There are 61 test vectors in total.
|
||||
const char *kTestVectors[] = {
|
||||
@@ -87,30 +83,9 @@ class TestVectorTest : public ::libvpx_test::DecoderTest,
|
||||
ASSERT_NE(res, EOF) << "Read md5 data failed";
|
||||
expected_md5[32] = '\0';
|
||||
|
||||
MD5Context md5;
|
||||
MD5Init(&md5);
|
||||
|
||||
// Compute and update md5 for each raw in decompressed data.
|
||||
for (int plane = 0; plane < 3; ++plane) {
|
||||
uint8_t *buf = img.planes[plane];
|
||||
|
||||
for (unsigned int y = 0; y < (plane ? (img.d_h + 1) >> 1 : img.d_h);
|
||||
++y) {
|
||||
MD5Update(&md5, buf, (plane ? (img.d_w + 1) >> 1 : img.d_w));
|
||||
buf += img.stride[plane];
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t md5_sum[16];
|
||||
MD5Final(md5_sum, &md5);
|
||||
|
||||
char actual_md5[33];
|
||||
// Convert to get the actual md5.
|
||||
for (int i = 0; i < 16; i++) {
|
||||
snprintf(&actual_md5[i * 2], sizeof(actual_md5) - i * 2, "%02x",
|
||||
md5_sum[i]);
|
||||
}
|
||||
actual_md5[32] = '\0';
|
||||
::libvpx_test::MD5 md5_res;
|
||||
md5_res.Add(&img);
|
||||
const char *actual_md5 = md5_res.Get();
|
||||
|
||||
// Check md5 match.
|
||||
ASSERT_STREQ(expected_md5, actual_md5)
|
||||
|
Reference in New Issue
Block a user