Merge branch 'experimental' into master
VP9 preview bitstream 2, commit '868ecb55a1528ca3f19286e7d1551572bf89b642'
Conflicts:
vp9/vp9_common.mk
Change-Id: I3f0f6e692c987ff24f98ceafbb86cb9cf64ad8d3
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 1a78f27..4d0cad2 100755
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -1088,10 +1088,12 @@
win32)
add_asflags -f win32
enabled debug && add_asflags -g cv8
+ EXE_SFX=.exe
;;
win64)
add_asflags -f x64
enabled debug && add_asflags -g cv8
+ EXE_SFX=.exe
;;
linux*|solaris*|android*)
add_asflags -f elf${bits}
diff --git a/libmkv/EbmlIDs.h b/libmkv/EbmlIDs.h
index 4920bf9..44d4385 100644
--- a/libmkv/EbmlIDs.h
+++ b/libmkv/EbmlIDs.h
@@ -67,10 +67,10 @@
BlockGroup = 0xA0,
Block = 0xA1,
/* BlockVirtual = 0xA2, */
-/* BlockAdditions = 0x75A1, */
-/* BlockMore = 0xA6, */
-/* BlockAddID = 0xEE, */
-/* BlockAdditional = 0xA5, */
+ BlockAdditions = 0x75A1,
+ BlockMore = 0xA6,
+ BlockAddID = 0xEE,
+ BlockAdditional = 0xA5,
BlockDuration = 0x9B,
/* ReferencePriority = 0xFA, */
ReferenceBlock = 0xFB,
@@ -100,7 +100,7 @@
DefaultDuration = 0x23E383,
/* TrackTimecodeScale = 0x23314F, */
/* TrackOffset = 0x537F, */
-/* MaxBlockAdditionID = 0x55EE, */
+ MaxBlockAdditionID = 0x55EE,
Name = 0x536E,
Language = 0x22B59C,
CodecID = 0x86,
@@ -120,6 +120,7 @@
Video = 0xE0,
FlagInterlaced = 0x9A,
StereoMode = 0x53B8,
+ AlphaMode = 0x53C0,
PixelWidth = 0xB0,
PixelHeight = 0xBA,
PixelCropBottom = 0x54AA,
diff --git a/libs.mk b/libs.mk
index 872a16b..2281bd0 100644
--- a/libs.mk
+++ b/libs.mk
@@ -436,7 +436,7 @@
PROJECTS-$(CONFIG_MSVS) += test_libvpx.vcproj
test:: testdata
- @set -e; for t in $(addprefix Win32/Release/,$(notdir $(LIBVPX_TEST_BINS:.cc=.exe))); do $$t; done
+ @set -e; for t in $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TEST_BINS:.cc=.exe))); do $$t; done
endif
else
diff --git a/test/acm_random.h b/test/acm_random.h
index 514894e..13903c6 100644
--- a/test/acm_random.h
+++ b/test/acm_random.h
@@ -11,7 +11,7 @@
#ifndef LIBVPX_TEST_ACM_RANDOM_H_
#define LIBVPX_TEST_ACM_RANDOM_H_
-#include <stdlib.h>
+#include "third_party/googletest/src/include/gtest/gtest.h"
#include "vpx/vpx_integer.h"
@@ -19,24 +19,23 @@
class ACMRandom {
public:
- ACMRandom() {
- Reset(DeterministicSeed());
- }
+ ACMRandom() : random_(DeterministicSeed()) {}
- explicit ACMRandom(int seed) {
- Reset(seed);
- }
+ explicit ACMRandom(int seed) : random_(seed) {}
void Reset(int seed) {
- srand(seed);
+ random_.Reseed(seed);
}
uint8_t Rand8(void) {
- return (rand() >> 8) & 0xff;
+ const uint32_t value =
+ random_.Generate(testing::internal::Random::kMaxRange);
+ // There's a bit more entropy in the upper bits of this implementation.
+ return (value >> 24) & 0xff;
}
int PseudoUniform(int range) {
- return (rand() >> 8) % range;
+ return random_.Generate(range);
}
int operator()(int n) {
@@ -46,6 +45,9 @@
static int DeterministicSeed(void) {
return 0xbaba;
}
+
+ private:
+ testing::internal::Random random_;
};
} // namespace libvpx_test
diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc
index 1a3e240..e1b2a07 100644
--- a/test/fdct8x8_test.cc
+++ b/test/fdct8x8_test.cc
@@ -51,11 +51,15 @@
}
for (int j = 0; j < 64; ++j) {
- const bool bias_acceptable = (abs(count_sign_block[j][0] -
- count_sign_block[j][1]) < 1000);
- EXPECT_TRUE(bias_acceptable)
- << "Error: 8x8 FDCT has a sign bias > 1%"
- << " for input range [-255, 255] at index " << j;
+ const int diff = abs(count_sign_block[j][0] - count_sign_block[j][1]);
+ const int max_diff = 1125;
+ EXPECT_LT(diff, max_diff)
+ << "Error: 8x8 FDCT has a sign bias > "
+ << 1. * max_diff / count_test_block * 100 << "%"
+ << " for input range [-255, 255] at index " << j
+ << " count0: " << count_sign_block[j][0]
+ << " count1: " << count_sign_block[j][1]
+ << " diff: " << diff;
}
memset(count_sign_block, 0, sizeof(count_sign_block));
@@ -76,11 +80,15 @@
}
for (int j = 0; j < 64; ++j) {
- const bool bias_acceptable = (abs(count_sign_block[j][0] -
- count_sign_block[j][1]) < 10000);
- EXPECT_TRUE(bias_acceptable)
- << "Error: 8x8 FDCT has a sign bias > 10%"
- << " for input range [-15, 15] at index " << j;
+ const int diff = abs(count_sign_block[j][0] - count_sign_block[j][1]);
+ const int max_diff = 10000;
+ EXPECT_LT(diff, max_diff)
+ << "Error: 4x4 FDCT has a sign bias > "
+ << 1. * max_diff / count_test_block * 100 << "%"
+ << " for input range [-15, 15] at index " << j
+ << " count0: " << count_sign_block[j][0]
+ << " count1: " << count_sign_block[j][1]
+ << " diff: " << diff;
}
};
diff --git a/vp8/common/generic/systemdependent.c b/vp8/common/generic/systemdependent.c
index 2de019d..d84df33 100644
--- a/vp8/common/generic/systemdependent.c
+++ b/vp8/common/generic/systemdependent.c
@@ -82,6 +82,7 @@
}
#endif
+void vp8_clear_system_state_c() {};
void vp8_machine_specific_config(VP8_COMMON *ctx)
{
diff --git a/vp8/common/rtcd_defs.sh b/vp8/common/rtcd_defs.sh
index ee892de..9ebf389 100644
--- a/vp8/common/rtcd_defs.sh
+++ b/vp8/common/rtcd_defs.sh
@@ -19,6 +19,13 @@
forward_decls vp8_common_forward_decls
#
+# system state
+#
+prototype void vp8_clear_system_state ""
+specialize vp8_clear_system_state mmx
+vp8_clear_system_state_mmx=vpx_reset_mmx_state
+
+#
# Dequant
#
prototype void vp8_dequantize_b "struct blockd*, short *dqc"
diff --git a/vp8/common/systemdependent.h b/vp8/common/systemdependent.h
index f99c4bb..e6b0456 100644
--- a/vp8/common/systemdependent.h
+++ b/vp8/common/systemdependent.h
@@ -10,12 +10,6 @@
#include "vpx_config.h"
-#if ARCH_X86 || ARCH_X86_64
-void vpx_reset_mmx_state(void);
-#define vp8_clear_system_state() vpx_reset_mmx_state()
-#else
-#define vp8_clear_system_state()
-#endif
struct VP8Common;
void vp8_machine_specific_config(struct VP8Common *);
diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c
index 4c2527d..c5279fe 100644
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -594,6 +594,7 @@
unsigned int zero_mv_sse = INT_MAX, best_sse = INT_MAX;
#endif
+ int sf_improved_mv_pred = cpi->sf.improved_mv_pred;
int_mv mvp;
int near_sadidx[8] = {0, 1, 2, 3, 4, 5, 6, 7};
@@ -882,7 +883,7 @@
last frame motion info is not stored, then we can not
use improved_mv_pred. */
if (cpi->oxcf.mr_encoder_id && !parent_ref_valid)
- cpi->sf.improved_mv_pred = 0;
+ sf_improved_mv_pred = 0;
if (parent_ref_valid && parent_ref_frame)
{
@@ -899,7 +900,7 @@
}else
#endif
{
- if(cpi->sf.improved_mv_pred)
+ if(sf_improved_mv_pred)
{
if(!saddone)
{
diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c
index b985cb1..4531d5a 100644
--- a/vp8/vp8_cx_iface.c
+++ b/vp8/vp8_cx_iface.c
@@ -684,6 +684,8 @@
yv12->u_buffer = img->planes[VPX_PLANE_U];
yv12->v_buffer = img->planes[VPX_PLANE_V];
+ yv12->y_crop_width = img->d_w;
+ yv12->y_crop_height = img->d_h;
yv12->y_width = img->d_w;
yv12->y_height = img->d_h;
yv12->uv_width = (1 + yv12->y_width) / 2;
diff --git a/vp8/vp8_dx_iface.c b/vp8/vp8_dx_iface.c
index f3834b0..90a1754 100644
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -790,6 +790,8 @@
yv12->u_buffer = img->planes[VPX_PLANE_U];
yv12->v_buffer = img->planes[VPX_PLANE_V];
+ yv12->y_crop_width = img->d_w;
+ yv12->y_crop_height = img->d_h;
yv12->y_width = img->d_w;
yv12->y_height = img->d_h;
yv12->uv_width = yv12->y_width / 2;
diff --git a/vp9/common/x86/vp9_loopfilter_intrin_mmx.c b/vp9/common/x86/vp9_loopfilter_intrin_mmx.c
new file mode 100644
index 0000000..2be9e31
--- /dev/null
+++ b/vp9/common/x86/vp9_loopfilter_intrin_mmx.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "vp9/common/vp9_loopfilter.h"
+
+prototype_loopfilter(vp9_loop_filter_vertical_edge_mmx);
+prototype_loopfilter(vp9_loop_filter_horizontal_edge_mmx);
+
+/* Horizontal MB filtering */
+void vp9_loop_filter_mbh_mmx(unsigned char *y_ptr,
+ unsigned char *u_ptr, unsigned char *v_ptr,
+ int y_stride, int uv_stride,
+ struct loop_filter_info *lfi) {
+}
+
+/* Vertical MB Filtering */
+void vp9_loop_filter_mbv_mmx(unsigned char *y_ptr,
+ unsigned char *u_ptr, unsigned char *v_ptr,
+ int y_stride, int uv_stride,
+ struct loop_filter_info *lfi) {
+}
+
+/* Horizontal B Filtering */
+void vp9_loop_filter_bh_mmx(unsigned char *y_ptr,
+ unsigned char *u_ptr, unsigned char *v_ptr,
+ int y_stride, int uv_stride,
+ struct loop_filter_info *lfi) {
+
+}
+
+void vp9_loop_filter_bhs_mmx(unsigned char *y_ptr, int y_stride,
+ const unsigned char *blimit) {
+ vp9_loop_filter_simple_horizontal_edge_mmx(y_ptr + 4 * y_stride,
+ y_stride, blimit);
+ vp9_loop_filter_simple_horizontal_edge_mmx(y_ptr + 8 * y_stride,
+ y_stride, blimit);
+ vp9_loop_filter_simple_horizontal_edge_mmx(y_ptr + 12 * y_stride,
+ y_stride, blimit);
+}
+
+/* Vertical B Filtering */
+void vp9_loop_filter_bv_mmx(unsigned char *y_ptr,
+ unsigned char *u_ptr, unsigned char *v_ptr,
+ int y_stride, int uv_stride,
+ struct loop_filter_info *lfi) {
+ vp9_loop_filter_vertical_edge_mmx(y_ptr + 4, y_stride,
+ lfi->blim, lfi->lim, lfi->hev_thr, 2);
+ vp9_loop_filter_vertical_edge_mmx(y_ptr + 8, y_stride,
+ lfi->blim, lfi->lim, lfi->hev_thr, 2);
+ vp9_loop_filter_vertical_edge_mmx(y_ptr + 12, y_stride,
+ lfi->blim, lfi->lim, lfi->hev_thr, 2);
+
+ if (u_ptr)
+ vp9_loop_filter_vertical_edge_mmx(u_ptr + 4, uv_stride,
+ lfi->blim, lfi->lim, lfi->hev_thr, 1);
+
+ if (v_ptr)
+ vp9_loop_filter_vertical_edge_mmx(v_ptr + 4, uv_stride,
+ lfi->blim, lfi->lim, lfi->hev_thr, 1);
+}
+
+void vp9_loop_filter_bvs_mmx(unsigned char *y_ptr, int y_stride,
+ const unsigned char *blimit) {
+ vp9_loop_filter_simple_vertical_edge_mmx(y_ptr + 4, y_stride, blimit);
+ vp9_loop_filter_simple_vertical_edge_mmx(y_ptr + 8, y_stride, blimit);
+ vp9_loop_filter_simple_vertical_edge_mmx(y_ptr + 12, y_stride, blimit);
+}
diff --git a/vp9/common/x86/vp9_loopfilter_x86.c b/vp9/common/x86/vp9_loopfilter_intrin_sse2.c
similarity index 94%
rename from vp9/common/x86/vp9_loopfilter_x86.c
rename to vp9/common/x86/vp9_loopfilter_intrin_sse2.c
index c848754..08447a6 100644
--- a/vp9/common/x86/vp9_loopfilter_x86.c
+++ b/vp9/common/x86/vp9_loopfilter_intrin_sse2.c
@@ -8,84 +8,16 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <emmintrin.h> // SSE2
-#include "vpx_config.h"
+#include <emmintrin.h> /* SSE2 */
#include "vp9/common/vp9_loopfilter.h"
#include "vpx_ports/emmintrin_compat.h"
-prototype_loopfilter(vp9_loop_filter_vertical_edge_mmx);
-prototype_loopfilter(vp9_loop_filter_horizontal_edge_mmx);
-
prototype_loopfilter(vp9_loop_filter_vertical_edge_sse2);
prototype_loopfilter(vp9_loop_filter_horizontal_edge_sse2);
extern loop_filter_uvfunction vp9_loop_filter_horizontal_edge_uv_sse2;
extern loop_filter_uvfunction vp9_loop_filter_vertical_edge_uv_sse2;
-#if HAVE_MMX
-/* Horizontal MB filtering */
-void vp9_loop_filter_mbh_mmx(unsigned char *y_ptr,
- unsigned char *u_ptr, unsigned char *v_ptr,
- int y_stride, int uv_stride,
- struct loop_filter_info *lfi) {
-}
-
-/* Vertical MB Filtering */
-void vp9_loop_filter_mbv_mmx(unsigned char *y_ptr,
- unsigned char *u_ptr, unsigned char *v_ptr,
- int y_stride, int uv_stride,
- struct loop_filter_info *lfi) {
-}
-
-/* Horizontal B Filtering */
-void vp9_loop_filter_bh_mmx(unsigned char *y_ptr,
- unsigned char *u_ptr, unsigned char *v_ptr,
- int y_stride, int uv_stride,
- struct loop_filter_info *lfi) {
-
-}
-
-void vp9_loop_filter_bhs_mmx(unsigned char *y_ptr, int y_stride,
- const unsigned char *blimit) {
- vp9_loop_filter_simple_horizontal_edge_mmx(y_ptr + 4 * y_stride,
- y_stride, blimit);
- vp9_loop_filter_simple_horizontal_edge_mmx(y_ptr + 8 * y_stride,
- y_stride, blimit);
- vp9_loop_filter_simple_horizontal_edge_mmx(y_ptr + 12 * y_stride,
- y_stride, blimit);
-}
-
-/* Vertical B Filtering */
-void vp9_loop_filter_bv_mmx(unsigned char *y_ptr,
- unsigned char *u_ptr, unsigned char *v_ptr,
- int y_stride, int uv_stride,
- struct loop_filter_info *lfi) {
- vp9_loop_filter_vertical_edge_mmx(y_ptr + 4, y_stride,
- lfi->blim, lfi->lim, lfi->hev_thr, 2);
- vp9_loop_filter_vertical_edge_mmx(y_ptr + 8, y_stride,
- lfi->blim, lfi->lim, lfi->hev_thr, 2);
- vp9_loop_filter_vertical_edge_mmx(y_ptr + 12, y_stride,
- lfi->blim, lfi->lim, lfi->hev_thr, 2);
-
- if (u_ptr)
- vp9_loop_filter_vertical_edge_mmx(u_ptr + 4, uv_stride,
- lfi->blim, lfi->lim, lfi->hev_thr, 1);
-
- if (v_ptr)
- vp9_loop_filter_vertical_edge_mmx(v_ptr + 4, uv_stride,
- lfi->blim, lfi->lim, lfi->hev_thr, 1);
-}
-
-void vp9_loop_filter_bvs_mmx(unsigned char *y_ptr, int y_stride,
- const unsigned char *blimit) {
- vp9_loop_filter_simple_vertical_edge_mmx(y_ptr + 4, y_stride, blimit);
- vp9_loop_filter_simple_vertical_edge_mmx(y_ptr + 8, y_stride, blimit);
- vp9_loop_filter_simple_vertical_edge_mmx(y_ptr + 12, y_stride, blimit);
-}
-#endif
-
-#if HAVE_SSE2
-
void vp9_mb_lpf_horizontal_edge_w_sse2(unsigned char *s,
int p,
const unsigned char *_blimit,
@@ -1217,5 +1149,3 @@
vp9_loop_filter_simple_vertical_edge_sse2(y_ptr + 8, y_stride, blimit);
vp9_loop_filter_simple_vertical_edge_sse2(y_ptr + 12, y_stride, blimit);
}
-
-#endif
diff --git a/vp9/common/x86/vp9_sadmxn_x86.c b/vp9/common/x86/vp9_sadmxn_sse2.c
similarity index 96%
rename from vp9/common/x86/vp9_sadmxn_x86.c
rename to vp9/common/x86/vp9_sadmxn_sse2.c
index 3072d6d..ed873a5 100644
--- a/vp9/common/x86/vp9_sadmxn_x86.c
+++ b/vp9/common/x86/vp9_sadmxn_sse2.c
@@ -8,13 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <emmintrin.h> // SSE2
-#include "./vpx_config.h"
-#include "./vp9_rtcd.h"
+#include <emmintrin.h> /* SSE2 */
#include "vpx/vpx_integer.h"
#include "vpx_ports/emmintrin_compat.h"
-#if HAVE_SSE2
unsigned int vp9_sad16x3_sse2(
const unsigned char *src_ptr,
int src_stride,
@@ -96,5 +93,3 @@
sad = _mm_add_epi16(sad, _mm_srli_si128(sad, 8));
return _mm_cvtsi128_si32(sad);
}
-
-#endif
diff --git a/vp9/encoder/vp9_dct.c b/vp9/encoder/vp9_dct.c
index 6365ed9..aeef9c6 100644
--- a/vp9/encoder/vp9_dct.c
+++ b/vp9/encoder/vp9_dct.c
@@ -1248,4 +1248,3 @@
out[j + i * 32] = (temp_out[j] + 1 + (temp_out[j] < 0)) >> 2;
}
}
-
diff --git a/vp9/encoder/vp9_sad_c.c b/vp9/encoder/vp9_sad_c.c
index af5526d..96d9938 100644
--- a/vp9/encoder/vp9_sad_c.c
+++ b/vp9/encoder/vp9_sad_c.c
@@ -485,4 +485,3 @@
sad_array[3] = vp9_sad4x4(src_ptr, src_stride,
ref_ptr[3], ref_stride, 0x7fffffff);
}
-
diff --git a/vp9/vp9_common.mk b/vp9/vp9_common.mk
index ea86317..5e1ff62 100644
--- a/vp9/vp9_common.mk
+++ b/vp9/vp9_common.mk
@@ -86,7 +86,8 @@
VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_loopfilter_x86.h
VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_postproc_x86.h
VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_asm_stubs.c
-VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_loopfilter_x86.c
+VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_loopfilter_intrin_mmx.c
+VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_loopfilter_intrin_sse2.c
VP9_COMMON_SRCS-$(CONFIG_POSTPROC) += common/vp9_postproc.h
VP9_COMMON_SRCS-$(CONFIG_POSTPROC) += common/vp9_postproc.c
VP9_COMMON_SRCS-$(HAVE_MMX) += common/x86/vp9_iwalsh_mmx.asm
@@ -112,14 +113,14 @@
endif
VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/vp9_idct_x86.c
-VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_sadmxn_x86.c
+VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_sadmxn_sse2.c
ifeq ($(HAVE_SSE2),yes)
vp9/common/x86/vp9_idct_x86.c.o: CFLAGS += -msse2
-vp9/common/x86/vp9_loopfilter_x86.c.o: CFLAGS += -msse2
-vp9/common/x86/vp9_sadmxn_x86.c.o: CFLAGS += -msse2
+vp9/common/x86/vp9_loopfilter_intrin_sse2.c.o: CFLAGS += -msse2
+vp9/common/x86/vp9_sadmxn_sse2.c.o: CFLAGS += -msse2
vp9/common/x86/vp9_idct_x86.c.d: CFLAGS += -msse2
-vp9/common/x86/vp9_loopfilter_x86.c.d: CFLAGS += -msse2
-vp9/common/x86/vp9_sadmxn_x86.c.d: CFLAGS += -msse2
+vp9/common/x86/vp9_loopfilter_intrin_sse2.c.d: CFLAGS += -msse2
+vp9/common/x86/vp9_sadmxn_sse2.c.d: CFLAGS += -msse2
endif
$(eval $(call asm_offsets_template,\
diff --git a/vpx_scale/generic/yv12extend.c b/vpx_scale/generic/yv12extend.c
index 49d7e8e..a322e0a 100644
--- a/vpx_scale/generic/yv12extend.c
+++ b/vpx_scale/generic/yv12extend.c
@@ -117,8 +117,13 @@
int row;
unsigned char *source, *dest;
+#if 0
+ /* These assertions are valid in the codec, but the libvpx-tester uses
+ * this code slightly differently.
+ */
assert(src_ybc->y_width == dst_ybc->y_width);
assert(src_ybc->y_height == dst_ybc->y_height);
+#endif
source = src_ybc->y_buffer;
dest = dst_ybc->y_buffer;