Merge "Modify block transform skipping check"
diff --git a/build/make/configure.sh b/build/make/configure.sh
index d07f877..f73d05c 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -754,6 +754,7 @@
fi
done
fi
+ IOS_VERSION_MIN="6.0"
;;
esac
@@ -788,8 +789,8 @@
add_ldflags "-mmacosx-version-min=10.9"
;;
*-iphonesimulator-*)
- add_cflags "-miphoneos-version-min=6.0"
- add_ldflags "-miphoneos-version-min=6.0"
+ add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
+ add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
osx_sdk_dir="$(xcrun --sdk iphonesimulator --show-sdk-path)"
add_cflags "-isysroot ${osx_sdk_dir}"
add_ldflags "-isysroot ${osx_sdk_dir}"
@@ -970,12 +971,11 @@
;;
darwin*)
-
XCRUN_FIND="xcrun --sdk iphoneos -find"
CXX="$(${XCRUN_FIND} clang++)"
CC="$(${XCRUN_FIND} clang)"
AR="$(${XCRUN_FIND} ar)"
- LD="$(${XCRUN_FIND} ld)"
+ LD="${CXX:-$(${XCRUN_FIND} ld)}"
AS="$(${XCRUN_FIND} as)"
STRIP="$(${XCRUN_FIND} strip)"
NM="$(${XCRUN_FIND} nm)"
@@ -989,7 +989,13 @@
alt_libc="$(xcrun --sdk iphoneos --show-sdk-path)"
add_cflags -arch ${tgt_isa} -isysroot ${alt_libc}
- add_ldflags -arch ${tgt_isa} -ios_version_min 7.0
+ add_ldflags -arch ${tgt_isa}
+
+ if [ "${LD}" = "${CXX}" ]; then
+ add_ldflags -miphoneos-version-min="${IOS_VERSION_MIN}"
+ else
+ add_ldflags -ios_version_min "${IOS_VERSION_MIN}"
+ fi
for d in lib usr/lib usr/lib/system; do
try_dir="${alt_libc}/${d}"
diff --git a/examples/simple_decoder.c b/examples/simple_decoder.c
index 3f7d6aa..c58b014 100644
--- a/examples/simple_decoder.c
+++ b/examples/simple_decoder.c
@@ -33,24 +33,25 @@
//
// Initializing The Codec
// ----------------------
-// The decoder is initialized by the following code. This is an example for
-// the VP8 decoder, but the code is analogous for all algorithms. Replace
-// `vpx_codec_vp8_dx()` with a pointer to the interface exposed by the
-// algorithm you want to use. The `cfg` argument is left as NULL in this
-// example, because we want the algorithm to determine the stream
-// configuration (width/height) and allocate memory automatically. This
-// parameter is generally only used if you need to preallocate memory,
-// particularly in External Memory Allocation mode.
+// The libvpx decoder is initialized by the call to vpx_codec_dec_init().
+// Determining the codec interface to use is handled by VpxVideoReader and the
+// functions prefixed with vpx_video_reader_. Discussion of those functions is
+// beyond the scope of this example, but the main gist is to open the input file
+// and parse just enough of it to determine if it's a VPx file and which VPx
+// codec is contained within the file.
+// Note the NULL pointer passed to vpx_codec_dec_init(). We do that in this
+// example because we want the algorithm to determine the stream configuration
+// (width/height) and allocate memory automatically.
//
// Decoding A Frame
// ----------------
// Once the frame has been read into memory, it is decoded using the
// `vpx_codec_decode` function. The call takes a pointer to the data
-// (`frame`) and the length of the data (`frame_sz`). No application data
+// (`frame`) and the length of the data (`frame_size`). No application data
// is associated with the frame in this example, so the `user_priv`
// parameter is NULL. The `deadline` parameter is left at zero for this
-// example. This parameter is generally only used when doing adaptive
-// postprocessing.
+// example. This parameter is generally only used when doing adaptive post
+// processing.
//
// Codecs may produce a variable number of output frames for every call to
// `vpx_codec_decode`. These frames are retrieved by the
@@ -72,14 +73,13 @@
// --------------
// This example does not special case any error return codes. If there was
// an error, a descriptive message is printed and the program exits. With
-// few exeptions, vpx_codec functions return an enumerated error status,
+// few exceptions, vpx_codec functions return an enumerated error status,
// with the value `0` indicating success.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "vpx/vp8dx.h"
#include "vpx/vpx_decoder.h"
#include "./tools_common.h"
diff --git a/test/vp9_lossless_test.cc b/test/vp9_lossless_test.cc
index b3b9c92..67215d3 100644
--- a/test/vp9_lossless_test.cc
+++ b/test/vp9_lossless_test.cc
@@ -19,17 +19,17 @@
const int kMaxPsnr = 100;
-class LosslessTestLarge : public ::libvpx_test::EncoderTest,
+class LosslessTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
- LosslessTestLarge()
+ LosslessTest()
: EncoderTest(GET_PARAM(0)),
psnr_(kMaxPsnr),
nframes_(0),
encoding_mode_(GET_PARAM(1)) {
}
- virtual ~LosslessTestLarge() {}
+ virtual ~LosslessTest() {}
virtual void SetUp() {
InitializeConfig();
@@ -67,7 +67,7 @@
libvpx_test::TestMode encoding_mode_;
};
-TEST_P(LosslessTestLarge, TestLossLessEncoding) {
+TEST_P(LosslessTest, TestLossLessEncoding) {
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
cfg_.rc_target_bitrate = 2000;
@@ -85,7 +85,7 @@
EXPECT_GE(psnr_lossless, kMaxPsnr);
}
-TEST_P(LosslessTestLarge, TestLossLessEncoding444) {
+TEST_P(LosslessTest, TestLossLessEncoding444) {
libvpx_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 10);
cfg_.g_profile = 1;
@@ -102,7 +102,7 @@
EXPECT_GE(psnr_lossless, kMaxPsnr);
}
-TEST_P(LosslessTestLarge, TestLossLessEncodingCtrl) {
+TEST_P(LosslessTest, TestLossLessEncodingCtrl) {
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
cfg_.rc_target_bitrate = 2000;
@@ -121,5 +121,8 @@
EXPECT_GE(psnr_lossless, kMaxPsnr);
}
-VP9_INSTANTIATE_TEST_CASE(LosslessTestLarge, ALL_TEST_MODES);
+VP9_INSTANTIATE_TEST_CASE(LosslessTest,
+ ::testing::Values(::libvpx_test::kRealTime,
+ ::libvpx_test::kOnePassGood,
+ ::libvpx_test::kTwoPassGood));
} // namespace
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h
index 03ab225..702efe0 100644
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -21,6 +21,7 @@
#include "vp9/common/vp9_common_data.h"
#include "vp9/common/vp9_enums.h"
#include "vp9/common/vp9_filter.h"
+#include "vp9/common/vp9_idct.h"
#include "vp9/common/vp9_mv.h"
#include "vp9/common/vp9_scale.h"
#include "vp9/common/vp9_seg_common.h"
diff --git a/vp9/common/vp9_common.h b/vp9/common/vp9_common.h
index 8305e7f..530d86f 100644
--- a/vp9/common/vp9_common.h
+++ b/vp9/common/vp9_common.h
@@ -77,8 +77,22 @@
}
}
+// Note:
+// tran_low_t is the datatype used for final transform coefficients.
+// tran_high_t is the datatype used for intermediate transform stages.
+typedef int64_t tran_high_t;
+typedef int32_t tran_low_t;
+
#define CONVERT_TO_SHORTPTR(x) ((uint16_t*)(((uintptr_t)x) << 1))
#define CONVERT_TO_BYTEPTR(x) ((uint8_t*)(((uintptr_t)x) >> 1 ))
+
+#else
+
+// Note:
+// tran_low_t is the datatype used for final transform coefficients.
+// tran_high_t is the datatype used for intermediate transform stages.
+typedef int32_t tran_high_t;
+typedef int16_t tran_low_t;
#endif // CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_DEBUG
diff --git a/vp9/common/vp9_entropymv.h b/vp9/common/vp9_entropymv.h
index e7033e4..75e6861 100644
--- a/vp9/common/vp9_entropymv.h
+++ b/vp9/common/vp9_entropymv.h
@@ -13,7 +13,9 @@
#define VP9_COMMON_VP9_ENTROPYMV_H_
#include "./vpx_config.h"
-#include "vp9/common/vp9_blockd.h"
+
+#include "vp9/common/vp9_mv.h"
+#include "vp9/common/vp9_prob.h"
#ifdef __cplusplus
extern "C" {
diff --git a/vp9/common/vp9_prob.h b/vp9/common/vp9_prob.h
index fa0e36d..bc1511a 100644
--- a/vp9/common/vp9_prob.h
+++ b/vp9/common/vp9_prob.h
@@ -14,7 +14,6 @@
#include "./vpx_config.h"
#include "vpx_ports/mem.h"
-#include "vpx/vpx_integer.h"
#include "vp9/common/vp9_common.h"
diff --git a/vp9/common/vp9_rtcd_defs.pl b/vp9/common/vp9_rtcd_defs.pl
index 99460d1..838ec44 100644
--- a/vp9/common/vp9_rtcd_defs.pl
+++ b/vp9/common/vp9_rtcd_defs.pl
@@ -5,6 +5,7 @@
*/
#include "vpx/vpx_integer.h"
+#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_enums.h"
struct macroblockd;
diff --git a/vp9/encoder/vp9_block.h b/vp9/encoder/vp9_block.h
index 767bd7f..2cb85e6 100644
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -13,8 +13,6 @@
#include "vp9/common/vp9_entropymv.h"
#include "vp9/common/vp9_entropy.h"
-#include "vpx_ports/mem.h"
-#include "vp9/common/vp9_onyxc_int.h"
#ifdef __cplusplus
extern "C" {
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index be7c18e..cf1ebd5 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -2985,6 +2985,13 @@
if (x->pred_mv_sad[ALTREF_FRAME] > (x->pred_mv_sad[GOLDEN_FRAME] << 1))
mode_skip_mask[ALTREF_FRAME] |= INTER_ALL;
+ if (cpi->sf.adaptive_mode_search) {
+ if (cm->show_frame && !cpi->rc.is_src_frame_alt_ref &&
+ cpi->rc.frames_since_golden >= 3)
+ if (x->pred_mv_sad[GOLDEN_FRAME] > (x->pred_mv_sad[LAST_FRAME] << 1))
+ mode_skip_mask[GOLDEN_FRAME] |= INTER_ALL;
+ }
+
if (bsize > cpi->sf.max_intra_bsize) {
ref_frame_skip_mask[0] |= (1 << INTRA_FRAME);
ref_frame_skip_mask[1] |= (1 << INTRA_FRAME);
diff --git a/vpx/vpx_integer.h b/vpx/vpx_integer.h
index 8eee303..500f9b9 100644
--- a/vpx/vpx_integer.h
+++ b/vpx/vpx_integer.h
@@ -49,9 +49,15 @@
/* Most platforms have the C99 standard integer types. */
-#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
-#define __STDC_FORMAT_MACROS
-#endif
+#if defined(__cplusplus)
+# if !defined(__STDC_FORMAT_MACROS)
+# define __STDC_FORMAT_MACROS
+# endif
+# if !defined(__STDC_LIMIT_MACROS)
+# define __STDC_LIMIT_MACROS
+# endif
+#endif // __cplusplus
+
#include <stdint.h>
#endif
@@ -63,15 +69,4 @@
#include <inttypes.h>
#endif
-// Note:
-// tran_low_t is the datatype used for final transform coefficients.
-// tran_high_t is the datatype used for intermediate transform stages.
-#if CONFIG_VP9_HIGHBITDEPTH && CONFIG_VP9
-typedef int64_t tran_high_t;
-typedef int32_t tran_low_t;
-#else
-typedef int32_t tran_high_t;
-typedef int16_t tran_low_t;
-#endif
-
#endif // VPX_VPX_INTEGER_H_