From 3e0ea7f6e1cec3c785312a140a72b120ff831ff0 Mon Sep 17 00:00:00 2001 From: Frank Galligan Date: Mon, 3 Dec 2012 10:20:11 -0800 Subject: [PATCH 1/6] vp9: Remove superfluous command. - vpx_calloc is called on arf_not_zz above. - Note The removed vpx_memset call had an issue with sizeof. Change-Id: I86fd7a167d0a042e581e613e2a6c0b5e63073fc6 --- vp9/encoder/vp9_mbgraph.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/vp9/encoder/vp9_mbgraph.c b/vp9/encoder/vp9_mbgraph.c index 059572e24..8511bc572 100644 --- a/vp9/encoder/vp9_mbgraph.c +++ b/vp9/encoder/vp9_mbgraph.c @@ -367,8 +367,6 @@ static void separate_arf_mbs(VP9_COMP *cpi) { CHECK_MEM_ERROR(arf_not_zz, vpx_calloc(cm->mb_rows * cm->mb_cols * sizeof(*arf_not_zz), 1)); - vpx_memset(arf_not_zz, 0, sizeof(arf_not_zz)); - // We are not interested in results beyond the alt ref itself. if (n_frames > cpi->frames_till_gf_update_due) n_frames = cpi->frames_till_gf_update_due; From 0d687ed22b43a7b10154392ae39003e6ea8c82e8 Mon Sep 17 00:00:00 2001 From: Frank Galligan Date: Mon, 3 Dec 2012 12:18:59 -0800 Subject: [PATCH 2/6] vp9: Fix assert check. Change-Id: If0cc1ab60dff6abd67dae7c7b3dc83a1afd7fe65 --- vp9/encoder/vp9_encodeframe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index b7f8cf49f..d2008a775 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -463,7 +463,7 @@ static void update_state(VP9_COMP *cpi, MACROBLOCK *x, if (mb_mode == B_PRED) { for (i = 0; i < 16; i++) { xd->block[i].bmi.as_mode = xd->mode_info_context->bmi[i].as_mode; - assert(xd->block[i].bmi.as_mode.first < MB_MODE_COUNT); + assert(xd->block[i].bmi.as_mode.first < B_MODE_COUNT); } } else if (mb_mode == I8X8_PRED) { for (i = 0; i < 16; i++) { @@ -931,7 +931,7 @@ static void pick_sb_modes (VP9_COMP *cpi, xd->mode_info_context->mbmi.segment_id = 0; x->active_ptr = cpi->active_map + map_index; - + cpi->update_context = 0; // TODO Do we need this now?? /* Find best coding mode & reconstruct the MB so it is available From d9038b3c600d39ce7a4b01e0c8c71bbe9d975fb0 Mon Sep 17 00:00:00 2001 From: Jim Bankoski Date: Mon, 3 Dec 2012 12:21:16 -0800 Subject: [PATCH 3/6] fixes --disable-vp9-encoder Change-Id: I467bf0fdf3b35326bcce58d5459e6d2dbfd6c5e5 --- vp9/common/x86/vp9_asm_stubs.c | 23 +++++++++++++++++++++++ vp9/encoder/x86/vp9_variance_mmx.c | 26 +------------------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/vp9/common/x86/vp9_asm_stubs.c b/vp9/common/x86/vp9_asm_stubs.c index f804af698..e53ede066 100644 --- a/vp9/common/x86/vp9_asm_stubs.c +++ b/vp9/common/x86/vp9_asm_stubs.c @@ -97,6 +97,29 @@ extern void vp9_filter_block1d8_v6_only_sse2(unsigned char *src_ptr, extern prototype_subpixel_predict(vp9_bilinear_predict8x8_mmx); +/////////////////////////////////////////////////////////////////////////// +// the mmx function that does the bilinear filtering and var calculation // +// int one pass // +/////////////////////////////////////////////////////////////////////////// +DECLARE_ALIGNED(16, const short, vp9_bilinear_filters_mmx[16][8]) = { + { 128, 128, 128, 128, 0, 0, 0, 0 }, + { 120, 120, 120, 120, 8, 8, 8, 8 }, + { 112, 112, 112, 112, 16, 16, 16, 16 }, + { 104, 104, 104, 104, 24, 24, 24, 24 }, + { 96, 96, 96, 96, 32, 32, 32, 32 }, + { 88, 88, 88, 88, 40, 40, 40, 40 }, + { 80, 80, 80, 80, 48, 48, 48, 48 }, + { 72, 72, 72, 72, 56, 56, 56, 56 }, + { 64, 64, 64, 64, 64, 64, 64, 64 }, + { 56, 56, 56, 56, 72, 72, 72, 72 }, + { 48, 48, 48, 48, 80, 80, 80, 80 }, + { 40, 40, 40, 40, 88, 88, 88, 88 }, + { 32, 32, 32, 32, 96, 96, 96, 96 }, + { 24, 24, 24, 24, 104, 104, 104, 104 }, + { 16, 16, 16, 16, 112, 112, 112, 112 }, + { 8, 8, 8, 8, 120, 120, 120, 120 } +}; + #if HAVE_MMX void vp9_sixtap_predict4x4_mmx(unsigned char *src_ptr, int src_pixels_per_line, diff --git a/vp9/encoder/x86/vp9_variance_mmx.c b/vp9/encoder/x86/vp9_variance_mmx.c index fa69130a1..dd3dfbc08 100644 --- a/vp9/encoder/x86/vp9_variance_mmx.c +++ b/vp9/encoder/x86/vp9_variance_mmx.c @@ -191,31 +191,7 @@ unsigned int vp9_variance8x16_mmx( } - - - -/////////////////////////////////////////////////////////////////////////// -// the mmx function that does the bilinear filtering and var calculation // -// int one pass // -/////////////////////////////////////////////////////////////////////////// -DECLARE_ALIGNED(16, const short, vp9_bilinear_filters_mmx[16][8]) = { - { 128, 128, 128, 128, 0, 0, 0, 0 }, - { 120, 120, 120, 120, 8, 8, 8, 8 }, - { 112, 112, 112, 112, 16, 16, 16, 16 }, - { 104, 104, 104, 104, 24, 24, 24, 24 }, - { 96, 96, 96, 96, 32, 32, 32, 32 }, - { 88, 88, 88, 88, 40, 40, 40, 40 }, - { 80, 80, 80, 80, 48, 48, 48, 48 }, - { 72, 72, 72, 72, 56, 56, 56, 56 }, - { 64, 64, 64, 64, 64, 64, 64, 64 }, - { 56, 56, 56, 56, 72, 72, 72, 72 }, - { 48, 48, 48, 48, 80, 80, 80, 80 }, - { 40, 40, 40, 40, 88, 88, 88, 88 }, - { 32, 32, 32, 32, 96, 96, 96, 96 }, - { 24, 24, 24, 24, 104, 104, 104, 104 }, - { 16, 16, 16, 16, 112, 112, 112, 112 }, - { 8, 8, 8, 8, 120, 120, 120, 120 } -}; +DECLARE_ALIGNED(16, const short, vp9_bilinear_filters_mmx[16][8]); unsigned int vp9_sub_pixel_variance4x4_mmx ( From 6a5e6e054951cefc337734f4c0f3c97582c59e09 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Tue, 4 Dec 2012 08:35:37 -0800 Subject: [PATCH 4/6] Fix the build with MSVC 1. remove the dependency on non existing "vp9_temporal_filter_x86.h" 2. prefix filenames with vp9_ in obj_int_extract.bat to reflect the change of the actual filenames. Change-Id: Ib1b4d96ac41788f76917764a6722d8461c857302 --- build/x86-msvs/obj_int_extract.bat | 12 ++++++------ vp9/vp9cx.mk | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build/x86-msvs/obj_int_extract.bat b/build/x86-msvs/obj_int_extract.bat index 1b77dfa1f..70b39f68a 100644 --- a/build/x86-msvs/obj_int_extract.bat +++ b/build/x86-msvs/obj_int_extract.bat @@ -7,12 +7,12 @@ REM in the file PATENTS. All contributing project authors may REM be found in the AUTHORS file in the root of the source tree. echo on -cl /I "./" /I "%1" /nologo /c "%1/vp9/common/asm_com_offsets.c" -cl /I "./" /I "%1" /nologo /c "%1/vp9/decoder/asm_dec_offsets.c" -cl /I "./" /I "%1" /nologo /c "%1/vp9/encoder/asm_enc_offsets.c" -obj_int_extract.exe rvds "asm_com_offsets.obj" > "vp9_asm_com_offsets.asm" -obj_int_extract.exe rvds "asm_dec_offsets.obj" > "vp9_asm_dec_offsets.asm" -obj_int_extract.exe rvds "asm_enc_offsets.obj" > "vp9_asm_enc_offsets.asm" +cl /I "./" /I "%1" /nologo /c "%1/vp9/common/vp9_asm_com_offsets.c" +cl /I "./" /I "%1" /nologo /c "%1/vp9/decoder/vp9_asm_dec_offsets.c" +cl /I "./" /I "%1" /nologo /c "%1/vp9/encoder/vp9_asm_enc_offsets.c" +obj_int_extract.exe rvds "vp9_asm_com_offsets.obj" > "vp9_asm_com_offsets.asm" +obj_int_extract.exe rvds "vp9_asm_dec_offsets.obj" > "vp9_asm_dec_offsets.asm" +obj_int_extract.exe rvds "vp9_asm_enc_offsets.obj" > "vp9_asm_enc_offsets.asm" cl /I "./" /I "%1" /nologo /c "%1/vp8/common/asm_com_offsets.c" cl /I "./" /I "%1" /nologo /c "%1/vp8/decoder/asm_dec_offsets.c" diff --git a/vp9/vp9cx.mk b/vp9/vp9cx.mk index d20e79a6c..b19036e1d 100644 --- a/vp9/vp9cx.mk +++ b/vp9/vp9cx.mk @@ -86,7 +86,6 @@ VP9_CX_SRCS-yes += encoder/vp9_mbgraph.h VP9_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/vp9_mcomp_x86.h VP9_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/vp9_quantize_x86.h -VP9_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/vp9_temporal_filter_x86.h VP9_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/vp9_x86_csystemdependent.c VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_variance_mmx.c VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_variance_impl_mmx.asm From c202100fe408499e8a18a5878af0fcfc74bfc635 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Tue, 4 Dec 2012 12:28:10 -0800 Subject: [PATCH 5/6] Enable unit tests to build with MSVC Change-Id: Ie80597221bee494679ae2ba50cca22dea2609cba --- libs.mk | 2 ++ test/idct8x8_test.cc | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/libs.mk b/libs.mk index 58151a66d..97892cc00 100644 --- a/libs.mk +++ b/libs.mk @@ -425,6 +425,7 @@ gtest.vcproj: $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc --proj-guid=EC00E1EC-AF68-4D92-A255-181690D1C9B1 \ --ver=$(CONFIG_VS_VERSION) \ --src-path-bare="$(SRC_PATH_BARE)" \ + -D_VARIADIC_MAX=10 \ --out=gtest.vcproj $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc \ -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" -I"$(SRC_PATH_BARE)/third_party/googletest/src" @@ -436,6 +437,7 @@ test_libvpx.vcproj: $(LIBVPX_TEST_SRCS) --exe \ --target=$(TOOLCHAIN) \ --name=test_libvpx \ + -D_VARIADIC_MAX=10 \ --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \ --ver=$(CONFIG_VS_VERSION) \ $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \ diff --git a/test/idct8x8_test.cc b/test/idct8x8_test.cc index 7cf7aa0ea..ab71e8566 100644 --- a/test/idct8x8_test.cc +++ b/test/idct8x8_test.cc @@ -25,6 +25,15 @@ using libvpx_test::ACMRandom; namespace { +#ifdef _MSC_VER +static int round(double x) { + if(x < 0) + return (int)ceil(x - 0.5); + else + return (int)floor(x + 0.5); +} +#endif + void reference_dct_1d(double input[8], double output[8]) { const double kPi = 3.141592653589793238462643383279502884; const double kInvSqrt2 = 0.707106781186547524400844362104; From 4a4d2aa55c970815375c795c570d29645b431b53 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Wed, 5 Dec 2012 08:27:48 -0800 Subject: [PATCH 6/6] vp9_bilinear_filters_mmx: add missing extern specifiers Change-Id: Ibabf18947f90cb4f45052763ebf44cfb8209bd8b --- vp9/encoder/x86/vp9_variance_mmx.c | 2 +- vp9/encoder/x86/vp9_variance_sse2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/x86/vp9_variance_mmx.c b/vp9/encoder/x86/vp9_variance_mmx.c index dd3dfbc08..bad1cfa74 100644 --- a/vp9/encoder/x86/vp9_variance_mmx.c +++ b/vp9/encoder/x86/vp9_variance_mmx.c @@ -191,7 +191,7 @@ unsigned int vp9_variance8x16_mmx( } -DECLARE_ALIGNED(16, const short, vp9_bilinear_filters_mmx[16][8]); +DECLARE_ALIGNED(16, extern const short, vp9_bilinear_filters_mmx[16][8]); unsigned int vp9_sub_pixel_variance4x4_mmx ( diff --git a/vp9/encoder/x86/vp9_variance_sse2.c b/vp9/encoder/x86/vp9_variance_sse2.c index 280efcd7a..36fae6e8c 100644 --- a/vp9/encoder/x86/vp9_variance_sse2.c +++ b/vp9/encoder/x86/vp9_variance_sse2.c @@ -137,7 +137,7 @@ void vp9_half_vert_variance16x_h_sse2 unsigned int *sumsquared ); -DECLARE_ALIGNED(16, extern short, vp9_bilinear_filters_mmx[16][8]); +DECLARE_ALIGNED(16, extern const short, vp9_bilinear_filters_mmx[16][8]); unsigned int vp9_variance4x4_wmt( const unsigned char *src_ptr,