Merge "skip the un-necessary motion search in the first pass"
diff --git a/build/make/iosbuild.sh b/build/make/iosbuild.sh
index bc3cc94..230c0ce 100755
--- a/build/make/iosbuild.sh
+++ b/build/make/iosbuild.sh
@@ -31,6 +31,8 @@
x86-iphonesimulator-gcc
x86_64-iphonesimulator-gcc"
+# Configures for the target specified by $1, and invokes make with the dist
+# target using $DIST_DIR as the distribution output directory.
build_target() {
local target="$1"
local old_pwd="$(pwd)"
@@ -48,6 +50,8 @@
vlog "***Done building target: ${target}***"
}
+# Configures and builds each target specified by $1, and then builds
+# VPX.framework.
build_targets() {
local lib_list=""
local targets="$1"
@@ -89,6 +93,8 @@
# VPX.framework/VPX via lipo -info.
}
+# Trap function. Cleans up the subtree used to build all targets contained in
+# $TARGETS.
cleanup() {
cd "${ORIG_PWD}"
diff --git a/test/decode_to_md5.sh b/test/decode_to_md5.sh
index f64acc8..28e29c6 100755
--- a/test/decode_to_md5.sh
+++ b/test/decode_to_md5.sh
@@ -34,7 +34,10 @@
local expected_md5="$3"
local output_file="${VPX_TEST_OUTPUT_DIR}/decode_to_md5_${codec}"
- [ -x "${decoder}" ] || return 1
+ if [ ! -x "${decoder}" ]; then
+ elog "${decoder} does not exist or is not executable."
+ return 1
+ fi
eval "${decoder}" "${input_file}" "${output_file}" ${devnull}
diff --git a/test/decode_with_drops.sh b/test/decode_with_drops.sh
index 82e934d..12e17de 100755
--- a/test/decode_with_drops.sh
+++ b/test/decode_with_drops.sh
@@ -34,7 +34,10 @@
local output_file="${VPX_TEST_OUTPUT_DIR}/decode_with_drops_${codec}"
local drop_mode="$3"
- [ -x "${decoder}" ] || return 1
+ if [ ! -x "${decoder}" ]; then
+ elog "${decoder} does not exist or is not executable."
+ return 1
+ fi
eval "${decoder}" "${input_file}" "${output_file}" "${drop_mode}" ${devnull}
diff --git a/test/postproc.sh b/test/postproc.sh
index 050a368..c9c4e58 100755
--- a/test/postproc.sh
+++ b/test/postproc.sh
@@ -32,7 +32,10 @@
local codec="$2"
local output_file="${VPX_TEST_OUTPUT_DIR}/postproc_${codec}.raw"
- [ -x "${decoder}" ] || return 1
+ if [ ! -x "${decoder}" ]; then
+ elog "${decoder} does not exist or is not executable."
+ return 1
+ fi
eval "${decoder}" "${input_file}" "${output_file}" ${devnull}
diff --git a/test/resize_util.sh b/test/resize_util.sh
index 2a8e3fb..ab3dfd1 100755
--- a/test/resize_util.sh
+++ b/test/resize_util.sh
@@ -33,7 +33,10 @@
# resize_util is available only when CONFIG_SHARED is disabled.
if [ -z "$(vpx_config_option_enabled CONFIG_SHARED)" ]; then
- [ -x "${resizer}" ] || return 1
+ if [ ! -x "${resizer}" ]; then
+ elog "${resizer} does not exist or is not executable."
+ return 1
+ fi
eval "${resizer}" "${YUV_RAW_INPUT}" \
"${YUV_RAW_INPUT_WIDTH}x${YUV_RAW_INPUT_HEIGHT}" \
diff --git a/test/simple_decoder.sh b/test/simple_decoder.sh
index 24b17c5..0be48e6 100755
--- a/test/simple_decoder.sh
+++ b/test/simple_decoder.sh
@@ -32,7 +32,10 @@
local codec="$2"
local output_file="${VPX_TEST_OUTPUT_DIR}/simple_decoder_${codec}.raw"
- [ -x "${decoder}" ] || return 1
+ if [ ! -x "${decoder}" ]; then
+ elog "${decoder} does not exist or is not executable."
+ return 1
+ fi
eval "${decoder}" "${input_file}" "${output_file}" ${devnull}
diff --git a/test/simple_encoder.sh b/test/simple_encoder.sh
index 6232093..a0b0e13 100755
--- a/test/simple_encoder.sh
+++ b/test/simple_encoder.sh
@@ -29,7 +29,10 @@
local codec="$1"
local output_file="${VPX_TEST_OUTPUT_DIR}/simple_encoder_${codec}.ivf"
- [ -x "${encoder}" ] || return 1
+ if [ ! -x "${encoder}" ]; then
+ elog "${encoder} does not exist or is not executable."
+ return 1
+ fi
eval "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" \
"${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" 9999 \
diff --git a/test/test-data.sha1 b/test/test-data.sha1
index 56946b5..0def69d 100644
--- a/test/test-data.sha1
+++ b/test/test-data.sha1
@@ -638,4 +638,5 @@
e3ab35d4316c5e81325c50f5236ceca4bc0d35df vp90-2-15-segkey.webm.md5
9b7ca2cac09d34c4a5d296c1900f93b1e2f69d0d vp90-2-15-segkey_adpq.webm
8f46ba5f785d0c2170591a153e0d0d146a7c8090 vp90-2-15-segkey_adpq.webm.md5
-
+d78e2fceba5ac942246503ec8366f879c4775ca5 vp90-2-15-fuzz-flicker.webm
+bbd7dd15f43a703ff0a332fee4959e7b23bf77dc vp90-2-15-fuzz-flicker.webm.md5
diff --git a/test/test.mk b/test/test.mk
index 56e467a..c59ae11 100644
--- a/test/test.mk
+++ b/test/test.mk
@@ -754,6 +754,8 @@
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey_adpq.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-segkey_adpq.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-fuzz-flicker.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-15-fuzz-flicker.webm.md5
ifeq ($(CONFIG_DECODE_PERF_TESTS),yes)
# BBB VP9 streams
diff --git a/test/test_vectors.cc b/test/test_vectors.cc
index fd8c4c3..3873712 100644
--- a/test/test_vectors.cc
+++ b/test/test_vectors.cc
@@ -178,7 +178,8 @@
"vp90-2-14-resize-fp-tiles-4-2.webm", "vp90-2-14-resize-fp-tiles-4-8.webm",
"vp90-2-14-resize-fp-tiles-8-16.webm", "vp90-2-14-resize-fp-tiles-8-1.webm",
"vp90-2-14-resize-fp-tiles-8-2.webm", "vp90-2-14-resize-fp-tiles-8-4.webm",
- "vp90-2-15-segkey.webm", "vp90-2-15-segkey_adpq.webm"
+ "vp90-2-15-segkey.webm", "vp90-2-15-segkey_adpq.webm",
+ "vp90-2-15-fuzz-flicker.webm"
};
const int kNumVP9TestVectors = NELEMENTS(kVP9TestVectors);
#endif // CONFIG_VP9_DECODER
diff --git a/test/tools_common.sh b/test/tools_common.sh
index 1ed1893..7f32905 100755
--- a/test/tools_common.sh
+++ b/test/tools_common.sh
@@ -17,6 +17,10 @@
set -e
devnull='> /dev/null 2>&1'
+elog() {
+ echo "$@" 1>&2
+}
+
vlog() {
if [ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ]; then
echo "$@"
diff --git a/test/twopass_encoder.sh b/test/twopass_encoder.sh
index fe3cbbb..95d49d6 100755
--- a/test/twopass_encoder.sh
+++ b/test/twopass_encoder.sh
@@ -29,7 +29,10 @@
local codec="$1"
local output_file="${VPX_TEST_OUTPUT_DIR}/twopass_encoder_${codec}.ivf"
- [ -x "${encoder}" ] || return 1
+ if [ ! -x "${encoder}" ]; then
+ elog "${encoder} does not exist or is not executable."
+ return 1
+ fi
eval "${encoder}" "${codec}" "${YUV_RAW_INPUT_WIDTH}" \
"${YUV_RAW_INPUT_HEIGHT}" "${YUV_RAW_INPUT}" "${output_file}" \
diff --git a/test/vp8cx_set_ref.sh b/test/vp8cx_set_ref.sh
index ef9d0c0..ee10056 100755
--- a/test/vp8cx_set_ref.sh
+++ b/test/vp8cx_set_ref.sh
@@ -34,7 +34,10 @@
local output_file="${VPX_TEST_OUTPUT_DIR}/vp8cx_set_ref_${codec}.ivf"
local ref_frame_num=90
- [ -x "${encoder}" ] || return 1
+ if [ ! -x "${encoder}" ]; then
+ elog "${encoder} does not exist or is not executable."
+ return 1
+ fi
eval "${encoder}" "${YUV_RAW_INPUT_WIDTH}" "${YUV_RAW_INPUT_HEIGHT}" \
"${YUV_RAW_INPUT}" "${output_file}" "${ref_frame_num}" \
diff --git a/test/vp9_spatial_svc_encoder.sh b/test/vp9_spatial_svc_encoder.sh
index 635cfa2..8c9d130 100755
--- a/test/vp9_spatial_svc_encoder.sh
+++ b/test/vp9_spatial_svc_encoder.sh
@@ -34,7 +34,10 @@
shift
- [ -x "${encoder}" ] || return 1
+ if [ ! -x "${encoder}" ]; then
+ elog "${encoder} does not exist or is not executable."
+ return 1
+ fi
eval "${encoder}" -w "${YUV_RAW_INPUT_WIDTH}" -h "${YUV_RAW_INPUT_HEIGHT}" \
-k "${max_kf}" -f "${frames_to_encode}" "$@" "${YUV_RAW_INPUT}" \
diff --git a/test/vpx_temporal_svc_encoder.sh b/test/vpx_temporal_svc_encoder.sh
index ff64740..b2e968f 100755
--- a/test/vpx_temporal_svc_encoder.sh
+++ b/test/vpx_temporal_svc_encoder.sh
@@ -39,7 +39,10 @@
shift 2
- [ -x "${encoder}" ] || return 1
+ if [ ! -x "${encoder}" ]; then
+ elog "${encoder} does not exist or is not executable."
+ return 1
+ fi
eval "${encoder}" "${YUV_RAW_INPUT}" "${output_file}" "${codec}" \
"${YUV_RAW_INPUT_WIDTH}" "${YUV_RAW_INPUT_HEIGHT}" \
diff --git a/vp8/encoder/denoising.c b/vp8/encoder/denoising.c
index 5616bda..0f2e5f1 100644
--- a/vp8/encoder/denoising.c
+++ b/vp8/encoder/denoising.c
@@ -276,7 +276,11 @@
MB_MODE_INFO saved_mbmi;
MACROBLOCKD *filter_xd = &x->e_mbd;
MB_MODE_INFO *mbmi = &filter_xd->mode_info_context->mbmi;
- int sse_diff = zero_mv_sse - best_sse;
+ int sse_diff = 0;
+ // Bias on zero motion vector sse.
+ int zero_bias = 95;
+ zero_mv_sse = (unsigned int)((int64_t)zero_mv_sse * zero_bias / 100);
+ sse_diff = zero_mv_sse - best_sse;
saved_mbmi = *mbmi;
diff --git a/vp9/common/vp9_rtcd_defs.pl b/vp9/common/vp9_rtcd_defs.pl
index 66a3956..68613ec 100644
--- a/vp9/common/vp9_rtcd_defs.pl
+++ b/vp9/common/vp9_rtcd_defs.pl
@@ -402,25 +402,25 @@
# variance
add_proto qw/unsigned int vp9_variance32x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
-specialize qw/vp9_variance32x16/, "$sse2_x86inc", "$avx2_x86inc";
+specialize qw/vp9_variance32x16 avx2/, "$sse2_x86inc";
add_proto qw/unsigned int vp9_variance16x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
specialize qw/vp9_variance16x32/, "$sse2_x86inc";
add_proto qw/unsigned int vp9_variance64x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
-specialize qw/vp9_variance64x32/, "$sse2_x86inc", "$avx2_x86inc";
+specialize qw/vp9_variance64x32 avx2/, "$sse2_x86inc";
add_proto qw/unsigned int vp9_variance32x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
specialize qw/vp9_variance32x64/, "$sse2_x86inc";
add_proto qw/unsigned int vp9_variance32x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
-specialize qw/vp9_variance32x32/, "$sse2_x86inc", "$avx2_x86inc";
+specialize qw/vp9_variance32x32 avx2/, "$sse2_x86inc";
add_proto qw/unsigned int vp9_variance64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
-specialize qw/vp9_variance64x64/, "$sse2_x86inc", "$avx2_x86inc";
+specialize qw/vp9_variance64x64 avx2/, "$sse2_x86inc";
add_proto qw/unsigned int vp9_variance16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
-specialize qw/vp9_variance16x16 mmx/, "$sse2_x86inc", "$avx2_x86inc";
+specialize qw/vp9_variance16x16 mmx avx2/, "$sse2_x86inc";
add_proto qw/unsigned int vp9_variance16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
specialize qw/vp9_variance16x8 mmx/, "$sse2_x86inc";
@@ -693,7 +693,7 @@
specialize qw/vp9_sad4x4x4d sse/;
add_proto qw/unsigned int vp9_mse16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse";
-specialize qw/vp9_mse16x16 mmx/, "$sse2_x86inc", "$avx2_x86inc";
+specialize qw/vp9_mse16x16 mmx avx2/, "$sse2_x86inc";
add_proto qw/unsigned int vp9_mse8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse";
specialize qw/vp9_mse8x16/;
diff --git a/vp9/encoder/vp9_dct.c b/vp9/encoder/vp9_dct.c
index 5c99a0a..59222f0 100644
--- a/vp9/encoder/vp9_dct.c
+++ b/vp9/encoder/vp9_dct.c
@@ -50,7 +50,7 @@
for (c = 0; c < 4; ++c)
sum += input[r * stride + c];
- output[0] = sum << 3;
+ output[0] = sum << 1;
output[1] = 0;
}
@@ -258,7 +258,7 @@
for (c = 0; c < 8; ++c)
sum += input[r * stride + c];
- output[0] = sum * 8;
+ output[0] = sum;
output[1] = 0;
}
@@ -340,7 +340,7 @@
for (c = 0; c < 16; ++c)
sum += input[r * stride + c];
- output[0] = sum * 8;
+ output[0] = sum >> 1;
output[1] = 0;
}
@@ -1369,7 +1369,7 @@
for (c = 0; c < 32; ++c)
sum += input[r * stride + c];
- output[0] = sum << 2;
+ output[0] = sum >> 3;
output[1] = 0;
}
diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c
index 80966ad..3f4fcd1 100644
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -158,15 +158,16 @@
int64_t dist;
struct macroblock_plane *const p = &x->plane[0];
struct macroblockd_plane *const pd = &xd->plane[0];
- const int quant = pd->dequant[1];
+ const uint32_t dc_quant = pd->dequant[0];
+ const uint32_t ac_quant = pd->dequant[1];
unsigned int var = cpi->fn_ptr[bsize].vf(p->src.buf, p->src.stride,
pd->dst.buf, pd->dst.stride, &sse);
*var_y = var;
*sse_y = sse;
- if (sse < pd->dequant[0] * pd->dequant[0] >> 6)
+ if (sse < dc_quant * dc_quant >> 6)
x->skip_txfm = 1;
- else if (var < quant * quant >> 6)
+ else if (var < ac_quant * ac_quant >> 6)
x->skip_txfm = 2;
else
x->skip_txfm = 0;
@@ -177,7 +178,7 @@
if ((sse >> 3) > var)
sse = var;
vp9_model_rd_from_var_lapndz(var + sse, 1 << num_pels_log2_lookup[bsize],
- quant >> 3, &rate, &dist);
+ ac_quant >> 3, &rate, &dist);
*out_rate_sum = rate;
*out_dist_sum = dist << 3;
}
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c
index 0738971..3b5d4bf 100644
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -321,31 +321,33 @@
const uint32_t mag = ((marker >> 3) & 0x3) + 1;
const size_t index_sz = 2 + mag * frames;
- uint8_t marker2 = read_marker(decrypt_cb, decrypt_state,
- data + data_sz - index_sz);
+ if (data_sz >= index_sz) {
+ uint8_t marker2 = read_marker(decrypt_cb, decrypt_state,
+ data + data_sz - index_sz);
- if (data_sz >= index_sz && marker2 == marker) {
- // found a valid superframe index
- uint32_t i, j;
- const uint8_t *x = &data[data_sz - index_sz + 1];
+ if (marker == marker2) {
+ // Found a valid superframe index.
+ uint32_t i, j;
+ const uint8_t *x = &data[data_sz - index_sz + 1];
- // frames has a maximum of 8 and mag has a maximum of 4.
- uint8_t clear_buffer[32];
- assert(sizeof(clear_buffer) >= frames * mag);
- if (decrypt_cb) {
- decrypt_cb(decrypt_state, x, clear_buffer, frames * mag);
- x = clear_buffer;
+ // Frames has a maximum of 8 and mag has a maximum of 4.
+ uint8_t clear_buffer[32];
+ assert(sizeof(clear_buffer) >= frames * mag);
+ if (decrypt_cb) {
+ decrypt_cb(decrypt_state, x, clear_buffer, frames * mag);
+ x = clear_buffer;
+ }
+
+ for (i = 0; i < frames; ++i) {
+ uint32_t this_sz = 0;
+
+ for (j = 0; j < mag; ++j)
+ this_sz |= (*x++) << (j * 8);
+ sizes[i] = this_sz;
+ }
+
+ *count = frames;
}
-
- for (i = 0; i < frames; i++) {
- uint32_t this_sz = 0;
-
- for (j = 0; j < mag; j++)
- this_sz |= (*x++) << (j * 8);
- sizes[i] = this_sz;
- }
-
- *count = frames;
}
}
}
diff --git a/vpx_scale/generic/yv12extend.c b/vpx_scale/generic/yv12extend.c
index 7b43eec..614602a 100644
--- a/vpx_scale/generic/yv12extend.c
+++ b/vpx_scale/generic/yv12extend.c
@@ -84,11 +84,12 @@
static void extend_frame(YV12_BUFFER_CONFIG *const ybf, int ext_size) {
const int c_w = ybf->uv_crop_width;
const int c_h = ybf->uv_crop_height;
- const int c_ext_size = ext_size >> 1;
- const int c_et = c_ext_size;
- const int c_el = c_ext_size;
- const int c_eb = c_ext_size + ybf->uv_height - ybf->uv_crop_height;
- const int c_er = c_ext_size + ybf->uv_width - ybf->uv_crop_width;
+ const int ss_x = ybf->uv_width < ybf->y_width;
+ const int ss_y = ybf->uv_height < ybf->y_height;
+ const int c_et = ext_size >> ss_y;
+ const int c_el = ext_size >> ss_x;
+ const int c_eb = c_et + ybf->uv_height - ybf->uv_crop_height;
+ const int c_er = c_el + ybf->uv_width - ybf->uv_crop_width;
assert(ybf->y_height - ybf->y_crop_height < 16);
assert(ybf->y_width - ybf->y_crop_width < 16);
diff --git a/vpx_scale/mips/dspr2/yv12extend_dspr2.c b/vpx_scale/mips/dspr2/yv12extend_dspr2.c
index 26558b0..0dfc47c 100644
--- a/vpx_scale/mips/dspr2/yv12extend_dspr2.c
+++ b/vpx_scale/mips/dspr2/yv12extend_dspr2.c
@@ -104,16 +104,15 @@
}
}
-static void extend_frame(YV12_BUFFER_CONFIG *const ybf,
- int subsampling_x, int subsampling_y,
- int ext_size) {
+static void extend_frame(YV12_BUFFER_CONFIG *const ybf, int ext_size) {
const int c_w = ybf->uv_crop_width;
const int c_h = ybf->uv_crop_height;
- const int c_ext_size = ext_size >> 1;
- const int c_et = c_ext_size;
- const int c_el = c_ext_size;
- const int c_eb = c_ext_size + ybf->uv_height - ybf->uv_crop_height;
- const int c_er = c_ext_size + ybf->uv_width - ybf->uv_crop_width;
+ const int ss_x = ybf->uv_width < ybf->y_width;
+ const int ss_y = ybf->uv_height < ybf->y_height;
+ const int c_et = ext_size >> ss_y;
+ const int c_el = ext_size >> ss_x;
+ const int c_eb = c_et + ybf->uv_height - ybf->uv_crop_height;
+ const int c_er = c_el + ybf->uv_width - ybf->uv_crop_width;
assert(ybf->y_height - ybf->y_crop_height < 16);
assert(ybf->y_width - ybf->y_crop_width < 16);
@@ -133,16 +132,13 @@
c_w, c_h, c_et, c_el, c_eb, c_er);
}
-void vp9_extend_frame_borders_dspr2(YV12_BUFFER_CONFIG *ybf,
- int subsampling_x, int subsampling_y) {
- extend_frame(ybf, subsampling_x, subsampling_y, ybf->border);
+void vp9_extend_frame_borders_dspr2(YV12_BUFFER_CONFIG *ybf) {
+ extend_frame(ybf, ybf->border);
}
-void vp9_extend_frame_inner_borders_dspr2(YV12_BUFFER_CONFIG *ybf,
- int subsampling_x,
- int subsampling_y) {
+void vp9_extend_frame_inner_borders_dspr2(YV12_BUFFER_CONFIG *ybf) {
const int inner_bw = (ybf->border > VP9INNERBORDERINPIXELS) ?
VP9INNERBORDERINPIXELS : ybf->border;
- extend_frame(ybf, subsampling_x, subsampling_y, inner_bw);
+ extend_frame(ybf, inner_bw);
}
#endif