summaryrefslogtreecommitdiff
path: root/vpxenc.c
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2013-01-15 06:43:35 -0800
committerDeb Mukherjee <debargha@google.com>2013-01-23 21:56:15 -0800
commit01cafaab1d99018c48c54178987101b490343a01 (patch)
tree5cd366fc39f64e95886b0dde8add8a7a08e6151b /vpxenc.c
parent8410582b1dd3c247f26ba1264cf7e1f204cd8d71 (diff)
downloadlibvpx-01cafaab1d99018c48c54178987101b490343a01.tar
libvpx-01cafaab1d99018c48c54178987101b490343a01.tar.gz
libvpx-01cafaab1d99018c48c54178987101b490343a01.tar.bz2
libvpx-01cafaab1d99018c48c54178987101b490343a01.zip
Adds an error-resilient mode with test
Adds an error-resilient mode where frames can be continued to be decoded even when there are errors (due to network losses) on a prior frame. Specifically, backward updates are turned off and probabilities of various symbols are reset to defaults at the beginning of each frame. Further, the last frame's mvs are not used for the mv reference list, and the sorting of the initial list based on search on previous frames is turned off as well. Also adds a test where an arbitrary set of frames are skipped from decoding to simulate errors. The test verifies (1) that if the error frames are droppable - i.e. frame buffer updates have been turned off - there are no mismatch errors for the remaining frames after the error frames; and (2) if the error-frames are non droppable, there are not only no decoding errors but the mismatch PSNR between the decoder's version of the post-error frames and the encoder's version is at least 20 dB. Change-Id: Ie6e2bcd436b1e8643270356d3a930e8989ff52a5
Diffstat (limited to 'vpxenc.c')
-rw-r--r--vpxenc.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/vpxenc.c b/vpxenc.c
index 3fc8da1fe..7b784f324 100644
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -1449,14 +1449,16 @@ static void show_rate_histogram(struct rate_hist *hist,
#define mmin(a, b) ((a) < (b) ? (a) : (b))
static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
int yloc[2], int uloc[2], int vloc[2]) {
+ static const int bsize = 64;
+ static const int bsize2 = bsize >> 1;
int match = 1;
int i, j;
yloc[0] = yloc[1] = -1;
- for (i = 0, match = 1; match && i < img1->d_h; i+=32) {
- for (j = 0; match && j < img1->d_w; j+=32) {
+ for (i = 0, match = 1; match && i < img1->d_h; i += bsize) {
+ for (j = 0; match && j < img1->d_w; j += bsize) {
int k, l;
- int si = mmin(i + 32, img1->d_h) - i;
- int sj = mmin(j + 32, img1->d_w) - j;
+ int si = mmin(i + bsize, img1->d_h) - i;
+ int sj = mmin(j + bsize, img1->d_w) - j;
for (k = 0; match && k < si; k++)
for (l = 0; match && l < sj; l++) {
if (*(img1->planes[VPX_PLANE_Y] +
@@ -1472,11 +1474,11 @@ static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
}
}
uloc[0] = uloc[1] = -1;
- for (i = 0, match = 1; match && i < (img1->d_h + 1) / 2; i+=16) {
- for (j = 0; j < match && (img1->d_w + 1) / 2; j+=16) {
+ for (i = 0, match = 1; match && i < (img1->d_h + 1) / 2; i += bsize2) {
+ for (j = 0; j < match && (img1->d_w + 1) / 2; j += bsize2) {
int k, l;
- int si = mmin(i + 16, (img1->d_h + 1) / 2) - i;
- int sj = mmin(j + 16, (img1->d_w + 1) / 2) - j;
+ int si = mmin(i + bsize2, (img1->d_h + 1) / 2) - i;
+ int sj = mmin(j + bsize2, (img1->d_w + 1) / 2) - j;
for (k = 0; match && k < si; k++)
for (l = 0; match && l < sj; l++) {
if (*(img1->planes[VPX_PLANE_U] +
@@ -1492,11 +1494,11 @@ static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
}
}
vloc[0] = vloc[1] = -1;
- for (i = 0, match = 1; match && i < (img1->d_h + 1) / 2; i+=16) {
- for (j = 0; j < match && (img1->d_w + 1) / 2; j+=16) {
+ for (i = 0, match = 1; match && i < (img1->d_h + 1) / 2; i += bsize2) {
+ for (j = 0; j < match && (img1->d_w + 1) / 2; j += bsize2) {
int k, l;
- int si = mmin(i + 16, (img1->d_h + 1) / 2) - i;
- int sj = mmin(j + 16, (img1->d_w + 1) / 2) - j;
+ int si = mmin(i + bsize2, (img1->d_h + 1) / 2) - i;
+ int sj = mmin(j + bsize2, (img1->d_w + 1) / 2) - j;
for (k = 0; match && k < si; k++)
for (l = 0; match && l < sj; l++) {
if (*(img1->planes[VPX_PLANE_V] +