Commit 7c514e2d authored by Yaowu Xu's avatar Yaowu Xu

Merged branch 'master' into nextgenv2

Resolved Conflicts in the following files:
        configure
        vp10/common/idct.c
        vp10/encoder/dct.c
        vp10/encoder/encodemb.c
        vp10/encoder/rdopt.c

Change-Id: I4cb3986b0b80de65c722ca29d53a0a57f5a94316
parent 07154b02
...@@ -73,6 +73,7 @@ Build options: ...@@ -73,6 +73,7 @@ Build options:
--target=TARGET target platform tuple [generic-gnu] --target=TARGET target platform tuple [generic-gnu]
--cpu=CPU optimize for a specific cpu rather than a family --cpu=CPU optimize for a specific cpu rather than a family
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS] --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
--extra-cxxflags=ECXXFLAGS add ECXXFLAGS to CXXFLAGS [$CXXFLAGS]
${toggle_extra_warnings} emit harmless warnings (always non-fatal) ${toggle_extra_warnings} emit harmless warnings (always non-fatal)
${toggle_werror} treat warnings as errors, if possible ${toggle_werror} treat warnings as errors, if possible
(not available with all compilers) (not available with all compilers)
...@@ -200,6 +201,10 @@ disabled(){ ...@@ -200,6 +201,10 @@ disabled(){
eval test "x\$$1" = "xno" eval test "x\$$1" = "xno"
} }
# Iterates through positional parameters, checks to confirm the parameter has
# not been explicitly (force) disabled, and enables the setting controlled by
# the parameter when the setting is not disabled.
# Note: Does NOT alter RTCD generation options ($RTCD_OPTIONS).
soft_enable() { soft_enable() {
for var in $*; do for var in $*; do
if ! disabled $var; then if ! disabled $var; then
...@@ -209,6 +214,10 @@ soft_enable() { ...@@ -209,6 +214,10 @@ soft_enable() {
done done
} }
# Iterates through positional parameters, checks to confirm the parameter has
# not been explicitly (force) enabled, and disables the setting controlled by
# the parameter when the setting is not enabled.
# Note: Does NOT alter RTCD generation options ($RTCD_OPTIONS).
soft_disable() { soft_disable() {
for var in $*; do for var in $*; do
if ! enabled $var; then if ! enabled $var; then
...@@ -337,6 +346,10 @@ check_add_cflags() { ...@@ -337,6 +346,10 @@ check_add_cflags() {
check_cflags "$@" && add_cflags_only "$@" check_cflags "$@" && add_cflags_only "$@"
} }
check_add_cxxflags() {
check_cxxflags "$@" && add_cxxflags_only "$@"
}
check_add_asflags() { check_add_asflags() {
log add_asflags "$@" log add_asflags "$@"
add_asflags "$@" add_asflags "$@"
...@@ -503,6 +516,9 @@ process_common_cmdline() { ...@@ -503,6 +516,9 @@ process_common_cmdline() {
--extra-cflags=*) --extra-cflags=*)
extra_cflags="${optval}" extra_cflags="${optval}"
;; ;;
--extra-cxxflags=*)
extra_cxxflags="${optval}"
;;
--enable-?*|--disable-?*) --enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
...@@ -617,6 +633,11 @@ show_darwin_sdk_path() { ...@@ -617,6 +633,11 @@ show_darwin_sdk_path() {
xcodebuild -sdk $1 -version Path 2>/dev/null xcodebuild -sdk $1 -version Path 2>/dev/null
} }
# Print the major version number of the Darwin SDK specified by $1.
show_darwin_sdk_major_version() {
xcrun --sdk $1 --show-sdk-version 2>/dev/null | cut -d. -f1
}
process_common_toolchain() { process_common_toolchain() {
if [ -z "$toolchain" ]; then if [ -z "$toolchain" ]; then
gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}" gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
...@@ -728,7 +749,15 @@ process_common_toolchain() { ...@@ -728,7 +749,15 @@ process_common_toolchain() {
# Handle darwin variants. Newer SDKs allow targeting older # Handle darwin variants. Newer SDKs allow targeting older
# platforms, so use the newest one available. # platforms, so use the newest one available.
case ${toolchain} in case ${toolchain} in
*-darwin*) arm*-darwin*)
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
if [ -d "${iphoneos_sdk_dir}" ]; then
add_cflags "-isysroot ${iphoneos_sdk_dir}"
add_ldflags "-isysroot ${iphoneos_sdk_dir}"
fi
;;
x86*-darwin*)
osx_sdk_dir="$(show_darwin_sdk_path macosx)" osx_sdk_dir="$(show_darwin_sdk_path macosx)"
if [ -d "${osx_sdk_dir}" ]; then if [ -d "${osx_sdk_dir}" ]; then
add_cflags "-isysroot ${osx_sdk_dir}" add_cflags "-isysroot ${osx_sdk_dir}"
...@@ -803,10 +832,36 @@ process_common_toolchain() { ...@@ -803,10 +832,36 @@ process_common_toolchain() {
if disabled neon && enabled neon_asm; then if disabled neon && enabled neon_asm; then
die "Disabling neon while keeping neon-asm is not supported" die "Disabling neon while keeping neon-asm is not supported"
fi fi
soft_enable media case ${toolchain} in
# Apple iOS SDKs no longer support armv6 as of the version 9
# release (coincides with release of Xcode 7). Only enable media
# when using earlier SDK releases.
*-darwin*)
if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
soft_enable media
else
soft_disable media
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-media "
fi
;;
*)
soft_enable media
;;
esac
;; ;;
armv6) armv6)
soft_enable media case ${toolchain} in
*-darwin*)
if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
soft_enable media
else
die "Your iOS SDK does not support armv6."
fi
;;
*)
soft_enable media
;;
esac
;; ;;
esac esac
...@@ -989,6 +1044,12 @@ EOF ...@@ -989,6 +1044,12 @@ EOF
done done
asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl" asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl"
if [ "$(show_darwin_sdk_major_version iphoneos)" -gt 8 ]; then
check_add_cflags -fembed-bitcode
check_add_asflags -fembed-bitcode
check_add_ldflags -fembed-bitcode
fi
;; ;;
linux*) linux*)
...@@ -1159,7 +1220,8 @@ EOF ...@@ -1159,7 +1220,8 @@ EOF
&& AS="" && AS=""
fi fi
[ "${AS}" = auto ] || [ -z "${AS}" ] \ [ "${AS}" = auto ] || [ -z "${AS}" ] \
&& die "Neither yasm nor nasm have been found" && die "Neither yasm nor nasm have been found." \
"See the prerequisites section in the README for more info."
;; ;;
esac esac
log_echo " using $AS" log_echo " using $AS"
...@@ -1198,6 +1260,13 @@ EOF ...@@ -1198,6 +1260,13 @@ EOF
enabled x86 && sim_arch="-arch i386" || sim_arch="-arch x86_64" enabled x86 && sim_arch="-arch i386" || sim_arch="-arch x86_64"
add_cflags ${sim_arch} add_cflags ${sim_arch}
add_ldflags ${sim_arch} add_ldflags ${sim_arch}
if [ "$(show_darwin_sdk_major_version iphonesimulator)" -gt 8 ]; then
# yasm v1.3.0 doesn't know what -fembed-bitcode means, so turning it
# on is pointless (unless building a C-only lib). Warn the user, but
# do nothing here.
log "Warning: Bitcode embed disabled for simulator targets."
fi
;; ;;
os2) os2)
add_asflags -f aout add_asflags -f aout
......
...@@ -41,13 +41,22 @@ TARGETS="arm64-darwin-gcc ...@@ -41,13 +41,22 @@ TARGETS="arm64-darwin-gcc
build_target() { build_target() {
local target="$1" local target="$1"
local old_pwd="$(pwd)" local old_pwd="$(pwd)"
local target_specific_flags=""
vlog "***Building target: ${target}***" vlog "***Building target: ${target}***"
case "${target}" in
x86-*)
target_specific_flags="--enable-pic"
vlog "Enabled PIC for ${target}"
;;
esac
mkdir "${target}" mkdir "${target}"
cd "${target}" cd "${target}"
eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \ eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \
${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${devnull} ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${target_specific_flags} \
${devnull}
export DIST_DIR export DIST_DIR
eval make -j ${MAKE_JOBS} dist ${devnull} eval make -j ${MAKE_JOBS} dist ${devnull}
cd "${old_pwd}" cd "${old_pwd}"
...@@ -199,6 +208,8 @@ cat << EOF ...@@ -199,6 +208,8 @@ cat << EOF
--show-build-output: Show output from each library build. --show-build-output: Show output from each library build.
--targets <targets>: Override default target list. Defaults: --targets <targets>: Override default target list. Defaults:
${TARGETS} ${TARGETS}
--test-link: Confirms all targets can be linked. Functionally identical to
passing --enable-examples via --extra-configure-args.
--verbose: Output information about the environment and each stage of the --verbose: Output information about the environment and each stage of the
build. build.
EOF EOF
...@@ -237,6 +248,9 @@ while [ -n "$1" ]; do ...@@ -237,6 +248,9 @@ while [ -n "$1" ]; do
--show-build-output) --show-build-output)
devnull= devnull=
;; ;;
--test-link)
EXTRA_CONFIGURE_ARGS="${EXTRA_CONFIGURE_ARGS} --enable-examples"
;;
--targets) --targets)
TARGETS="$2" TARGETS="$2"
shift shift
......
...@@ -724,6 +724,10 @@ EOF ...@@ -724,6 +724,10 @@ EOF
check_add_cflags ${extra_cflags} || \ check_add_cflags ${extra_cflags} || \
die "Requested extra CFLAGS '${extra_cflags}' not supported by compiler" die "Requested extra CFLAGS '${extra_cflags}' not supported by compiler"
fi fi
if [ -n "${extra_cxxflags}" ]; then
check_add_cxxflags ${extra_cxxflags} || \
die "Requested extra CXXFLAGS '${extra_cxxflags}' not supported by compiler"
fi
} }
......
...@@ -544,6 +544,59 @@ vpx_codec_err_t parse_superframe_index(const uint8_t *data, ...@@ -544,6 +544,59 @@ vpx_codec_err_t parse_superframe_index(const uint8_t *data,
} }
#endif #endif
// Example pattern for spatial layers and 2 temporal layers used in the
// bypass/flexible mode. The pattern corresponds to the pattern
// VP9E_TEMPORAL_LAYERING_MODE_0101 (temporal_layering_mode == 2) used in
// non-flexible mode.
void set_frame_flags_bypass_mode(int sl, int tl, int num_spatial_layers,
int is_key_frame,
vpx_svc_ref_frame_config_t *ref_frame_config) {
for (sl = 0; sl < num_spatial_layers; ++sl) {
if (!tl) {
if (!sl) {
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
} else {
if (is_key_frame) {
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_LAST |
VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
} else {
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
}
}
} else if (tl == 1) {
if (!sl) {
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_GF;
} else {
ref_frame_config->frame_flags[sl] = VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_GF;
}
}
if (tl == 0) {
ref_frame_config->lst_fb_idx[sl] = sl;
if (sl)
ref_frame_config->gld_fb_idx[sl] = sl - 1;
else
ref_frame_config->gld_fb_idx[sl] = 0;
ref_frame_config->alt_fb_idx[sl] = 0;
} else if (tl == 1) {
ref_frame_config->lst_fb_idx[sl] = sl;
ref_frame_config->gld_fb_idx[sl] = num_spatial_layers + sl - 1;
ref_frame_config->alt_fb_idx[sl] = num_spatial_layers + sl;
}
}
}
int main(int argc, const char **argv) { int main(int argc, const char **argv) {
AppInput app_input = {0}; AppInput app_input = {0};
VpxVideoWriter *writer = NULL; VpxVideoWriter *writer = NULL;
...@@ -564,6 +617,7 @@ int main(int argc, const char **argv) { ...@@ -564,6 +617,7 @@ int main(int argc, const char **argv) {
VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = {NULL}; VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = {NULL};
struct RateControlStats rc; struct RateControlStats rc;
vpx_svc_layer_id_t layer_id; vpx_svc_layer_id_t layer_id;
vpx_svc_ref_frame_config_t ref_frame_config;
int sl, tl; int sl, tl;
double sum_bitrate = 0.0; double sum_bitrate = 0.0;
double sum_bitrate2 = 0.0; double sum_bitrate2 = 0.0;
...@@ -653,6 +707,30 @@ int main(int argc, const char **argv) { ...@@ -653,6 +707,30 @@ int main(int argc, const char **argv) {
end_of_stream = 1; end_of_stream = 1;
} }
// For BYPASS/FLEXIBLE mode, set the frame flags (reference and updates)
// and the buffer indices for each spatial layer of the current
// (super)frame to be encoded. The temporal layer_id for the current frame
// also needs to be set.
// TODO(marpan): Should rename the "VP9E_TEMPORAL_LAYERING_MODE_BYPASS"
// mode to "VP9E_LAYERING_MODE_BYPASS".
if (svc_ctx.temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
// Example for 2 temporal layers.
if (frame_cnt % 2 == 0)
layer_id.temporal_layer_id = 0;
else
layer_id.temporal_layer_id = 1;
// Note that we only set the temporal layer_id, since we are calling
// the encode for the whole superframe. The encoder will internally loop
// over all the spatial layers for the current superframe.
vpx_codec_control(&codec, VP9E_SET_SVC_LAYER_ID, &layer_id);
set_frame_flags_bypass_mode(sl, layer_id.temporal_layer_id,
svc_ctx.spatial_layers,
frame_cnt == 0,
&ref_frame_config);
vpx_codec_control(&codec, VP9E_SET_SVC_REF_FRAME_CONFIG,
&ref_frame_config);
}
vpx_usec_timer_start(&timer); vpx_usec_timer_start(&timer);
res = vpx_svc_encode(&svc_ctx, &codec, (end_of_stream ? NULL : &raw), res = vpx_svc_encode(&svc_ctx, &codec, (end_of_stream ? NULL : &raw),
pts, frame_duration, svc_ctx.speed >= 5 ? pts, frame_duration, svc_ctx.speed >= 5 ?
......
...@@ -124,6 +124,11 @@ class Encoder { ...@@ -124,6 +124,11 @@ class Encoder {
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
} }
void Control(int ctrl_id, int *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
void Control(int ctrl_id, struct vpx_scaling_mode *arg) { void Control(int ctrl_id, struct vpx_scaling_mode *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg); const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
......
...@@ -196,13 +196,27 @@ class ResizeInternalTest : public ResizeTest { ...@@ -196,13 +196,27 @@ class ResizeInternalTest : public ResizeTest {
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video, virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) { libvpx_test::Encoder *encoder) {
if (video->frame() == kStepDownFrame) { if (change_config_) {
struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE}; int new_q = 60;
encoder->Control(VP8E_SET_SCALEMODE, &mode); if (video->frame() == 0) {
} struct vpx_scaling_mode mode = {VP8E_ONETWO, VP8E_ONETWO};
if (video->frame() == kStepUpFrame) { encoder->Control(VP8E_SET_SCALEMODE, &mode);
struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL}; }
encoder->Control(VP8E_SET_SCALEMODE, &mode); if (video->frame() == 1) {
struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};
encoder->Control(VP8E_SET_SCALEMODE, &mode);
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = new_q;
encoder->Config(&cfg_);
}
} else {
if (video->frame() == kStepDownFrame) {
struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE};
encoder->Control(VP8E_SET_SCALEMODE, &mode);
}
if (video->frame() == kStepUpFrame) {
struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};
encoder->Control(VP8E_SET_SCALEMODE, &mode);
}
} }
} }
...@@ -227,6 +241,7 @@ class ResizeInternalTest : public ResizeTest { ...@@ -227,6 +241,7 @@ class ResizeInternalTest : public ResizeTest {
#endif #endif
double frame0_psnr_; double frame0_psnr_;
bool change_config_;
#if WRITE_COMPRESSED_STREAM #if WRITE_COMPRESSED_STREAM
FILE *outfile_; FILE *outfile_;
unsigned int out_frames_; unsigned int out_frames_;
...@@ -237,6 +252,7 @@ TEST_P(ResizeInternalTest, TestInternalResizeWorks) { ...@@ -237,6 +252,7 @@ TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 10); 30, 1, 0, 10);
init_flags_ = VPX_CODEC_USE_PSNR; init_flags_ = VPX_CODEC_USE_PSNR;
change_config_ = false;
// q picked such that initial keyframe on this clip is ~30dB PSNR // q picked such that initial keyframe on this clip is ~30dB PSNR
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48; cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48;
...@@ -261,6 +277,15 @@ TEST_P(ResizeInternalTest, TestInternalResizeWorks) { ...@@ -261,6 +277,15 @@ TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
} }
} }
TEST_P(ResizeInternalTest, TestInternalResizeChangeConfig) {
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 10);
cfg_.g_w = 352;
cfg_.g_h = 288;
change_config_ = true;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
class ResizeInternalRealtimeTest : public ::libvpx_test::EncoderTest, class ResizeInternalRealtimeTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> { public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected: protected:
......
...@@ -107,6 +107,5 @@ INSTANTIATE_TEST_CASE_P( ...@@ -107,6 +107,5 @@ INSTANTIATE_TEST_CASE_P(
::testing::Values( ::testing::Values(
FdctParam(&fdct4, &reference_dct_1d, 4, 1), FdctParam(&fdct4, &reference_dct_1d, 4, 1),
FdctParam(&fdct8, &reference_dct_1d, 8, 1), FdctParam(&fdct8, &reference_dct_1d, 8, 1),
FdctParam(&fdct16, &reference_dct_1d, 16, 2), FdctParam(&fdct16, &reference_dct_1d, 16, 2)));
FdctParam(&fdct32, &reference_dct_1d, 32, 4)));
} // namespace } // namespace
...@@ -203,7 +203,7 @@ TEST_P(Vp10PartialIDctTest, RunQuantCheck) { ...@@ -203,7 +203,7 @@ TEST_P(Vp10PartialIDctTest, RunQuantCheck) {
// quantization with maximum allowed step sizes // quantization with maximum allowed step sizes
test_coef_block1[0] = (output_ref_block[0] / 1336) * 1336; test_coef_block1[0] = (output_ref_block[0] / 1336) * 1336;
for (int j = 1; j < last_nonzero_; ++j) for (int j = 1; j < last_nonzero_; ++j)
test_coef_block1[vp10_default_scan_orders[tx_size_].scan[j]] test_coef_block1[get_scan(tx_size_, DCT_DCT, 0)->scan[j]]
= (output_ref_block[j] / 1828) * 1828; = (output_ref_block[j] / 1828) * 1828;
} }
...@@ -265,7 +265,7 @@ TEST_P(Vp10PartialIDctTest, ResultsMatch) { ...@@ -265,7 +265,7 @@ TEST_P(Vp10PartialIDctTest, ResultsMatch) {
max_energy_leftover = 0; max_energy_leftover = 0;
coef = 0; coef = 0;
} }
test_coef_block1[vp10_default_scan_orders[tx_size_].scan[j]] = coef; test_coef_block1[get_scan(tx_size_, DCT_DCT, 0)->scan[j]] = coef;
} }
memcpy(test_coef_block2, test_coef_block1, memcpy(test_coef_block2, test_coef_block1,
......
...@@ -230,9 +230,23 @@ VP9_INSTANTIATE_TEST_CASE( ...@@ -230,9 +230,23 @@ VP9_INSTANTIATE_TEST_CASE(
::testing::ValuesIn(kEncodeVectors), ::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kMinArfVectors)); ::testing::ValuesIn(kMinArfVectors));
#if CONFIG_VP9_HIGHBITDEPTH
# if CONFIG_VP10_ENCODER
// TODO(angiebird): 25-29 fail in high bitdepth mode.
INSTANTIATE_TEST_CASE_P(
DISABLED_VP10, ArfFreqTest,
::testing::Combine(
::testing::Values(static_cast<const libvpx_test::CodecFactory *>(
&libvpx_test::kVP10)),
::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kMinArfVectors)));
# endif // CONFIG_VP10_ENCODER
#else
VP10_INSTANTIATE_TEST_CASE( VP10_INSTANTIATE_TEST_CASE(
ArfFreqTest, ArfFreqTest,
::testing::ValuesIn(kTestVectors), ::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kEncodeVectors), ::testing::ValuesIn(kEncodeVectors),
::testing::ValuesIn(kMinArfVectors)); ::testing::ValuesIn(kMinArfVectors));
#endif // CONFIG_VP9_HIGHBITDEPTH
} // namespace } // namespace
...@@ -42,6 +42,7 @@ struct EncodeParameters { ...@@ -42,6 +42,7 @@ struct EncodeParameters {
int32_t frame_parallel; int32_t frame_parallel;
int32_t color_range; int32_t color_range;
vpx_color_space_t cs; vpx_color_space_t cs;
int render_size[2];
// TODO(JBB): quantizers / bitrate // TODO(JBB): quantizers / bitrate
}; };
...@@ -49,7 +50,7 @@ const EncodeParameters kVP9EncodeParameterSet[] = { ...@@ -49,7 +50,7 @@ const EncodeParameters kVP9EncodeParameterSet[] = {
{0, 0, 0, 1, 0, 0, VPX_CS_BT_601}, {0, 0, 0, 1, 0, 0, VPX_CS_BT_601},
{0, 0, 0, 0, 0, 1, VPX_CS_BT_709}, {0, 0, 0, 0, 0, 1, VPX_CS_BT_709},
{0, 0, 1, 0, 0, 1, VPX_CS_BT_2020}, {0, 0, 1, 0, 0, 1, VPX_CS_BT_2020},
{0, 2, 0, 0, 1, 0, VPX_CS_UNKNOWN}, {0, 2, 0, 0, 1, 0, VPX_CS_UNKNOWN, { 640, 480 }},
// TODO(JBB): Test profiles (requires more work). // TODO(JBB): Test profiles (requires more work).
}; };
...@@ -88,6 +89,8 @@ class VpxEncoderParmsGetToDecoder ...@@ -88,6 +89,8 @@ class VpxEncoderParmsGetToDecoder
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7); encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
encoder->Control(VP8E_SET_ARNR_STRENGTH, 5); encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
encoder->Control(VP8E_SET_ARNR_TYPE, 3); encoder->Control(VP8E_SET_ARNR_TYPE, 3);
if (encode_parms.render_size[0] > 0 && encode_parms.render_size[1] > 0)
encoder->Control(VP9E_SET_RENDER_SIZE, encode_parms.render_size);
} }
} }
...@@ -118,6 +121,10 @@ class VpxEncoderParmsGetToDecoder ...@@ -118,6 +121,10 @@ class VpxEncoderParmsGetToDecoder
} }
EXPECT_EQ(encode_parms.color_range, common->color_range); EXPECT_EQ(encode_parms.color_range, common->color_range);
EXPECT_EQ(encode_parms.cs, common->color_space); EXPECT_EQ(encode_parms.cs, common->color_space);
if (encode_parms.render_size[0] > 0 && encode_parms.render_size[1] > 0) {
EXPECT_EQ(encode_parms.render_size[0], common->render_width);
EXPECT_EQ(encode_parms.render_size[1], common->render_height);
}
EXPECT_EQ(encode_parms.tile_cols, common->log2_tile_cols); EXPECT_EQ(encode_parms.tile_cols, common->log2_tile_cols);
EXPECT_EQ(encode_parms.tile_rows, common->log2_tile_rows); EXPECT_EQ(encode_parms.tile_rows, common->log2_tile_rows);
......
...@@ -187,9 +187,23 @@ VP9_INSTANTIATE_TEST_CASE( ...@@ -187,9 +187,23 @@ VP9_INSTANTIATE_TEST_CASE(
::testing::ValuesIn(kTestVectors), ::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kCpuUsedVectors)); ::testing::ValuesIn(kCpuUsedVectors));
#if CONFIG_VP9_HIGHBITDEPTH
# if CONFIG_VP10_ENCODER
// TODO(angiebird): many fail in high bitdepth mode.
INSTANTIATE_TEST_CASE_P(
DISABLED_VP10, EndToEndTestLarge,
::testing::Combine(
::testing::Values(static_cast<const libvpx_test::CodecFactory *>(
&libvpx_test::kVP10)),
::testing::ValuesIn(kEncodingModeVectors),
::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kCpuUsedVectors)));
# endif // CONFIG_VP10_ENCODER
#else
VP10_INSTANTIATE_TEST_CASE( VP10_INSTANTIATE_TEST_CASE(
EndToEndTestLarge, EndToEndTestLarge,
::testing::ValuesIn(kEncodingModeVectors), ::testing::ValuesIn(kEncodingModeVectors),
::testing::ValuesIn(kTestVectors), ::testing::ValuesIn(kTestVectors),
::testing::ValuesIn(kCpuUsedVectors)); ::testing::ValuesIn(kCpuUsedVectors));
#endif // CONFIG_VP9_HIGHBITDEPTH
} // namespace } // namespace
...@@ -447,20 +447,21 @@ void vp10_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride, ...@@ -447,20 +447,21 @@ void vp10_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride,
vpx_idct32x32_1024_add(input, dest, stride); vpx_idct32x32_1024_add(input, dest, stride);
} }
void vp10_inv_txfm_add_4x4( void vp10_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
const tran_low_t *input, uint8_t *dest, int stride, int eob, TX_TYPE tx_type, int lossless) {
int stride, int eob, TX_TYPE tx_type, if (lossless) {
void (*itxm_add_4x4)(const tran_low_t *input, assert(tx_type == DCT_DCT);
uint8_t *dest, int stride, int eob)) { vp10_iwht4x4_add(input, dest, stride, eob);
switch (tx_type) { } else {
case DCT_DCT: switch (tx_type) {
itxm_add_4x4(input, dest, stride, eob); case DCT_DCT:
break; vp10_idct4x4_add(input, dest, stride, eob);
case ADST_DCT: break;
case DCT_ADST: case ADST_DCT:
case ADST_ADST: case DCT_ADST:
vp10_iht4x4_16_add(input, dest, stride, tx_type); case ADST_ADST:
break; vp10_iht4x4_16_add(input, dest, stride, tx_type);
break;
#if CONFIG_EXT_TX #if CONFIG_EXT_TX
case FLIPADST_DCT: case FLIPADST_DCT:
flipud(dest, stride, 4); flipud(dest, stride, 4);
...@@ -506,9 +507,10 @@ void vp10_inv_txfm_add_4x4( ...@@ -506,9 +507,10 @@ void vp10_inv_txfm_add_4x4(
fliplr(dest, stride, 4); fliplr(dest, stride, 4);
break; break;
#endif // CONFIG_EXT_TX #endif // CONFIG_EXT_TX
default: default:
assert(0); assert(0);
break; break;
}
} }
}