Compare commits
163 Commits
sandbox/jk
...
eider
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dae3ca262 | ||
|
|
1a23086bc6 | ||
|
|
363a67c601 | ||
|
|
5205d299bb | ||
|
|
2926571be6 | ||
|
|
e343988f9d | ||
|
|
cab6ac16e0 | ||
|
|
b073e3cdd4 | ||
|
|
dd6134b472 | ||
|
|
fc2fc899ae | ||
|
|
f78e5a04e6 | ||
|
|
5715c39cf8 | ||
|
|
4890853010 | ||
|
|
cf0970157d | ||
|
|
297dc90255 | ||
|
|
499510f2be | ||
|
|
2d6cb342c2 | ||
|
|
c8f4c187b3 | ||
|
|
14d827f44e | ||
|
|
22f56b93e5 | ||
|
|
3e32105d63 | ||
|
|
2bf8fb5889 | ||
|
|
f039a85fd8 | ||
|
|
9f9cc8fe71 | ||
|
|
d8216b19b6 | ||
|
|
d46ddd0839 | ||
|
|
8b1a14d12f | ||
|
|
e50c842755 | ||
|
|
22ae1403e9 | ||
|
|
14c9fce8e4 | ||
|
|
f2a6799cc9 | ||
|
|
e918ed98d4 | ||
|
|
e5cef5d5a6 | ||
|
|
faed00d844 | ||
|
|
101c2bd1fa | ||
|
|
60b36abf85 | ||
|
|
061a16d96e | ||
|
|
1b27e93cd1 | ||
|
|
3939e85b26 | ||
|
|
dba053898a | ||
|
|
504601bb14 | ||
|
|
a7eea3e267 | ||
|
|
d72c536ede | ||
|
|
8e858f90f3 | ||
|
|
c311b3b3a9 | ||
|
|
21173e1999 | ||
|
|
b5b61c179d | ||
|
|
0c261715b0 | ||
|
|
3c5ed6f52e | ||
|
|
6dc21bce63 | ||
|
|
87b12ac875 | ||
|
|
72b7db36f3 | ||
|
|
e0a80519c7 | ||
|
|
46da1cae05 | ||
|
|
e4dc2b9248 | ||
|
|
6b33ca395f | ||
|
|
9aa58f3fcb | ||
|
|
d9ca52452b | ||
|
|
8106df8f5a | ||
|
|
c459d37c26 | ||
|
|
811d0ff209 | ||
|
|
21ac3c8f26 | ||
|
|
4ed05a8bb1 | ||
|
|
00794a93ec | ||
|
|
8b15cf6929 | ||
|
|
3df4436e1a | ||
|
|
a46ec16569 | ||
|
|
3f8349467a | ||
|
|
31322c5faa | ||
|
|
a337725625 | ||
|
|
b3151c80fc | ||
|
|
0799cccce3 | ||
|
|
c88fc5b2f9 | ||
|
|
cb265a497d | ||
|
|
ccea000c4b | ||
|
|
403966ae00 | ||
|
|
bf2c903000 | ||
|
|
85ef83a173 | ||
|
|
1991123054 | ||
|
|
9e9f5f3d70 | ||
|
|
06dc2f6166 | ||
|
|
66ba79f5fb | ||
|
|
fd9df44a05 | ||
|
|
3c021e1d79 | ||
|
|
451ab0c01e | ||
|
|
bcee56bed5 | ||
|
|
921ffdd2c9 | ||
|
|
9ed1b2f09e | ||
|
|
6a819ce4fe | ||
|
|
56e8485c84 | ||
|
|
a05bf133ae | ||
|
|
e68953b7c8 | ||
|
|
9aa2bd8a03 | ||
|
|
6b7cf3077d | ||
|
|
eb0c5a6ffc | ||
|
|
422f97d7ab | ||
|
|
7af4eb014b | ||
|
|
20cd3e6b8f | ||
|
|
6b66c01c88 | ||
|
|
9c41143d66 | ||
|
|
e9cacfd66d | ||
|
|
301409107f | ||
|
|
ddf94f6184 | ||
|
|
c21f53a501 | ||
|
|
7a1590713e | ||
|
|
9ed874713f | ||
|
|
676610d2a8 | ||
|
|
fd903902ef | ||
|
|
154b4b4196 | ||
|
|
953c6a011e | ||
|
|
e50f96a4a3 | ||
|
|
5d88a82aa0 | ||
|
|
cbcfbe1b29 | ||
|
|
888699091d | ||
|
|
87c40b35eb | ||
|
|
a60461a340 | ||
|
|
f0f609c2e2 | ||
|
|
91b5c98b3d | ||
|
|
8d07a97acc | ||
|
|
6d84322762 | ||
|
|
c34d91a84e | ||
|
|
aabae97e57 | ||
|
|
52cf4dcaea | ||
|
|
b8fa2839a2 | ||
|
|
2578b767c3 | ||
|
|
ce328b855f | ||
|
|
aab70f4d7a | ||
|
|
bcba86e2e9 | ||
|
|
9a4052a4ec | ||
|
|
b1bfd0ba87 | ||
|
|
019384f2d3 | ||
|
|
e2c6b05f9a | ||
|
|
61c5e31ca1 | ||
|
|
ad1216151d | ||
|
|
02a31e6b3c | ||
|
|
84be08b07f | ||
|
|
313bfbb6a2 | ||
|
|
2089f26b08 | ||
|
|
507ee87e3e | ||
|
|
f2bd11faa4 | ||
|
|
0c1cec2205 | ||
|
|
dadc9189ed | ||
|
|
f05feab7b9 | ||
|
|
02360dd2c2 | ||
|
|
b0a12a2880 | ||
|
|
b5ce9456db | ||
|
|
e6047a17a9 | ||
|
|
f93b1e7be1 | ||
|
|
04b9e0d787 | ||
|
|
ce42e79abc | ||
|
|
565d0e6feb | ||
|
|
6b151d436d | ||
|
|
5f0b303c28 | ||
|
|
3653fb473a | ||
|
|
e8223bd250 | ||
|
|
7989bb7fe7 | ||
|
|
6776bd62b5 | ||
|
|
a5879f7c81 | ||
|
|
12ee845ee7 | ||
|
|
d02e74a073 | ||
|
|
78071b3b97 | ||
|
|
8144132866 | ||
|
|
768ae275dc |
1
.mailmap
1
.mailmap
@@ -5,3 +5,4 @@ Tom Finegan <tomfinegan@google.com>
|
||||
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
|
||||
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
|
||||
Alpha Lam <hclam@google.com> <hclam@chromium.org>
|
||||
Deb Mukherjee <debargha@google.com>
|
||||
|
||||
4
AUTHORS
4
AUTHORS
@@ -31,9 +31,11 @@ John Koleszar <jkoleszar@google.com>
|
||||
Joshua Bleecher Snyder <josh@treelinelabs.com>
|
||||
Justin Clift <justin@salasaga.org>
|
||||
Justin Lebar <justin.lebar@gmail.com>
|
||||
KO Myung-Hun <komh@chollian.net>
|
||||
Lou Quillio <louquillio@google.com>
|
||||
Luca Barbato <lu_zero@gentoo.org>
|
||||
Makoto Kato <makoto.kt@gmail.com>
|
||||
Marco Paniconi <marpan@google.com>
|
||||
Martin Ettl <ettl.martin78@googlemail.com>
|
||||
Michael Kohler <michaelkohler@live.com>
|
||||
Mike Hommey <mhommey@mozilla.com>
|
||||
@@ -43,6 +45,7 @@ Patrik Westin <patrik.westin@gmail.com>
|
||||
Paul Wilkins <paulwilkins@google.com>
|
||||
Pavol Rusnak <stick@gk2.sk>
|
||||
Philip Jägenstedt <philipj@opera.com>
|
||||
Priit Laes <plaes@plaes.org>
|
||||
Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
|
||||
Rafaël Carré <funman@videolan.org>
|
||||
Ralph Giles <giles@xiph.org>
|
||||
@@ -50,6 +53,7 @@ Ronald S. Bultje <rbultje@google.com>
|
||||
Scott LaVarnway <slavarnway@google.com>
|
||||
Stefan Holmer <holmer@google.com>
|
||||
Taekhyun Kim <takim@nvidia.com>
|
||||
Takanori MATSUURA <t.matsuu@gmail.com>
|
||||
Tero Rintaluoma <teror@google.com>
|
||||
Thijs Vermeir <thijsvermeir@gmail.com>
|
||||
Timothy B. Terriberry <tterribe@xiph.org>
|
||||
|
||||
92
CHANGELOG
92
CHANGELOG
@@ -1,3 +1,95 @@
|
||||
2012-05-09 v1.1.0 "Eider"
|
||||
This introduces a number of enhancements, mostly focused on real-time
|
||||
encoding. In addition, it fixes a decoder bug (first introduced in
|
||||
Duclair) so all users of that release are encouraged to upgrade.
|
||||
|
||||
- Upgrading:
|
||||
This release is ABI and API compatible with Duclair (v1.0.0). Users
|
||||
of older releases should refer to the Upgrading notes in this
|
||||
document for that release.
|
||||
|
||||
This release introduces a new temporal denoiser, controlled by the
|
||||
VP8E_SET_NOISE_SENSITIVITY control. The temporal denoiser does not
|
||||
currently take a strength parameter, so the control is effectively
|
||||
a boolean - zero (off) or non-zero (on). For compatibility with
|
||||
existing applications, the values accepted are the same as those
|
||||
for the spatial denoiser (0-6). The temporal denoiser is enabled
|
||||
by default, and the older spatial denoiser may be restored by
|
||||
configuring with --disable-temporal-denoising. The temporal denoiser
|
||||
is more computationally intensive than the spatial one.
|
||||
|
||||
This release removes support for a legacy, decode only API that was
|
||||
supported, but deprecated, at the initial release of libvpx
|
||||
(v0.9.0). This is not expected to have any impact. If you are
|
||||
impacted, you can apply a reversion to commit 2bf8fb58 locally.
|
||||
Please update to the latest libvpx API if you are affected.
|
||||
|
||||
- Enhancements:
|
||||
Adds a motion compensated temporal denoiser to the encoder, which
|
||||
gives higher quality than the older spatial denoiser. (See above
|
||||
for notes on upgrading).
|
||||
|
||||
In addition, support for new compilers and platforms were added,
|
||||
including:
|
||||
improved support for XCode
|
||||
Android x86 NDK build
|
||||
OS/2 support
|
||||
SunCC support
|
||||
|
||||
Changing resolution with vpx_codec_enc_config_set() is now
|
||||
supported. Previously, reinitializing the codec was required to
|
||||
change the input resolution.
|
||||
|
||||
The vpxenc application has initial support for producing multiple
|
||||
encodes from the same input in one call. Resizing is not yet
|
||||
supported, but varying other codec parameters is. Use -- to
|
||||
delineate output streams. Options persist from one stream to the
|
||||
next.
|
||||
|
||||
Also, the vpxenc application will now use a keyframe interval of
|
||||
5 seconds by default. Use the --kf-max-dist option to override.
|
||||
|
||||
- Speed:
|
||||
Decoder performance improved 2.5% versus Duclair. Encoder speed is
|
||||
consistent with Duclair for most material. Two pass encoding of
|
||||
slideshow-like material will see significant improvements.
|
||||
|
||||
Large realtime encoding speed gains at a small quality expense are
|
||||
possible by configuring the on-the-fly bitpacking experiment with
|
||||
--enable-onthefly-bitpacking. Realtime encoder can be up to 13%
|
||||
faster (ARM) depending on the number of threads and bitrate
|
||||
settings. This technique sees constant gain over the 5-16 speed
|
||||
range. For VC style input the loss seen is up to 0.2dB. See commit
|
||||
52cf4dca for further details.
|
||||
|
||||
- Quality:
|
||||
On the whole, quality is consistent with the Duclair release. Some
|
||||
tweaks:
|
||||
|
||||
Reduced blockiness in easy sections by applying a penalty to
|
||||
intra modes.
|
||||
|
||||
Improved quality of static sections (like slideshows) with
|
||||
two pass encoding.
|
||||
|
||||
Improved keyframe sizing with multiple temporal layers
|
||||
|
||||
- Bug Fixes:
|
||||
Corrected alt-ref contribution to frame rate for visible updates
|
||||
to the alt-ref buffer. This affected applications making manual
|
||||
usage of the frame reference flags, or temporal layers.
|
||||
|
||||
Additional constraints were added to disable multi-frame quality
|
||||
enhancement (MFQE) in sections of the frame where there is motion.
|
||||
(#392)
|
||||
|
||||
Fixed corruption issues when vpx_codec_enc_config_set() was called
|
||||
with spatial resampling enabled.
|
||||
|
||||
Fixed a decoder error introduced in Duclair where the segmentation
|
||||
map was not being reinitialized on keyframes (#378)
|
||||
|
||||
|
||||
2012-01-27 v1.0.0 "Duclair"
|
||||
Our fourth named release, focused on performance and features related to
|
||||
real-time encoding. It also fixes a decoder crash bug introduced in
|
||||
|
||||
@@ -99,7 +99,7 @@ $$(eval $$(call ev-build-file))
|
||||
|
||||
$(1) : $$(_OBJ) $(2)
|
||||
@mkdir -p $$(dir $$@)
|
||||
@grep -w EQU $$< | tr -d '\#' | $(CONFIG_DIR)/$(ASM_CONVERSION) > $$@
|
||||
@grep $(OFFSET_PATTERN) $$< | tr -d '\#' | $(CONFIG_DIR)/$(ASM_CONVERSION) > $$@
|
||||
endef
|
||||
|
||||
# Use ads2gas script to convert from RVCT format to GAS format. This passes
|
||||
@@ -118,6 +118,9 @@ $(ASM_CNV_PATH)/libvpx/%.asm.s: $(LIBVPX_PATH)/%.asm $(ASM_CNV_OFFSETS_DEPEND)
|
||||
@mkdir -p $(dir $@)
|
||||
@$(CONFIG_DIR)/$(ASM_CONVERSION) <$< > $@
|
||||
|
||||
# For building vpx_rtcd.h, which has a rule in libs.mk
|
||||
TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
|
||||
target := libs
|
||||
|
||||
LOCAL_SRC_FILES += vpx_config.c
|
||||
|
||||
@@ -165,12 +168,15 @@ LOCAL_LDLIBS := -llog
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := cpufeatures
|
||||
|
||||
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_rtcd.h
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@echo "Clean: ads2gas files [$(TARGET_ARCH_ABI)]"
|
||||
@$(RM) $(CODEC_SRCS_ASM_ADS2GAS) $(CODEC_SRCS_ASM_NEON_ADS2GAS)
|
||||
@$(RM) $(patsubst %.asm, %.*, $(ASM_CNV_OFFSETS_DEPEND))
|
||||
@$(RM) -r $(ASM_CNV_PATH)
|
||||
@$(RM) $(CLEAN-OBJS)
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
||||
@@ -458,7 +458,10 @@ process_common_cmdline() {
|
||||
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
||||
if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
|
||||
[ $action = "disable" ] && RTCD_OPTIONS="${RTCD_OPTIONS}${opt} "
|
||||
else
|
||||
elif [ $action = "disable" ] && ! disabled $option ; then
|
||||
echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
|
||||
die_unknown $opt
|
||||
elif [ $action = "enable" ] && ! enabled $option ; then
|
||||
echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
|
||||
die_unknown $opt
|
||||
fi
|
||||
@@ -585,6 +588,10 @@ process_common_toolchain() {
|
||||
tgt_isa=x86_64
|
||||
tgt_os=darwin11
|
||||
;;
|
||||
*darwin12*)
|
||||
tgt_isa=x86_64
|
||||
tgt_os=darwin12
|
||||
;;
|
||||
*mingw32*|*cygwin*)
|
||||
[ -z "$tgt_isa" ] && tgt_isa=x86
|
||||
tgt_os=win32
|
||||
@@ -635,44 +642,51 @@ process_common_toolchain() {
|
||||
|
||||
# Handle darwin variants. Newer SDKs allow targeting older
|
||||
# platforms, so find the newest SDK available.
|
||||
if [ -d "/Developer/SDKs/MacOSX10.4u.sdk" ]; then
|
||||
osx_sdk_dir="/Developer/SDKs/MacOSX10.4u.sdk"
|
||||
case ${toolchain} in
|
||||
*-darwin*)
|
||||
if [ -z "${DEVELOPER_DIR}" ]; then
|
||||
DEVELOPER_DIR=`xcode-select -print-path 2> /dev/null`
|
||||
[ $? -ne 0 ] && OSX_SKIP_DIR_CHECK=1
|
||||
fi
|
||||
if [ -d "/Developer/SDKs/MacOSX10.5.sdk" ]; then
|
||||
osx_sdk_dir="/Developer/SDKs/MacOSX10.5.sdk"
|
||||
if [ -z "${OSX_SKIP_DIR_CHECK}" ]; then
|
||||
OSX_SDK_ROOTS="${DEVELOPER_DIR}/SDKs"
|
||||
OSX_SDK_VERSIONS="MacOSX10.4u.sdk MacOSX10.5.sdk MacOSX10.6.sdk"
|
||||
OSX_SDK_VERSIONS="${OSX_SDK_VERSIONS} MacOSX10.7.sdk"
|
||||
for v in ${OSX_SDK_VERSIONS}; do
|
||||
if [ -d "${OSX_SDK_ROOTS}/${v}" ]; then
|
||||
osx_sdk_dir="${OSX_SDK_ROOTS}/${v}"
|
||||
fi
|
||||
if [ -d "/Developer/SDKs/MacOSX10.6.sdk" ]; then
|
||||
osx_sdk_dir="/Developer/SDKs/MacOSX10.6.sdk"
|
||||
done
|
||||
fi
|
||||
if [ -d "/Developer/SDKs/MacOSX10.7.sdk" ]; then
|
||||
osx_sdk_dir="/Developer/SDKs/MacOSX10.7.sdk"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -d "${osx_sdk_dir}" ]; then
|
||||
add_cflags "-isysroot ${osx_sdk_dir}"
|
||||
add_ldflags "-isysroot ${osx_sdk_dir}"
|
||||
fi
|
||||
|
||||
case ${toolchain} in
|
||||
*-darwin8-*)
|
||||
add_cflags "-isysroot ${osx_sdk_dir}"
|
||||
add_cflags "-mmacosx-version-min=10.4"
|
||||
add_ldflags "-isysroot ${osx_sdk_dir}"
|
||||
add_ldflags "-mmacosx-version-min=10.4"
|
||||
;;
|
||||
*-darwin9-*)
|
||||
add_cflags "-isysroot ${osx_sdk_dir}"
|
||||
add_cflags "-mmacosx-version-min=10.5"
|
||||
add_ldflags "-isysroot ${osx_sdk_dir}"
|
||||
add_ldflags "-mmacosx-version-min=10.5"
|
||||
;;
|
||||
*-darwin10-*)
|
||||
add_cflags "-isysroot ${osx_sdk_dir}"
|
||||
add_cflags "-mmacosx-version-min=10.6"
|
||||
add_ldflags "-isysroot ${osx_sdk_dir}"
|
||||
add_ldflags "-mmacosx-version-min=10.6"
|
||||
;;
|
||||
*-darwin11-*)
|
||||
add_cflags "-isysroot ${osx_sdk_dir}"
|
||||
add_cflags "-mmacosx-version-min=10.7"
|
||||
add_ldflags "-isysroot ${osx_sdk_dir}"
|
||||
add_ldflags "-mmacosx-version-min=10.7"
|
||||
;;
|
||||
*-darwin12-*)
|
||||
add_cflags "-mmacosx-version-min=10.8"
|
||||
add_ldflags "-mmacosx-version-min=10.8"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Handle Solaris variants. Solaris 10 needs -lposix4
|
||||
@@ -796,6 +810,8 @@ process_common_toolchain() {
|
||||
add_cflags "--sysroot=${alt_libc}"
|
||||
add_ldflags "--sysroot=${alt_libc}"
|
||||
|
||||
add_cflags "-I${SDK_PATH}/sources/android/cpufeatures/"
|
||||
|
||||
enable pic
|
||||
soft_enable realtime_only
|
||||
if [ ${tgt_isa} == "armv7" ]; then
|
||||
@@ -805,7 +821,8 @@ process_common_toolchain() {
|
||||
|
||||
darwin*)
|
||||
if [ -z "${sdk_path}" ]; then
|
||||
SDK_PATH=/Developer/Platforms/iPhoneOS.platform/Developer
|
||||
SDK_PATH=`xcode-select -print-path 2> /dev/null`
|
||||
SDK_PATH=${SDK_PATH}/Platforms/iPhoneOS.platform/Developer
|
||||
else
|
||||
SDK_PATH=${sdk_path}
|
||||
fi
|
||||
@@ -827,7 +844,7 @@ process_common_toolchain() {
|
||||
add_ldflags -arch_only ${tgt_isa}
|
||||
|
||||
if [ -z "${alt_libc}" ]; then
|
||||
alt_libc=${SDK_PATH}/SDKs/iPhoneOS5.0.sdk
|
||||
alt_libc=${SDK_PATH}/SDKs/iPhoneOS5.1.sdk
|
||||
fi
|
||||
|
||||
add_cflags "-isysroot ${alt_libc}"
|
||||
|
||||
@@ -42,7 +42,7 @@ done
|
||||
|
||||
[ -n "$srcfile" ] || show_help
|
||||
sfx=${sfx:-asm}
|
||||
includes=$(egrep -i "include +\"?+[a-z0-9_/]+\.${sfx}" $srcfile |
|
||||
includes=$(LC_ALL=C egrep -i "include +\"?+[a-z0-9_/]+\.${sfx}" $srcfile |
|
||||
perl -p -e "s;.*?([a-z0-9_/]+.${sfx}).*;\1;")
|
||||
#" restore editor state
|
||||
for inc in ${includes}; do
|
||||
|
||||
@@ -680,7 +680,7 @@ int parse_coff(uint8_t *buf, size_t sz)
|
||||
uint32_t symoffset;
|
||||
|
||||
char **sectionlist; //this array holds all section names in their correct order.
|
||||
//it is used to check if the symbol is in .bss or .data section.
|
||||
//it is used to check if the symbol is in .bss or .rdata section.
|
||||
|
||||
nsections = get_le16(buf + 2);
|
||||
symtab_ptr = get_le32(buf + 8);
|
||||
@@ -725,15 +725,15 @@ int parse_coff(uint8_t *buf, size_t sz)
|
||||
}
|
||||
strcpy(sectionlist[i], sectionname);
|
||||
|
||||
if (!strcmp(sectionname, ".data")) sectionrawdata_ptr = get_le32(ptr + 20);
|
||||
if (!strcmp(sectionname, ".rdata")) sectionrawdata_ptr = get_le32(ptr + 20);
|
||||
|
||||
ptr += 40;
|
||||
}
|
||||
|
||||
//log_msg("COFF: Symbol table at offset %u\n", symtab_ptr);
|
||||
//log_msg("COFF: raw data pointer ofset for section .data is %u\n", sectionrawdata_ptr);
|
||||
//log_msg("COFF: raw data pointer ofset for section .rdata is %u\n", sectionrawdata_ptr);
|
||||
|
||||
/* The compiler puts the data with non-zero offset in .data section, but puts the data with
|
||||
/* The compiler puts the data with non-zero offset in .rdata section, but puts the data with
|
||||
zero offset in .bss section. So, if the data in in .bss section, set offset=0.
|
||||
Note from Wiki: In an object module compiled from C, the bss section contains
|
||||
the local variables (but not functions) that were declared with the static keyword,
|
||||
|
||||
@@ -196,8 +196,8 @@ filter() {
|
||||
# Helper functions for generating the arch specific RTCD files
|
||||
#
|
||||
common_top() {
|
||||
local outfile_basename=$(basename ${outfile:-rtcd.h})
|
||||
local include_guard=$(echo -n $outfile_basename | tr '[a-z]' '[A-Z]' | tr -c '[A-Z]' _)
|
||||
local outfile_basename=$(basename ${symbol:-rtcd.h})
|
||||
local include_guard=$(echo $outfile_basename | tr '[a-z]' '[A-Z]' | tr -c '[A-Z]' _)
|
||||
cat <<EOF
|
||||
#ifndef ${include_guard}
|
||||
#define ${include_guard}
|
||||
@@ -211,6 +211,8 @@ common_top() {
|
||||
$(process_forward_decls)
|
||||
|
||||
$(declare_function_pointers c $ALL_ARCHS)
|
||||
|
||||
void ${symbol:-rtcd}(void);
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -225,17 +227,16 @@ x86() {
|
||||
|
||||
# Assign the helper variable for each enabled extension
|
||||
for opt in $ALL_ARCHS; do
|
||||
local uc=$(echo -n $opt | tr '[a-z]' '[A-Z]')
|
||||
local uc=$(echo $opt | tr '[a-z]' '[A-Z]')
|
||||
eval "have_${opt}=\"flags & HAS_${uc}\""
|
||||
done
|
||||
|
||||
cat <<EOF
|
||||
$(common_top)
|
||||
void ${symbol:-rtcd}(void);
|
||||
|
||||
#ifdef RTCD_C
|
||||
#include "vpx_ports/x86.h"
|
||||
void ${symbol:-rtcd}(void)
|
||||
static void setup_rtcd_internal(void)
|
||||
{
|
||||
int flags = x86_simd_caps();
|
||||
|
||||
@@ -253,7 +254,7 @@ arm() {
|
||||
|
||||
# Assign the helper variable for each enabled extension
|
||||
for opt in $ALL_ARCHS; do
|
||||
local uc=$(echo -n $opt | tr '[a-z]' '[A-Z]')
|
||||
local uc=$(echo $opt | tr '[a-z]' '[A-Z]')
|
||||
eval "have_${opt}=\"flags & HAS_${uc}\""
|
||||
done
|
||||
|
||||
@@ -261,11 +262,9 @@ arm() {
|
||||
$(common_top)
|
||||
#include "vpx_config.h"
|
||||
|
||||
void ${symbol:-rtcd}(void);
|
||||
|
||||
#ifdef RTCD_C
|
||||
#include "vpx_ports/arm.h"
|
||||
void ${symbol:-rtcd}(void)
|
||||
static void setup_rtcd_internal(void)
|
||||
{
|
||||
int flags = arm_cpu_caps();
|
||||
|
||||
@@ -285,10 +284,8 @@ unoptimized() {
|
||||
$(common_top)
|
||||
#include "vpx_config.h"
|
||||
|
||||
void ${symbol:-rtcd}(void);
|
||||
|
||||
#ifdef RTCD_C
|
||||
void ${symbol:-rtcd}(void)
|
||||
static void setup_rtcd_internal(void)
|
||||
{
|
||||
$(set_function_pointers c)
|
||||
}
|
||||
|
||||
34
configure
vendored
34
configure
vendored
@@ -39,6 +39,7 @@ Advanced options:
|
||||
${toggle_multithread} multithreaded encoding and decoding
|
||||
${toggle_spatial_resampling} spatial sampling (scaling) support
|
||||
${toggle_realtime_only} enable this option while building for real-time encoding
|
||||
${toggle_onthefly_bitpacking} enable on-the-fly bitpacking in real-time encoding
|
||||
${toggle_error_concealment} enable this option to get a decoder which is able to conceal losses
|
||||
${toggle_runtime_cpu_detect} runtime cpu detection
|
||||
${toggle_shared} shared library support
|
||||
@@ -46,6 +47,7 @@ Advanced options:
|
||||
${toggle_small} favor smaller size over speed
|
||||
${toggle_postproc_visualizer} macro block / block level visualizers
|
||||
${toggle_multi_res_encoding} enable multiple-resolution encoding
|
||||
${toggle_temporal_denoising} enable temporal denoising and disable the spatial denoiser
|
||||
|
||||
Codecs:
|
||||
Codecs can be selectively enabled or disabled individually, or by family:
|
||||
@@ -107,6 +109,8 @@ all_platforms="${all_platforms} x86-darwin8-icc"
|
||||
all_platforms="${all_platforms} x86-darwin9-gcc"
|
||||
all_platforms="${all_platforms} x86-darwin9-icc"
|
||||
all_platforms="${all_platforms} x86-darwin10-gcc"
|
||||
all_platforms="${all_platforms} x86-darwin11-gcc"
|
||||
all_platforms="${all_platforms} x86-darwin12-gcc"
|
||||
all_platforms="${all_platforms} x86-linux-gcc"
|
||||
all_platforms="${all_platforms} x86-linux-icc"
|
||||
all_platforms="${all_platforms} x86-os2-gcc"
|
||||
@@ -118,6 +122,7 @@ all_platforms="${all_platforms} x86-win32-vs9"
|
||||
all_platforms="${all_platforms} x86_64-darwin9-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin10-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin11-gcc"
|
||||
all_platforms="${all_platforms} x86_64-darwin12-gcc"
|
||||
all_platforms="${all_platforms} x86_64-linux-gcc"
|
||||
all_platforms="${all_platforms} x86_64-linux-icc"
|
||||
all_platforms="${all_platforms} x86_64-solaris-gcc"
|
||||
@@ -126,6 +131,9 @@ all_platforms="${all_platforms} x86_64-win64-vs8"
|
||||
all_platforms="${all_platforms} x86_64-win64-vs9"
|
||||
all_platforms="${all_platforms} universal-darwin8-gcc"
|
||||
all_platforms="${all_platforms} universal-darwin9-gcc"
|
||||
all_platforms="${all_platforms} universal-darwin10-gcc"
|
||||
all_platforms="${all_platforms} universal-darwin11-gcc"
|
||||
all_platforms="${all_platforms} universal-darwin12-gcc"
|
||||
all_platforms="${all_platforms} generic-gnu"
|
||||
|
||||
# all_targets is a list of all targets that can be configured
|
||||
@@ -164,6 +172,7 @@ enable md5
|
||||
enable spatial_resampling
|
||||
enable multithread
|
||||
enable os_support
|
||||
enable temporal_denoising
|
||||
|
||||
[ -d ${source_path}/../include ] && enable alt_tree_layout
|
||||
for d in vp8; do
|
||||
@@ -177,6 +186,8 @@ else
|
||||
# customer environment
|
||||
[ -f ${source_path}/../include/vpx/vp8cx.h ] && CODECS="${CODECS} vp8_encoder"
|
||||
[ -f ${source_path}/../include/vpx/vp8dx.h ] && CODECS="${CODECS} vp8_decoder"
|
||||
[ -f ${source_path}/../include/vpx/vp8cx.h ] || disable vp8_encoder
|
||||
[ -f ${source_path}/../include/vpx/vp8dx.h ] || disable vp8_decoder
|
||||
|
||||
[ -f ${source_path}/../lib/*/*mt.lib ] && soft_enable static_msvcrt
|
||||
fi
|
||||
@@ -253,6 +264,7 @@ CONFIG_LIST="
|
||||
static_msvcrt
|
||||
spatial_resampling
|
||||
realtime_only
|
||||
onthefly_bitpacking
|
||||
error_concealment
|
||||
shared
|
||||
static
|
||||
@@ -261,6 +273,7 @@ CONFIG_LIST="
|
||||
os_support
|
||||
unit_tests
|
||||
multi_res_encoding
|
||||
temporal_denoising
|
||||
"
|
||||
CMDLINE_SELECT="
|
||||
extra_warnings
|
||||
@@ -297,6 +310,7 @@ CMDLINE_SELECT="
|
||||
mem_tracker
|
||||
spatial_resampling
|
||||
realtime_only
|
||||
onthefly_bitpacking
|
||||
error_concealment
|
||||
shared
|
||||
static
|
||||
@@ -304,6 +318,7 @@ CMDLINE_SELECT="
|
||||
postproc_visualizer
|
||||
unit_tests
|
||||
multi_res_encoding
|
||||
temporal_denoising
|
||||
"
|
||||
|
||||
process_cmdline() {
|
||||
@@ -484,11 +499,20 @@ process_toolchain() {
|
||||
case $toolchain in
|
||||
universal-darwin*)
|
||||
local darwin_ver=${tgt_os##darwin}
|
||||
fat_bin_archs="$fat_bin_archs ppc32-${tgt_os}-gcc"
|
||||
|
||||
# Intel
|
||||
# Snow Leopard (10.6/darwin10) dropped support for PPC
|
||||
# Include PPC support for all prior versions
|
||||
if [ $darwin_ver -lt 10 ]; then
|
||||
fat_bin_archs="$fat_bin_archs ppc32-${tgt_os}-gcc"
|
||||
fi
|
||||
|
||||
# Tiger (10.4/darwin8) brought support for x86
|
||||
if [ $darwin_ver -ge 8 ]; then
|
||||
fat_bin_archs="$fat_bin_archs x86-${tgt_os}-${tgt_cc}"
|
||||
if [ $darwin_ver -gt 8 ]; then
|
||||
fi
|
||||
|
||||
# Leopard (10.5/darwin9) brought 64 bit support
|
||||
if [ $darwin_ver -ge 9 ]; then
|
||||
fat_bin_archs="$fat_bin_archs x86_64-${tgt_os}-${tgt_cc}"
|
||||
fi
|
||||
;;
|
||||
@@ -504,6 +528,10 @@ process_toolchain() {
|
||||
check_add_cflags -Wpointer-arith
|
||||
check_add_cflags -Wtype-limits
|
||||
check_add_cflags -Wcast-qual
|
||||
check_add_cflags -Wimplicit-function-declaration
|
||||
check_add_cflags -Wuninitialized
|
||||
check_add_cflags -Wunused-variable
|
||||
check_add_cflags -Wunused-but-set-variable
|
||||
enabled extra_warnings || check_add_cflags -Wno-unused-function
|
||||
fi
|
||||
|
||||
|
||||
3
docs.mk
3
docs.mk
@@ -21,9 +21,6 @@ CODEC_DOX := mainpage.dox \
|
||||
usage_dx.dox \
|
||||
|
||||
# Other doxy files sourced in Markdown
|
||||
TXT_DOX-$(CONFIG_VP8) += vp8_api1_migration.dox
|
||||
vp8_api1_migration.dox.DESC = VP8 API 1.x Migration
|
||||
|
||||
TXT_DOX = $(call enabled,TXT_DOX)
|
||||
|
||||
%.dox: %.txt
|
||||
|
||||
33
examples.mk
33
examples.mk
@@ -8,20 +8,6 @@
|
||||
## be found in the AUTHORS file in the root of the source tree.
|
||||
##
|
||||
|
||||
LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \
|
||||
third_party/libyuv/include/libyuv/cpu_id.h \
|
||||
third_party/libyuv/include/libyuv/scale.h \
|
||||
third_party/libyuv/source/row.h \
|
||||
third_party/libyuv/source/scale.c \
|
||||
third_party/libyuv/source/cpu_id.c
|
||||
|
||||
NESTEGG_SRCS += nestegg/halloc/halloc.h \
|
||||
nestegg/halloc/src/align.h \
|
||||
nestegg/halloc/src/halloc.c \
|
||||
nestegg/halloc/src/hlist.h \
|
||||
nestegg/halloc/src/macros.h \
|
||||
nestegg/include/nestegg/nestegg.h \
|
||||
nestegg/src/nestegg.c
|
||||
|
||||
# List of examples to build. UTILS are files that are taken from the source
|
||||
# tree directly, and GEN_EXAMPLES are files that are created from the
|
||||
@@ -32,7 +18,13 @@ vpxdec.SRCS += vpx_ports/vpx_timer.h
|
||||
vpxdec.SRCS += vpx/vpx_integer.h
|
||||
vpxdec.SRCS += args.c args.h
|
||||
vpxdec.SRCS += tools_common.c tools_common.h
|
||||
vpxdec.SRCS += $(NESTEGG_SRCS)
|
||||
vpxdec.SRCS += nestegg/halloc/halloc.h
|
||||
vpxdec.SRCS += nestegg/halloc/src/align.h
|
||||
vpxdec.SRCS += nestegg/halloc/src/halloc.c
|
||||
vpxdec.SRCS += nestegg/halloc/src/hlist.h
|
||||
vpxdec.SRCS += nestegg/halloc/src/macros.h
|
||||
vpxdec.SRCS += nestegg/include/nestegg/nestegg.h
|
||||
vpxdec.SRCS += nestegg/src/nestegg.c
|
||||
vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950
|
||||
vpxdec.DESCRIPTION = Full featured decoder
|
||||
UTILS-$(CONFIG_ENCODERS) += vpxenc.c
|
||||
@@ -40,11 +32,10 @@ vpxenc.SRCS += args.c args.h y4minput.c y4minput.h
|
||||
vpxenc.SRCS += tools_common.c tools_common.h
|
||||
vpxenc.SRCS += vpx_ports/mem_ops.h
|
||||
vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
|
||||
vpxenc.SRCS += vpx_ports/vpx_timer.h
|
||||
vpxenc.SRCS += libmkv/EbmlIDs.h
|
||||
vpxenc.SRCS += libmkv/EbmlWriter.c
|
||||
vpxenc.SRCS += libmkv/EbmlWriter.h
|
||||
vpxenc.SRCS += $(LIBYUV_SRCS)
|
||||
vpxenc.SRCS += $(NESTEGG_SRCS)
|
||||
vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
|
||||
vpxenc.DESCRIPTION = Full featured encoder
|
||||
UTILS-$(CONFIG_ENCODERS) += vp8_scalable_patterns.c
|
||||
@@ -108,7 +99,13 @@ vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame
|
||||
|
||||
# C file is provided, not generated automatically.
|
||||
GEN_EXAMPLES-$(CONFIG_MULTI_RES_ENCODING) += vp8_multi_resolution_encoder.c
|
||||
vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS)
|
||||
vp8_multi_resolution_encoder.SRCS \
|
||||
+= third_party/libyuv/include/libyuv/basic_types.h \
|
||||
third_party/libyuv/include/libyuv/cpu_id.h \
|
||||
third_party/libyuv/include/libyuv/scale.h \
|
||||
third_party/libyuv/source/row.h \
|
||||
third_party/libyuv/source/scale.c \
|
||||
third_party/libyuv/source/cpu_id.c
|
||||
vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de
|
||||
vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
|
||||
|
||||
|
||||
20
libs.mk
20
libs.mk
@@ -17,6 +17,7 @@ else
|
||||
ASM:=.asm
|
||||
endif
|
||||
|
||||
CODEC_SRCS-yes += CHANGELOG
|
||||
CODEC_SRCS-yes += libs.mk
|
||||
|
||||
include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
|
||||
@@ -34,9 +35,9 @@ ifeq ($(CONFIG_VP8_ENCODER),yes)
|
||||
include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk
|
||||
CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
|
||||
CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS))
|
||||
CODEC_SRCS-yes += $(VP8_PREFIX)vp8cx.mk vpx/vp8.h vpx/vp8cx.h vpx/vp8e.h
|
||||
CODEC_SRCS-yes += $(VP8_PREFIX)vp8cx.mk vpx/vp8.h vpx/vp8cx.h
|
||||
CODEC_SRCS-$(ARCH_ARM) += $(VP8_PREFIX)vp8cx_arm.mk
|
||||
INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8e.h include/vpx/vp8cx.h
|
||||
INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
|
||||
INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
|
||||
CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
|
||||
CODEC_DOC_SECTIONS += vp8 vp8_encoder
|
||||
@@ -114,7 +115,6 @@ INSTALL-LIBS-yes += include/vpx/vpx_integer.h
|
||||
INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_top.h
|
||||
INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_bottom.h
|
||||
INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
|
||||
INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder_compat.h
|
||||
INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
|
||||
ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
|
||||
ifeq ($(CONFIG_MSVS),yes)
|
||||
@@ -233,7 +233,7 @@ vpx.pc: config.mk libs.mk
|
||||
$(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
|
||||
$(qexec)echo 'prefix=$(PREFIX)' >> $@
|
||||
$(qexec)echo 'exec_prefix=$${prefix}' >> $@
|
||||
$(qexec)echo 'libdir=$${prefix}/lib' >> $@
|
||||
$(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@
|
||||
$(qexec)echo 'includedir=$${prefix}/include' >> $@
|
||||
$(qexec)echo '' >> $@
|
||||
$(qexec)echo 'Name: vpx' >> $@
|
||||
@@ -280,19 +280,21 @@ $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
|
||||
# Calculate platform- and compiler-specific offsets for hand coded assembly
|
||||
#
|
||||
|
||||
OFFSET_PATTERN:='^[a-zA-Z0-9_]* EQU'
|
||||
|
||||
ifeq ($(filter icc gcc,$(TGT_CC)), $(TGT_CC))
|
||||
$(BUILD_PFX)asm_com_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
|
||||
grep -w EQU $< | tr -d '$$\#' $(ADS2GAS) > $@
|
||||
LC_ALL=C grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
|
||||
$(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S: $(VP8_PREFIX)common/asm_com_offsets.c
|
||||
CLEAN-OBJS += $(BUILD_PFX)asm_com_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
|
||||
|
||||
$(BUILD_PFX)asm_enc_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
|
||||
grep -w EQU $< | tr -d '$$\#' $(ADS2GAS) > $@
|
||||
LC_ALL=C grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
|
||||
$(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S: $(VP8_PREFIX)encoder/asm_enc_offsets.c
|
||||
CLEAN-OBJS += $(BUILD_PFX)asm_enc_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
|
||||
|
||||
$(BUILD_PFX)asm_dec_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
|
||||
grep -w EQU $< | tr -d '$$\#' $(ADS2GAS) > $@
|
||||
LC_ALL=C grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
|
||||
$(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S: $(VP8_PREFIX)decoder/asm_dec_offsets.c
|
||||
CLEAN-OBJS += $(BUILD_PFX)asm_dec_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
|
||||
else
|
||||
@@ -326,8 +328,8 @@ CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
|
||||
#
|
||||
# Rule to generate runtime cpu detection files
|
||||
#
|
||||
$(OBJS-yes:.o=.d): vpx_rtcd.h
|
||||
vpx_rtcd.h: $(sort $(filter %rtcd_defs.sh,$(CODEC_SRCS)))
|
||||
$(OBJS-yes:.o=.d): $(BUILD_PFX)vpx_rtcd.h
|
||||
$(BUILD_PFX)vpx_rtcd.h: $(SRC_PATH_BARE)/$(sort $(filter %rtcd_defs.sh,$(CODEC_SRCS)))
|
||||
@echo " [CREATE] $@"
|
||||
$(qexec)$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$(TGT_ISA) \
|
||||
--sym=vpx_rtcd \
|
||||
|
||||
16
mainpage.dox
16
mainpage.dox
@@ -12,8 +12,12 @@
|
||||
|
||||
This distribution of the WebM VP8 Codec SDK includes the following support:
|
||||
|
||||
\if vp8_encoder - \ref vp8_encoder \endif
|
||||
\if vp8_decoder - \ref vp8_decoder \endif
|
||||
\if vp8_encoder
|
||||
- \ref vp8_encoder
|
||||
\endif
|
||||
\if vp8_decoder
|
||||
- \ref vp8_decoder
|
||||
\endif
|
||||
|
||||
|
||||
\section main_startpoints Starting Points
|
||||
@@ -24,8 +28,12 @@
|
||||
- Read the \ref samples "sample code" for examples of how to interact with the
|
||||
codec.
|
||||
- \ref codec reference
|
||||
\if encoder - \ref encoder reference \endif
|
||||
\if decoder - \ref decoder reference \endif
|
||||
\if encoder
|
||||
- \ref encoder reference
|
||||
\endif
|
||||
\if decoder
|
||||
- \ref decoder reference
|
||||
\endif
|
||||
|
||||
\section main_support Support Options & FAQ
|
||||
The WebM project is an open source project supported by its community. For
|
||||
|
||||
8
third_party/libyuv/source/scale.c
vendored
8
third_party/libyuv/source/scale.c
vendored
@@ -60,7 +60,7 @@ void SetUseReferenceImpl(int use) {
|
||||
|
||||
#if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
|
||||
#define HAS_SCALEROWDOWN2_NEON
|
||||
void ScaleRowDown2_NEON(const uint8* src_ptr, int src_stride,
|
||||
void ScaleRowDown2_NEON(const uint8* src_ptr, int /* src_stride */,
|
||||
uint8* dst, int dst_width) {
|
||||
asm volatile (
|
||||
"1: \n"
|
||||
@@ -102,7 +102,7 @@ void ScaleRowDown2Int_NEON(const uint8* src_ptr, int src_stride,
|
||||
}
|
||||
|
||||
#define HAS_SCALEROWDOWN4_NEON
|
||||
static void ScaleRowDown4_NEON(const uint8* src_ptr, int src_stride,
|
||||
static void ScaleRowDown4_NEON(const uint8* src_ptr, int /* src_stride */,
|
||||
uint8* dst_ptr, int dst_width) {
|
||||
asm volatile (
|
||||
"1: \n"
|
||||
@@ -160,7 +160,7 @@ static void ScaleRowDown4Int_NEON(const uint8* src_ptr, int src_stride,
|
||||
// Down scale from 4 to 3 pixels. Use the neon multilane read/write
|
||||
// to load up the every 4th pixel into a 4 different registers.
|
||||
// Point samples 32 pixels to 24 pixels.
|
||||
static void ScaleRowDown34_NEON(const uint8* src_ptr, int src_stride,
|
||||
static void ScaleRowDown34_NEON(const uint8* src_ptr, int /* src_stride */,
|
||||
uint8* dst_ptr, int dst_width) {
|
||||
asm volatile (
|
||||
"1: \n"
|
||||
@@ -284,7 +284,7 @@ const unsigned short mult38_div9[8] __attribute__ ((aligned(16))) =
|
||||
65536 / 18, 65536 / 18, 65536 / 18, 65536 / 18 };
|
||||
|
||||
// 32 -> 12
|
||||
static void ScaleRowDown38_NEON(const uint8* src_ptr, int src_stride,
|
||||
static void ScaleRowDown38_NEON(const uint8* src_ptr, int,
|
||||
uint8* dst_ptr, int dst_width) {
|
||||
asm volatile (
|
||||
"vld1.u8 {q3}, [%3] \n"
|
||||
|
||||
160
tools/ftfy.sh
Executable file
160
tools/ftfy.sh
Executable file
@@ -0,0 +1,160 @@
|
||||
#!/bin/sh
|
||||
self="$0"
|
||||
dirname_self=$(dirname "$self")
|
||||
|
||||
usage() {
|
||||
cat <<EOF >&2
|
||||
Usage: $self [option]
|
||||
|
||||
This script applies a whitespace transformation to the commit at HEAD. If no
|
||||
options are given, then the modified files are left in the working tree.
|
||||
|
||||
Options:
|
||||
-h, --help Shows this message
|
||||
-n, --dry-run Shows a diff of the changes to be made.
|
||||
--amend Squashes the changes into the commit at HEAD
|
||||
This option will also reformat the commit message.
|
||||
--commit Creates a new commit containing only the whitespace changes
|
||||
--msg-only Reformat the commit message only, ignore the patch itself.
|
||||
|
||||
EOF
|
||||
rm -f ${CLEAN_FILES}
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
log() {
|
||||
echo "${self##*/}: $@" >&2
|
||||
}
|
||||
|
||||
|
||||
vpx_style() {
|
||||
astyle --style=bsd --min-conditional-indent=0 --break-blocks \
|
||||
--pad-oper --pad-header --unpad-paren \
|
||||
--align-pointer=name \
|
||||
--indent-preprocessor --convert-tabs --indent-labels \
|
||||
--suffix=none --quiet "$@"
|
||||
sed -i 's/[[:space:]]\{1,\},/,/g' "$@"
|
||||
}
|
||||
|
||||
|
||||
apply() {
|
||||
[ $INTERSECT_RESULT -ne 0 ] && patch -p1 < "$1"
|
||||
}
|
||||
|
||||
|
||||
commit() {
|
||||
LAST_CHANGEID=$(git show | awk '/Change-Id:/{print $2}')
|
||||
if [ -z "$LAST_CHANGEID" ]; then
|
||||
log "HEAD doesn't have a Change-Id, unable to generate a new commit"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build a deterministic Change-Id from the parent's
|
||||
NEW_CHANGEID=${LAST_CHANGEID}-styled
|
||||
NEW_CHANGEID=I$(echo $NEW_CHANGEID | git hash-object --stdin)
|
||||
|
||||
# Commit, preserving authorship from the parent commit.
|
||||
git commit -a -C HEAD > /dev/null
|
||||
git commit --amend -F- << EOF
|
||||
Cosmetic: Fix whitespace in change ${LAST_CHANGEID:0:9}
|
||||
|
||||
Change-Id: ${NEW_CHANGEID}
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
show_commit_msg_diff() {
|
||||
if [ $DIFF_MSG_RESULT -ne 0 ]; then
|
||||
log "Modified commit message:"
|
||||
diff -u "$ORIG_COMMIT_MSG" "$NEW_COMMIT_MSG" | tail -n +3
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
amend() {
|
||||
show_commit_msg_diff
|
||||
if [ $DIFF_MSG_RESULT -ne 0 ] || [ $INTERSECT_RESULT -ne 0 ]; then
|
||||
git commit -a --amend -F "$NEW_COMMIT_MSG"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
diff_msg() {
|
||||
git log -1 --format=%B > "$ORIG_COMMIT_MSG"
|
||||
"${dirname_self}"/wrap-commit-msg.py \
|
||||
< "$ORIG_COMMIT_MSG" > "$NEW_COMMIT_MSG"
|
||||
cmp -s "$ORIG_COMMIT_MSG" "$NEW_COMMIT_MSG"
|
||||
DIFF_MSG_RESULT=$?
|
||||
}
|
||||
|
||||
|
||||
# Temporary files
|
||||
ORIG_DIFF=orig.diff.$$
|
||||
MODIFIED_DIFF=modified.diff.$$
|
||||
FINAL_DIFF=final.diff.$$
|
||||
ORIG_COMMIT_MSG=orig.commit-msg.$$
|
||||
NEW_COMMIT_MSG=new.commit-msg.$$
|
||||
CLEAN_FILES="${ORIG_DIFF} ${MODIFIED_DIFF} ${FINAL_DIFF}"
|
||||
CLEAN_FILES="${CLEAN_FILES} ${ORIG_COMMIT_MSG} ${NEW_COMMIT_MSG}"
|
||||
|
||||
# Preconditions
|
||||
[ $# -lt 2 ] || usage
|
||||
|
||||
# Check that astyle supports pad-header and align-pointer=name
|
||||
if ! astyle --pad-header --align-pointer=name < /dev/null; then
|
||||
log "Install astyle v1.24 or newer"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! git diff --quiet HEAD; then
|
||||
log "Working tree is dirty, commit your changes first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Need to be in the root
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
# Collect the original diff
|
||||
git show > "${ORIG_DIFF}"
|
||||
|
||||
# Apply the style guide on new and modified files and collect its diff
|
||||
for f in $(git diff HEAD^ --name-only -M90 --diff-filter=AM \
|
||||
| grep '\.[ch]$'); do
|
||||
case "$f" in
|
||||
third_party/*) continue;;
|
||||
nestegg/*) continue;;
|
||||
esac
|
||||
vpx_style "$f"
|
||||
done
|
||||
git diff --no-color --no-ext-diff > "${MODIFIED_DIFF}"
|
||||
|
||||
# Intersect the two diffs
|
||||
"${dirname_self}"/intersect-diffs.py \
|
||||
"${ORIG_DIFF}" "${MODIFIED_DIFF}" > "${FINAL_DIFF}"
|
||||
INTERSECT_RESULT=$?
|
||||
git reset --hard >/dev/null
|
||||
|
||||
# Fixup the commit message
|
||||
diff_msg
|
||||
|
||||
# Handle options
|
||||
if [ -n "$1" ]; then
|
||||
case "$1" in
|
||||
-h|--help) usage;;
|
||||
-n|--dry-run) cat "${FINAL_DIFF}"; show_commit_msg_diff;;
|
||||
--commit) apply "${FINAL_DIFF}"; commit;;
|
||||
--amend) apply "${FINAL_DIFF}"; amend;;
|
||||
--msg-only) amend;;
|
||||
*) usage;;
|
||||
esac
|
||||
else
|
||||
apply "${FINAL_DIFF}"
|
||||
if ! git diff --quiet; then
|
||||
log "Formatting changes applied, verify and commit."
|
||||
log "See also: http://www.webmproject.org/code/contribute/conventions/"
|
||||
git diff --stat
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f ${CLEAN_FILES}
|
||||
188
tools/intersect-diffs.py
Executable file
188
tools/intersect-diffs.py
Executable file
@@ -0,0 +1,188 @@
|
||||
#!/usr/bin/env python
|
||||
## Copyright (c) 2012 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.
|
||||
##
|
||||
"""Calculates the "intersection" of two unified diffs.
|
||||
|
||||
Given two diffs, A and B, it finds all hunks in B that had non-context lines
|
||||
in A and prints them to stdout. This is useful to determine the hunks in B that
|
||||
are relevant to A. The resulting file can be applied with patch(1) on top of A.
|
||||
"""
|
||||
|
||||
__author__ = "jkoleszar@google.com"
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
class DiffLines(object):
|
||||
"""A container for one half of a diff."""
|
||||
|
||||
def __init__(self, filename, offset, length):
|
||||
self.filename = filename
|
||||
self.offset = offset
|
||||
self.length = length
|
||||
self.lines = []
|
||||
self.delta_line_nums = []
|
||||
|
||||
def Append(self, line):
|
||||
l = len(self.lines)
|
||||
if line[0] != " ":
|
||||
self.delta_line_nums.append(self.offset + l)
|
||||
self.lines.append(line[1:])
|
||||
assert l+1 <= self.length
|
||||
|
||||
def Complete(self):
|
||||
return len(self.lines) == self.length
|
||||
|
||||
def __contains__(self, item):
|
||||
return item >= self.offset and item <= self.offset + self.length - 1
|
||||
|
||||
|
||||
class DiffHunk(object):
|
||||
"""A container for one diff hunk, consisting of two DiffLines."""
|
||||
|
||||
def __init__(self, header, file_a, file_b, start_a, len_a, start_b, len_b):
|
||||
self.header = header
|
||||
self.left = DiffLines(file_a, start_a, len_a)
|
||||
self.right = DiffLines(file_b, start_b, len_b)
|
||||
self.lines = []
|
||||
|
||||
def Append(self, line):
|
||||
"""Adds a line to the DiffHunk and its DiffLines children."""
|
||||
if line[0] == "-":
|
||||
self.left.Append(line)
|
||||
elif line[0] == "+":
|
||||
self.right.Append(line)
|
||||
elif line[0] == " ":
|
||||
self.left.Append(line)
|
||||
self.right.Append(line)
|
||||
else:
|
||||
assert False, ("Unrecognized character at start of diff line "
|
||||
"%r" % line[0])
|
||||
self.lines.append(line)
|
||||
|
||||
def Complete(self):
|
||||
return self.left.Complete() and self.right.Complete()
|
||||
|
||||
def __repr__(self):
|
||||
return "DiffHunk(%s, %s, len %d)" % (
|
||||
self.left.filename, self.right.filename,
|
||||
max(self.left.length, self.right.length))
|
||||
|
||||
|
||||
def ParseDiffHunks(stream):
|
||||
"""Walk a file-like object, yielding DiffHunks as they're parsed."""
|
||||
|
||||
file_regex = re.compile(r"(\+\+\+|---) (\S+)")
|
||||
range_regex = re.compile(r"@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))?")
|
||||
hunk = None
|
||||
while True:
|
||||
line = stream.readline()
|
||||
if not line:
|
||||
break
|
||||
|
||||
if hunk is None:
|
||||
# Parse file names
|
||||
diff_file = file_regex.match(line)
|
||||
if diff_file:
|
||||
if line.startswith("---"):
|
||||
a_line = line
|
||||
a = diff_file.group(2)
|
||||
continue
|
||||
if line.startswith("+++"):
|
||||
b_line = line
|
||||
b = diff_file.group(2)
|
||||
continue
|
||||
|
||||
# Parse offset/lengths
|
||||
diffrange = range_regex.match(line)
|
||||
if diffrange:
|
||||
if diffrange.group(2):
|
||||
start_a = int(diffrange.group(1))
|
||||
len_a = int(diffrange.group(3))
|
||||
else:
|
||||
start_a = 1
|
||||
len_a = int(diffrange.group(1))
|
||||
|
||||
if diffrange.group(5):
|
||||
start_b = int(diffrange.group(4))
|
||||
len_b = int(diffrange.group(6))
|
||||
else:
|
||||
start_b = 1
|
||||
len_b = int(diffrange.group(4))
|
||||
|
||||
header = [a_line, b_line, line]
|
||||
hunk = DiffHunk(header, a, b, start_a, len_a, start_b, len_b)
|
||||
else:
|
||||
# Add the current line to the hunk
|
||||
hunk.Append(line)
|
||||
|
||||
# See if the whole hunk has been parsed. If so, yield it and prepare
|
||||
# for the next hunk.
|
||||
if hunk.Complete():
|
||||
yield hunk
|
||||
hunk = None
|
||||
|
||||
# Partial hunks are a parse error
|
||||
assert hunk is None
|
||||
|
||||
|
||||
def FormatDiffHunks(hunks):
|
||||
"""Re-serialize a list of DiffHunks."""
|
||||
r = []
|
||||
last_header = None
|
||||
for hunk in hunks:
|
||||
this_header = hunk.header[0:2]
|
||||
if last_header != this_header:
|
||||
r.extend(hunk.header)
|
||||
last_header = this_header
|
||||
else:
|
||||
r.extend(hunk.header[2])
|
||||
r.extend(hunk.lines)
|
||||
r.append("\n")
|
||||
return "".join(r)
|
||||
|
||||
|
||||
def ZipHunks(rhs_hunks, lhs_hunks):
|
||||
"""Join two hunk lists on filename."""
|
||||
for rhs_hunk in rhs_hunks:
|
||||
rhs_file = rhs_hunk.right.filename.split("/")[1:]
|
||||
|
||||
for lhs_hunk in lhs_hunks:
|
||||
lhs_file = lhs_hunk.left.filename.split("/")[1:]
|
||||
if lhs_file != rhs_file:
|
||||
continue
|
||||
yield (rhs_hunk, lhs_hunk)
|
||||
|
||||
|
||||
def main():
|
||||
old_hunks = [x for x in ParseDiffHunks(open(sys.argv[1], "r"))]
|
||||
new_hunks = [x for x in ParseDiffHunks(open(sys.argv[2], "r"))]
|
||||
out_hunks = []
|
||||
|
||||
# Join the right hand side of the older diff with the left hand side of the
|
||||
# newer diff.
|
||||
for old_hunk, new_hunk in ZipHunks(old_hunks, new_hunks):
|
||||
if new_hunk in out_hunks:
|
||||
continue
|
||||
old_lines = old_hunk.right
|
||||
new_lines = new_hunk.left
|
||||
|
||||
# Determine if this hunk overlaps any non-context line from the other
|
||||
for i in old_lines.delta_line_nums:
|
||||
if i in new_lines:
|
||||
out_hunks.append(new_hunk)
|
||||
break
|
||||
|
||||
if out_hunks:
|
||||
print FormatDiffHunks(out_hunks)
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
70
tools/wrap-commit-msg.py
Executable file
70
tools/wrap-commit-msg.py
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env python
|
||||
## Copyright (c) 2012 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.
|
||||
##
|
||||
"""Wraps paragraphs of text, preserving manual formatting
|
||||
|
||||
This is like fold(1), but has the special convention of not modifying lines
|
||||
that start with whitespace. This allows you to intersperse blocks with
|
||||
special formatting, like code blocks, with written prose. The prose will
|
||||
be wordwrapped, and the manual formatting will be preserved.
|
||||
|
||||
* This won't handle the case of a bulleted (or ordered) list specially, so
|
||||
manual wrapping must be done.
|
||||
|
||||
Occasionally it's useful to put something with explicit formatting that
|
||||
doesn't look at all like a block of text inline.
|
||||
|
||||
indicator = has_leading_whitespace(line);
|
||||
if (indicator)
|
||||
preserve_formatting(line);
|
||||
|
||||
The intent is that this docstring would make it through the transform
|
||||
and still be legible and presented as it is in the source. If additional
|
||||
cases are handled, update this doc to describe the effect.
|
||||
"""
|
||||
|
||||
__author__ = "jkoleszar@google.com"
|
||||
import textwrap
|
||||
import sys
|
||||
|
||||
def wrap(text):
|
||||
if text:
|
||||
return textwrap.fill(text, break_long_words=False) + '\n'
|
||||
return ""
|
||||
|
||||
|
||||
def main(fileobj):
|
||||
text = ""
|
||||
output = ""
|
||||
while True:
|
||||
line = fileobj.readline()
|
||||
if not line:
|
||||
break
|
||||
|
||||
if line.lstrip() == line:
|
||||
text += line
|
||||
else:
|
||||
output += wrap(text)
|
||||
text=""
|
||||
output += line
|
||||
output += wrap(text)
|
||||
|
||||
# Replace the file or write to stdout.
|
||||
if fileobj == sys.stdin:
|
||||
fileobj = sys.stdout
|
||||
else:
|
||||
fileobj.seek(0)
|
||||
fileobj.truncate(0)
|
||||
fileobj.write(output)
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1:
|
||||
main(open(sys.argv[1], "r+"))
|
||||
else:
|
||||
main(sys.stdin)
|
||||
10
usage.dox
10
usage.dox
@@ -1,6 +1,6 @@
|
||||
/*!\page usage Usage
|
||||
|
||||
The vpx Multi-Format codec SDK provides a unified interface amongst its
|
||||
The vpx multi-format codec SDK provides a unified interface amongst its
|
||||
supported codecs. This abstraction allows applications using this SDK to
|
||||
easily support multiple video formats with minimal code duplication or
|
||||
"special casing." This section describes the interface common to all codecs.
|
||||
@@ -14,8 +14,12 @@
|
||||
|
||||
Fore more information on decoder and encoder specific usage, see the
|
||||
following pages:
|
||||
\if decoder - \subpage usage_decode \endif
|
||||
\if decoder - \subpage usage_encode \endif
|
||||
\if decoder
|
||||
- \subpage usage_decode
|
||||
\endif
|
||||
\if decoder
|
||||
- \subpage usage_encode
|
||||
\endif
|
||||
|
||||
\section usage_types Important Data Types
|
||||
There are two important data structures to consider in this interface.
|
||||
|
||||
@@ -37,14 +37,15 @@ static void update_mode_info_border(MODE_INFO *mi, int rows, int cols)
|
||||
void vp8_de_alloc_frame_buffers(VP8_COMMON *oci)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_YV12_BUFFERS; i++)
|
||||
vp8_yv12_de_alloc_frame_buffer(&oci->yv12_fb[i]);
|
||||
|
||||
vp8_yv12_de_alloc_frame_buffer(&oci->temp_scale_frame);
|
||||
#if CONFIG_POSTPROC
|
||||
vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer);
|
||||
if (oci->post_proc_buffer_int_used)
|
||||
vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer_int);
|
||||
#endif
|
||||
|
||||
vpx_free(oci->above_context);
|
||||
vpx_free(oci->mip);
|
||||
@@ -97,6 +98,7 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if CONFIG_POSTPROC
|
||||
if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer, width, height, VP8BORDERINPIXELS) < 0)
|
||||
{
|
||||
vp8_de_alloc_frame_buffers(oci);
|
||||
@@ -104,6 +106,9 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
|
||||
}
|
||||
|
||||
oci->post_proc_buffer_int_used = 0;
|
||||
vpx_memset(&oci->postproc_state, 0, sizeof(oci->postproc_state));
|
||||
vpx_memset((&oci->post_proc_buffer)->buffer_alloc,128,(&oci->post_proc_buffer)->frame_size);
|
||||
#endif
|
||||
|
||||
oci->mb_rows = height >> 4;
|
||||
oci->mb_cols = width >> 4;
|
||||
@@ -203,7 +208,7 @@ void vp8_create_common(VP8_COMMON *oci)
|
||||
oci->clr_type = REG_YUV;
|
||||
oci->clamp_type = RECON_CLAMP_REQUIRED;
|
||||
|
||||
/* Initialise reference frame sign bias structure to defaults */
|
||||
/* Initialize reference frame sign bias structure to defaults */
|
||||
vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias));
|
||||
|
||||
/* Default disable buffer to buffer copying */
|
||||
@@ -215,13 +220,3 @@ void vp8_remove_common(VP8_COMMON *oci)
|
||||
{
|
||||
vp8_de_alloc_frame_buffers(oci);
|
||||
}
|
||||
|
||||
void vp8_initialize_common()
|
||||
{
|
||||
vp8_coef_tree_initialize();
|
||||
|
||||
vp8_entropy_mode_init();
|
||||
|
||||
vp8_init_scan_order_mask();
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
;
|
||||
|
||||
|
||||
bilinear_taps_coeff
|
||||
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
|
||||
|
||||
;-----------------
|
||||
|
||||
EXPORT |vp8_sub_pixel_variance16x16_neon_func|
|
||||
ARM
|
||||
REQUIRE8
|
||||
@@ -27,7 +32,7 @@
|
||||
|vp8_sub_pixel_variance16x16_neon_func| PROC
|
||||
push {r4-r6, lr}
|
||||
|
||||
ldr r12, _BilinearTaps_coeff_
|
||||
adr r12, bilinear_taps_coeff
|
||||
ldr r4, [sp, #16] ;load *dst_ptr from stack
|
||||
ldr r5, [sp, #20] ;load dst_pixels_per_line from stack
|
||||
ldr r6, [sp, #24] ;load *sse from stack
|
||||
@@ -415,11 +420,4 @@ sub_pixel_variance16x16_neon_loop
|
||||
|
||||
ENDP
|
||||
|
||||
;-----------------
|
||||
|
||||
_BilinearTaps_coeff_
|
||||
DCD bilinear_taps_coeff
|
||||
bilinear_taps_coeff
|
||||
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
|
||||
|
||||
END
|
||||
@@ -27,7 +27,7 @@
|
||||
|vp8_sub_pixel_variance8x8_neon| PROC
|
||||
push {r4-r5, lr}
|
||||
|
||||
ldr r12, _BilinearTaps_coeff_
|
||||
adr r12, bilinear_taps_coeff
|
||||
ldr r4, [sp, #12] ;load *dst_ptr from stack
|
||||
ldr r5, [sp, #16] ;load dst_pixels_per_line from stack
|
||||
ldr lr, [sp, #20] ;load *sse from stack
|
||||
@@ -216,8 +216,6 @@ sub_pixel_variance8x8_neon_loop
|
||||
|
||||
;-----------------
|
||||
|
||||
_BilinearTaps_coeff_
|
||||
DCD bilinear_taps_coeff
|
||||
bilinear_taps_coeff
|
||||
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "vpx_config.h"
|
||||
#include "vpx_rtcd.h"
|
||||
#include "vp8/encoder/variance.h"
|
||||
#include "vp8/common/variance.h"
|
||||
#include "vp8/common/filter.h"
|
||||
|
||||
#if HAVE_MEDIA
|
||||
@@ -97,6 +97,17 @@ unsigned int vp8_sub_pixel_variance16x16_armv6
|
||||
|
||||
#if HAVE_NEON
|
||||
|
||||
extern unsigned int vp8_sub_pixel_variance16x16_neon_func
|
||||
(
|
||||
const unsigned char *src_ptr,
|
||||
int src_pixels_per_line,
|
||||
int xoffset,
|
||||
int yoffset,
|
||||
const unsigned char *dst_ptr,
|
||||
int dst_pixels_per_line,
|
||||
unsigned int *sse
|
||||
);
|
||||
|
||||
unsigned int vp8_sub_pixel_variance16x16_neon
|
||||
(
|
||||
const unsigned char *src_ptr,
|
||||
@@ -15,6 +15,10 @@
|
||||
#include "vpx_scale/yv12config.h"
|
||||
#include "vp8/common/blockd.h"
|
||||
|
||||
#if CONFIG_POSTPROC
|
||||
#include "postproc.h"
|
||||
#endif /* CONFIG_POSTPROC */
|
||||
|
||||
BEGIN
|
||||
|
||||
/* vpx_scale */
|
||||
@@ -30,6 +34,11 @@ DEFINE(yv12_buffer_config_v_buffer, offsetof(YV12_BUFFER_CONFIG, v_b
|
||||
DEFINE(yv12_buffer_config_border, offsetof(YV12_BUFFER_CONFIG, border));
|
||||
DEFINE(VP8BORDERINPIXELS_VAL, VP8BORDERINPIXELS);
|
||||
|
||||
#if CONFIG_POSTPROC
|
||||
/* mfqe.c / filter_by_weight */
|
||||
DEFINE(MFQE_PRECISION_VAL, MFQE_PRECISION);
|
||||
#endif /* CONFIG_POSTPROC */
|
||||
|
||||
END
|
||||
|
||||
/* add asserts for any offset that is not supported by assembly code */
|
||||
@@ -53,3 +62,10 @@ ct_assert(B_HU_PRED, B_HU_PRED == 9);
|
||||
/* vp8_yv12_extend_frame_borders_neon makes several assumptions based on this */
|
||||
ct_assert(VP8BORDERINPIXELS_VAL, VP8BORDERINPIXELS == 32)
|
||||
#endif
|
||||
|
||||
#if HAVE_SSE2
|
||||
#if CONFIG_POSTPROC
|
||||
/* vp8_filter_by_weight16x16 and 8x8 */
|
||||
ct_assert(MFQE_PRECISION_VAL, MFQE_PRECISION == 4)
|
||||
#endif /* CONFIG_POSTPROC */
|
||||
#endif /* HAVE_SSE2 */
|
||||
|
||||
@@ -150,14 +150,15 @@ typedef enum
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MB_PREDICTION_MODE mode, uv_mode;
|
||||
MV_REFERENCE_FRAME ref_frame;
|
||||
uint8_t mode, uv_mode;
|
||||
uint8_t ref_frame;
|
||||
uint8_t is_4x4;
|
||||
int_mv mv;
|
||||
|
||||
unsigned char partitioning;
|
||||
unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
|
||||
unsigned char need_to_clamp_mvs;
|
||||
unsigned char segment_id; /* Which set of segmentation parameters should be used for this MB */
|
||||
uint8_t partitioning;
|
||||
uint8_t mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
|
||||
uint8_t need_to_clamp_mvs;
|
||||
uint8_t segment_id; /* Which set of segmentation parameters should be used for this MB */
|
||||
} MB_MODE_INFO;
|
||||
|
||||
typedef struct
|
||||
@@ -205,11 +206,6 @@ typedef struct macroblockd
|
||||
DECLARE_ALIGNED(16, short, dequant_y2[16]);
|
||||
DECLARE_ALIGNED(16, short, dequant_uv[16]);
|
||||
|
||||
/* position of this macroblock */
|
||||
int mbr;
|
||||
int mbc;
|
||||
int mbrc;
|
||||
|
||||
/* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */
|
||||
BLOCKD block[25];
|
||||
int fullpixel_mask;
|
||||
@@ -225,6 +221,10 @@ typedef struct macroblockd
|
||||
int up_available;
|
||||
int left_available;
|
||||
|
||||
unsigned char *recon_above[3];
|
||||
unsigned char *recon_left[3];
|
||||
int recon_left_stride[2];
|
||||
|
||||
/* Y,U,V,Y2 */
|
||||
ENTROPY_CONTEXT_PLANES *above_context;
|
||||
ENTROPY_CONTEXT_PLANES *left_context;
|
||||
|
||||
@@ -8,23 +8,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "entropy.h"
|
||||
#include "string.h"
|
||||
#include "blockd.h"
|
||||
#include "onyxc_int.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
#define uchar unsigned char /* typedefs can clash */
|
||||
#define uint unsigned int
|
||||
|
||||
typedef const uchar cuchar;
|
||||
typedef const uint cuint;
|
||||
|
||||
typedef vp8_prob Prob;
|
||||
|
||||
#include "coefupdateprobs.h"
|
||||
|
||||
DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) =
|
||||
@@ -47,10 +35,11 @@ DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) =
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
DECLARE_ALIGNED(16, cuchar, vp8_coef_bands[16]) =
|
||||
DECLARE_ALIGNED(16, const unsigned char, vp8_coef_bands[16]) =
|
||||
{ 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7};
|
||||
|
||||
DECLARE_ALIGNED(16, cuchar, vp8_prev_token_class[MAX_ENTROPY_TOKENS]) =
|
||||
DECLARE_ALIGNED(16, const unsigned char,
|
||||
vp8_prev_token_class[MAX_ENTROPY_TOKENS]) =
|
||||
{ 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0};
|
||||
|
||||
DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) =
|
||||
@@ -69,7 +58,26 @@ DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]) =
|
||||
10, 11, 15, 16
|
||||
};
|
||||
|
||||
DECLARE_ALIGNED(16, short, vp8_default_zig_zag_mask[16]);
|
||||
/* vp8_default_zig_zag_mask generated with:
|
||||
|
||||
void vp8_init_scan_order_mask()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
DECLARE_ALIGNED(16, const short, vp8_default_zig_zag_mask[16]) =
|
||||
{
|
||||
1, 2, 32, 64,
|
||||
4, 16, 128, 4096,
|
||||
8, 256, 2048, 8192,
|
||||
512, 1024, 16384, -32768
|
||||
};
|
||||
|
||||
const int vp8_mb_feature_data_bits[MB_LVL_MAX] = {7, 6};
|
||||
|
||||
@@ -90,34 +98,41 @@ const vp8_tree_index vp8_coef_tree[ 22] = /* corresponding _CONTEXT_NODEs */
|
||||
-DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6 /* 10 = CAT_FIVE */
|
||||
};
|
||||
|
||||
struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS];
|
||||
/* vp8_coef_encodings generated with:
|
||||
vp8_tokens_from_tree(vp8_coef_encodings, vp8_coef_tree);
|
||||
*/
|
||||
const vp8_token vp8_coef_encodings[MAX_ENTROPY_TOKENS] =
|
||||
{
|
||||
{2, 2},
|
||||
{6, 3},
|
||||
{28, 5},
|
||||
{58, 6},
|
||||
{59, 6},
|
||||
{60, 6},
|
||||
{61, 6},
|
||||
{124, 7},
|
||||
{125, 7},
|
||||
{126, 7},
|
||||
{127, 7},
|
||||
{0, 1}
|
||||
};
|
||||
|
||||
/* Trees for extra bits. Probabilities are constant and
|
||||
do not depend on previously encoded bits */
|
||||
|
||||
static const Prob Pcat1[] = { 159};
|
||||
static const Prob Pcat2[] = { 165, 145};
|
||||
static const Prob Pcat3[] = { 173, 148, 140};
|
||||
static const Prob Pcat4[] = { 176, 155, 140, 135};
|
||||
static const Prob Pcat5[] = { 180, 157, 141, 134, 130};
|
||||
static const Prob Pcat6[] =
|
||||
static const vp8_prob Pcat1[] = { 159};
|
||||
static const vp8_prob Pcat2[] = { 165, 145};
|
||||
static const vp8_prob Pcat3[] = { 173, 148, 140};
|
||||
static const vp8_prob Pcat4[] = { 176, 155, 140, 135};
|
||||
static const vp8_prob Pcat5[] = { 180, 157, 141, 134, 130};
|
||||
static const vp8_prob Pcat6[] =
|
||||
{ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129};
|
||||
|
||||
static vp8_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[22];
|
||||
|
||||
void vp8_init_scan_order_mask()
|
||||
{
|
||||
int i;
|
||||
/* tree index tables generated with:
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
void init_bit_tree(vp8_tree_index *p, int n)
|
||||
{
|
||||
vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void init_bit_tree(vp8_tree_index *p, int n)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while (++i < n)
|
||||
@@ -127,19 +142,28 @@ static void init_bit_tree(vp8_tree_index *p, int n)
|
||||
}
|
||||
|
||||
p[0] = p[1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void init_bit_trees()
|
||||
{
|
||||
void init_bit_trees()
|
||||
{
|
||||
init_bit_tree(cat1, 1);
|
||||
init_bit_tree(cat2, 2);
|
||||
init_bit_tree(cat3, 3);
|
||||
init_bit_tree(cat4, 4);
|
||||
init_bit_tree(cat5, 5);
|
||||
init_bit_tree(cat6, 11);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
vp8_extra_bit_struct vp8_extra_bits[12] =
|
||||
static const vp8_tree_index cat1[2] = { 0, 0 };
|
||||
static const vp8_tree_index cat2[4] = { 2, 2, 0, 0 };
|
||||
static const vp8_tree_index cat3[6] = { 2, 2, 4, 4, 0, 0 };
|
||||
static const vp8_tree_index cat4[8] = { 2, 2, 4, 4, 6, 6, 0, 0 };
|
||||
static const vp8_tree_index cat5[10] = { 2, 2, 4, 4, 6, 6, 8, 8, 0, 0 };
|
||||
static const vp8_tree_index cat6[22] = { 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12,
|
||||
14, 14, 16, 16, 18, 18, 20, 20, 0, 0 };
|
||||
|
||||
const vp8_extra_bit_struct vp8_extra_bits[12] =
|
||||
{
|
||||
{ 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 1},
|
||||
@@ -163,8 +187,3 @@ void vp8_default_coef_probs(VP8_COMMON *pc)
|
||||
sizeof(default_coef_probs));
|
||||
}
|
||||
|
||||
void vp8_coef_tree_initialize()
|
||||
{
|
||||
init_bit_trees();
|
||||
vp8_tokens_from_tree(vp8_coef_encodings, vp8_coef_tree);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
extern const vp8_tree_index vp8_coef_tree[];
|
||||
|
||||
extern struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS];
|
||||
extern const struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -45,7 +45,7 @@ typedef struct
|
||||
int base_val;
|
||||
} vp8_extra_bit_struct;
|
||||
|
||||
extern vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */
|
||||
extern const vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */
|
||||
|
||||
#define PROB_UPDATE_BASELINE_COST 7
|
||||
|
||||
@@ -94,7 +94,7 @@ void vp8_default_coef_probs(struct VP8Common *);
|
||||
|
||||
extern DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]);
|
||||
extern DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]);
|
||||
extern short vp8_default_zig_zag_mask[16];
|
||||
extern DECLARE_ALIGNED(16, const short, vp8_default_zig_zag_mask[16]);
|
||||
extern const int vp8_mb_feature_data_bits[MB_LVL_MAX];
|
||||
|
||||
void vp8_coef_tree_initialize(void);
|
||||
|
||||
@@ -8,22 +8,13 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#define USE_PREBUILT_TABLES
|
||||
|
||||
#include "entropymode.h"
|
||||
#include "entropy.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
static const unsigned int kf_y_mode_cts[VP8_YMODES] = { 1607, 915, 812, 811, 5455};
|
||||
static const unsigned int y_mode_cts [VP8_YMODES] = { 8080, 1908, 1582, 1007, 5874};
|
||||
|
||||
static const unsigned int uv_mode_cts [VP8_UV_MODES] = { 59483, 13605, 16492, 4230};
|
||||
static const unsigned int kf_uv_mode_cts[VP8_UV_MODES] = { 5319, 1904, 1703, 674};
|
||||
|
||||
static const unsigned int bmode_cts[VP8_BINTRAMODES] =
|
||||
{
|
||||
43891, 17694, 10036, 3920, 3363, 2546, 5119, 3221, 2471, 1723
|
||||
};
|
||||
|
||||
#include "vp8_entropymodedata.h"
|
||||
|
||||
int vp8_mv_cont(const int_mv *l, const int_mv *a)
|
||||
{
|
||||
@@ -59,7 +50,7 @@ const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1] =
|
||||
|
||||
|
||||
|
||||
vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
|
||||
const vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
|
||||
{
|
||||
{
|
||||
0, 0, 0, 0,
|
||||
@@ -84,7 +75,7 @@ vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
|
||||
4, 5, 6, 7,
|
||||
8, 9, 10, 11,
|
||||
12, 13, 14, 15,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
const int vp8_mbsplit_count [VP8_NUMMBSPLITS] = { 2, 2, 4, 16};
|
||||
@@ -155,17 +146,6 @@ const vp8_tree_index vp8_sub_mv_ref_tree[6] =
|
||||
-ZERO4X4, -NEW4X4
|
||||
};
|
||||
|
||||
|
||||
struct vp8_token_struct vp8_bmode_encodings [VP8_BINTRAMODES];
|
||||
struct vp8_token_struct vp8_ymode_encodings [VP8_YMODES];
|
||||
struct vp8_token_struct vp8_kf_ymode_encodings [VP8_YMODES];
|
||||
struct vp8_token_struct vp8_uv_mode_encodings [VP8_UV_MODES];
|
||||
struct vp8_token_struct vp8_mbsplit_encodings [VP8_NUMMBSPLITS];
|
||||
|
||||
struct vp8_token_struct vp8_mv_ref_encoding_array [VP8_MVREFS];
|
||||
struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
|
||||
|
||||
|
||||
const vp8_tree_index vp8_small_mvtree [14] =
|
||||
{
|
||||
2, 8,
|
||||
@@ -177,89 +157,21 @@ const vp8_tree_index vp8_small_mvtree [14] =
|
||||
-6, -7
|
||||
};
|
||||
|
||||
struct vp8_token_struct vp8_small_mvencodings [8];
|
||||
|
||||
void vp8_init_mbmode_probs(VP8_COMMON *x)
|
||||
{
|
||||
unsigned int bct [VP8_YMODES] [2]; /* num Ymodes > num UV modes */
|
||||
|
||||
vp8_tree_probs_from_distribution(
|
||||
VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree,
|
||||
x->fc.ymode_prob, bct, y_mode_cts,
|
||||
256, 1
|
||||
);
|
||||
vp8_tree_probs_from_distribution(
|
||||
VP8_YMODES, vp8_kf_ymode_encodings, vp8_kf_ymode_tree,
|
||||
x->kf_ymode_prob, bct, kf_y_mode_cts,
|
||||
256, 1
|
||||
);
|
||||
vp8_tree_probs_from_distribution(
|
||||
VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
|
||||
x->fc.uv_mode_prob, bct, uv_mode_cts,
|
||||
256, 1
|
||||
);
|
||||
vp8_tree_probs_from_distribution(
|
||||
VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
|
||||
x->kf_uv_mode_prob, bct, kf_uv_mode_cts,
|
||||
256, 1
|
||||
);
|
||||
vpx_memcpy(x->fc.ymode_prob, vp8_ymode_prob, sizeof(vp8_ymode_prob));
|
||||
vpx_memcpy(x->kf_ymode_prob, vp8_kf_ymode_prob, sizeof(vp8_kf_ymode_prob));
|
||||
vpx_memcpy(x->fc.uv_mode_prob, vp8_uv_mode_prob, sizeof(vp8_uv_mode_prob));
|
||||
vpx_memcpy(x->kf_uv_mode_prob, vp8_kf_uv_mode_prob, sizeof(vp8_kf_uv_mode_prob));
|
||||
vpx_memcpy(x->fc.sub_mv_ref_prob, sub_mv_ref_prob, sizeof(sub_mv_ref_prob));
|
||||
}
|
||||
|
||||
|
||||
static void intra_bmode_probs_from_distribution(
|
||||
vp8_prob p [VP8_BINTRAMODES-1],
|
||||
unsigned int branch_ct [VP8_BINTRAMODES-1] [2],
|
||||
const unsigned int events [VP8_BINTRAMODES]
|
||||
)
|
||||
{
|
||||
vp8_tree_probs_from_distribution(
|
||||
VP8_BINTRAMODES, vp8_bmode_encodings, vp8_bmode_tree,
|
||||
p, branch_ct, events,
|
||||
256, 1
|
||||
);
|
||||
}
|
||||
|
||||
void vp8_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES-1])
|
||||
{
|
||||
unsigned int branch_ct [VP8_BINTRAMODES-1] [2];
|
||||
intra_bmode_probs_from_distribution(p, branch_ct, bmode_cts);
|
||||
vpx_memcpy(p, vp8_bmode_prob, sizeof(vp8_bmode_prob));
|
||||
}
|
||||
|
||||
void vp8_kf_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1])
|
||||
{
|
||||
unsigned int branch_ct [VP8_BINTRAMODES-1] [2];
|
||||
|
||||
int i = 0;
|
||||
|
||||
do
|
||||
{
|
||||
int j = 0;
|
||||
|
||||
do
|
||||
{
|
||||
intra_bmode_probs_from_distribution(
|
||||
p[i][j], branch_ct, vp8_kf_default_bmode_counts[i][j]);
|
||||
|
||||
}
|
||||
while (++j < VP8_BINTRAMODES);
|
||||
}
|
||||
while (++i < VP8_BINTRAMODES);
|
||||
}
|
||||
|
||||
|
||||
void vp8_entropy_mode_init()
|
||||
{
|
||||
vp8_tokens_from_tree(vp8_bmode_encodings, vp8_bmode_tree);
|
||||
vp8_tokens_from_tree(vp8_ymode_encodings, vp8_ymode_tree);
|
||||
vp8_tokens_from_tree(vp8_kf_ymode_encodings, vp8_kf_ymode_tree);
|
||||
vp8_tokens_from_tree(vp8_uv_mode_encodings, vp8_uv_mode_tree);
|
||||
vp8_tokens_from_tree(vp8_mbsplit_encodings, vp8_mbsplit_tree);
|
||||
|
||||
vp8_tokens_from_tree_offset(vp8_mv_ref_encoding_array,
|
||||
vp8_mv_ref_tree, NEARESTMV);
|
||||
vp8_tokens_from_tree_offset(vp8_sub_mv_ref_encoding_array,
|
||||
vp8_sub_mv_ref_tree, LEFT4X4);
|
||||
|
||||
vp8_tokens_from_tree(vp8_small_mvencodings, vp8_small_mvtree);
|
||||
vpx_memcpy(p, vp8_kf_bmode_prob, sizeof(vp8_kf_bmode_prob));
|
||||
}
|
||||
|
||||
@@ -52,22 +52,20 @@ extern const vp8_tree_index vp8_mbsplit_tree[];
|
||||
extern const vp8_tree_index vp8_mv_ref_tree[];
|
||||
extern const vp8_tree_index vp8_sub_mv_ref_tree[];
|
||||
|
||||
extern struct vp8_token_struct vp8_bmode_encodings [VP8_BINTRAMODES];
|
||||
extern struct vp8_token_struct vp8_ymode_encodings [VP8_YMODES];
|
||||
extern struct vp8_token_struct vp8_kf_ymode_encodings [VP8_YMODES];
|
||||
extern struct vp8_token_struct vp8_uv_mode_encodings [VP8_UV_MODES];
|
||||
extern struct vp8_token_struct vp8_mbsplit_encodings [VP8_NUMMBSPLITS];
|
||||
extern const struct vp8_token_struct vp8_bmode_encodings[VP8_BINTRAMODES];
|
||||
extern const struct vp8_token_struct vp8_ymode_encodings[VP8_YMODES];
|
||||
extern const struct vp8_token_struct vp8_kf_ymode_encodings[VP8_YMODES];
|
||||
extern const struct vp8_token_struct vp8_uv_mode_encodings[VP8_UV_MODES];
|
||||
extern const struct vp8_token_struct vp8_mbsplit_encodings[VP8_NUMMBSPLITS];
|
||||
|
||||
/* Inter mode values do not start at zero */
|
||||
|
||||
extern struct vp8_token_struct vp8_mv_ref_encoding_array [VP8_MVREFS];
|
||||
extern struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
|
||||
extern const struct vp8_token_struct vp8_mv_ref_encoding_array[VP8_MVREFS];
|
||||
extern const struct vp8_token_struct vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS];
|
||||
|
||||
extern const vp8_tree_index vp8_small_mvtree[];
|
||||
|
||||
extern struct vp8_token_struct vp8_small_mvencodings [8];
|
||||
|
||||
void vp8_entropy_mode_init(void);
|
||||
extern const struct vp8_token_struct vp8_small_mvencodings[8];
|
||||
|
||||
void vp8_init_mbmode_probs(VP8_COMMON *x);
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ static int get_cpu_count()
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void vp8_machine_specific_config(VP8_COMMON *ctx)
|
||||
{
|
||||
#if CONFIG_MULTITHREAD
|
||||
@@ -93,6 +94,4 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
|
||||
#elif ARCH_X86 || ARCH_X86_64
|
||||
ctx->cpu_caps = x86_simd_caps();
|
||||
#endif
|
||||
|
||||
vpx_rtcd();
|
||||
}
|
||||
|
||||
31
vp8/common/idctllm_test.cc
Executable file
31
vp8/common/idctllm_test.cc
Executable file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
extern "C" {
|
||||
void vp8_short_idct4x4llm_c(short *input, unsigned char *pred_ptr,
|
||||
int pred_stride, unsigned char *dst_ptr,
|
||||
int dst_stride);
|
||||
}
|
||||
|
||||
#include "vpx_config.h"
|
||||
#include "idctllm_test.h"
|
||||
namespace
|
||||
{
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(C, IDCTTest,
|
||||
::testing::Values(vp8_short_idct4x4llm_c));
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
113
vp8/common/idctllm_test.h
Executable file
113
vp8/common/idctllm_test.h
Executable file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* 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 "third_party/googletest/src/include/gtest/gtest.h"
|
||||
typedef void (*idct_fn_t)(short *input, unsigned char *pred_ptr,
|
||||
int pred_stride, unsigned char *dst_ptr,
|
||||
int dst_stride);
|
||||
namespace {
|
||||
class IDCTTest : public ::testing::TestWithParam<idct_fn_t>
|
||||
{
|
||||
protected:
|
||||
virtual void SetUp()
|
||||
{
|
||||
int i;
|
||||
|
||||
UUT = GetParam();
|
||||
memset(input, 0, sizeof(input));
|
||||
/* Set up guard blocks */
|
||||
for(i=0; i<256; i++)
|
||||
output[i] = ((i&0xF)<4&&(i<64))?0:-1;
|
||||
}
|
||||
|
||||
idct_fn_t UUT;
|
||||
short input[16];
|
||||
unsigned char output[256];
|
||||
unsigned char predict[256];
|
||||
};
|
||||
|
||||
TEST_P(IDCTTest, TestGuardBlocks)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i=0; i<256; i++)
|
||||
if((i&0xF) < 4 && i<64)
|
||||
EXPECT_EQ(0, output[i]) << i;
|
||||
else
|
||||
EXPECT_EQ(255, output[i]);
|
||||
}
|
||||
|
||||
TEST_P(IDCTTest, TestAllZeros)
|
||||
{
|
||||
int i;
|
||||
|
||||
UUT(input, output, 16, output, 16);
|
||||
|
||||
for(i=0; i<256; i++)
|
||||
if((i&0xF) < 4 && i<64)
|
||||
EXPECT_EQ(0, output[i]) << "i==" << i;
|
||||
else
|
||||
EXPECT_EQ(255, output[i]) << "i==" << i;
|
||||
}
|
||||
|
||||
TEST_P(IDCTTest, TestAllOnes)
|
||||
{
|
||||
int i;
|
||||
|
||||
input[0] = 4;
|
||||
UUT(input, output, 16, output, 16);
|
||||
|
||||
for(i=0; i<256; i++)
|
||||
if((i&0xF) < 4 && i<64)
|
||||
EXPECT_EQ(1, output[i]) << "i==" << i;
|
||||
else
|
||||
EXPECT_EQ(255, output[i]) << "i==" << i;
|
||||
}
|
||||
|
||||
TEST_P(IDCTTest, TestAddOne)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i=0; i<256; i++)
|
||||
predict[i] = i;
|
||||
|
||||
input[0] = 4;
|
||||
UUT(input, predict, 16, output, 16);
|
||||
|
||||
for(i=0; i<256; i++)
|
||||
if((i&0xF) < 4 && i<64)
|
||||
EXPECT_EQ(i+1, output[i]) << "i==" << i;
|
||||
else
|
||||
EXPECT_EQ(255, output[i]) << "i==" << i;
|
||||
}
|
||||
|
||||
TEST_P(IDCTTest, TestWithData)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i=0; i<16; i++)
|
||||
input[i] = i;
|
||||
|
||||
UUT(input, output, 16, output, 16);
|
||||
|
||||
for(i=0; i<256; i++)
|
||||
if((i&0xF) > 3 || i>63)
|
||||
EXPECT_EQ(255, output[i]) << "i==" << i;
|
||||
else if(i == 0)
|
||||
EXPECT_EQ(11, output[i]) << "i==" << i;
|
||||
else if(i == 34)
|
||||
EXPECT_EQ(1, output[i]) << "i==" << i;
|
||||
else if(i == 2 || i == 17 || i == 32)
|
||||
EXPECT_EQ(3, output[i]) << "i==" << i;
|
||||
else
|
||||
EXPECT_EQ(0, output[i]) << "i==" << i;
|
||||
}
|
||||
}
|
||||
@@ -196,20 +196,18 @@ void vp8_loop_filter_frame_init(VP8_COMMON *cm,
|
||||
}
|
||||
}
|
||||
|
||||
void vp8_loop_filter_frame
|
||||
(
|
||||
VP8_COMMON *cm,
|
||||
MACROBLOCKD *mbd
|
||||
)
|
||||
void vp8_loop_filter_frame(VP8_COMMON *cm,
|
||||
MACROBLOCKD *mbd,
|
||||
int frame_type)
|
||||
{
|
||||
YV12_BUFFER_CONFIG *post = cm->frame_to_show;
|
||||
loop_filter_info_n *lfi_n = &cm->lf_info;
|
||||
loop_filter_info lfi;
|
||||
|
||||
FRAME_TYPE frame_type = cm->frame_type;
|
||||
|
||||
int mb_row;
|
||||
int mb_col;
|
||||
int mb_rows = cm->mb_rows;
|
||||
int mb_cols = cm->mb_cols;
|
||||
|
||||
int filter_level;
|
||||
|
||||
@@ -217,6 +215,8 @@ void vp8_loop_filter_frame
|
||||
|
||||
/* Point at base of Mb MODE_INFO list */
|
||||
const MODE_INFO *mode_info_context = cm->mi;
|
||||
int post_y_stride = post->y_stride;
|
||||
int post_uv_stride = post->uv_stride;
|
||||
|
||||
/* Initialize the loop filter for this frame. */
|
||||
vp8_loop_filter_frame_init(cm, mbd, cm->filter_level);
|
||||
@@ -227,9 +227,11 @@ void vp8_loop_filter_frame
|
||||
v_ptr = post->v_buffer;
|
||||
|
||||
/* vp8_filter each macro block */
|
||||
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
|
||||
if (cm->filter_type == NORMAL_LOOPFILTER)
|
||||
{
|
||||
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
|
||||
for (mb_row = 0; mb_row < mb_rows; mb_row++)
|
||||
{
|
||||
for (mb_col = 0; mb_col < mb_cols; mb_col++)
|
||||
{
|
||||
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
|
||||
mode_info_context->mbmi.mode != SPLITMV &&
|
||||
@@ -242,8 +244,6 @@ void vp8_loop_filter_frame
|
||||
filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
|
||||
|
||||
if (filter_level)
|
||||
{
|
||||
if (cm->filter_type == NORMAL_LOOPFILTER)
|
||||
{
|
||||
const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level];
|
||||
lfi.mblim = lfi_n->mblim[filter_level];
|
||||
@@ -253,40 +253,20 @@ void vp8_loop_filter_frame
|
||||
|
||||
if (mb_col > 0)
|
||||
vp8_loop_filter_mbv
|
||||
(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
|
||||
(y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
|
||||
|
||||
if (!skip_lf)
|
||||
vp8_loop_filter_bv
|
||||
(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
|
||||
(y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
|
||||
|
||||
/* don't apply across umv border */
|
||||
if (mb_row > 0)
|
||||
vp8_loop_filter_mbh
|
||||
(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
|
||||
(y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
|
||||
|
||||
if (!skip_lf)
|
||||
vp8_loop_filter_bh
|
||||
(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mb_col > 0)
|
||||
vp8_loop_filter_simple_mbv
|
||||
(y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
|
||||
|
||||
if (!skip_lf)
|
||||
vp8_loop_filter_simple_bv
|
||||
(y_ptr, post->y_stride, lfi_n->blim[filter_level]);
|
||||
|
||||
/* don't apply across umv border */
|
||||
if (mb_row > 0)
|
||||
vp8_loop_filter_simple_mbh
|
||||
(y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
|
||||
|
||||
if (!skip_lf)
|
||||
vp8_loop_filter_simple_bh
|
||||
(y_ptr, post->y_stride, lfi_n->blim[filter_level]);
|
||||
}
|
||||
(y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
|
||||
}
|
||||
|
||||
y_ptr += 16;
|
||||
@@ -295,12 +275,65 @@ void vp8_loop_filter_frame
|
||||
|
||||
mode_info_context++; /* step to next MB */
|
||||
}
|
||||
|
||||
y_ptr += post->y_stride * 16 - post->y_width;
|
||||
u_ptr += post->uv_stride * 8 - post->uv_width;
|
||||
v_ptr += post->uv_stride * 8 - post->uv_width;
|
||||
y_ptr += post_y_stride * 16 - post->y_width;
|
||||
u_ptr += post_uv_stride * 8 - post->uv_width;
|
||||
v_ptr += post_uv_stride * 8 - post->uv_width;
|
||||
|
||||
mode_info_context++; /* Skip border mb */
|
||||
|
||||
}
|
||||
}
|
||||
else /* SIMPLE_LOOPFILTER */
|
||||
{
|
||||
for (mb_row = 0; mb_row < mb_rows; mb_row++)
|
||||
{
|
||||
for (mb_col = 0; mb_col < mb_cols; mb_col++)
|
||||
{
|
||||
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
|
||||
mode_info_context->mbmi.mode != SPLITMV &&
|
||||
mode_info_context->mbmi.mb_skip_coeff);
|
||||
|
||||
const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
|
||||
const int seg = mode_info_context->mbmi.segment_id;
|
||||
const int ref_frame = mode_info_context->mbmi.ref_frame;
|
||||
|
||||
filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
|
||||
if (filter_level)
|
||||
{
|
||||
const unsigned char * mblim = lfi_n->mblim[filter_level];
|
||||
const unsigned char * blim = lfi_n->blim[filter_level];
|
||||
|
||||
if (mb_col > 0)
|
||||
vp8_loop_filter_simple_mbv
|
||||
(y_ptr, post_y_stride, mblim);
|
||||
|
||||
if (!skip_lf)
|
||||
vp8_loop_filter_simple_bv
|
||||
(y_ptr, post_y_stride, blim);
|
||||
|
||||
/* don't apply across umv border */
|
||||
if (mb_row > 0)
|
||||
vp8_loop_filter_simple_mbh
|
||||
(y_ptr, post_y_stride, mblim);
|
||||
|
||||
if (!skip_lf)
|
||||
vp8_loop_filter_simple_bh
|
||||
(y_ptr, post_y_stride, blim);
|
||||
}
|
||||
|
||||
y_ptr += 16;
|
||||
u_ptr += 8;
|
||||
v_ptr += 8;
|
||||
|
||||
mode_info_context++; /* step to next MB */
|
||||
}
|
||||
y_ptr += post_y_stride * 16 - post->y_width;
|
||||
u_ptr += post_uv_stride * 8 - post->uv_width;
|
||||
v_ptr += post_uv_stride * 8 - post->uv_width;
|
||||
|
||||
mode_info_context++; /* Skip border mb */
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,8 @@ void vp8_loop_filter_frame_init(struct VP8Common *cm,
|
||||
struct macroblockd *mbd,
|
||||
int default_filt_lvl);
|
||||
|
||||
void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd);
|
||||
void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd,
|
||||
int frame_type);
|
||||
|
||||
void vp8_loop_filter_partial_frame(struct VP8Common *cm,
|
||||
struct macroblockd *mbd,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
typedef unsigned char uc;
|
||||
|
||||
static __inline signed char vp8_signed_char_clamp(int t)
|
||||
static signed char vp8_signed_char_clamp(int t)
|
||||
{
|
||||
t = (t < -128 ? -128 : t);
|
||||
t = (t > 127 ? 127 : t);
|
||||
@@ -24,7 +24,7 @@ static __inline signed char vp8_signed_char_clamp(int t)
|
||||
|
||||
|
||||
/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
|
||||
static __inline signed char vp8_filter_mask(uc limit, uc blimit,
|
||||
static signed char vp8_filter_mask(uc limit, uc blimit,
|
||||
uc p3, uc p2, uc p1, uc p0,
|
||||
uc q0, uc q1, uc q2, uc q3)
|
||||
{
|
||||
@@ -40,7 +40,7 @@ static __inline signed char vp8_filter_mask(uc limit, uc blimit,
|
||||
}
|
||||
|
||||
/* is there high variance internal edge ( 11111111 yes, 00000000 no) */
|
||||
static __inline signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
|
||||
static signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
|
||||
{
|
||||
signed char hev = 0;
|
||||
hev |= (abs(p1 - p0) > thresh) * -1;
|
||||
@@ -48,7 +48,7 @@ static __inline signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
|
||||
return hev;
|
||||
}
|
||||
|
||||
static __inline void vp8_filter(signed char mask, uc hev, uc *op1,
|
||||
static void vp8_filter(signed char mask, uc hev, uc *op1,
|
||||
uc *op0, uc *oq0, uc *oq1)
|
||||
|
||||
{
|
||||
@@ -158,7 +158,7 @@ void vp8_loop_filter_vertical_edge_c
|
||||
while (++i < count * 8);
|
||||
}
|
||||
|
||||
static __inline void vp8_mbfilter(signed char mask, uc hev,
|
||||
static void vp8_mbfilter(signed char mask, uc hev,
|
||||
uc *op2, uc *op1, uc *op0, uc *oq0, uc *oq1, uc *oq2)
|
||||
{
|
||||
signed char s, u;
|
||||
@@ -279,7 +279,7 @@ void vp8_mbloop_filter_vertical_edge_c
|
||||
}
|
||||
|
||||
/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
|
||||
static __inline signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1)
|
||||
static signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1)
|
||||
{
|
||||
/* Why does this cause problems for win32?
|
||||
* error C2143: syntax error : missing ';' before 'type'
|
||||
@@ -289,7 +289,7 @@ static __inline signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q
|
||||
return mask;
|
||||
}
|
||||
|
||||
static __inline void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1)
|
||||
static void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1)
|
||||
{
|
||||
signed char vp8_filter, Filter1, Filter2;
|
||||
signed char p1 = (signed char) * op1 ^ 0x80;
|
||||
|
||||
@@ -11,45 +11,6 @@
|
||||
|
||||
#include "blockd.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PRED = 0,
|
||||
DEST = 1
|
||||
} BLOCKSET;
|
||||
|
||||
static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs)
|
||||
{
|
||||
int block;
|
||||
|
||||
unsigned char **y, **u, **v;
|
||||
|
||||
if (bs == DEST)
|
||||
{
|
||||
y = &x->dst.y_buffer;
|
||||
u = &x->dst.u_buffer;
|
||||
v = &x->dst.v_buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
y = &x->pre.y_buffer;
|
||||
u = &x->pre.u_buffer;
|
||||
v = &x->pre.v_buffer;
|
||||
}
|
||||
|
||||
for (block = 0; block < 16; block++) /* y blocks */
|
||||
{
|
||||
x->block[block].offset =
|
||||
(block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4;
|
||||
}
|
||||
|
||||
for (block = 16; block < 20; block++) /* U and V blocks */
|
||||
{
|
||||
x->block[block+4].offset =
|
||||
x->block[block].offset =
|
||||
((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4;
|
||||
}
|
||||
}
|
||||
|
||||
void vp8_setup_block_dptrs(MACROBLOCKD *x)
|
||||
{
|
||||
int r, c;
|
||||
@@ -90,8 +51,18 @@ void vp8_setup_block_dptrs(MACROBLOCKD *x)
|
||||
|
||||
void vp8_build_block_doffsets(MACROBLOCKD *x)
|
||||
{
|
||||
int block;
|
||||
|
||||
/* handle the destination pitch features */
|
||||
setup_macroblock(x, DEST);
|
||||
setup_macroblock(x, PRED);
|
||||
for (block = 0; block < 16; block++) /* y blocks */
|
||||
{
|
||||
x->block[block].offset =
|
||||
(block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4;
|
||||
}
|
||||
|
||||
for (block = 16; block < 20; block++) /* U and V blocks */
|
||||
{
|
||||
x->block[block+4].offset =
|
||||
x->block[block].offset =
|
||||
((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4;
|
||||
}
|
||||
}
|
||||
|
||||
385
vp8/common/mfqe.c
Normal file
385
vp8/common/mfqe.c
Normal file
@@ -0,0 +1,385 @@
|
||||
/*
|
||||
* Copyright (c) 2012 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.
|
||||
*/
|
||||
|
||||
|
||||
/* MFQE: Multiframe Quality Enhancement
|
||||
* In rate limited situations keyframes may cause significant visual artifacts
|
||||
* commonly referred to as "popping." This file implements a postproccesing
|
||||
* algorithm which blends data from the preceeding frame when there is no
|
||||
* motion and the q from the previous frame is lower which indicates that it is
|
||||
* higher quality.
|
||||
*/
|
||||
|
||||
#include "postproc.h"
|
||||
#include "variance.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "vpx_rtcd.h"
|
||||
#include "vpx_scale/yv12config.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static void filter_by_weight(unsigned char *src, int src_stride,
|
||||
unsigned char *dst, int dst_stride,
|
||||
int block_size, int src_weight)
|
||||
{
|
||||
int dst_weight = (1 << MFQE_PRECISION) - src_weight;
|
||||
int rounding_bit = 1 << (MFQE_PRECISION - 1);
|
||||
int r, c;
|
||||
|
||||
for (r = 0; r < block_size; r++)
|
||||
{
|
||||
for (c = 0; c < block_size; c++)
|
||||
{
|
||||
dst[c] = (src[c] * src_weight +
|
||||
dst[c] * dst_weight +
|
||||
rounding_bit) >> MFQE_PRECISION;
|
||||
}
|
||||
src += src_stride;
|
||||
dst += dst_stride;
|
||||
}
|
||||
}
|
||||
|
||||
void vp8_filter_by_weight16x16_c(unsigned char *src, int src_stride,
|
||||
unsigned char *dst, int dst_stride,
|
||||
int src_weight)
|
||||
{
|
||||
filter_by_weight(src, src_stride, dst, dst_stride, 16, src_weight);
|
||||
}
|
||||
|
||||
void vp8_filter_by_weight8x8_c(unsigned char *src, int src_stride,
|
||||
unsigned char *dst, int dst_stride,
|
||||
int src_weight)
|
||||
{
|
||||
filter_by_weight(src, src_stride, dst, dst_stride, 8, src_weight);
|
||||
}
|
||||
|
||||
void vp8_filter_by_weight4x4_c(unsigned char *src, int src_stride,
|
||||
unsigned char *dst, int dst_stride,
|
||||
int src_weight)
|
||||
{
|
||||
filter_by_weight(src, src_stride, dst, dst_stride, 4, src_weight);
|
||||
}
|
||||
|
||||
static void apply_ifactor(unsigned char *y_src,
|
||||
int y_src_stride,
|
||||
unsigned char *y_dst,
|
||||
int y_dst_stride,
|
||||
unsigned char *u_src,
|
||||
unsigned char *v_src,
|
||||
int uv_src_stride,
|
||||
unsigned char *u_dst,
|
||||
unsigned char *v_dst,
|
||||
int uv_dst_stride,
|
||||
int block_size,
|
||||
int src_weight)
|
||||
{
|
||||
if (block_size == 16)
|
||||
{
|
||||
vp8_filter_by_weight16x16(y_src, y_src_stride, y_dst, y_dst_stride, src_weight);
|
||||
vp8_filter_by_weight8x8(u_src, uv_src_stride, u_dst, uv_dst_stride, src_weight);
|
||||
vp8_filter_by_weight8x8(v_src, uv_src_stride, v_dst, uv_dst_stride, src_weight);
|
||||
}
|
||||
else /* if (block_size == 8) */
|
||||
{
|
||||
vp8_filter_by_weight8x8(y_src, y_src_stride, y_dst, y_dst_stride, src_weight);
|
||||
vp8_filter_by_weight4x4(u_src, uv_src_stride, u_dst, uv_dst_stride, src_weight);
|
||||
vp8_filter_by_weight4x4(v_src, uv_src_stride, v_dst, uv_dst_stride, src_weight);
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int int_sqrt(unsigned int x)
|
||||
{
|
||||
unsigned int y = x;
|
||||
unsigned int guess;
|
||||
int p = 1;
|
||||
while (y>>=1) p++;
|
||||
p>>=1;
|
||||
|
||||
guess=0;
|
||||
while (p>=0)
|
||||
{
|
||||
guess |= (1<<p);
|
||||
if (x<guess*guess)
|
||||
guess -= (1<<p);
|
||||
p--;
|
||||
}
|
||||
/* choose between guess or guess+1 */
|
||||
return guess+(guess*guess+guess+1<=x);
|
||||
}
|
||||
|
||||
#define USE_SSD
|
||||
static void multiframe_quality_enhance_block
|
||||
(
|
||||
int blksize, /* Currently only values supported are 16, 8 */
|
||||
int qcurr,
|
||||
int qprev,
|
||||
unsigned char *y,
|
||||
unsigned char *u,
|
||||
unsigned char *v,
|
||||
int y_stride,
|
||||
int uv_stride,
|
||||
unsigned char *yd,
|
||||
unsigned char *ud,
|
||||
unsigned char *vd,
|
||||
int yd_stride,
|
||||
int uvd_stride
|
||||
)
|
||||
{
|
||||
static const unsigned char VP8_ZEROS[16]=
|
||||
{
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
int uvblksize = blksize >> 1;
|
||||
int qdiff = qcurr - qprev;
|
||||
|
||||
int i;
|
||||
unsigned char *up;
|
||||
unsigned char *udp;
|
||||
unsigned char *vp;
|
||||
unsigned char *vdp;
|
||||
|
||||
unsigned int act, actd, sad, usad, vsad, sse, thr, thrsq, actrisk;
|
||||
|
||||
if (blksize == 16)
|
||||
{
|
||||
actd = (vp8_variance16x16(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
|
||||
act = (vp8_variance16x16(y, y_stride, VP8_ZEROS, 0, &sse)+128)>>8;
|
||||
#ifdef USE_SSD
|
||||
sad = (vp8_variance16x16(y, y_stride, yd, yd_stride, &sse));
|
||||
sad = (sse + 128)>>8;
|
||||
usad = (vp8_variance8x8(u, uv_stride, ud, uvd_stride, &sse));
|
||||
usad = (sse + 32)>>6;
|
||||
vsad = (vp8_variance8x8(v, uv_stride, vd, uvd_stride, &sse));
|
||||
vsad = (sse + 32)>>6;
|
||||
#else
|
||||
sad = (vp8_sad16x16(y, y_stride, yd, yd_stride, INT_MAX)+128)>>8;
|
||||
usad = (vp8_sad8x8(u, uv_stride, ud, uvd_stride, INT_MAX)+32)>>6;
|
||||
vsad = (vp8_sad8x8(v, uv_stride, vd, uvd_stride, INT_MAX)+32)>>6;
|
||||
#endif
|
||||
}
|
||||
else /* if (blksize == 8) */
|
||||
{
|
||||
actd = (vp8_variance8x8(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
|
||||
act = (vp8_variance8x8(y, y_stride, VP8_ZEROS, 0, &sse)+32)>>6;
|
||||
#ifdef USE_SSD
|
||||
sad = (vp8_variance8x8(y, y_stride, yd, yd_stride, &sse));
|
||||
sad = (sse + 32)>>6;
|
||||
usad = (vp8_variance4x4(u, uv_stride, ud, uvd_stride, &sse));
|
||||
usad = (sse + 8)>>4;
|
||||
vsad = (vp8_variance4x4(v, uv_stride, vd, uvd_stride, &sse));
|
||||
vsad = (sse + 8)>>4;
|
||||
#else
|
||||
sad = (vp8_sad8x8(y, y_stride, yd, yd_stride, INT_MAX)+32)>>6;
|
||||
usad = (vp8_sad4x4(u, uv_stride, ud, uvd_stride, INT_MAX)+8)>>4;
|
||||
vsad = (vp8_sad4x4(v, uv_stride, vd, uvd_stride, INT_MAX)+8)>>4;
|
||||
#endif
|
||||
}
|
||||
|
||||
actrisk = (actd > act * 5);
|
||||
|
||||
/* thr = qdiff/8 + log2(act) + log4(qprev) */
|
||||
thr = (qdiff >> 3);
|
||||
while (actd >>= 1) thr++;
|
||||
while (qprev >>= 2) thr++;
|
||||
|
||||
#ifdef USE_SSD
|
||||
thrsq = thr * thr;
|
||||
if (sad < thrsq &&
|
||||
/* additional checks for color mismatch and excessive addition of
|
||||
* high-frequencies */
|
||||
4 * usad < thrsq && 4 * vsad < thrsq && !actrisk)
|
||||
#else
|
||||
if (sad < thr &&
|
||||
/* additional checks for color mismatch and excessive addition of
|
||||
* high-frequencies */
|
||||
2 * usad < thr && 2 * vsad < thr && !actrisk)
|
||||
#endif
|
||||
{
|
||||
int ifactor;
|
||||
#ifdef USE_SSD
|
||||
/* TODO: optimize this later to not need sqr root */
|
||||
sad = int_sqrt(sad);
|
||||
#endif
|
||||
ifactor = (sad << MFQE_PRECISION) / thr;
|
||||
ifactor >>= (qdiff >> 5);
|
||||
|
||||
if (ifactor)
|
||||
{
|
||||
apply_ifactor(y, y_stride, yd, yd_stride,
|
||||
u, v, uv_stride,
|
||||
ud, vd, uvd_stride,
|
||||
blksize, ifactor);
|
||||
}
|
||||
}
|
||||
else /* else implicitly copy from previous frame */
|
||||
{
|
||||
if (blksize == 16)
|
||||
{
|
||||
vp8_copy_mem16x16(y, y_stride, yd, yd_stride);
|
||||
vp8_copy_mem8x8(u, uv_stride, ud, uvd_stride);
|
||||
vp8_copy_mem8x8(v, uv_stride, vd, uvd_stride);
|
||||
}
|
||||
else /* if (blksize == 8) */
|
||||
{
|
||||
vp8_copy_mem8x8(y, y_stride, yd, yd_stride);
|
||||
for (up = u, udp = ud, i = 0; i < uvblksize; ++i, up += uv_stride, udp += uvd_stride)
|
||||
vpx_memcpy(udp, up, uvblksize);
|
||||
for (vp = v, vdp = vd, i = 0; i < uvblksize; ++i, vp += uv_stride, vdp += uvd_stride)
|
||||
vpx_memcpy(vdp, vp, uvblksize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int qualify_inter_mb(const MODE_INFO *mode_info_context, int *map)
|
||||
{
|
||||
if (mode_info_context->mbmi.mb_skip_coeff)
|
||||
map[0] = map[1] = map[2] = map[3] = 1;
|
||||
else if (mode_info_context->mbmi.mode==SPLITMV)
|
||||
{
|
||||
static int ndx[4][4] =
|
||||
{
|
||||
{0, 1, 4, 5},
|
||||
{2, 3, 6, 7},
|
||||
{8, 9, 12, 13},
|
||||
{10, 11, 14, 15}
|
||||
};
|
||||
int i, j;
|
||||
for (i=0; i<4; ++i)
|
||||
{
|
||||
map[i] = 1;
|
||||
for (j=0; j<4 && map[j]; ++j)
|
||||
map[i] &= (mode_info_context->bmi[ndx[i][j]].mv.as_mv.row <= 2 &&
|
||||
mode_info_context->bmi[ndx[i][j]].mv.as_mv.col <= 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
map[0] = map[1] = map[2] = map[3] =
|
||||
(mode_info_context->mbmi.mode > B_PRED &&
|
||||
abs(mode_info_context->mbmi.mv.as_mv.row) <= 2 &&
|
||||
abs(mode_info_context->mbmi.mv.as_mv.col) <= 2);
|
||||
}
|
||||
return (map[0]+map[1]+map[2]+map[3]);
|
||||
}
|
||||
|
||||
void vp8_multiframe_quality_enhance
|
||||
(
|
||||
VP8_COMMON *cm
|
||||
)
|
||||
{
|
||||
YV12_BUFFER_CONFIG *show = cm->frame_to_show;
|
||||
YV12_BUFFER_CONFIG *dest = &cm->post_proc_buffer;
|
||||
|
||||
FRAME_TYPE frame_type = cm->frame_type;
|
||||
/* Point at base of Mb MODE_INFO list has motion vectors etc */
|
||||
const MODE_INFO *mode_info_context = cm->mi;
|
||||
int mb_row;
|
||||
int mb_col;
|
||||
int totmap, map[4];
|
||||
int qcurr = cm->base_qindex;
|
||||
int qprev = cm->postproc_state.last_base_qindex;
|
||||
|
||||
unsigned char *y_ptr, *u_ptr, *v_ptr;
|
||||
unsigned char *yd_ptr, *ud_ptr, *vd_ptr;
|
||||
|
||||
/* Set up the buffer pointers */
|
||||
y_ptr = show->y_buffer;
|
||||
u_ptr = show->u_buffer;
|
||||
v_ptr = show->v_buffer;
|
||||
yd_ptr = dest->y_buffer;
|
||||
ud_ptr = dest->u_buffer;
|
||||
vd_ptr = dest->v_buffer;
|
||||
|
||||
/* postprocess each macro block */
|
||||
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
|
||||
{
|
||||
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
|
||||
{
|
||||
/* if motion is high there will likely be no benefit */
|
||||
if (frame_type == INTER_FRAME) totmap = qualify_inter_mb(mode_info_context, map);
|
||||
else totmap = (frame_type == KEY_FRAME ? 4 : 0);
|
||||
if (totmap)
|
||||
{
|
||||
if (totmap < 4)
|
||||
{
|
||||
int i, j;
|
||||
for (i=0; i<2; ++i)
|
||||
for (j=0; j<2; ++j)
|
||||
{
|
||||
if (map[i*2+j])
|
||||
{
|
||||
multiframe_quality_enhance_block(8, qcurr, qprev,
|
||||
y_ptr + 8*(i*show->y_stride+j),
|
||||
u_ptr + 4*(i*show->uv_stride+j),
|
||||
v_ptr + 4*(i*show->uv_stride+j),
|
||||
show->y_stride,
|
||||
show->uv_stride,
|
||||
yd_ptr + 8*(i*dest->y_stride+j),
|
||||
ud_ptr + 4*(i*dest->uv_stride+j),
|
||||
vd_ptr + 4*(i*dest->uv_stride+j),
|
||||
dest->y_stride,
|
||||
dest->uv_stride);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* copy a 8x8 block */
|
||||
int k;
|
||||
unsigned char *up = u_ptr + 4*(i*show->uv_stride+j);
|
||||
unsigned char *udp = ud_ptr + 4*(i*dest->uv_stride+j);
|
||||
unsigned char *vp = v_ptr + 4*(i*show->uv_stride+j);
|
||||
unsigned char *vdp = vd_ptr + 4*(i*dest->uv_stride+j);
|
||||
vp8_copy_mem8x8(y_ptr + 8*(i*show->y_stride+j), show->y_stride,
|
||||
yd_ptr + 8*(i*dest->y_stride+j), dest->y_stride);
|
||||
for (k = 0; k < 4; ++k, up += show->uv_stride, udp += dest->uv_stride,
|
||||
vp += show->uv_stride, vdp += dest->uv_stride)
|
||||
{
|
||||
vpx_memcpy(udp, up, 4);
|
||||
vpx_memcpy(vdp, vp, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else /* totmap = 4 */
|
||||
{
|
||||
multiframe_quality_enhance_block(16, qcurr, qprev, y_ptr,
|
||||
u_ptr, v_ptr,
|
||||
show->y_stride,
|
||||
show->uv_stride,
|
||||
yd_ptr, ud_ptr, vd_ptr,
|
||||
dest->y_stride,
|
||||
dest->uv_stride);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vp8_copy_mem16x16(y_ptr, show->y_stride, yd_ptr, dest->y_stride);
|
||||
vp8_copy_mem8x8(u_ptr, show->uv_stride, ud_ptr, dest->uv_stride);
|
||||
vp8_copy_mem8x8(v_ptr, show->uv_stride, vd_ptr, dest->uv_stride);
|
||||
}
|
||||
y_ptr += 16;
|
||||
u_ptr += 8;
|
||||
v_ptr += 8;
|
||||
yd_ptr += 16;
|
||||
ud_ptr += 8;
|
||||
vd_ptr += 8;
|
||||
mode_info_context++; /* step to next MB */
|
||||
}
|
||||
|
||||
y_ptr += show->y_stride * 16 - 16 * cm->mb_cols;
|
||||
u_ptr += show->uv_stride * 8 - 8 * cm->mb_cols;
|
||||
v_ptr += show->uv_stride * 8 - 8 * cm->mb_cols;
|
||||
yd_ptr += dest->y_stride * 16 - 16 * cm->mb_cols;
|
||||
ud_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols;
|
||||
vd_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols;
|
||||
|
||||
mode_info_context++; /* Skip border mb */
|
||||
}
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
* 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 "entropymode.h"
|
||||
|
||||
const unsigned int vp8_kf_default_bmode_counts [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES] =
|
||||
{
|
||||
{
|
||||
/*Above Mode : 0*/
|
||||
{ 43438, 2195, 470, 316, 615, 171, 217, 412, 124, 160, }, /* left_mode 0 */
|
||||
{ 5722, 2751, 296, 291, 81, 68, 80, 101, 100, 170, }, /* left_mode 1 */
|
||||
{ 1629, 201, 307, 25, 47, 16, 34, 72, 19, 28, }, /* left_mode 2 */
|
||||
{ 332, 266, 36, 500, 20, 65, 23, 14, 154, 106, }, /* left_mode 3 */
|
||||
{ 450, 97, 10, 24, 117, 10, 2, 12, 8, 71, }, /* left_mode 4 */
|
||||
{ 384, 49, 29, 44, 12, 162, 51, 5, 87, 42, }, /* left_mode 5 */
|
||||
{ 495, 53, 157, 27, 14, 57, 180, 17, 17, 34, }, /* left_mode 6 */
|
||||
{ 695, 64, 62, 9, 27, 5, 3, 147, 10, 26, }, /* left_mode 7 */
|
||||
{ 230, 54, 20, 124, 16, 125, 29, 12, 283, 37, }, /* left_mode 8 */
|
||||
{ 260, 87, 21, 120, 32, 16, 33, 16, 33, 203, }, /* left_mode 9 */
|
||||
},
|
||||
{
|
||||
/*Above Mode : 1*/
|
||||
{ 3934, 2573, 355, 137, 128, 87, 133, 117, 37, 27, }, /* left_mode 0 */
|
||||
{ 1036, 1929, 278, 135, 27, 37, 48, 55, 41, 91, }, /* left_mode 1 */
|
||||
{ 223, 256, 253, 15, 13, 9, 28, 64, 3, 3, }, /* left_mode 2 */
|
||||
{ 120, 129, 17, 316, 15, 11, 9, 4, 53, 74, }, /* left_mode 3 */
|
||||
{ 129, 58, 6, 11, 38, 2, 0, 5, 2, 67, }, /* left_mode 4 */
|
||||
{ 53, 22, 11, 16, 8, 26, 14, 3, 19, 12, }, /* left_mode 5 */
|
||||
{ 59, 26, 61, 11, 4, 9, 35, 13, 8, 8, }, /* left_mode 6 */
|
||||
{ 101, 52, 40, 8, 5, 2, 8, 59, 2, 20, }, /* left_mode 7 */
|
||||
{ 48, 34, 10, 52, 8, 15, 6, 6, 63, 20, }, /* left_mode 8 */
|
||||
{ 96, 48, 22, 63, 11, 14, 5, 8, 9, 96, }, /* left_mode 9 */
|
||||
},
|
||||
{
|
||||
/*Above Mode : 2*/
|
||||
{ 709, 461, 506, 36, 27, 33, 151, 98, 24, 6, }, /* left_mode 0 */
|
||||
{ 201, 375, 442, 27, 13, 8, 46, 58, 6, 19, }, /* left_mode 1 */
|
||||
{ 122, 140, 417, 4, 13, 3, 33, 59, 4, 2, }, /* left_mode 2 */
|
||||
{ 36, 17, 22, 16, 6, 8, 12, 17, 9, 21, }, /* left_mode 3 */
|
||||
{ 51, 15, 7, 1, 14, 0, 4, 5, 3, 22, }, /* left_mode 4 */
|
||||
{ 18, 11, 30, 9, 7, 20, 11, 5, 2, 6, }, /* left_mode 5 */
|
||||
{ 38, 21, 103, 9, 4, 12, 79, 13, 2, 5, }, /* left_mode 6 */
|
||||
{ 64, 17, 66, 2, 12, 4, 2, 65, 4, 5, }, /* left_mode 7 */
|
||||
{ 14, 7, 7, 16, 3, 11, 4, 13, 15, 16, }, /* left_mode 8 */
|
||||
{ 36, 8, 32, 9, 9, 4, 14, 7, 6, 24, }, /* left_mode 9 */
|
||||
},
|
||||
{
|
||||
/*Above Mode : 3*/
|
||||
{ 1340, 173, 36, 119, 30, 10, 13, 10, 20, 26, }, /* left_mode 0 */
|
||||
{ 156, 293, 26, 108, 5, 16, 2, 4, 23, 30, }, /* left_mode 1 */
|
||||
{ 60, 34, 13, 7, 3, 3, 0, 8, 4, 5, }, /* left_mode 2 */
|
||||
{ 72, 64, 1, 235, 3, 9, 2, 7, 28, 38, }, /* left_mode 3 */
|
||||
{ 29, 14, 1, 3, 5, 0, 2, 2, 5, 13, }, /* left_mode 4 */
|
||||
{ 22, 7, 4, 11, 2, 5, 1, 2, 6, 4, }, /* left_mode 5 */
|
||||
{ 18, 14, 5, 6, 4, 3, 14, 0, 9, 2, }, /* left_mode 6 */
|
||||
{ 41, 10, 7, 1, 2, 0, 0, 10, 2, 1, }, /* left_mode 7 */
|
||||
{ 23, 19, 2, 33, 1, 5, 2, 0, 51, 8, }, /* left_mode 8 */
|
||||
{ 33, 26, 7, 53, 3, 9, 3, 3, 9, 19, }, /* left_mode 9 */
|
||||
},
|
||||
{
|
||||
/*Above Mode : 4*/
|
||||
{ 410, 165, 43, 31, 66, 15, 30, 54, 8, 17, }, /* left_mode 0 */
|
||||
{ 115, 64, 27, 18, 30, 7, 11, 15, 4, 19, }, /* left_mode 1 */
|
||||
{ 31, 23, 25, 1, 7, 2, 2, 10, 0, 5, }, /* left_mode 2 */
|
||||
{ 17, 4, 1, 6, 8, 2, 7, 5, 5, 21, }, /* left_mode 3 */
|
||||
{ 120, 12, 1, 2, 83, 3, 0, 4, 1, 40, }, /* left_mode 4 */
|
||||
{ 4, 3, 1, 2, 1, 2, 5, 0, 3, 6, }, /* left_mode 5 */
|
||||
{ 10, 2, 13, 6, 6, 6, 8, 2, 4, 5, }, /* left_mode 6 */
|
||||
{ 58, 10, 5, 1, 28, 1, 1, 33, 1, 9, }, /* left_mode 7 */
|
||||
{ 8, 2, 1, 4, 2, 5, 1, 1, 2, 10, }, /* left_mode 8 */
|
||||
{ 76, 7, 5, 7, 18, 2, 2, 0, 5, 45, }, /* left_mode 9 */
|
||||
},
|
||||
{
|
||||
/*Above Mode : 5*/
|
||||
{ 444, 46, 47, 20, 14, 110, 60, 14, 60, 7, }, /* left_mode 0 */
|
||||
{ 59, 57, 25, 18, 3, 17, 21, 6, 14, 6, }, /* left_mode 1 */
|
||||
{ 24, 17, 20, 6, 4, 13, 7, 2, 3, 2, }, /* left_mode 2 */
|
||||
{ 13, 11, 5, 14, 4, 9, 2, 4, 15, 7, }, /* left_mode 3 */
|
||||
{ 8, 5, 2, 1, 4, 0, 1, 1, 2, 12, }, /* left_mode 4 */
|
||||
{ 19, 5, 5, 7, 4, 40, 6, 3, 10, 4, }, /* left_mode 5 */
|
||||
{ 16, 5, 9, 1, 1, 16, 26, 2, 10, 4, }, /* left_mode 6 */
|
||||
{ 11, 4, 8, 1, 1, 4, 4, 5, 4, 1, }, /* left_mode 7 */
|
||||
{ 15, 1, 3, 7, 3, 21, 7, 1, 34, 5, }, /* left_mode 8 */
|
||||
{ 18, 5, 1, 3, 4, 3, 7, 1, 2, 9, }, /* left_mode 9 */
|
||||
},
|
||||
{
|
||||
/*Above Mode : 6*/
|
||||
{ 476, 149, 94, 13, 14, 77, 291, 27, 23, 3, }, /* left_mode 0 */
|
||||
{ 79, 83, 42, 14, 2, 12, 63, 2, 4, 14, }, /* left_mode 1 */
|
||||
{ 43, 36, 55, 1, 3, 8, 42, 11, 5, 1, }, /* left_mode 2 */
|
||||
{ 9, 9, 6, 16, 1, 5, 6, 3, 11, 10, }, /* left_mode 3 */
|
||||
{ 10, 3, 1, 3, 10, 1, 0, 1, 1, 4, }, /* left_mode 4 */
|
||||
{ 14, 6, 15, 5, 1, 20, 25, 2, 5, 0, }, /* left_mode 5 */
|
||||
{ 28, 7, 51, 1, 0, 8, 127, 6, 2, 5, }, /* left_mode 6 */
|
||||
{ 13, 3, 3, 2, 3, 1, 2, 8, 1, 2, }, /* left_mode 7 */
|
||||
{ 10, 3, 3, 3, 3, 8, 2, 2, 9, 3, }, /* left_mode 8 */
|
||||
{ 13, 7, 11, 4, 0, 4, 6, 2, 5, 8, }, /* left_mode 9 */
|
||||
},
|
||||
{
|
||||
/*Above Mode : 7*/
|
||||
{ 376, 135, 119, 6, 32, 8, 31, 224, 9, 3, }, /* left_mode 0 */
|
||||
{ 93, 60, 54, 6, 13, 7, 8, 92, 2, 12, }, /* left_mode 1 */
|
||||
{ 74, 36, 84, 0, 3, 2, 9, 67, 2, 1, }, /* left_mode 2 */
|
||||
{ 19, 4, 4, 8, 8, 2, 4, 7, 6, 16, }, /* left_mode 3 */
|
||||
{ 51, 7, 4, 1, 77, 3, 0, 14, 1, 15, }, /* left_mode 4 */
|
||||
{ 7, 7, 5, 7, 4, 7, 4, 5, 0, 3, }, /* left_mode 5 */
|
||||
{ 18, 2, 19, 2, 2, 4, 12, 11, 1, 2, }, /* left_mode 6 */
|
||||
{ 129, 6, 27, 1, 21, 3, 0, 189, 0, 6, }, /* left_mode 7 */
|
||||
{ 9, 1, 2, 8, 3, 7, 0, 5, 3, 3, }, /* left_mode 8 */
|
||||
{ 20, 4, 5, 10, 4, 2, 7, 17, 3, 16, }, /* left_mode 9 */
|
||||
},
|
||||
{
|
||||
/*Above Mode : 8*/
|
||||
{ 617, 68, 34, 79, 11, 27, 25, 14, 75, 13, }, /* left_mode 0 */
|
||||
{ 51, 82, 21, 26, 6, 12, 13, 1, 26, 16, }, /* left_mode 1 */
|
||||
{ 29, 9, 12, 11, 3, 7, 1, 10, 2, 2, }, /* left_mode 2 */
|
||||
{ 17, 19, 11, 74, 4, 3, 2, 0, 58, 13, }, /* left_mode 3 */
|
||||
{ 10, 1, 1, 3, 4, 1, 0, 2, 1, 8, }, /* left_mode 4 */
|
||||
{ 14, 4, 5, 5, 1, 13, 2, 0, 27, 8, }, /* left_mode 5 */
|
||||
{ 10, 3, 5, 4, 1, 7, 6, 4, 5, 1, }, /* left_mode 6 */
|
||||
{ 10, 2, 6, 2, 1, 1, 1, 4, 2, 1, }, /* left_mode 7 */
|
||||
{ 14, 8, 5, 23, 2, 12, 6, 2, 117, 5, }, /* left_mode 8 */
|
||||
{ 9, 6, 2, 19, 1, 6, 3, 2, 9, 9, }, /* left_mode 9 */
|
||||
},
|
||||
{
|
||||
/*Above Mode : 9*/
|
||||
{ 680, 73, 22, 38, 42, 5, 11, 9, 6, 28, }, /* left_mode 0 */
|
||||
{ 113, 112, 21, 22, 10, 2, 8, 4, 6, 42, }, /* left_mode 1 */
|
||||
{ 44, 20, 24, 6, 5, 4, 3, 3, 1, 2, }, /* left_mode 2 */
|
||||
{ 40, 23, 7, 71, 5, 2, 4, 1, 7, 22, }, /* left_mode 3 */
|
||||
{ 85, 9, 4, 4, 17, 2, 0, 3, 2, 23, }, /* left_mode 4 */
|
||||
{ 13, 4, 2, 6, 1, 7, 0, 1, 7, 6, }, /* left_mode 5 */
|
||||
{ 26, 6, 8, 3, 2, 3, 8, 1, 5, 4, }, /* left_mode 6 */
|
||||
{ 54, 8, 9, 6, 7, 0, 1, 11, 1, 3, }, /* left_mode 7 */
|
||||
{ 9, 10, 4, 13, 2, 5, 4, 2, 14, 8, }, /* left_mode 8 */
|
||||
{ 92, 9, 5, 19, 15, 3, 3, 1, 6, 58, }, /* left_mode 9 */
|
||||
},
|
||||
};
|
||||
@@ -60,19 +60,19 @@ extern "C"
|
||||
MODE_BESTQUALITY = 0x2,
|
||||
MODE_FIRSTPASS = 0x3,
|
||||
MODE_SECONDPASS = 0x4,
|
||||
MODE_SECONDPASS_BEST = 0x5,
|
||||
MODE_SECONDPASS_BEST = 0x5
|
||||
} MODE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FRAMEFLAGS_KEY = 1,
|
||||
FRAMEFLAGS_GOLDEN = 2,
|
||||
FRAMEFLAGS_ALTREF = 4,
|
||||
FRAMEFLAGS_ALTREF = 4
|
||||
} FRAMETYPE_FLAGS;
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
static __inline void Scale2Ratio(int mode, int *hr, int *hs)
|
||||
static void Scale2Ratio(int mode, int *hr, int *hs)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ extern "C"
|
||||
int Width; // width of data passed to the compressor
|
||||
int Height; // height of data passed to the compressor
|
||||
struct vpx_rational timebase;
|
||||
int target_bandwidth; // bandwidth to be used in kilobits per second
|
||||
unsigned int target_bandwidth; // bandwidth to be used in kilobits per second
|
||||
|
||||
int noise_sensitivity; // parameter used for applying pre processing blur: recommendation 0
|
||||
int Sharpness; // parameter used for sharpening output: recommendation 0:
|
||||
@@ -207,10 +207,10 @@ extern "C"
|
||||
|
||||
// Temporal scaling parameters
|
||||
unsigned int number_of_layers;
|
||||
unsigned int target_bitrate[MAX_PERIODICITY];
|
||||
unsigned int rate_decimator[MAX_PERIODICITY];
|
||||
unsigned int target_bitrate[VPX_TS_MAX_PERIODICITY];
|
||||
unsigned int rate_decimator[VPX_TS_MAX_PERIODICITY];
|
||||
unsigned int periodicity;
|
||||
unsigned int layer_id[MAX_PERIODICITY];
|
||||
unsigned int layer_id[VPX_TS_MAX_PERIODICITY];
|
||||
|
||||
#if CONFIG_MULTI_RES_ENCODING
|
||||
/* Number of total resolutions encoded */
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
#include "header.h"
|
||||
/*#endif*/
|
||||
|
||||
/* Create/destroy static data structures. */
|
||||
|
||||
void vp8_initialize_common(void);
|
||||
|
||||
#define MINQ 0
|
||||
#define MAXQ 127
|
||||
#define QINDEX_RANGE (MAXQ + 1)
|
||||
@@ -92,11 +88,13 @@ typedef struct VP8Common
|
||||
int fb_idx_ref_cnt[NUM_YV12_BUFFERS];
|
||||
int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx;
|
||||
|
||||
YV12_BUFFER_CONFIG post_proc_buffer;
|
||||
YV12_BUFFER_CONFIG temp_scale_frame;
|
||||
|
||||
#if CONFIG_POSTPROC
|
||||
YV12_BUFFER_CONFIG post_proc_buffer;
|
||||
YV12_BUFFER_CONFIG post_proc_buffer_int;
|
||||
int post_proc_buffer_int_used;
|
||||
#endif
|
||||
|
||||
FRAME_TYPE last_frame_type; /* Save last frame's frame type for motion search. */
|
||||
FRAME_TYPE frame_type;
|
||||
|
||||
@@ -14,10 +14,8 @@
|
||||
#include "vpx_scale/yv12config.h"
|
||||
#include "postproc.h"
|
||||
#include "common.h"
|
||||
#include "vpx_scale/yv12extend.h"
|
||||
#include "vpx_scale/vpxscale.h"
|
||||
#include "systemdependent.h"
|
||||
#include "../encoder/variance.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
@@ -30,7 +28,6 @@
|
||||
( (0.439*(float)(t>>16)) - (0.368*(float)(t>>8&0xff)) - (0.071*(float)(t&0xff)) + 128)
|
||||
|
||||
/* global constants */
|
||||
#define MFQE_PRECISION 4
|
||||
#if CONFIG_POSTPROC_VISUALIZER
|
||||
static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] =
|
||||
{
|
||||
@@ -362,6 +359,7 @@ void vp8_deblock(YV12_BUFFER_CONFIG *source,
|
||||
vp8_post_proc_down_and_across(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl);
|
||||
}
|
||||
|
||||
#if !(CONFIG_TEMPORAL_DENOISING)
|
||||
void vp8_de_noise(YV12_BUFFER_CONFIG *source,
|
||||
YV12_BUFFER_CONFIG *post,
|
||||
int q,
|
||||
@@ -398,6 +396,7 @@ void vp8_de_noise(YV12_BUFFER_CONFIG *source,
|
||||
source->uv_width - 4, ppl);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
double vp8_gaussian(double sigma, double mu, double x)
|
||||
{
|
||||
@@ -405,9 +404,6 @@ double vp8_gaussian(double sigma, double mu, double x)
|
||||
(exp(-(x - mu) * (x - mu) / (2 * sigma * sigma)));
|
||||
}
|
||||
|
||||
extern void (*vp8_clear_system_state)(void);
|
||||
|
||||
|
||||
static void fillrd(struct postproc_state *state, int q, int a)
|
||||
{
|
||||
char char_dist[300];
|
||||
@@ -693,214 +689,7 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void multiframe_quality_enhance_block
|
||||
(
|
||||
int blksize, /* Currently only values supported are 16, 8, 4 */
|
||||
int qcurr,
|
||||
int qprev,
|
||||
unsigned char *y,
|
||||
unsigned char *u,
|
||||
unsigned char *v,
|
||||
int y_stride,
|
||||
int uv_stride,
|
||||
unsigned char *yd,
|
||||
unsigned char *ud,
|
||||
unsigned char *vd,
|
||||
int yd_stride,
|
||||
int uvd_stride
|
||||
)
|
||||
{
|
||||
static const unsigned char VP8_ZEROS[16]=
|
||||
{
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
};
|
||||
int blksizeby2 = blksize >> 1;
|
||||
int qdiff = qcurr - qprev;
|
||||
|
||||
int i, j;
|
||||
unsigned char *yp;
|
||||
unsigned char *ydp;
|
||||
unsigned char *up;
|
||||
unsigned char *udp;
|
||||
unsigned char *vp;
|
||||
unsigned char *vdp;
|
||||
|
||||
unsigned int act, sse, sad, thr;
|
||||
if (blksize == 16)
|
||||
{
|
||||
act = (vp8_variance16x16(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
|
||||
sad = (vp8_sad16x16(y, y_stride, yd, yd_stride, INT_MAX)+128)>>8;
|
||||
}
|
||||
else if (blksize == 8)
|
||||
{
|
||||
act = (vp8_variance8x8(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
|
||||
sad = (vp8_sad8x8(y, y_stride, yd, yd_stride, INT_MAX)+32)>>6;
|
||||
}
|
||||
else
|
||||
{
|
||||
act = (vp8_variance4x4(yd, yd_stride, VP8_ZEROS, 0, &sse)+8)>>4;
|
||||
sad = (vp8_sad4x4(y, y_stride, yd, yd_stride, INT_MAX)+8)>>4;
|
||||
}
|
||||
/* thr = qdiff/8 + log2(act) + log4(qprev) */
|
||||
thr = (qdiff>>3);
|
||||
while (act>>=1) thr++;
|
||||
while (qprev>>=2) thr++;
|
||||
if (sad < thr)
|
||||
{
|
||||
static const int roundoff = (1 << (MFQE_PRECISION - 1));
|
||||
int ifactor = (sad << MFQE_PRECISION) / thr;
|
||||
ifactor >>= (qdiff >> 5);
|
||||
// TODO: SIMD optimize this section
|
||||
if (ifactor)
|
||||
{
|
||||
int icfactor = (1 << MFQE_PRECISION) - ifactor;
|
||||
for (yp = y, ydp = yd, i = 0; i < blksize; ++i, yp += y_stride, ydp += yd_stride)
|
||||
{
|
||||
for (j = 0; j < blksize; ++j)
|
||||
ydp[j] = (int)((yp[j] * ifactor + ydp[j] * icfactor + roundoff) >> MFQE_PRECISION);
|
||||
}
|
||||
for (up = u, udp = ud, i = 0; i < blksizeby2; ++i, up += uv_stride, udp += uvd_stride)
|
||||
{
|
||||
for (j = 0; j < blksizeby2; ++j)
|
||||
udp[j] = (int)((up[j] * ifactor + udp[j] * icfactor + roundoff) >> MFQE_PRECISION);
|
||||
}
|
||||
for (vp = v, vdp = vd, i = 0; i < blksizeby2; ++i, vp += uv_stride, vdp += uvd_stride)
|
||||
{
|
||||
for (j = 0; j < blksizeby2; ++j)
|
||||
vdp[j] = (int)((vp[j] * ifactor + vdp[j] * icfactor + roundoff) >> MFQE_PRECISION);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (blksize == 16)
|
||||
{
|
||||
vp8_copy_mem16x16(y, y_stride, yd, yd_stride);
|
||||
vp8_copy_mem8x8(u, uv_stride, ud, uvd_stride);
|
||||
vp8_copy_mem8x8(v, uv_stride, vd, uvd_stride);
|
||||
}
|
||||
else if (blksize == 8)
|
||||
{
|
||||
vp8_copy_mem8x8(y, y_stride, yd, yd_stride);
|
||||
for (up = u, udp = ud, i = 0; i < blksizeby2; ++i, up += uv_stride, udp += uvd_stride)
|
||||
vpx_memcpy(udp, up, blksizeby2);
|
||||
for (vp = v, vdp = vd, i = 0; i < blksizeby2; ++i, vp += uv_stride, vdp += uvd_stride)
|
||||
vpx_memcpy(vdp, vp, blksizeby2);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (yp = y, ydp = yd, i = 0; i < blksize; ++i, yp += y_stride, ydp += yd_stride)
|
||||
vpx_memcpy(ydp, yp, blksize);
|
||||
for (up = u, udp = ud, i = 0; i < blksizeby2; ++i, up += uv_stride, udp += uvd_stride)
|
||||
vpx_memcpy(udp, up, blksizeby2);
|
||||
for (vp = v, vdp = vd, i = 0; i < blksizeby2; ++i, vp += uv_stride, vdp += uvd_stride)
|
||||
vpx_memcpy(vdp, vp, blksizeby2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void vp8_multiframe_quality_enhance
|
||||
(
|
||||
VP8_COMMON *cm
|
||||
)
|
||||
{
|
||||
YV12_BUFFER_CONFIG *show = cm->frame_to_show;
|
||||
YV12_BUFFER_CONFIG *dest = &cm->post_proc_buffer;
|
||||
|
||||
FRAME_TYPE frame_type = cm->frame_type;
|
||||
/* Point at base of Mb MODE_INFO list has motion vectors etc */
|
||||
const MODE_INFO *mode_info_context = cm->mi;
|
||||
int mb_row;
|
||||
int mb_col;
|
||||
int qcurr = cm->base_qindex;
|
||||
int qprev = cm->postproc_state.last_base_qindex;
|
||||
|
||||
unsigned char *y_ptr, *u_ptr, *v_ptr;
|
||||
unsigned char *yd_ptr, *ud_ptr, *vd_ptr;
|
||||
|
||||
/* Set up the buffer pointers */
|
||||
y_ptr = show->y_buffer;
|
||||
u_ptr = show->u_buffer;
|
||||
v_ptr = show->v_buffer;
|
||||
yd_ptr = dest->y_buffer;
|
||||
ud_ptr = dest->u_buffer;
|
||||
vd_ptr = dest->v_buffer;
|
||||
|
||||
/* postprocess each macro block */
|
||||
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
|
||||
{
|
||||
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
|
||||
{
|
||||
/* if motion is high there will likely be no benefit */
|
||||
if (((frame_type == INTER_FRAME &&
|
||||
abs(mode_info_context->mbmi.mv.as_mv.row) <= 10 &&
|
||||
abs(mode_info_context->mbmi.mv.as_mv.col) <= 10) ||
|
||||
(frame_type == KEY_FRAME)))
|
||||
{
|
||||
if (mode_info_context->mbmi.mode == B_PRED || mode_info_context->mbmi.mode == SPLITMV)
|
||||
{
|
||||
int i, j;
|
||||
for (i=0; i<2; ++i)
|
||||
for (j=0; j<2; ++j)
|
||||
multiframe_quality_enhance_block(8,
|
||||
qcurr,
|
||||
qprev,
|
||||
y_ptr + 8*(i*show->y_stride+j),
|
||||
u_ptr + 4*(i*show->uv_stride+j),
|
||||
v_ptr + 4*(i*show->uv_stride+j),
|
||||
show->y_stride,
|
||||
show->uv_stride,
|
||||
yd_ptr + 8*(i*dest->y_stride+j),
|
||||
ud_ptr + 4*(i*dest->uv_stride+j),
|
||||
vd_ptr + 4*(i*dest->uv_stride+j),
|
||||
dest->y_stride,
|
||||
dest->uv_stride);
|
||||
}
|
||||
else
|
||||
{
|
||||
multiframe_quality_enhance_block(16,
|
||||
qcurr,
|
||||
qprev,
|
||||
y_ptr,
|
||||
u_ptr,
|
||||
v_ptr,
|
||||
show->y_stride,
|
||||
show->uv_stride,
|
||||
yd_ptr,
|
||||
ud_ptr,
|
||||
vd_ptr,
|
||||
dest->y_stride,
|
||||
dest->uv_stride);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vp8_copy_mem16x16(y_ptr, show->y_stride, yd_ptr, dest->y_stride);
|
||||
vp8_copy_mem8x8(u_ptr, show->uv_stride, ud_ptr, dest->uv_stride);
|
||||
vp8_copy_mem8x8(v_ptr, show->uv_stride, vd_ptr, dest->uv_stride);
|
||||
}
|
||||
y_ptr += 16;
|
||||
u_ptr += 8;
|
||||
v_ptr += 8;
|
||||
yd_ptr += 16;
|
||||
ud_ptr += 8;
|
||||
vd_ptr += 8;
|
||||
mode_info_context++; /* step to next MB */
|
||||
}
|
||||
|
||||
y_ptr += show->y_stride * 16 - 16 * cm->mb_cols;
|
||||
u_ptr += show->uv_stride * 8 - 8 * cm->mb_cols;
|
||||
v_ptr += show->uv_stride * 8 - 8 * cm->mb_cols;
|
||||
yd_ptr += dest->y_stride * 16 - 16 * cm->mb_cols;
|
||||
ud_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols;
|
||||
vd_ptr += dest->uv_stride * 8 - 8 * cm->mb_cols;
|
||||
|
||||
mode_info_context++; /* Skip border mb */
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_POSTPROC
|
||||
int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags)
|
||||
{
|
||||
int q = oci->filter_level * 10 / 6;
|
||||
@@ -923,6 +712,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
|
||||
dest->y_height = oci->Height;
|
||||
dest->uv_height = dest->y_height / 2;
|
||||
oci->postproc_state.last_base_qindex = oci->base_qindex;
|
||||
oci->postproc_state.last_frame_valid = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -943,7 +733,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
|
||||
|
||||
// insure that postproc is set to all 0's so that post proc
|
||||
// doesn't pull random data in from edge
|
||||
vpx_memset((&oci->post_proc_buffer_int)->buffer_alloc,126,(&oci->post_proc_buffer)->frame_size);
|
||||
vpx_memset((&oci->post_proc_buffer_int)->buffer_alloc,128,(&oci->post_proc_buffer)->frame_size);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -953,6 +743,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
|
||||
#endif
|
||||
|
||||
if ((flags & VP8D_MFQE) &&
|
||||
oci->postproc_state.last_frame_valid &&
|
||||
oci->current_video_frame >= 2 &&
|
||||
oci->base_qindex - oci->postproc_state.last_base_qindex >= 10)
|
||||
{
|
||||
@@ -960,7 +751,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
|
||||
if (((flags & VP8D_DEBLOCK) || (flags & VP8D_DEMACROBLOCK)) &&
|
||||
oci->post_proc_buffer_int_used)
|
||||
{
|
||||
vp8_yv12_copy_frame_ptr(&oci->post_proc_buffer, &oci->post_proc_buffer_int);
|
||||
vp8_yv12_copy_frame(&oci->post_proc_buffer, &oci->post_proc_buffer_int);
|
||||
if (flags & VP8D_DEMACROBLOCK)
|
||||
{
|
||||
vp8_deblock_and_de_macro_block(&oci->post_proc_buffer_int, &oci->post_proc_buffer,
|
||||
@@ -989,9 +780,10 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
|
||||
}
|
||||
else
|
||||
{
|
||||
vp8_yv12_copy_frame_ptr(oci->frame_to_show, &oci->post_proc_buffer);
|
||||
vp8_yv12_copy_frame(oci->frame_to_show, &oci->post_proc_buffer);
|
||||
oci->postproc_state.last_base_qindex = oci->base_qindex;
|
||||
}
|
||||
oci->postproc_state.last_frame_valid = 1;
|
||||
|
||||
if (flags & VP8D_ADDNOISE)
|
||||
{
|
||||
@@ -1378,3 +1170,4 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
|
||||
dest->uv_height = dest->y_height / 2;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -19,6 +19,7 @@ struct postproc_state
|
||||
int last_noise;
|
||||
char noise[3072];
|
||||
int last_base_qindex;
|
||||
int last_frame_valid;
|
||||
DECLARE_ALIGNED(16, char, blackclamp[16]);
|
||||
DECLARE_ALIGNED(16, char, whiteclamp[16]);
|
||||
DECLARE_ALIGNED(16, char, bothclamp[16]);
|
||||
@@ -40,4 +41,8 @@ void vp8_deblock(YV12_BUFFER_CONFIG *source,
|
||||
int q,
|
||||
int low_var_thresh,
|
||||
int flag);
|
||||
|
||||
#define MFQE_PRECISION 4
|
||||
|
||||
void vp8_multiframe_quality_enhance(struct VP8Common *cm);
|
||||
#endif
|
||||
|
||||
@@ -14,143 +14,20 @@
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "blockd.h"
|
||||
|
||||
/* For skip_recon_mb(), add vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) and
|
||||
* vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x).
|
||||
*/
|
||||
|
||||
void vp8_build_intra_predictors_mby_c(MACROBLOCKD *x)
|
||||
void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x,
|
||||
unsigned char * yabove_row,
|
||||
unsigned char * yleft,
|
||||
int left_stride,
|
||||
unsigned char * ypred_ptr,
|
||||
int y_stride)
|
||||
{
|
||||
|
||||
unsigned char *yabove_row = x->dst.y_buffer - x->dst.y_stride;
|
||||
unsigned char yleft_col[16];
|
||||
unsigned char ytop_left = yabove_row[-1];
|
||||
unsigned char *ypred_ptr = x->predictor;
|
||||
int r, c, i;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
yleft_col[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
|
||||
}
|
||||
|
||||
/* for Y */
|
||||
switch (x->mode_info_context->mbmi.mode)
|
||||
{
|
||||
case DC_PRED:
|
||||
{
|
||||
int expected_dc;
|
||||
int i;
|
||||
int shift;
|
||||
int average = 0;
|
||||
|
||||
|
||||
if (x->up_available || x->left_available)
|
||||
{
|
||||
if (x->up_available)
|
||||
{
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
average += yabove_row[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (x->left_available)
|
||||
{
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
average += yleft_col[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
shift = 3 + x->up_available + x->left_available;
|
||||
expected_dc = (average + (1 << (shift - 1))) >> shift;
|
||||
}
|
||||
else
|
||||
{
|
||||
expected_dc = 128;
|
||||
}
|
||||
|
||||
vpx_memset(ypred_ptr, expected_dc, 256);
|
||||
}
|
||||
break;
|
||||
case V_PRED:
|
||||
{
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
|
||||
((int *)ypred_ptr)[0] = ((int *)yabove_row)[0];
|
||||
((int *)ypred_ptr)[1] = ((int *)yabove_row)[1];
|
||||
((int *)ypred_ptr)[2] = ((int *)yabove_row)[2];
|
||||
((int *)ypred_ptr)[3] = ((int *)yabove_row)[3];
|
||||
ypred_ptr += 16;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case H_PRED:
|
||||
{
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
|
||||
vpx_memset(ypred_ptr, yleft_col[r], 16);
|
||||
ypred_ptr += 16;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case TM_PRED:
|
||||
{
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
for (c = 0; c < 16; c++)
|
||||
{
|
||||
int pred = yleft_col[r] + yabove_row[ c] - ytop_left;
|
||||
|
||||
if (pred < 0)
|
||||
pred = 0;
|
||||
|
||||
if (pred > 255)
|
||||
pred = 255;
|
||||
|
||||
ypred_ptr[c] = pred;
|
||||
}
|
||||
|
||||
ypred_ptr += 16;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case B_PRED:
|
||||
case NEARESTMV:
|
||||
case NEARMV:
|
||||
case ZEROMV:
|
||||
case NEWMV:
|
||||
case SPLITMV:
|
||||
case MB_MODE_COUNT:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x)
|
||||
{
|
||||
|
||||
unsigned char *yabove_row = x->dst.y_buffer - x->dst.y_stride;
|
||||
unsigned char yleft_col[16];
|
||||
unsigned char ytop_left = yabove_row[-1];
|
||||
unsigned char *ypred_ptr = x->predictor;
|
||||
int r, c, i;
|
||||
|
||||
int y_stride = x->dst.y_stride;
|
||||
ypred_ptr = x->dst.y_buffer; /*x->predictor;*/
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
yleft_col[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
|
||||
yleft_col[i] = yleft[i* left_stride];
|
||||
}
|
||||
|
||||
/* for Y */
|
||||
@@ -198,7 +75,7 @@ void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x)
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
vpx_memset(ypred_ptr, expected_dc, 16);
|
||||
ypred_ptr += y_stride; /*16;*/
|
||||
ypred_ptr += y_stride;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -212,7 +89,7 @@ void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x)
|
||||
((int *)ypred_ptr)[1] = ((int *)yabove_row)[1];
|
||||
((int *)ypred_ptr)[2] = ((int *)yabove_row)[2];
|
||||
((int *)ypred_ptr)[3] = ((int *)yabove_row)[3];
|
||||
ypred_ptr += y_stride; /*16;*/
|
||||
ypred_ptr += y_stride;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -223,7 +100,7 @@ void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x)
|
||||
{
|
||||
|
||||
vpx_memset(ypred_ptr, yleft_col[r], 16);
|
||||
ypred_ptr += y_stride; /*16;*/
|
||||
ypred_ptr += y_stride;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -246,7 +123,7 @@ void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x)
|
||||
ypred_ptr[c] = pred;
|
||||
}
|
||||
|
||||
ypred_ptr += y_stride; /*16;*/
|
||||
ypred_ptr += y_stride;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -262,162 +139,27 @@ void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x)
|
||||
}
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mbuv_c(MACROBLOCKD *x)
|
||||
void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x,
|
||||
unsigned char * uabove_row,
|
||||
unsigned char * vabove_row,
|
||||
unsigned char * uleft,
|
||||
unsigned char * vleft,
|
||||
int left_stride,
|
||||
unsigned char * upred_ptr,
|
||||
unsigned char * vpred_ptr,
|
||||
int pred_stride)
|
||||
{
|
||||
unsigned char *uabove_row = x->dst.u_buffer - x->dst.uv_stride;
|
||||
unsigned char uleft_col[16];
|
||||
unsigned char uleft_col[8];
|
||||
unsigned char utop_left = uabove_row[-1];
|
||||
unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride;
|
||||
unsigned char vleft_col[20];
|
||||
unsigned char vleft_col[8];
|
||||
unsigned char vtop_left = vabove_row[-1];
|
||||
unsigned char *upred_ptr = &x->predictor[256];
|
||||
unsigned char *vpred_ptr = &x->predictor[320];
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
uleft_col[i] = x->dst.u_buffer [i* x->dst.uv_stride -1];
|
||||
vleft_col[i] = x->dst.v_buffer [i* x->dst.uv_stride -1];
|
||||
}
|
||||
|
||||
switch (x->mode_info_context->mbmi.uv_mode)
|
||||
{
|
||||
case DC_PRED:
|
||||
{
|
||||
int expected_udc;
|
||||
int expected_vdc;
|
||||
int i;
|
||||
int shift;
|
||||
int Uaverage = 0;
|
||||
int Vaverage = 0;
|
||||
|
||||
if (x->up_available)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
Uaverage += uabove_row[i];
|
||||
Vaverage += vabove_row[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (x->left_available)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
Uaverage += uleft_col[i];
|
||||
Vaverage += vleft_col[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (!x->up_available && !x->left_available)
|
||||
{
|
||||
expected_udc = 128;
|
||||
expected_vdc = 128;
|
||||
}
|
||||
else
|
||||
{
|
||||
shift = 2 + x->up_available + x->left_available;
|
||||
expected_udc = (Uaverage + (1 << (shift - 1))) >> shift;
|
||||
expected_vdc = (Vaverage + (1 << (shift - 1))) >> shift;
|
||||
}
|
||||
|
||||
|
||||
vpx_memset(upred_ptr, expected_udc, 64);
|
||||
vpx_memset(vpred_ptr, expected_vdc, 64);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case V_PRED:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
vpx_memcpy(upred_ptr, uabove_row, 8);
|
||||
vpx_memcpy(vpred_ptr, vabove_row, 8);
|
||||
upred_ptr += 8;
|
||||
vpred_ptr += 8;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case H_PRED:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
vpx_memset(upred_ptr, uleft_col[i], 8);
|
||||
vpx_memset(vpred_ptr, vleft_col[i], 8);
|
||||
upred_ptr += 8;
|
||||
vpred_ptr += 8;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case TM_PRED:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
int predu = uleft_col[i] + uabove_row[j] - utop_left;
|
||||
int predv = vleft_col[i] + vabove_row[j] - vtop_left;
|
||||
|
||||
if (predu < 0)
|
||||
predu = 0;
|
||||
|
||||
if (predu > 255)
|
||||
predu = 255;
|
||||
|
||||
if (predv < 0)
|
||||
predv = 0;
|
||||
|
||||
if (predv > 255)
|
||||
predv = 255;
|
||||
|
||||
upred_ptr[j] = predu;
|
||||
vpred_ptr[j] = predv;
|
||||
}
|
||||
|
||||
upred_ptr += 8;
|
||||
vpred_ptr += 8;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case B_PRED:
|
||||
case NEARESTMV:
|
||||
case NEARMV:
|
||||
case ZEROMV:
|
||||
case NEWMV:
|
||||
case SPLITMV:
|
||||
case MB_MODE_COUNT:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x)
|
||||
{
|
||||
unsigned char *uabove_row = x->dst.u_buffer - x->dst.uv_stride;
|
||||
unsigned char uleft_col[16];
|
||||
unsigned char utop_left = uabove_row[-1];
|
||||
unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride;
|
||||
unsigned char vleft_col[20];
|
||||
unsigned char vtop_left = vabove_row[-1];
|
||||
unsigned char *upred_ptr = x->dst.u_buffer; /*&x->predictor[256];*/
|
||||
unsigned char *vpred_ptr = x->dst.v_buffer; /*&x->predictor[320];*/
|
||||
int uv_stride = x->dst.uv_stride;
|
||||
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
uleft_col[i] = x->dst.u_buffer [i* x->dst.uv_stride -1];
|
||||
vleft_col[i] = x->dst.v_buffer [i* x->dst.uv_stride -1];
|
||||
uleft_col[i] = uleft [i* left_stride];
|
||||
vleft_col[i] = vleft [i* left_stride];
|
||||
}
|
||||
|
||||
switch (x->mode_info_context->mbmi.uv_mode)
|
||||
@@ -468,8 +210,8 @@ void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x)
|
||||
{
|
||||
vpx_memset(upred_ptr, expected_udc, 8);
|
||||
vpx_memset(vpred_ptr, expected_vdc, 8);
|
||||
upred_ptr += uv_stride; /*8;*/
|
||||
vpred_ptr += uv_stride; /*8;*/
|
||||
upred_ptr += pred_stride;
|
||||
vpred_ptr += pred_stride;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -481,8 +223,8 @@ void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x)
|
||||
{
|
||||
vpx_memcpy(upred_ptr, uabove_row, 8);
|
||||
vpx_memcpy(vpred_ptr, vabove_row, 8);
|
||||
upred_ptr += uv_stride; /*8;*/
|
||||
vpred_ptr += uv_stride; /*8;*/
|
||||
upred_ptr += pred_stride;
|
||||
vpred_ptr += pred_stride;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -495,8 +237,8 @@ void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x)
|
||||
{
|
||||
vpx_memset(upred_ptr, uleft_col[i], 8);
|
||||
vpx_memset(vpred_ptr, vleft_col[i], 8);
|
||||
upred_ptr += uv_stride; /*8;*/
|
||||
vpred_ptr += uv_stride; /*8;*/
|
||||
upred_ptr += pred_stride;
|
||||
vpred_ptr += pred_stride;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,8 +270,8 @@ void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x)
|
||||
vpred_ptr[j] = predv;
|
||||
}
|
||||
|
||||
upred_ptr += uv_stride; /*8;*/
|
||||
vpred_ptr += uv_stride; /*8;*/
|
||||
upred_ptr += pred_stride;
|
||||
vpred_ptr += pred_stride;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,20 +13,19 @@
|
||||
#include "vpx_rtcd.h"
|
||||
#include "blockd.h"
|
||||
|
||||
void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
|
||||
void vp8_intra4x4_predict_d_c(unsigned char *Above,
|
||||
unsigned char *yleft, int left_stride,
|
||||
int b_mode,
|
||||
unsigned char *dst, int dst_stride)
|
||||
unsigned char *dst, int dst_stride,
|
||||
unsigned char top_left)
|
||||
{
|
||||
int i, r, c;
|
||||
|
||||
unsigned char *Above = src - src_stride;
|
||||
unsigned char Left[4];
|
||||
unsigned char top_left = Above[-1];
|
||||
|
||||
Left[0] = src[-1];
|
||||
Left[1] = src[-1 + src_stride];
|
||||
Left[2] = src[-1 + 2 * src_stride];
|
||||
Left[3] = src[-1 + 3 * src_stride];
|
||||
Left[0] = yleft[0];
|
||||
Left[1] = yleft[left_stride];
|
||||
Left[2] = yleft[2 * left_stride];
|
||||
Left[3] = yleft[3 * left_stride];
|
||||
|
||||
switch (b_mode)
|
||||
{
|
||||
@@ -295,24 +294,15 @@ void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
|
||||
* to the right prediction have filled in pixels to use.
|
||||
*/
|
||||
void vp8_intra_prediction_down_copy(MACROBLOCKD *x)
|
||||
void vp8_intra4x4_predict_c(unsigned char *src, int src_stride,
|
||||
int b_mode,
|
||||
unsigned char *dst, int dst_stride)
|
||||
{
|
||||
int dst_stride = x->dst.y_stride;
|
||||
unsigned char *above_right = x->dst.y_buffer - dst_stride + 16;
|
||||
unsigned char *Above = src - src_stride;
|
||||
|
||||
unsigned int *src_ptr = (unsigned int *)above_right;
|
||||
unsigned int *dst_ptr0 = (unsigned int *)(above_right + 4 * dst_stride);
|
||||
unsigned int *dst_ptr1 = (unsigned int *)(above_right + 8 * dst_stride);
|
||||
unsigned int *dst_ptr2 = (unsigned int *)(above_right + 12 * dst_stride);
|
||||
|
||||
*dst_ptr0 = *src_ptr;
|
||||
*dst_ptr1 = *src_ptr;
|
||||
*dst_ptr2 = *src_ptr;
|
||||
vp8_intra4x4_predict_d_c(Above,
|
||||
src - 1, src_stride,
|
||||
b_mode,
|
||||
dst, dst_stride,
|
||||
Above[-1]);
|
||||
}
|
||||
|
||||
@@ -11,9 +11,22 @@
|
||||
|
||||
#ifndef __INC_RECONINTRA4x4_H
|
||||
#define __INC_RECONINTRA4x4_H
|
||||
#include "vp8/common/blockd.h"
|
||||
|
||||
struct macroblockd;
|
||||
static void intra_prediction_down_copy(MACROBLOCKD *xd,
|
||||
unsigned char *above_right_src)
|
||||
{
|
||||
int dst_stride = xd->dst.y_stride;
|
||||
unsigned char *above_right_dst = xd->dst.y_buffer - dst_stride + 16;
|
||||
|
||||
extern void vp8_intra_prediction_down_copy(struct macroblockd *x);
|
||||
unsigned int *src_ptr = (unsigned int *)above_right_src;
|
||||
unsigned int *dst_ptr0 = (unsigned int *)(above_right_dst + 4 * dst_stride);
|
||||
unsigned int *dst_ptr1 = (unsigned int *)(above_right_dst + 8 * dst_stride);
|
||||
unsigned int *dst_ptr2 = (unsigned int *)(above_right_dst + 12 * dst_stride);
|
||||
|
||||
*dst_ptr0 = *src_ptr;
|
||||
*dst_ptr1 = *src_ptr;
|
||||
*dst_ptr2 = *src_ptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,3 +10,60 @@
|
||||
#include "vpx_config.h"
|
||||
#define RTCD_C
|
||||
#include "vpx_rtcd.h"
|
||||
|
||||
#if CONFIG_MULTITHREAD && HAVE_PTHREAD_H
|
||||
#include <pthread.h>
|
||||
static void once(void (*func)(void))
|
||||
{
|
||||
static pthread_once_t lock = PTHREAD_ONCE_INIT;
|
||||
pthread_once(&lock, func);
|
||||
}
|
||||
|
||||
|
||||
#elif CONFIG_MULTITHREAD && defined(_WIN32)
|
||||
#include <windows.h>
|
||||
static void once(void (*func)(void))
|
||||
{
|
||||
/* Using a static initializer here rather than InitializeCriticalSection()
|
||||
* since there's no race-free context in which to execute it. Protecting
|
||||
* it with an atomic op like InterlockedCompareExchangePointer introduces
|
||||
* an x86 dependency, and InitOnceExecuteOnce requires Vista.
|
||||
*/
|
||||
static CRITICAL_SECTION lock = {(void *)-1, -1, 0, 0, 0, 0};
|
||||
static int done;
|
||||
|
||||
EnterCriticalSection(&lock);
|
||||
|
||||
if (!done)
|
||||
{
|
||||
func();
|
||||
done = 1;
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&lock);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
/* No-op version that performs no synchronization. vpx_rtcd() is idempotent,
|
||||
* so as long as your platform provides atomic loads/stores of pointers
|
||||
* no synchronization is strictly necessary.
|
||||
*/
|
||||
|
||||
static void once(void (*func)(void))
|
||||
{
|
||||
static int done;
|
||||
|
||||
if(!done)
|
||||
{
|
||||
func();
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void vpx_rtcd()
|
||||
{
|
||||
once(setup_rtcd_internal);
|
||||
}
|
||||
|
||||
@@ -122,18 +122,14 @@ prototype void vp8_copy_mem8x4 "unsigned char *src, int src_pitch, unsigned char
|
||||
specialize vp8_copy_mem8x4 mmx media neon
|
||||
vp8_copy_mem8x4_media=vp8_copy_mem8x4_v6
|
||||
|
||||
prototype void vp8_build_intra_predictors_mby "struct macroblockd *x"
|
||||
specialize vp8_build_intra_predictors_mby sse2 ssse3 neon
|
||||
prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x, unsigned char * yabove_row, unsigned char * yleft, int left_stride, unsigned char * ypred_ptr, int y_stride"
|
||||
specialize vp8_build_intra_predictors_mby_s sse2 ssse3
|
||||
#TODO: fix assembly for neon
|
||||
|
||||
prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x"
|
||||
specialize vp8_build_intra_predictors_mby_s sse2 ssse3 neon
|
||||
|
||||
prototype void vp8_build_intra_predictors_mbuv "struct macroblockd *x"
|
||||
specialize vp8_build_intra_predictors_mbuv sse2 ssse3
|
||||
|
||||
prototype void vp8_build_intra_predictors_mbuv_s "struct macroblockd *x"
|
||||
prototype void vp8_build_intra_predictors_mbuv_s "struct macroblockd *x, unsigned char * uabove_row, unsigned char * vabove_row, unsigned char *uleft, unsigned char *vleft, int left_stride, unsigned char * upred_ptr, unsigned char * vpred_ptr, int pred_stride"
|
||||
specialize vp8_build_intra_predictors_mbuv_s sse2 ssse3
|
||||
|
||||
prototype void vp8_intra4x4_predict_d "unsigned char *above, unsigned char *left, int left_stride, int b_mode, unsigned char *dst, int dst_stride, unsigned char top_left"
|
||||
prototype void vp8_intra4x4_predict "unsigned char *src, int src_stride, int b_mode, unsigned char *dst, int dst_stride"
|
||||
specialize vp8_intra4x4_predict media
|
||||
vp8_intra4x4_predict_media=vp8_intra4x4_predict_armv6
|
||||
@@ -166,6 +162,15 @@ if [ "$CONFIG_POSTPROC" = "yes" ]; then
|
||||
|
||||
prototype void vp8_blend_b "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride"
|
||||
# no asm yet
|
||||
|
||||
prototype void vp8_filter_by_weight16x16 "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight"
|
||||
specialize vp8_filter_by_weight16x16 sse2
|
||||
|
||||
prototype void vp8_filter_by_weight8x8 "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight"
|
||||
specialize vp8_filter_by_weight8x8 sse2
|
||||
|
||||
prototype void vp8_filter_by_weight4x4 "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight"
|
||||
# no asm yet
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -203,11 +208,6 @@ prototype void vp8_bilinear_predict4x4 "unsigned char *src, int src_pitch, int x
|
||||
specialize vp8_bilinear_predict4x4 mmx media neon
|
||||
vp8_bilinear_predict4x4_media=vp8_bilinear_predict4x4_armv6
|
||||
|
||||
#
|
||||
# Encoder functions below this point.
|
||||
#
|
||||
if [ "$CONFIG_VP8_ENCODER" = "yes" ]; then
|
||||
|
||||
#
|
||||
# Whole-pixel Variance
|
||||
#
|
||||
@@ -273,27 +273,6 @@ specialize vp8_variance_halfpixvar16x16_hv mmx sse2 media neon
|
||||
vp8_variance_halfpixvar16x16_hv_sse2=vp8_variance_halfpixvar16x16_hv_wmt
|
||||
vp8_variance_halfpixvar16x16_hv_media=vp8_variance_halfpixvar16x16_hv_armv6
|
||||
|
||||
#
|
||||
# Sum of squares (vector)
|
||||
#
|
||||
prototype unsigned int vp8_get_mb_ss "const short *"
|
||||
specialize vp8_get_mb_ss mmx sse2
|
||||
|
||||
#
|
||||
# SSE (Sum Squared Error)
|
||||
#
|
||||
prototype unsigned int vp8_sub_pixel_mse16x16 "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse"
|
||||
specialize vp8_sub_pixel_mse16x16 mmx sse2
|
||||
vp8_sub_pixel_mse16x16_sse2=vp8_sub_pixel_mse16x16_wmt
|
||||
|
||||
prototype unsigned int vp8_mse16x16 "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
|
||||
specialize vp8_mse16x16 mmx sse2 media neon
|
||||
vp8_mse16x16_sse2=vp8_mse16x16_wmt
|
||||
vp8_mse16x16_media=vp8_mse16x16_armv6
|
||||
|
||||
prototype unsigned int vp8_get4x4sse_cs "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride"
|
||||
specialize vp8_get4x4sse_cs mmx neon
|
||||
|
||||
#
|
||||
# Single block SAD
|
||||
#
|
||||
@@ -376,6 +355,32 @@ specialize vp8_sad16x8x4d sse3
|
||||
prototype void vp8_sad16x16x4d "const unsigned char *src_ptr, int source_stride, unsigned char *ref_ptr[4], int ref_stride, unsigned int *sad_array"
|
||||
specialize vp8_sad16x16x4d sse3
|
||||
|
||||
#
|
||||
# Encoder functions below this point.
|
||||
#
|
||||
if [ "$CONFIG_VP8_ENCODER" = "yes" ]; then
|
||||
|
||||
#
|
||||
# Sum of squares (vector)
|
||||
#
|
||||
prototype unsigned int vp8_get_mb_ss "const short *"
|
||||
specialize vp8_get_mb_ss mmx sse2
|
||||
|
||||
#
|
||||
# SSE (Sum Squared Error)
|
||||
#
|
||||
prototype unsigned int vp8_sub_pixel_mse16x16 "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse"
|
||||
specialize vp8_sub_pixel_mse16x16 mmx sse2
|
||||
vp8_sub_pixel_mse16x16_sse2=vp8_sub_pixel_mse16x16_wmt
|
||||
|
||||
prototype unsigned int vp8_mse16x16 "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
|
||||
specialize vp8_mse16x16 mmx sse2 media neon
|
||||
vp8_mse16x16_sse2=vp8_mse16x16_wmt
|
||||
vp8_mse16x16_media=vp8_mse16x16_armv6
|
||||
|
||||
prototype unsigned int vp8_get4x4sse_cs "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride"
|
||||
specialize vp8_get4x4sse_cs mmx neon
|
||||
|
||||
#
|
||||
# Block copy
|
||||
#
|
||||
@@ -496,5 +501,49 @@ fi
|
||||
prototype void vp8_yv12_copy_partial_frame "struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
|
||||
specialize vp8_yv12_copy_partial_frame neon
|
||||
|
||||
#
|
||||
# Denoiser filter
|
||||
#
|
||||
if [ "$CONFIG_TEMPORAL_DENOISING" = "yes" ]; then
|
||||
prototype int vp8_denoiser_filter "struct yv12_buffer_config* mc_running_avg, struct yv12_buffer_config* running_avg, struct macroblock* signal, unsigned int motion_magnitude2, int y_offset, int uv_offset"
|
||||
specialize vp8_denoiser_filter sse2
|
||||
fi
|
||||
|
||||
# End of encoder only functions
|
||||
fi
|
||||
|
||||
# Scaler functions
|
||||
if [ "CONFIG_SPATIAL_RESAMPLING" != "yes" ]; then
|
||||
prototype void vp8_horizontal_line_4_5_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
|
||||
prototype void vp8_vertical_band_4_5_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_last_vertical_band_4_5_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_horizontal_line_2_3_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
|
||||
prototype void vp8_vertical_band_2_3_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_last_vertical_band_2_3_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_horizontal_line_3_5_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
|
||||
prototype void vp8_vertical_band_3_5_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_last_vertical_band_3_5_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_horizontal_line_3_4_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
|
||||
prototype void vp8_vertical_band_3_4_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_last_vertical_band_3_4_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_horizontal_line_1_2_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
|
||||
prototype void vp8_vertical_band_1_2_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_last_vertical_band_1_2_scale "unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_horizontal_line_5_4_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
|
||||
prototype void vp8_vertical_band_5_4_scale "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_horizontal_line_5_3_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
|
||||
prototype void vp8_vertical_band_5_3_scale "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_horizontal_line_2_1_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
|
||||
prototype void vp8_vertical_band_2_1_scale "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
prototype void vp8_vertical_band_2_1_scale_i "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
|
||||
fi
|
||||
|
||||
prototype void vp8_yv12_extend_frame_borders "struct yv12_buffer_config *ybf"
|
||||
specialize vp8_yv12_extend_frame_borders neon
|
||||
|
||||
prototype void vp8_yv12_copy_frame "struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
|
||||
specialize vp8_yv12_copy_frame neon
|
||||
|
||||
prototype void vp8_yv12_copy_y "struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
|
||||
specialize vp8_yv12_copy_y neon
|
||||
|
||||
|
||||
@@ -13,38 +13,13 @@
|
||||
#include "vpx_config.h"
|
||||
#include "vpx/vpx_integer.h"
|
||||
|
||||
unsigned int vp8_sad16x16_c(
|
||||
const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
int ref_stride,
|
||||
int max_sad)
|
||||
{
|
||||
|
||||
int r, c;
|
||||
unsigned int sad = 0;
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
for (c = 0; c < 16; c++)
|
||||
{
|
||||
sad += abs(src_ptr[c] - ref_ptr[c]);
|
||||
}
|
||||
|
||||
src_ptr += src_stride;
|
||||
ref_ptr += ref_stride;
|
||||
}
|
||||
|
||||
return sad;
|
||||
}
|
||||
|
||||
|
||||
static __inline
|
||||
static
|
||||
unsigned int sad_mx_n_c(
|
||||
const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
int ref_stride,
|
||||
int max_sad,
|
||||
int m,
|
||||
int n)
|
||||
{
|
||||
@@ -59,6 +34,9 @@ unsigned int sad_mx_n_c(
|
||||
sad += abs(src_ptr[c] - ref_ptr[c]);
|
||||
}
|
||||
|
||||
if (sad > max_sad)
|
||||
break;
|
||||
|
||||
src_ptr += src_stride;
|
||||
ref_ptr += ref_stride;
|
||||
}
|
||||
@@ -66,6 +44,21 @@ unsigned int sad_mx_n_c(
|
||||
return sad;
|
||||
}
|
||||
|
||||
/* max_sad is provided as an optional optimization point. Alternative
|
||||
* implementations of these functions are not required to check it.
|
||||
*/
|
||||
|
||||
unsigned int vp8_sad16x16_c(
|
||||
const unsigned char *src_ptr,
|
||||
int src_stride,
|
||||
const unsigned char *ref_ptr,
|
||||
int ref_stride,
|
||||
int max_sad)
|
||||
{
|
||||
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 16);
|
||||
}
|
||||
|
||||
|
||||
unsigned int vp8_sad8x8_c(
|
||||
const unsigned char *src_ptr,
|
||||
@@ -75,7 +68,7 @@ unsigned int vp8_sad8x8_c(
|
||||
int max_sad)
|
||||
{
|
||||
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 8, 8);
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 8, 8);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +80,7 @@ unsigned int vp8_sad16x8_c(
|
||||
int max_sad)
|
||||
{
|
||||
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 8);
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 8);
|
||||
|
||||
}
|
||||
|
||||
@@ -100,7 +93,7 @@ unsigned int vp8_sad8x16_c(
|
||||
int max_sad)
|
||||
{
|
||||
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 8, 16);
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 8, 16);
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +105,7 @@ unsigned int vp8_sad4x4_c(
|
||||
int max_sad)
|
||||
{
|
||||
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 4, 4);
|
||||
return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 4, 4);
|
||||
}
|
||||
|
||||
void vp8_sad16x16x3_c(
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
#include "variance.h"
|
||||
#include "vp8/common/filter.h"
|
||||
#include "filter.h"
|
||||
|
||||
|
||||
unsigned int vp8_get_mb_ss_c
|
||||
242
vp8/common/vp8_entropymodedata.h
Executable file
242
vp8/common/vp8_entropymodedata.h
Executable file
@@ -0,0 +1,242 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
/*Generated file, included by entropymode.c*/
|
||||
|
||||
|
||||
const struct vp8_token_struct vp8_bmode_encodings[VP8_BINTRAMODES] =
|
||||
{
|
||||
{ 0, 1 },
|
||||
{ 2, 2 },
|
||||
{ 6, 3 },
|
||||
{ 28, 5 },
|
||||
{ 30, 5 },
|
||||
{ 58, 6 },
|
||||
{ 59, 6 },
|
||||
{ 62, 6 },
|
||||
{ 126, 7 },
|
||||
{ 127, 7 }
|
||||
};
|
||||
|
||||
const struct vp8_token_struct vp8_ymode_encodings[VP8_YMODES] =
|
||||
{
|
||||
{ 0, 1 },
|
||||
{ 4, 3 },
|
||||
{ 5, 3 },
|
||||
{ 6, 3 },
|
||||
{ 7, 3 }
|
||||
};
|
||||
|
||||
const struct vp8_token_struct vp8_kf_ymode_encodings[VP8_YMODES] =
|
||||
{
|
||||
{ 4, 3 },
|
||||
{ 5, 3 },
|
||||
{ 6, 3 },
|
||||
{ 7, 3 },
|
||||
{ 0, 1 }
|
||||
};
|
||||
|
||||
const struct vp8_token_struct vp8_uv_mode_encodings[VP8_UV_MODES] =
|
||||
{
|
||||
{ 0, 1 },
|
||||
{ 2, 2 },
|
||||
{ 6, 3 },
|
||||
{ 7, 3 }
|
||||
};
|
||||
|
||||
const struct vp8_token_struct vp8_mbsplit_encodings[VP8_NUMMBSPLITS] =
|
||||
{
|
||||
{ 6, 3 },
|
||||
{ 7, 3 },
|
||||
{ 2, 2 },
|
||||
{ 0, 1 }
|
||||
};
|
||||
|
||||
const struct vp8_token_struct vp8_mv_ref_encoding_array[VP8_MVREFS] =
|
||||
{
|
||||
{ 2, 2 },
|
||||
{ 6, 3 },
|
||||
{ 0, 1 },
|
||||
{ 14, 4 },
|
||||
{ 15, 4 }
|
||||
};
|
||||
|
||||
const struct vp8_token_struct vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS] =
|
||||
{
|
||||
{ 0, 1 },
|
||||
{ 2, 2 },
|
||||
{ 6, 3 },
|
||||
{ 7, 3 }
|
||||
};
|
||||
|
||||
const struct vp8_token_struct vp8_small_mvencodings[8] =
|
||||
{
|
||||
{ 0, 3 },
|
||||
{ 1, 3 },
|
||||
{ 2, 3 },
|
||||
{ 3, 3 },
|
||||
{ 4, 3 },
|
||||
{ 5, 3 },
|
||||
{ 6, 3 },
|
||||
{ 7, 3 }
|
||||
};
|
||||
|
||||
const vp8_prob vp8_ymode_prob[VP8_YMODES-1] =
|
||||
{
|
||||
112, 86, 140, 37
|
||||
};
|
||||
|
||||
const vp8_prob vp8_kf_ymode_prob[VP8_YMODES-1] =
|
||||
{
|
||||
145, 156, 163, 128
|
||||
};
|
||||
|
||||
const vp8_prob vp8_uv_mode_prob[VP8_UV_MODES-1] =
|
||||
{
|
||||
162, 101, 204
|
||||
};
|
||||
|
||||
const vp8_prob vp8_kf_uv_mode_prob[VP8_UV_MODES-1] =
|
||||
{
|
||||
142, 114, 183
|
||||
};
|
||||
|
||||
const vp8_prob vp8_bmode_prob[VP8_BINTRAMODES-1] =
|
||||
{
|
||||
120, 90, 79, 133, 87, 85, 80, 111, 151
|
||||
};
|
||||
|
||||
|
||||
|
||||
const vp8_prob vp8_kf_bmode_prob
|
||||
[VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1] =
|
||||
{
|
||||
{
|
||||
{ 231, 120, 48, 89, 115, 113, 120, 152, 112 },
|
||||
{ 152, 179, 64, 126, 170, 118, 46, 70, 95 },
|
||||
{ 175, 69, 143, 80, 85, 82, 72, 155, 103 },
|
||||
{ 56, 58, 10, 171, 218, 189, 17, 13, 152 },
|
||||
{ 144, 71, 10, 38, 171, 213, 144, 34, 26 },
|
||||
{ 114, 26, 17, 163, 44, 195, 21, 10, 173 },
|
||||
{ 121, 24, 80, 195, 26, 62, 44, 64, 85 },
|
||||
{ 170, 46, 55, 19, 136, 160, 33, 206, 71 },
|
||||
{ 63, 20, 8, 114, 114, 208, 12, 9, 226 },
|
||||
{ 81, 40, 11, 96, 182, 84, 29, 16, 36 }
|
||||
},
|
||||
{
|
||||
{ 134, 183, 89, 137, 98, 101, 106, 165, 148 },
|
||||
{ 72, 187, 100, 130, 157, 111, 32, 75, 80 },
|
||||
{ 66, 102, 167, 99, 74, 62, 40, 234, 128 },
|
||||
{ 41, 53, 9, 178, 241, 141, 26, 8, 107 },
|
||||
{ 104, 79, 12, 27, 217, 255, 87, 17, 7 },
|
||||
{ 74, 43, 26, 146, 73, 166, 49, 23, 157 },
|
||||
{ 65, 38, 105, 160, 51, 52, 31, 115, 128 },
|
||||
{ 87, 68, 71, 44, 114, 51, 15, 186, 23 },
|
||||
{ 47, 41, 14, 110, 182, 183, 21, 17, 194 },
|
||||
{ 66, 45, 25, 102, 197, 189, 23, 18, 22 }
|
||||
},
|
||||
{
|
||||
{ 88, 88, 147, 150, 42, 46, 45, 196, 205 },
|
||||
{ 43, 97, 183, 117, 85, 38, 35, 179, 61 },
|
||||
{ 39, 53, 200, 87, 26, 21, 43, 232, 171 },
|
||||
{ 56, 34, 51, 104, 114, 102, 29, 93, 77 },
|
||||
{ 107, 54, 32, 26, 51, 1, 81, 43, 31 },
|
||||
{ 39, 28, 85, 171, 58, 165, 90, 98, 64 },
|
||||
{ 34, 22, 116, 206, 23, 34, 43, 166, 73 },
|
||||
{ 68, 25, 106, 22, 64, 171, 36, 225, 114 },
|
||||
{ 34, 19, 21, 102, 132, 188, 16, 76, 124 },
|
||||
{ 62, 18, 78, 95, 85, 57, 50, 48, 51 }
|
||||
},
|
||||
{
|
||||
{ 193, 101, 35, 159, 215, 111, 89, 46, 111 },
|
||||
{ 60, 148, 31, 172, 219, 228, 21, 18, 111 },
|
||||
{ 112, 113, 77, 85, 179, 255, 38, 120, 114 },
|
||||
{ 40, 42, 1, 196, 245, 209, 10, 25, 109 },
|
||||
{ 100, 80, 8, 43, 154, 1, 51, 26, 71 },
|
||||
{ 88, 43, 29, 140, 166, 213, 37, 43, 154 },
|
||||
{ 61, 63, 30, 155, 67, 45, 68, 1, 209 },
|
||||
{ 142, 78, 78, 16, 255, 128, 34, 197, 171 },
|
||||
{ 41, 40, 5, 102, 211, 183, 4, 1, 221 },
|
||||
{ 51, 50, 17, 168, 209, 192, 23, 25, 82 }
|
||||
},
|
||||
{
|
||||
{ 125, 98, 42, 88, 104, 85, 117, 175, 82 },
|
||||
{ 95, 84, 53, 89, 128, 100, 113, 101, 45 },
|
||||
{ 75, 79, 123, 47, 51, 128, 81, 171, 1 },
|
||||
{ 57, 17, 5, 71, 102, 57, 53, 41, 49 },
|
||||
{ 115, 21, 2, 10, 102, 255, 166, 23, 6 },
|
||||
{ 38, 33, 13, 121, 57, 73, 26, 1, 85 },
|
||||
{ 41, 10, 67, 138, 77, 110, 90, 47, 114 },
|
||||
{ 101, 29, 16, 10, 85, 128, 101, 196, 26 },
|
||||
{ 57, 18, 10, 102, 102, 213, 34, 20, 43 },
|
||||
{ 117, 20, 15, 36, 163, 128, 68, 1, 26 }
|
||||
},
|
||||
{
|
||||
{ 138, 31, 36, 171, 27, 166, 38, 44, 229 },
|
||||
{ 67, 87, 58, 169, 82, 115, 26, 59, 179 },
|
||||
{ 63, 59, 90, 180, 59, 166, 93, 73, 154 },
|
||||
{ 40, 40, 21, 116, 143, 209, 34, 39, 175 },
|
||||
{ 57, 46, 22, 24, 128, 1, 54, 17, 37 },
|
||||
{ 47, 15, 16, 183, 34, 223, 49, 45, 183 },
|
||||
{ 46, 17, 33, 183, 6, 98, 15, 32, 183 },
|
||||
{ 65, 32, 73, 115, 28, 128, 23, 128, 205 },
|
||||
{ 40, 3, 9, 115, 51, 192, 18, 6, 223 },
|
||||
{ 87, 37, 9, 115, 59, 77, 64, 21, 47 }
|
||||
},
|
||||
{
|
||||
{ 104, 55, 44, 218, 9, 54, 53, 130, 226 },
|
||||
{ 64, 90, 70, 205, 40, 41, 23, 26, 57 },
|
||||
{ 54, 57, 112, 184, 5, 41, 38, 166, 213 },
|
||||
{ 30, 34, 26, 133, 152, 116, 10, 32, 134 },
|
||||
{ 75, 32, 12, 51, 192, 255, 160, 43, 51 },
|
||||
{ 39, 19, 53, 221, 26, 114, 32, 73, 255 },
|
||||
{ 31, 9, 65, 234, 2, 15, 1, 118, 73 },
|
||||
{ 88, 31, 35, 67, 102, 85, 55, 186, 85 },
|
||||
{ 56, 21, 23, 111, 59, 205, 45, 37, 192 },
|
||||
{ 55, 38, 70, 124, 73, 102, 1, 34, 98 }
|
||||
},
|
||||
{
|
||||
{ 102, 61, 71, 37, 34, 53, 31, 243, 192 },
|
||||
{ 69, 60, 71, 38, 73, 119, 28, 222, 37 },
|
||||
{ 68, 45, 128, 34, 1, 47, 11, 245, 171 },
|
||||
{ 62, 17, 19, 70, 146, 85, 55, 62, 70 },
|
||||
{ 75, 15, 9, 9, 64, 255, 184, 119, 16 },
|
||||
{ 37, 43, 37, 154, 100, 163, 85, 160, 1 },
|
||||
{ 63, 9, 92, 136, 28, 64, 32, 201, 85 },
|
||||
{ 86, 6, 28, 5, 64, 255, 25, 248, 1 },
|
||||
{ 56, 8, 17, 132, 137, 255, 55, 116, 128 },
|
||||
{ 58, 15, 20, 82, 135, 57, 26, 121, 40 }
|
||||
},
|
||||
{
|
||||
{ 164, 50, 31, 137, 154, 133, 25, 35, 218 },
|
||||
{ 51, 103, 44, 131, 131, 123, 31, 6, 158 },
|
||||
{ 86, 40, 64, 135, 148, 224, 45, 183, 128 },
|
||||
{ 22, 26, 17, 131, 240, 154, 14, 1, 209 },
|
||||
{ 83, 12, 13, 54, 192, 255, 68, 47, 28 },
|
||||
{ 45, 16, 21, 91, 64, 222, 7, 1, 197 },
|
||||
{ 56, 21, 39, 155, 60, 138, 23, 102, 213 },
|
||||
{ 85, 26, 85, 85, 128, 128, 32, 146, 171 },
|
||||
{ 18, 11, 7, 63, 144, 171, 4, 4, 246 },
|
||||
{ 35, 27, 10, 146, 174, 171, 12, 26, 128 }
|
||||
},
|
||||
{
|
||||
{ 190, 80, 35, 99, 180, 80, 126, 54, 45 },
|
||||
{ 85, 126, 47, 87, 176, 51, 41, 20, 32 },
|
||||
{ 101, 75, 128, 139, 118, 146, 116, 128, 85 },
|
||||
{ 56, 41, 15, 176, 236, 85, 37, 9, 62 },
|
||||
{ 146, 36, 19, 30, 171, 255, 97, 27, 20 },
|
||||
{ 71, 30, 17, 119, 118, 255, 17, 18, 138 },
|
||||
{ 101, 38, 60, 138, 55, 70, 43, 26, 142 },
|
||||
{ 138, 45, 61, 62, 219, 1, 81, 188, 64 },
|
||||
{ 32, 41, 20, 117, 151, 142, 20, 21, 163 },
|
||||
{ 112, 19, 12, 61, 195, 128, 48, 4, 24 }
|
||||
}
|
||||
};
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
;void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q)
|
||||
global sym(vp8_dequantize_b_impl_mmx)
|
||||
global sym(vp8_dequantize_b_impl_mmx) PRIVATE
|
||||
sym(vp8_dequantize_b_impl_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -55,7 +55,7 @@ sym(vp8_dequantize_b_impl_mmx):
|
||||
;short *dq, 1
|
||||
;unsigned char *dest, 2
|
||||
;int stride) 3
|
||||
global sym(vp8_dequant_idct_add_mmx)
|
||||
global sym(vp8_dequant_idct_add_mmx) PRIVATE
|
||||
sym(vp8_dequant_idct_add_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
;void vp8_short_idct4x4llm_mmx(short *input, unsigned char *pred,
|
||||
;int pitch, unsigned char *dest,int stride)
|
||||
global sym(vp8_short_idct4x4llm_mmx)
|
||||
global sym(vp8_short_idct4x4llm_mmx) PRIVATE
|
||||
sym(vp8_short_idct4x4llm_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -224,7 +224,7 @@ sym(vp8_short_idct4x4llm_mmx):
|
||||
;int pred_stride,
|
||||
;unsigned char *dst_ptr,
|
||||
;int stride)
|
||||
global sym(vp8_dc_only_idct_add_mmx)
|
||||
global sym(vp8_dc_only_idct_add_mmx) PRIVATE
|
||||
sym(vp8_dc_only_idct_add_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
31
vp8/common/x86/idctllm_mmx_test.cc
Executable file
31
vp8/common/x86/idctllm_mmx_test.cc
Executable file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
extern "C" {
|
||||
void vp8_short_idct4x4llm_mmx(short *input, unsigned char *pred_ptr,
|
||||
int pred_stride, unsigned char *dst_ptr,
|
||||
int dst_stride);
|
||||
}
|
||||
|
||||
#include "vp8/common/idctllm_test.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(MMX, IDCTTest,
|
||||
::testing::Values(vp8_short_idct4x4llm_mmx));
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
; int dst_stride - 3
|
||||
; )
|
||||
|
||||
global sym(vp8_idct_dequant_0_2x_sse2)
|
||||
global sym(vp8_idct_dequant_0_2x_sse2) PRIVATE
|
||||
sym(vp8_idct_dequant_0_2x_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -101,7 +101,7 @@ sym(vp8_idct_dequant_0_2x_sse2):
|
||||
; unsigned char *dst - 2
|
||||
; int dst_stride - 3
|
||||
; )
|
||||
global sym(vp8_idct_dequant_full_2x_sse2)
|
||||
global sym(vp8_idct_dequant_full_2x_sse2) PRIVATE
|
||||
sym(vp8_idct_dequant_full_2x_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -358,7 +358,7 @@ sym(vp8_idct_dequant_full_2x_sse2):
|
||||
; int dst_stride - 3
|
||||
; short *dc - 4
|
||||
; )
|
||||
global sym(vp8_idct_dequant_dc_0_2x_sse2)
|
||||
global sym(vp8_idct_dequant_dc_0_2x_sse2) PRIVATE
|
||||
sym(vp8_idct_dequant_dc_0_2x_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -434,7 +434,7 @@ sym(vp8_idct_dequant_dc_0_2x_sse2):
|
||||
; int dst_stride - 3
|
||||
; short *dc - 4
|
||||
; )
|
||||
global sym(vp8_idct_dequant_dc_full_2x_sse2)
|
||||
global sym(vp8_idct_dequant_dc_full_2x_sse2) PRIVATE
|
||||
sym(vp8_idct_dequant_dc_full_2x_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
%include "vpx_ports/x86_abi_support.asm"
|
||||
|
||||
;void vp8_short_inv_walsh4x4_mmx(short *input, short *output)
|
||||
global sym(vp8_short_inv_walsh4x4_mmx)
|
||||
global sym(vp8_short_inv_walsh4x4_mmx) PRIVATE
|
||||
sym(vp8_short_inv_walsh4x4_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
%include "vpx_ports/x86_abi_support.asm"
|
||||
|
||||
;void vp8_short_inv_walsh4x4_sse2(short *input, short *output)
|
||||
global sym(vp8_short_inv_walsh4x4_sse2)
|
||||
global sym(vp8_short_inv_walsh4x4_sse2) PRIVATE
|
||||
sym(vp8_short_inv_walsh4x4_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
; const char *limit,
|
||||
; const char *thresh
|
||||
;)
|
||||
global sym(vp8_loop_filter_bh_y_sse2)
|
||||
global sym(vp8_loop_filter_bh_y_sse2) PRIVATE
|
||||
sym(vp8_loop_filter_bh_y_sse2):
|
||||
|
||||
%ifidn __OUTPUT_FORMAT__,x64
|
||||
@@ -273,7 +273,7 @@ LF_FILTER xmm0, xmm1, xmm3, xmm8, xmm4, xmm2
|
||||
; const char *thresh
|
||||
;)
|
||||
|
||||
global sym(vp8_loop_filter_bv_y_sse2)
|
||||
global sym(vp8_loop_filter_bv_y_sse2) PRIVATE
|
||||
sym(vp8_loop_filter_bv_y_sse2):
|
||||
|
||||
%ifidn __OUTPUT_FORMAT__,x64
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
; const char *thresh,
|
||||
; int count
|
||||
;)
|
||||
global sym(vp8_loop_filter_horizontal_edge_mmx)
|
||||
global sym(vp8_loop_filter_horizontal_edge_mmx) PRIVATE
|
||||
sym(vp8_loop_filter_horizontal_edge_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -233,7 +233,7 @@ sym(vp8_loop_filter_horizontal_edge_mmx):
|
||||
; const char *thresh,
|
||||
; int count
|
||||
;)
|
||||
global sym(vp8_loop_filter_vertical_edge_mmx)
|
||||
global sym(vp8_loop_filter_vertical_edge_mmx) PRIVATE
|
||||
sym(vp8_loop_filter_vertical_edge_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -603,7 +603,7 @@ sym(vp8_loop_filter_vertical_edge_mmx):
|
||||
; const char *thresh,
|
||||
; int count
|
||||
;)
|
||||
global sym(vp8_mbloop_filter_horizontal_edge_mmx)
|
||||
global sym(vp8_mbloop_filter_horizontal_edge_mmx) PRIVATE
|
||||
sym(vp8_mbloop_filter_horizontal_edge_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -920,7 +920,7 @@ sym(vp8_mbloop_filter_horizontal_edge_mmx):
|
||||
; const char *thresh,
|
||||
; int count
|
||||
;)
|
||||
global sym(vp8_mbloop_filter_vertical_edge_mmx)
|
||||
global sym(vp8_mbloop_filter_vertical_edge_mmx) PRIVATE
|
||||
sym(vp8_mbloop_filter_vertical_edge_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -1384,7 +1384,7 @@ sym(vp8_mbloop_filter_vertical_edge_mmx):
|
||||
; int src_pixel_step,
|
||||
; const char *blimit
|
||||
;)
|
||||
global sym(vp8_loop_filter_simple_horizontal_edge_mmx)
|
||||
global sym(vp8_loop_filter_simple_horizontal_edge_mmx) PRIVATE
|
||||
sym(vp8_loop_filter_simple_horizontal_edge_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -1500,7 +1500,7 @@ sym(vp8_loop_filter_simple_horizontal_edge_mmx):
|
||||
; int src_pixel_step,
|
||||
; const char *blimit
|
||||
;)
|
||||
global sym(vp8_loop_filter_simple_vertical_edge_mmx)
|
||||
global sym(vp8_loop_filter_simple_vertical_edge_mmx) PRIVATE
|
||||
sym(vp8_loop_filter_simple_vertical_edge_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,10 @@
|
||||
void sym(unsigned char *src, int pitch, const unsigned char *blimit,\
|
||||
const unsigned char *limit, const unsigned char *thresh, int count)
|
||||
|
||||
#define prototype_loopfilter_nc(sym) \
|
||||
void sym(unsigned char *src, int pitch, const unsigned char *blimit,\
|
||||
const unsigned char *limit, const unsigned char *thresh)
|
||||
|
||||
#define prototype_simple_loopfilter(sym) \
|
||||
void sym(unsigned char *y, int ystride, const unsigned char *blimit)
|
||||
|
||||
@@ -30,11 +34,11 @@ prototype_simple_loopfilter(vp8_loop_filter_simple_vertical_edge_mmx);
|
||||
prototype_loopfilter(vp8_loop_filter_bv_y_sse2);
|
||||
prototype_loopfilter(vp8_loop_filter_bh_y_sse2);
|
||||
#else
|
||||
prototype_loopfilter(vp8_loop_filter_vertical_edge_sse2);
|
||||
prototype_loopfilter(vp8_loop_filter_horizontal_edge_sse2);
|
||||
prototype_loopfilter_nc(vp8_loop_filter_vertical_edge_sse2);
|
||||
prototype_loopfilter_nc(vp8_loop_filter_horizontal_edge_sse2);
|
||||
#endif
|
||||
prototype_loopfilter(vp8_mbloop_filter_vertical_edge_sse2);
|
||||
prototype_loopfilter(vp8_mbloop_filter_horizontal_edge_sse2);
|
||||
prototype_loopfilter_nc(vp8_mbloop_filter_vertical_edge_sse2);
|
||||
prototype_loopfilter_nc(vp8_mbloop_filter_horizontal_edge_sse2);
|
||||
|
||||
extern loop_filter_uvfunction vp8_loop_filter_horizontal_edge_uv_sse2;
|
||||
extern loop_filter_uvfunction vp8_loop_filter_vertical_edge_uv_sse2;
|
||||
@@ -124,7 +128,7 @@ void vp8_loop_filter_bvs_mmx(unsigned char *y_ptr, int y_stride, const unsigned
|
||||
void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
|
||||
int y_stride, int uv_stride, loop_filter_info *lfi)
|
||||
{
|
||||
vp8_mbloop_filter_horizontal_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2);
|
||||
vp8_mbloop_filter_horizontal_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr);
|
||||
|
||||
if (u_ptr)
|
||||
vp8_mbloop_filter_horizontal_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr);
|
||||
@@ -135,7 +139,7 @@ void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsign
|
||||
void vp8_loop_filter_mbv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
|
||||
int y_stride, int uv_stride, loop_filter_info *lfi)
|
||||
{
|
||||
vp8_mbloop_filter_vertical_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2);
|
||||
vp8_mbloop_filter_vertical_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr);
|
||||
|
||||
if (u_ptr)
|
||||
vp8_mbloop_filter_vertical_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr);
|
||||
@@ -149,9 +153,9 @@ void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
|
||||
#if ARCH_X86_64
|
||||
vp8_loop_filter_bh_y_sse2(y_ptr, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
|
||||
#else
|
||||
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
|
||||
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
|
||||
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
|
||||
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
|
||||
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
|
||||
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
|
||||
#endif
|
||||
|
||||
if (u_ptr)
|
||||
@@ -174,9 +178,9 @@ void vp8_loop_filter_bv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
|
||||
#if ARCH_X86_64
|
||||
vp8_loop_filter_bv_y_sse2(y_ptr, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
|
||||
#else
|
||||
vp8_loop_filter_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
|
||||
vp8_loop_filter_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
|
||||
vp8_loop_filter_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2);
|
||||
vp8_loop_filter_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
|
||||
vp8_loop_filter_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
|
||||
vp8_loop_filter_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr);
|
||||
#endif
|
||||
|
||||
if (u_ptr)
|
||||
|
||||
281
vp8/common/x86/mfqe_sse2.asm
Normal file
281
vp8/common/x86/mfqe_sse2.asm
Normal file
@@ -0,0 +1,281 @@
|
||||
;
|
||||
; Copyright (c) 2012 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 "vpx_ports/x86_abi_support.asm"
|
||||
|
||||
;void vp8_filter_by_weight16x16_sse2
|
||||
;(
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *dst,
|
||||
; int dst_stride,
|
||||
; int src_weight
|
||||
;)
|
||||
global sym(vp8_filter_by_weight16x16_sse2) PRIVATE
|
||||
sym(vp8_filter_by_weight16x16_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
SAVE_XMM 6
|
||||
GET_GOT rbx
|
||||
push rsi
|
||||
push rdi
|
||||
; end prolog
|
||||
|
||||
movd xmm0, arg(4) ; src_weight
|
||||
pshuflw xmm0, xmm0, 0x0 ; replicate to all low words
|
||||
punpcklqdq xmm0, xmm0 ; replicate to all hi words
|
||||
|
||||
movdqa xmm1, [GLOBAL(tMFQE)]
|
||||
psubw xmm1, xmm0 ; dst_weight
|
||||
|
||||
mov rax, arg(0) ; src
|
||||
mov rsi, arg(1) ; src_stride
|
||||
mov rdx, arg(2) ; dst
|
||||
mov rdi, arg(3) ; dst_stride
|
||||
|
||||
mov rcx, 16 ; loop count
|
||||
pxor xmm6, xmm6
|
||||
|
||||
.combine
|
||||
movdqa xmm2, [rax]
|
||||
movdqa xmm4, [rdx]
|
||||
add rax, rsi
|
||||
|
||||
; src * src_weight
|
||||
movdqa xmm3, xmm2
|
||||
punpcklbw xmm2, xmm6
|
||||
punpckhbw xmm3, xmm6
|
||||
pmullw xmm2, xmm0
|
||||
pmullw xmm3, xmm0
|
||||
|
||||
; dst * dst_weight
|
||||
movdqa xmm5, xmm4
|
||||
punpcklbw xmm4, xmm6
|
||||
punpckhbw xmm5, xmm6
|
||||
pmullw xmm4, xmm1
|
||||
pmullw xmm5, xmm1
|
||||
|
||||
; sum, round and shift
|
||||
paddw xmm2, xmm4
|
||||
paddw xmm3, xmm5
|
||||
paddw xmm2, [GLOBAL(tMFQE_round)]
|
||||
paddw xmm3, [GLOBAL(tMFQE_round)]
|
||||
psrlw xmm2, 4
|
||||
psrlw xmm3, 4
|
||||
|
||||
packuswb xmm2, xmm3
|
||||
movdqa [rdx], xmm2
|
||||
add rdx, rdi
|
||||
|
||||
dec rcx
|
||||
jnz .combine
|
||||
|
||||
; begin epilog
|
||||
pop rdi
|
||||
pop rsi
|
||||
RESTORE_GOT
|
||||
RESTORE_XMM
|
||||
UNSHADOW_ARGS
|
||||
pop rbp
|
||||
|
||||
ret
|
||||
|
||||
;void vp8_filter_by_weight8x8_sse2
|
||||
;(
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *dst,
|
||||
; int dst_stride,
|
||||
; int src_weight
|
||||
;)
|
||||
global sym(vp8_filter_by_weight8x8_sse2) PRIVATE
|
||||
sym(vp8_filter_by_weight8x8_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
GET_GOT rbx
|
||||
push rsi
|
||||
push rdi
|
||||
; end prolog
|
||||
|
||||
movd xmm0, arg(4) ; src_weight
|
||||
pshuflw xmm0, xmm0, 0x0 ; replicate to all low words
|
||||
punpcklqdq xmm0, xmm0 ; replicate to all hi words
|
||||
|
||||
movdqa xmm1, [GLOBAL(tMFQE)]
|
||||
psubw xmm1, xmm0 ; dst_weight
|
||||
|
||||
mov rax, arg(0) ; src
|
||||
mov rsi, arg(1) ; src_stride
|
||||
mov rdx, arg(2) ; dst
|
||||
mov rdi, arg(3) ; dst_stride
|
||||
|
||||
mov rcx, 8 ; loop count
|
||||
pxor xmm4, xmm4
|
||||
|
||||
.combine
|
||||
movq xmm2, [rax]
|
||||
movq xmm3, [rdx]
|
||||
add rax, rsi
|
||||
|
||||
; src * src_weight
|
||||
punpcklbw xmm2, xmm4
|
||||
pmullw xmm2, xmm0
|
||||
|
||||
; dst * dst_weight
|
||||
punpcklbw xmm3, xmm4
|
||||
pmullw xmm3, xmm1
|
||||
|
||||
; sum, round and shift
|
||||
paddw xmm2, xmm3
|
||||
paddw xmm2, [GLOBAL(tMFQE_round)]
|
||||
psrlw xmm2, 4
|
||||
|
||||
packuswb xmm2, xmm4
|
||||
movq [rdx], xmm2
|
||||
add rdx, rdi
|
||||
|
||||
dec rcx
|
||||
jnz .combine
|
||||
|
||||
; begin epilog
|
||||
pop rdi
|
||||
pop rsi
|
||||
RESTORE_GOT
|
||||
UNSHADOW_ARGS
|
||||
pop rbp
|
||||
|
||||
ret
|
||||
|
||||
;void vp8_variance_and_sad_16x16_sse2 | arg
|
||||
;(
|
||||
; unsigned char *src1, 0
|
||||
; int stride1, 1
|
||||
; unsigned char *src2, 2
|
||||
; int stride2, 3
|
||||
; unsigned int *variance, 4
|
||||
; unsigned int *sad, 5
|
||||
;)
|
||||
global sym(vp8_variance_and_sad_16x16_sse2) PRIVATE
|
||||
sym(vp8_variance_and_sad_16x16_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 6
|
||||
GET_GOT rbx
|
||||
push rsi
|
||||
push rdi
|
||||
; end prolog
|
||||
|
||||
mov rax, arg(0) ; src1
|
||||
mov rcx, arg(1) ; stride1
|
||||
mov rdx, arg(2) ; src2
|
||||
mov rdi, arg(3) ; stride2
|
||||
|
||||
mov rsi, 16 ; block height
|
||||
|
||||
; Prep accumulator registers
|
||||
pxor xmm3, xmm3 ; SAD
|
||||
pxor xmm4, xmm4 ; sum of src2
|
||||
pxor xmm5, xmm5 ; sum of src2^2
|
||||
|
||||
; Because we're working with the actual output frames
|
||||
; we can't depend on any kind of data alignment.
|
||||
.accumulate
|
||||
movdqa xmm0, [rax] ; src1
|
||||
movdqa xmm1, [rdx] ; src2
|
||||
add rax, rcx ; src1 + stride1
|
||||
add rdx, rdi ; src2 + stride2
|
||||
|
||||
; SAD(src1, src2)
|
||||
psadbw xmm0, xmm1
|
||||
paddusw xmm3, xmm0
|
||||
|
||||
; SUM(src2)
|
||||
pxor xmm2, xmm2
|
||||
psadbw xmm2, xmm1 ; sum src2 by misusing SAD against 0
|
||||
paddusw xmm4, xmm2
|
||||
|
||||
; pmaddubsw would be ideal if it took two unsigned values. instead,
|
||||
; it expects a signed and an unsigned value. so instead we zero extend
|
||||
; and operate on words.
|
||||
pxor xmm2, xmm2
|
||||
movdqa xmm0, xmm1
|
||||
punpcklbw xmm0, xmm2
|
||||
punpckhbw xmm1, xmm2
|
||||
pmaddwd xmm0, xmm0
|
||||
pmaddwd xmm1, xmm1
|
||||
paddd xmm5, xmm0
|
||||
paddd xmm5, xmm1
|
||||
|
||||
sub rsi, 1
|
||||
jnz .accumulate
|
||||
|
||||
; phaddd only operates on adjacent double words.
|
||||
; Finalize SAD and store
|
||||
movdqa xmm0, xmm3
|
||||
psrldq xmm0, 8
|
||||
paddusw xmm0, xmm3
|
||||
paddd xmm0, [GLOBAL(t128)]
|
||||
psrld xmm0, 8
|
||||
|
||||
mov rax, arg(5)
|
||||
movd [rax], xmm0
|
||||
|
||||
; Accumulate sum of src2
|
||||
movdqa xmm0, xmm4
|
||||
psrldq xmm0, 8
|
||||
paddusw xmm0, xmm4
|
||||
; Square src2. Ignore high value
|
||||
pmuludq xmm0, xmm0
|
||||
psrld xmm0, 8
|
||||
|
||||
; phaddw could be used to sum adjacent values but we want
|
||||
; all the values summed. promote to doubles, accumulate,
|
||||
; shift and sum
|
||||
pxor xmm2, xmm2
|
||||
movdqa xmm1, xmm5
|
||||
punpckldq xmm1, xmm2
|
||||
punpckhdq xmm5, xmm2
|
||||
paddd xmm1, xmm5
|
||||
movdqa xmm2, xmm1
|
||||
psrldq xmm1, 8
|
||||
paddd xmm1, xmm2
|
||||
|
||||
psubd xmm1, xmm0
|
||||
|
||||
; (variance + 128) >> 8
|
||||
paddd xmm1, [GLOBAL(t128)]
|
||||
psrld xmm1, 8
|
||||
mov rax, arg(4)
|
||||
|
||||
movd [rax], xmm1
|
||||
|
||||
|
||||
; begin epilog
|
||||
pop rdi
|
||||
pop rsi
|
||||
RESTORE_GOT
|
||||
UNSHADOW_ARGS
|
||||
pop rbp
|
||||
ret
|
||||
|
||||
SECTION_RODATA
|
||||
align 16
|
||||
t128:
|
||||
ddq 128
|
||||
align 16
|
||||
tMFQE: ; 1 << MFQE_PRECISION
|
||||
times 8 dw 0x10
|
||||
align 16
|
||||
tMFQE_round: ; 1 << (MFQE_PRECISION - 1)
|
||||
times 8 dw 0x08
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
; int cols,
|
||||
; int flimit
|
||||
;)
|
||||
global sym(vp8_post_proc_down_and_across_mmx)
|
||||
global sym(vp8_post_proc_down_and_across_mmx) PRIVATE
|
||||
sym(vp8_post_proc_down_and_across_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -282,7 +282,7 @@ sym(vp8_post_proc_down_and_across_mmx):
|
||||
;void vp8_mbpost_proc_down_mmx(unsigned char *dst,
|
||||
; int pitch, int rows, int cols,int flimit)
|
||||
extern sym(vp8_rv)
|
||||
global sym(vp8_mbpost_proc_down_mmx)
|
||||
global sym(vp8_mbpost_proc_down_mmx) PRIVATE
|
||||
sym(vp8_mbpost_proc_down_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -510,7 +510,7 @@ sym(vp8_mbpost_proc_down_mmx):
|
||||
; unsigned char bothclamp[16],
|
||||
; unsigned int Width, unsigned int Height, int Pitch)
|
||||
extern sym(rand)
|
||||
global sym(vp8_plane_add_noise_mmx)
|
||||
global sym(vp8_plane_add_noise_mmx) PRIVATE
|
||||
sym(vp8_plane_add_noise_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
; int cols,
|
||||
; int flimit
|
||||
;)
|
||||
global sym(vp8_post_proc_down_and_across_xmm)
|
||||
global sym(vp8_post_proc_down_and_across_xmm) PRIVATE
|
||||
sym(vp8_post_proc_down_and_across_xmm):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -269,7 +269,7 @@ sym(vp8_post_proc_down_and_across_xmm):
|
||||
;void vp8_mbpost_proc_down_xmm(unsigned char *dst,
|
||||
; int pitch, int rows, int cols,int flimit)
|
||||
extern sym(vp8_rv)
|
||||
global sym(vp8_mbpost_proc_down_xmm)
|
||||
global sym(vp8_mbpost_proc_down_xmm) PRIVATE
|
||||
sym(vp8_mbpost_proc_down_xmm):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -497,7 +497,7 @@ sym(vp8_mbpost_proc_down_xmm):
|
||||
|
||||
;void vp8_mbpost_proc_across_ip_xmm(unsigned char *src,
|
||||
; int pitch, int rows, int cols,int flimit)
|
||||
global sym(vp8_mbpost_proc_across_ip_xmm)
|
||||
global sym(vp8_mbpost_proc_across_ip_xmm) PRIVATE
|
||||
sym(vp8_mbpost_proc_across_ip_xmm):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -694,7 +694,7 @@ sym(vp8_mbpost_proc_across_ip_xmm):
|
||||
; unsigned char bothclamp[16],
|
||||
; unsigned int Width, unsigned int Height, int Pitch)
|
||||
extern sym(rand)
|
||||
global sym(vp8_plane_add_noise_wmt)
|
||||
global sym(vp8_plane_add_noise_wmt) PRIVATE
|
||||
sym(vp8_plane_add_noise_wmt):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
21
vp8/common/x86/postproc_x86.c
Normal file
21
vp8/common/x86/postproc_x86.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2012 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.
|
||||
*/
|
||||
|
||||
/* On Android NDK, rand is inlined function, but postproc needs rand symbol */
|
||||
#if defined(__ANDROID__)
|
||||
#define rand __rand
|
||||
#include <stdlib.h>
|
||||
#undef rand
|
||||
|
||||
extern int rand(void)
|
||||
{
|
||||
return __rand();
|
||||
}
|
||||
#endif
|
||||
@@ -18,7 +18,7 @@
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; )
|
||||
global sym(vp8_copy_mem8x8_mmx)
|
||||
global sym(vp8_copy_mem8x8_mmx) PRIVATE
|
||||
sym(vp8_copy_mem8x8_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -81,7 +81,7 @@ sym(vp8_copy_mem8x8_mmx):
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; )
|
||||
global sym(vp8_copy_mem8x4_mmx)
|
||||
global sym(vp8_copy_mem8x4_mmx) PRIVATE
|
||||
sym(vp8_copy_mem8x4_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -125,7 +125,7 @@ sym(vp8_copy_mem8x4_mmx):
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; )
|
||||
global sym(vp8_copy_mem16x16_mmx)
|
||||
global sym(vp8_copy_mem16x16_mmx) PRIVATE
|
||||
sym(vp8_copy_mem16x16_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; )
|
||||
global sym(vp8_copy_mem16x16_sse2)
|
||||
global sym(vp8_copy_mem16x16_sse2) PRIVATE
|
||||
sym(vp8_copy_mem16x16_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -119,35 +119,37 @@ sym(vp8_copy_mem16x16_sse2):
|
||||
;void vp8_intra_pred_uv_dc_mmx2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride,
|
||||
; )
|
||||
global sym(vp8_intra_pred_uv_dc_mmx2)
|
||||
global sym(vp8_intra_pred_uv_dc_mmx2) PRIVATE
|
||||
sym(vp8_intra_pred_uv_dc_mmx2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
push rdi
|
||||
; end prolog
|
||||
|
||||
; from top
|
||||
mov rsi, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
sub rsi, rax
|
||||
mov rdi, arg(2) ;above;
|
||||
mov rsi, arg(3) ;left;
|
||||
movsxd rax, dword ptr arg(4) ;left_stride;
|
||||
pxor mm0, mm0
|
||||
movq mm1, [rsi]
|
||||
psadbw mm1, mm0
|
||||
|
||||
; from left
|
||||
dec rsi
|
||||
movq mm1, [rdi]
|
||||
lea rdi, [rax*3]
|
||||
movzx ecx, byte [rsi+rax]
|
||||
psadbw mm1, mm0
|
||||
; from left
|
||||
movzx ecx, byte [rsi]
|
||||
movzx edx, byte [rsi+rax*1]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rax*2]
|
||||
add ecx, edx
|
||||
|
||||
movzx edx, byte [rsi+rdi]
|
||||
add ecx, edx
|
||||
lea rsi, [rsi+rax*4]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rax]
|
||||
@@ -156,31 +158,29 @@ sym(vp8_intra_pred_uv_dc_mmx2):
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rdi]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rax*4]
|
||||
add ecx, edx
|
||||
|
||||
; add up
|
||||
pextrw edx, mm1, 0x0
|
||||
lea edx, [edx+ecx+8]
|
||||
sar edx, 4
|
||||
movd mm1, edx
|
||||
movsxd rcx, dword ptr arg(1) ;dst_stride
|
||||
pshufw mm1, mm1, 0x0
|
||||
mov rdi, arg(0) ;dst;
|
||||
packuswb mm1, mm1
|
||||
|
||||
; write out
|
||||
mov rdi, arg(0) ;dst;
|
||||
movsxd rcx, dword ptr arg(1) ;dst_stride
|
||||
lea rax, [rcx*3]
|
||||
lea rdx, [rdi+rcx*4]
|
||||
|
||||
movq [rdi ], mm1
|
||||
movq [rdi+rcx ], mm1
|
||||
movq [rdi+rcx*2], mm1
|
||||
movq [rdi+rax ], mm1
|
||||
lea rdi, [rdi+rcx*4]
|
||||
movq [rdi ], mm1
|
||||
movq [rdi+rcx ], mm1
|
||||
movq [rdi+rcx*2], mm1
|
||||
movq [rdi+rax ], mm1
|
||||
movq [rdx ], mm1
|
||||
movq [rdx+rcx ], mm1
|
||||
movq [rdx+rcx*2], mm1
|
||||
movq [rdx+rax ], mm1
|
||||
|
||||
; begin epilog
|
||||
pop rdi
|
||||
@@ -192,23 +192,24 @@ sym(vp8_intra_pred_uv_dc_mmx2):
|
||||
;void vp8_intra_pred_uv_dctop_mmx2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride,
|
||||
; )
|
||||
global sym(vp8_intra_pred_uv_dctop_mmx2)
|
||||
global sym(vp8_intra_pred_uv_dctop_mmx2) PRIVATE
|
||||
sym(vp8_intra_pred_uv_dctop_mmx2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
GET_GOT rbx
|
||||
push rsi
|
||||
push rdi
|
||||
; end prolog
|
||||
|
||||
;arg(3), arg(4) not used
|
||||
|
||||
; from top
|
||||
mov rsi, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
sub rsi, rax
|
||||
mov rsi, arg(2) ;above;
|
||||
pxor mm0, mm0
|
||||
movq mm1, [rsi]
|
||||
psadbw mm1, mm0
|
||||
@@ -245,22 +246,24 @@ sym(vp8_intra_pred_uv_dctop_mmx2):
|
||||
;void vp8_intra_pred_uv_dcleft_mmx2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride,
|
||||
; )
|
||||
global sym(vp8_intra_pred_uv_dcleft_mmx2)
|
||||
global sym(vp8_intra_pred_uv_dcleft_mmx2) PRIVATE
|
||||
sym(vp8_intra_pred_uv_dcleft_mmx2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
push rdi
|
||||
; end prolog
|
||||
|
||||
;arg(2) not used
|
||||
|
||||
; from left
|
||||
mov rsi, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
dec rsi
|
||||
mov rsi, arg(3) ;left;
|
||||
movsxd rax, dword ptr arg(4) ;left_stride;
|
||||
lea rdi, [rax*3]
|
||||
movzx ecx, byte [rsi]
|
||||
movzx edx, byte [rsi+rax]
|
||||
@@ -310,17 +313,20 @@ sym(vp8_intra_pred_uv_dcleft_mmx2):
|
||||
;void vp8_intra_pred_uv_dc128_mmx(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride,
|
||||
; )
|
||||
global sym(vp8_intra_pred_uv_dc128_mmx)
|
||||
global sym(vp8_intra_pred_uv_dc128_mmx) PRIVATE
|
||||
sym(vp8_intra_pred_uv_dc128_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
GET_GOT rbx
|
||||
; end prolog
|
||||
|
||||
;arg(2), arg(3), arg(4) not used
|
||||
|
||||
; write out
|
||||
movq mm1, [GLOBAL(dc_128)]
|
||||
mov rax, arg(0) ;dst;
|
||||
@@ -346,15 +352,16 @@ sym(vp8_intra_pred_uv_dc128_mmx):
|
||||
;void vp8_intra_pred_uv_tm_sse2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride,
|
||||
; )
|
||||
%macro vp8_intra_pred_uv_tm 1
|
||||
global sym(vp8_intra_pred_uv_tm_%1)
|
||||
global sym(vp8_intra_pred_uv_tm_%1) PRIVATE
|
||||
sym(vp8_intra_pred_uv_tm_%1):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
GET_GOT rbx
|
||||
push rsi
|
||||
push rdi
|
||||
@@ -362,9 +369,8 @@ sym(vp8_intra_pred_uv_tm_%1):
|
||||
|
||||
; read top row
|
||||
mov edx, 4
|
||||
mov rsi, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
sub rsi, rax
|
||||
mov rsi, arg(2) ;above
|
||||
movsxd rax, dword ptr arg(4) ;left_stride;
|
||||
pxor xmm0, xmm0
|
||||
%ifidn %1, ssse3
|
||||
movdqa xmm2, [GLOBAL(dc_1024)]
|
||||
@@ -374,7 +380,7 @@ sym(vp8_intra_pred_uv_tm_%1):
|
||||
|
||||
; set up left ptrs ans subtract topleft
|
||||
movd xmm3, [rsi-1]
|
||||
lea rsi, [rsi+rax-1]
|
||||
mov rsi, arg(3) ;left;
|
||||
%ifidn %1, sse2
|
||||
punpcklbw xmm3, xmm0
|
||||
pshuflw xmm3, xmm3, 0x0
|
||||
@@ -427,20 +433,22 @@ vp8_intra_pred_uv_tm ssse3
|
||||
;void vp8_intra_pred_uv_ve_mmx(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride,
|
||||
; )
|
||||
global sym(vp8_intra_pred_uv_ve_mmx)
|
||||
global sym(vp8_intra_pred_uv_ve_mmx) PRIVATE
|
||||
sym(vp8_intra_pred_uv_ve_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
; end prolog
|
||||
|
||||
; arg(3), arg(4) not used
|
||||
|
||||
; read from top
|
||||
mov rax, arg(2) ;src;
|
||||
movsxd rdx, dword ptr arg(3) ;src_stride;
|
||||
sub rax, rdx
|
||||
|
||||
movq mm1, [rax]
|
||||
|
||||
; write out
|
||||
@@ -466,15 +474,16 @@ sym(vp8_intra_pred_uv_ve_mmx):
|
||||
;void vp8_intra_pred_uv_ho_mmx2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride
|
||||
; )
|
||||
%macro vp8_intra_pred_uv_ho 1
|
||||
global sym(vp8_intra_pred_uv_ho_%1)
|
||||
global sym(vp8_intra_pred_uv_ho_%1) PRIVATE
|
||||
sym(vp8_intra_pred_uv_ho_%1):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
push rdi
|
||||
%ifidn %1, ssse3
|
||||
@@ -485,12 +494,14 @@ sym(vp8_intra_pred_uv_ho_%1):
|
||||
%endif
|
||||
; end prolog
|
||||
|
||||
;arg(2) not used
|
||||
|
||||
; read from left and write out
|
||||
%ifidn %1, mmx2
|
||||
mov edx, 4
|
||||
%endif
|
||||
mov rsi, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
mov rsi, arg(3) ;left
|
||||
movsxd rax, dword ptr arg(4) ;left_stride;
|
||||
mov rdi, arg(0) ;dst;
|
||||
movsxd rcx, dword ptr arg(1) ;dst_stride
|
||||
%ifidn %1, ssse3
|
||||
@@ -498,7 +509,7 @@ sym(vp8_intra_pred_uv_ho_%1):
|
||||
movdqa xmm2, [GLOBAL(dc_00001111)]
|
||||
lea rbx, [rax*3]
|
||||
%endif
|
||||
dec rsi
|
||||
|
||||
%ifidn %1, mmx2
|
||||
.vp8_intra_pred_uv_ho_%1_loop:
|
||||
movd mm0, [rsi]
|
||||
@@ -562,38 +573,43 @@ vp8_intra_pred_uv_ho ssse3
|
||||
;void vp8_intra_pred_y_dc_sse2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride
|
||||
; )
|
||||
global sym(vp8_intra_pred_y_dc_sse2)
|
||||
global sym(vp8_intra_pred_y_dc_sse2) PRIVATE
|
||||
sym(vp8_intra_pred_y_dc_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
push rdi
|
||||
; end prolog
|
||||
|
||||
; from top
|
||||
mov rsi, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
sub rsi, rax
|
||||
mov rdi, arg(2) ;above
|
||||
mov rsi, arg(3) ;left
|
||||
movsxd rax, dword ptr arg(4) ;left_stride;
|
||||
|
||||
pxor xmm0, xmm0
|
||||
movdqa xmm1, [rsi]
|
||||
movdqa xmm1, [rdi]
|
||||
psadbw xmm1, xmm0
|
||||
movq xmm2, xmm1
|
||||
punpckhqdq xmm1, xmm1
|
||||
paddw xmm1, xmm2
|
||||
|
||||
; from left
|
||||
dec rsi
|
||||
lea rdi, [rax*3]
|
||||
movzx ecx, byte [rsi+rax]
|
||||
|
||||
movzx ecx, byte [rsi]
|
||||
movzx edx, byte [rsi+rax]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rax*2]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rdi]
|
||||
add ecx, edx
|
||||
lea rsi, [rsi+rax*4]
|
||||
|
||||
movzx edx, byte [rsi]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rax]
|
||||
@@ -603,6 +619,7 @@ sym(vp8_intra_pred_y_dc_sse2):
|
||||
movzx edx, byte [rsi+rdi]
|
||||
add ecx, edx
|
||||
lea rsi, [rsi+rax*4]
|
||||
|
||||
movzx edx, byte [rsi]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rax]
|
||||
@@ -612,6 +629,7 @@ sym(vp8_intra_pred_y_dc_sse2):
|
||||
movzx edx, byte [rsi+rdi]
|
||||
add ecx, edx
|
||||
lea rsi, [rsi+rax*4]
|
||||
|
||||
movzx edx, byte [rsi]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rax]
|
||||
@@ -620,8 +638,6 @@ sym(vp8_intra_pred_y_dc_sse2):
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rdi]
|
||||
add ecx, edx
|
||||
movzx edx, byte [rsi+rax*4]
|
||||
add ecx, edx
|
||||
|
||||
; add up
|
||||
pextrw edx, xmm1, 0x0
|
||||
@@ -663,22 +679,23 @@ sym(vp8_intra_pred_y_dc_sse2):
|
||||
;void vp8_intra_pred_y_dctop_sse2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride
|
||||
; )
|
||||
global sym(vp8_intra_pred_y_dctop_sse2)
|
||||
global sym(vp8_intra_pred_y_dctop_sse2) PRIVATE
|
||||
sym(vp8_intra_pred_y_dctop_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
GET_GOT rbx
|
||||
; end prolog
|
||||
|
||||
;arg(3), arg(4) not used
|
||||
|
||||
; from top
|
||||
mov rcx, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
sub rcx, rax
|
||||
mov rcx, arg(2) ;above;
|
||||
pxor xmm0, xmm0
|
||||
movdqa xmm1, [rcx]
|
||||
psadbw xmm1, xmm0
|
||||
@@ -724,22 +741,25 @@ sym(vp8_intra_pred_y_dctop_sse2):
|
||||
;void vp8_intra_pred_y_dcleft_sse2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride
|
||||
; )
|
||||
global sym(vp8_intra_pred_y_dcleft_sse2)
|
||||
global sym(vp8_intra_pred_y_dcleft_sse2) PRIVATE
|
||||
sym(vp8_intra_pred_y_dcleft_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
push rdi
|
||||
; end prolog
|
||||
|
||||
;arg(2) not used
|
||||
|
||||
; from left
|
||||
mov rsi, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
dec rsi
|
||||
mov rsi, arg(3) ;left;
|
||||
movsxd rax, dword ptr arg(4) ;left_stride;
|
||||
|
||||
lea rdi, [rax*3]
|
||||
movzx ecx, byte [rsi]
|
||||
movzx edx, byte [rsi+rax]
|
||||
@@ -814,18 +834,21 @@ sym(vp8_intra_pred_y_dcleft_sse2):
|
||||
;void vp8_intra_pred_y_dc128_sse2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride
|
||||
; )
|
||||
global sym(vp8_intra_pred_y_dc128_sse2)
|
||||
global sym(vp8_intra_pred_y_dc128_sse2) PRIVATE
|
||||
sym(vp8_intra_pred_y_dc128_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
GET_GOT rbx
|
||||
; end prolog
|
||||
|
||||
;arg(2), arg(3), arg(4) not used
|
||||
|
||||
; write out
|
||||
mov rsi, 2
|
||||
movdqa xmm1, [GLOBAL(dc_128)]
|
||||
@@ -857,15 +880,16 @@ sym(vp8_intra_pred_y_dc128_sse2):
|
||||
;void vp8_intra_pred_y_tm_sse2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride
|
||||
; )
|
||||
%macro vp8_intra_pred_y_tm 1
|
||||
global sym(vp8_intra_pred_y_tm_%1)
|
||||
global sym(vp8_intra_pred_y_tm_%1) PRIVATE
|
||||
sym(vp8_intra_pred_y_tm_%1):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
push rdi
|
||||
GET_GOT rbx
|
||||
@@ -873,9 +897,8 @@ sym(vp8_intra_pred_y_tm_%1):
|
||||
|
||||
; read top row
|
||||
mov edx, 8
|
||||
mov rsi, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
sub rsi, rax
|
||||
mov rsi, arg(2) ;above
|
||||
movsxd rax, dword ptr arg(4) ;left_stride;
|
||||
pxor xmm0, xmm0
|
||||
%ifidn %1, ssse3
|
||||
movdqa xmm3, [GLOBAL(dc_1024)]
|
||||
@@ -887,7 +910,7 @@ sym(vp8_intra_pred_y_tm_%1):
|
||||
|
||||
; set up left ptrs ans subtract topleft
|
||||
movd xmm4, [rsi-1]
|
||||
lea rsi, [rsi+rax-1]
|
||||
mov rsi, arg(3) ;left
|
||||
%ifidn %1, sse2
|
||||
punpcklbw xmm4, xmm0
|
||||
pshuflw xmm4, xmm4, 0x0
|
||||
@@ -945,27 +968,29 @@ vp8_intra_pred_y_tm ssse3
|
||||
;void vp8_intra_pred_y_ve_sse2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride
|
||||
; )
|
||||
global sym(vp8_intra_pred_y_ve_sse2)
|
||||
global sym(vp8_intra_pred_y_ve_sse2) PRIVATE
|
||||
sym(vp8_intra_pred_y_ve_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
; end prolog
|
||||
|
||||
;arg(3), arg(4) not used
|
||||
|
||||
mov rax, arg(2) ;above;
|
||||
mov rsi, 2
|
||||
movsxd rdx, dword ptr arg(1) ;dst_stride
|
||||
|
||||
; read from top
|
||||
mov rax, arg(2) ;src;
|
||||
movsxd rdx, dword ptr arg(3) ;src_stride;
|
||||
sub rax, rdx
|
||||
movdqa xmm1, [rax]
|
||||
|
||||
; write out
|
||||
mov rsi, 2
|
||||
mov rax, arg(0) ;dst;
|
||||
movsxd rdx, dword ptr arg(1) ;dst_stride
|
||||
lea rcx, [rdx*3]
|
||||
|
||||
.label
|
||||
@@ -991,25 +1016,27 @@ sym(vp8_intra_pred_y_ve_sse2):
|
||||
;void vp8_intra_pred_y_ho_sse2(
|
||||
; unsigned char *dst,
|
||||
; int dst_stride
|
||||
; unsigned char *src,
|
||||
; int src_stride,
|
||||
; unsigned char *above,
|
||||
; unsigned char *left,
|
||||
; int left_stride,
|
||||
; )
|
||||
global sym(vp8_intra_pred_y_ho_sse2)
|
||||
global sym(vp8_intra_pred_y_ho_sse2) PRIVATE
|
||||
sym(vp8_intra_pred_y_ho_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
SHADOW_ARGS_TO_STACK 4
|
||||
SHADOW_ARGS_TO_STACK 5
|
||||
push rsi
|
||||
push rdi
|
||||
; end prolog
|
||||
|
||||
;arg(2) not used
|
||||
|
||||
; read from left and write out
|
||||
mov edx, 8
|
||||
mov rsi, arg(2) ;src;
|
||||
movsxd rax, dword ptr arg(3) ;src_stride;
|
||||
mov rsi, arg(3) ;left;
|
||||
movsxd rax, dword ptr arg(4) ;left_stride;
|
||||
mov rdi, arg(0) ;dst;
|
||||
movsxd rcx, dword ptr arg(1) ;dst_stride
|
||||
dec rsi
|
||||
|
||||
vp8_intra_pred_y_ho_sse2_loop:
|
||||
movd xmm0, [rsi]
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
|
||||
#define build_intra_predictors_mbuv_prototype(sym) \
|
||||
void sym(unsigned char *dst, int dst_stride, \
|
||||
const unsigned char *src, int src_stride)
|
||||
const unsigned char *above, \
|
||||
const unsigned char *left, int left_stride)
|
||||
typedef build_intra_predictors_mbuv_prototype((*build_intra_predictors_mbuv_fn_t));
|
||||
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_uv_dc_mmx2);
|
||||
@@ -29,15 +30,19 @@ extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_uv_tm_sse2);
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_uv_tm_ssse3);
|
||||
|
||||
static void vp8_build_intra_predictors_mbuv_x86(MACROBLOCKD *x,
|
||||
unsigned char * uabove_row,
|
||||
unsigned char * vabove_row,
|
||||
unsigned char *dst_u,
|
||||
unsigned char *dst_v,
|
||||
int dst_stride,
|
||||
unsigned char * uleft,
|
||||
unsigned char * vleft,
|
||||
int left_stride,
|
||||
build_intra_predictors_mbuv_fn_t tm_func,
|
||||
build_intra_predictors_mbuv_fn_t ho_func)
|
||||
{
|
||||
int mode = x->mode_info_context->mbmi.uv_mode;
|
||||
build_intra_predictors_mbuv_fn_t fn;
|
||||
int src_stride = x->dst.uv_stride;
|
||||
|
||||
switch (mode) {
|
||||
case V_PRED: fn = vp8_intra_pred_uv_ve_mmx; break;
|
||||
@@ -59,59 +64,78 @@ static void vp8_build_intra_predictors_mbuv_x86(MACROBLOCKD *x,
|
||||
default: return;
|
||||
}
|
||||
|
||||
fn(dst_u, dst_stride, x->dst.u_buffer, src_stride);
|
||||
fn(dst_v, dst_stride, x->dst.v_buffer, src_stride);
|
||||
fn(dst_u, dst_stride, uabove_row, uleft, left_stride);
|
||||
fn(dst_v, dst_stride, vabove_row, vleft, left_stride);
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mbuv_sse2(MACROBLOCKD *x)
|
||||
void vp8_build_intra_predictors_mbuv_s_sse2(MACROBLOCKD *x,
|
||||
unsigned char * uabove_row,
|
||||
unsigned char * vabove_row,
|
||||
unsigned char * uleft,
|
||||
unsigned char * vleft,
|
||||
int left_stride,
|
||||
unsigned char * upred_ptr,
|
||||
unsigned char * vpred_ptr,
|
||||
int pred_stride)
|
||||
{
|
||||
vp8_build_intra_predictors_mbuv_x86(x, &x->predictor[256],
|
||||
&x->predictor[320], 8,
|
||||
vp8_build_intra_predictors_mbuv_x86(x,
|
||||
uabove_row, vabove_row,
|
||||
upred_ptr,
|
||||
vpred_ptr, pred_stride,
|
||||
uleft,
|
||||
vleft,
|
||||
left_stride,
|
||||
vp8_intra_pred_uv_tm_sse2,
|
||||
vp8_intra_pred_uv_ho_mmx2);
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mbuv_ssse3(MACROBLOCKD *x)
|
||||
void vp8_build_intra_predictors_mbuv_s_ssse3(MACROBLOCKD *x,
|
||||
unsigned char * uabove_row,
|
||||
unsigned char * vabove_row,
|
||||
unsigned char * uleft,
|
||||
unsigned char * vleft,
|
||||
int left_stride,
|
||||
unsigned char * upred_ptr,
|
||||
unsigned char * vpred_ptr,
|
||||
int pred_stride)
|
||||
{
|
||||
vp8_build_intra_predictors_mbuv_x86(x, &x->predictor[256],
|
||||
&x->predictor[320], 8,
|
||||
vp8_build_intra_predictors_mbuv_x86(x,
|
||||
uabove_row, vabove_row,
|
||||
upred_ptr,
|
||||
vpred_ptr, pred_stride,
|
||||
uleft,
|
||||
vleft,
|
||||
left_stride,
|
||||
vp8_intra_pred_uv_tm_ssse3,
|
||||
vp8_intra_pred_uv_ho_ssse3);
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mbuv_s_sse2(MACROBLOCKD *x)
|
||||
{
|
||||
vp8_build_intra_predictors_mbuv_x86(x, x->dst.u_buffer,
|
||||
x->dst.v_buffer, x->dst.uv_stride,
|
||||
vp8_intra_pred_uv_tm_sse2,
|
||||
vp8_intra_pred_uv_ho_mmx2);
|
||||
}
|
||||
#define build_intra_predictors_mby_prototype(sym) \
|
||||
void sym(unsigned char *dst, int dst_stride, \
|
||||
const unsigned char *above, \
|
||||
const unsigned char *left, int left_stride)
|
||||
typedef build_intra_predictors_mby_prototype((*build_intra_predictors_mby_fn_t));
|
||||
|
||||
void vp8_build_intra_predictors_mbuv_s_ssse3(MACROBLOCKD *x)
|
||||
{
|
||||
vp8_build_intra_predictors_mbuv_x86(x, x->dst.u_buffer,
|
||||
x->dst.v_buffer, x->dst.uv_stride,
|
||||
vp8_intra_pred_uv_tm_ssse3,
|
||||
vp8_intra_pred_uv_ho_ssse3);
|
||||
}
|
||||
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_y_dc_sse2);
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_y_dctop_sse2);
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_y_dcleft_sse2);
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_y_dc128_sse2);
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_y_ho_sse2);
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_y_ve_sse2);
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_y_tm_sse2);
|
||||
extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_y_tm_ssse3);
|
||||
extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_dc_sse2);
|
||||
extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_dctop_sse2);
|
||||
extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_dcleft_sse2);
|
||||
extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_dc128_sse2);
|
||||
extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_ho_sse2);
|
||||
extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_ve_sse2);
|
||||
extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_tm_sse2);
|
||||
extern build_intra_predictors_mby_prototype(vp8_intra_pred_y_tm_ssse3);
|
||||
|
||||
static void vp8_build_intra_predictors_mby_x86(MACROBLOCKD *x,
|
||||
unsigned char * yabove_row,
|
||||
unsigned char *dst_y,
|
||||
int dst_stride,
|
||||
build_intra_predictors_mbuv_fn_t tm_func)
|
||||
unsigned char * yleft,
|
||||
int left_stride,
|
||||
build_intra_predictors_mby_fn_t tm_func)
|
||||
{
|
||||
int mode = x->mode_info_context->mbmi.mode;
|
||||
build_intra_predictors_mbuv_fn_t fn;
|
||||
int src_stride = x->dst.y_stride;
|
||||
|
||||
switch (mode) {
|
||||
case V_PRED: fn = vp8_intra_pred_y_ve_sse2; break;
|
||||
case H_PRED: fn = vp8_intra_pred_y_ho_sse2; break;
|
||||
@@ -132,31 +156,31 @@ static void vp8_build_intra_predictors_mby_x86(MACROBLOCKD *x,
|
||||
default: return;
|
||||
}
|
||||
|
||||
fn(dst_y, dst_stride, x->dst.y_buffer, src_stride);
|
||||
fn(dst_y, dst_stride, yabove_row, yleft, left_stride);
|
||||
return;
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mby_sse2(MACROBLOCKD *x)
|
||||
void vp8_build_intra_predictors_mby_s_sse2(MACROBLOCKD *x,
|
||||
unsigned char * yabove_row,
|
||||
unsigned char * yleft,
|
||||
int left_stride,
|
||||
unsigned char * ypred_ptr,
|
||||
int y_stride)
|
||||
{
|
||||
vp8_build_intra_predictors_mby_x86(x, x->predictor, 16,
|
||||
vp8_build_intra_predictors_mby_x86(x, yabove_row, ypred_ptr,
|
||||
y_stride, yleft, left_stride,
|
||||
vp8_intra_pred_y_tm_sse2);
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mby_ssse3(MACROBLOCKD *x)
|
||||
void vp8_build_intra_predictors_mby_s_ssse3(MACROBLOCKD *x,
|
||||
unsigned char * yabove_row,
|
||||
unsigned char * yleft,
|
||||
int left_stride,
|
||||
unsigned char * ypred_ptr,
|
||||
int y_stride)
|
||||
{
|
||||
vp8_build_intra_predictors_mby_x86(x, x->predictor, 16,
|
||||
vp8_intra_pred_y_tm_ssse3);
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mby_s_sse2(MACROBLOCKD *x)
|
||||
{
|
||||
vp8_build_intra_predictors_mby_x86(x, x->dst.y_buffer, x->dst.y_stride,
|
||||
vp8_intra_pred_y_tm_sse2);
|
||||
}
|
||||
|
||||
void vp8_build_intra_predictors_mby_s_ssse3(MACROBLOCKD *x)
|
||||
{
|
||||
vp8_build_intra_predictors_mby_x86(x, x->dst.y_buffer, x->dst.y_stride,
|
||||
vp8_build_intra_predictors_mby_x86(x, yabove_row, ypred_ptr,
|
||||
y_stride, yleft, left_stride,
|
||||
vp8_intra_pred_y_tm_ssse3);
|
||||
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
|
||||
%include "vpx_ports/x86_abi_support.asm"
|
||||
|
||||
global sym(vp8_sad16x16_mmx)
|
||||
global sym(vp8_sad8x16_mmx)
|
||||
global sym(vp8_sad8x8_mmx)
|
||||
global sym(vp8_sad4x4_mmx)
|
||||
global sym(vp8_sad16x8_mmx)
|
||||
global sym(vp8_sad16x16_mmx) PRIVATE
|
||||
global sym(vp8_sad8x16_mmx) PRIVATE
|
||||
global sym(vp8_sad8x8_mmx) PRIVATE
|
||||
global sym(vp8_sad4x4_mmx) PRIVATE
|
||||
global sym(vp8_sad16x8_mmx) PRIVATE
|
||||
|
||||
;unsigned int vp8_sad16x16_mmx(
|
||||
; unsigned char *src_ptr,
|
||||
@@ -16,7 +16,7 @@
|
||||
; int src_stride,
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride)
|
||||
global sym(vp8_sad16x16_wmt)
|
||||
global sym(vp8_sad16x16_wmt) PRIVATE
|
||||
sym(vp8_sad16x16_wmt):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -89,8 +89,8 @@ sym(vp8_sad16x16_wmt):
|
||||
; int src_stride,
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int max_err)
|
||||
global sym(vp8_sad8x16_wmt)
|
||||
; int max_sad)
|
||||
global sym(vp8_sad8x16_wmt) PRIVATE
|
||||
sym(vp8_sad8x16_wmt):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -153,7 +153,7 @@ sym(vp8_sad8x16_wmt):
|
||||
; int src_stride,
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride)
|
||||
global sym(vp8_sad8x8_wmt)
|
||||
global sym(vp8_sad8x8_wmt) PRIVATE
|
||||
sym(vp8_sad8x8_wmt):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -206,7 +206,7 @@ sym(vp8_sad8x8_wmt):
|
||||
; int src_stride,
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride)
|
||||
global sym(vp8_sad4x4_wmt)
|
||||
global sym(vp8_sad4x4_wmt) PRIVATE
|
||||
sym(vp8_sad4x4_wmt):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -261,7 +261,7 @@ sym(vp8_sad4x4_wmt):
|
||||
; int src_stride,
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride)
|
||||
global sym(vp8_sad16x8_wmt)
|
||||
global sym(vp8_sad16x8_wmt) PRIVATE
|
||||
sym(vp8_sad16x8_wmt):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -335,7 +335,7 @@ sym(vp8_sad16x8_wmt):
|
||||
; unsigned char *dst_ptr,
|
||||
; int dst_stride,
|
||||
; int height);
|
||||
global sym(vp8_copy32xn_sse2)
|
||||
global sym(vp8_copy32xn_sse2) PRIVATE
|
||||
sym(vp8_copy32xn_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -19,7 +19,7 @@
|
||||
%define end_ptr rcx
|
||||
%define ret_var rbx
|
||||
%define result_ptr arg(4)
|
||||
%define max_err arg(4)
|
||||
%define max_sad arg(4)
|
||||
%define height dword ptr arg(4)
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -42,7 +42,7 @@
|
||||
%define end_ptr r10
|
||||
%define ret_var r11
|
||||
%define result_ptr [rsp+xmm_stack_space+8+4*8]
|
||||
%define max_err [rsp+xmm_stack_space+8+4*8]
|
||||
%define max_sad [rsp+xmm_stack_space+8+4*8]
|
||||
%define height dword ptr [rsp+xmm_stack_space+8+4*8]
|
||||
%else
|
||||
%define src_ptr rdi
|
||||
@@ -52,7 +52,7 @@
|
||||
%define end_ptr r9
|
||||
%define ret_var r10
|
||||
%define result_ptr r8
|
||||
%define max_err r8
|
||||
%define max_sad r8
|
||||
%define height r8
|
||||
%endif
|
||||
%endif
|
||||
@@ -67,7 +67,7 @@
|
||||
%define end_ptr
|
||||
%define ret_var
|
||||
%define result_ptr
|
||||
%define max_err
|
||||
%define max_sad
|
||||
%define height
|
||||
|
||||
%if ABI_IS_32BIT
|
||||
@@ -380,7 +380,7 @@
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad16x16x3_sse3)
|
||||
global sym(vp8_sad16x16x3_sse3) PRIVATE
|
||||
sym(vp8_sad16x16x3_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X3
|
||||
@@ -422,7 +422,7 @@ sym(vp8_sad16x16x3_sse3):
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad16x8x3_sse3)
|
||||
global sym(vp8_sad16x8x3_sse3) PRIVATE
|
||||
sym(vp8_sad16x8x3_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X3
|
||||
@@ -460,7 +460,7 @@ sym(vp8_sad16x8x3_sse3):
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad8x16x3_sse3)
|
||||
global sym(vp8_sad8x16x3_sse3) PRIVATE
|
||||
sym(vp8_sad8x16x3_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X3
|
||||
@@ -489,7 +489,7 @@ sym(vp8_sad8x16x3_sse3):
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad8x8x3_sse3)
|
||||
global sym(vp8_sad8x8x3_sse3) PRIVATE
|
||||
sym(vp8_sad8x8x3_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X3
|
||||
@@ -514,7 +514,7 @@ sym(vp8_sad8x8x3_sse3):
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad4x4x3_sse3)
|
||||
global sym(vp8_sad4x4x3_sse3) PRIVATE
|
||||
sym(vp8_sad4x4x3_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X3
|
||||
@@ -587,9 +587,9 @@ sym(vp8_sad4x4x3_sse3):
|
||||
; int src_stride,
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int max_err)
|
||||
; int max_sad)
|
||||
;%define lddqu movdqu
|
||||
global sym(vp8_sad16x16_sse3)
|
||||
global sym(vp8_sad16x16_sse3) PRIVATE
|
||||
sym(vp8_sad16x16_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X3
|
||||
@@ -642,7 +642,7 @@ sym(vp8_sad16x16_sse3):
|
||||
; unsigned char *dst_ptr,
|
||||
; int dst_stride,
|
||||
; int height);
|
||||
global sym(vp8_copy32xn_sse3)
|
||||
global sym(vp8_copy32xn_sse3) PRIVATE
|
||||
sym(vp8_copy32xn_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X3
|
||||
@@ -703,7 +703,7 @@ sym(vp8_copy32xn_sse3):
|
||||
; unsigned char *ref_ptr_base,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad16x16x4d_sse3)
|
||||
global sym(vp8_sad16x16x4d_sse3) PRIVATE
|
||||
sym(vp8_sad16x16x4d_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X4
|
||||
@@ -754,7 +754,7 @@ sym(vp8_sad16x16x4d_sse3):
|
||||
; unsigned char *ref_ptr_base,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad16x8x4d_sse3)
|
||||
global sym(vp8_sad16x8x4d_sse3) PRIVATE
|
||||
sym(vp8_sad16x8x4d_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X4
|
||||
@@ -801,7 +801,7 @@ sym(vp8_sad16x8x4d_sse3):
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad8x16x4d_sse3)
|
||||
global sym(vp8_sad8x16x4d_sse3) PRIVATE
|
||||
sym(vp8_sad8x16x4d_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X4
|
||||
@@ -834,7 +834,7 @@ sym(vp8_sad8x16x4d_sse3):
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad8x8x4d_sse3)
|
||||
global sym(vp8_sad8x8x4d_sse3) PRIVATE
|
||||
sym(vp8_sad8x8x4d_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X4
|
||||
@@ -863,7 +863,7 @@ sym(vp8_sad8x8x4d_sse3):
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad4x4x4d_sse3)
|
||||
global sym(vp8_sad4x4x4d_sse3) PRIVATE
|
||||
sym(vp8_sad4x4x4d_sse3):
|
||||
|
||||
STACK_FRAME_CREATE_X4
|
||||
@@ -161,7 +161,7 @@
|
||||
; const unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; unsigned short *sad_array);
|
||||
global sym(vp8_sad16x16x8_sse4)
|
||||
global sym(vp8_sad16x16x8_sse4) PRIVATE
|
||||
sym(vp8_sad16x16x8_sse4):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -203,7 +203,7 @@ sym(vp8_sad16x16x8_sse4):
|
||||
; int ref_stride,
|
||||
; unsigned short *sad_array
|
||||
;);
|
||||
global sym(vp8_sad16x8x8_sse4)
|
||||
global sym(vp8_sad16x8x8_sse4) PRIVATE
|
||||
sym(vp8_sad16x8x8_sse4):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -241,7 +241,7 @@ sym(vp8_sad16x8x8_sse4):
|
||||
; int ref_stride,
|
||||
; unsigned short *sad_array
|
||||
;);
|
||||
global sym(vp8_sad8x8x8_sse4)
|
||||
global sym(vp8_sad8x8x8_sse4) PRIVATE
|
||||
sym(vp8_sad8x8x8_sse4):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -279,7 +279,7 @@ sym(vp8_sad8x8x8_sse4):
|
||||
; int ref_stride,
|
||||
; unsigned short *sad_array
|
||||
;);
|
||||
global sym(vp8_sad8x16x8_sse4)
|
||||
global sym(vp8_sad8x16x8_sse4) PRIVATE
|
||||
sym(vp8_sad8x16x8_sse4):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -320,7 +320,7 @@ sym(vp8_sad8x16x8_sse4):
|
||||
; int ref_stride,
|
||||
; unsigned short *sad_array
|
||||
;);
|
||||
global sym(vp8_sad4x4x8_sse4)
|
||||
global sym(vp8_sad4x4x8_sse4) PRIVATE
|
||||
sym(vp8_sad4x4x8_sse4):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -152,7 +152,7 @@
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad16x16x3_ssse3)
|
||||
global sym(vp8_sad16x16x3_ssse3) PRIVATE
|
||||
sym(vp8_sad16x16x3_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -265,7 +265,7 @@ sym(vp8_sad16x16x3_ssse3):
|
||||
; unsigned char *ref_ptr,
|
||||
; int ref_stride,
|
||||
; int *results)
|
||||
global sym(vp8_sad16x8x3_ssse3)
|
||||
global sym(vp8_sad16x8x3_ssse3) PRIVATE
|
||||
sym(vp8_sad16x8x3_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -28,7 +28,7 @@ extern sym(vp8_bilinear_filters_x86_8)
|
||||
; unsigned int output_width,
|
||||
; short * vp8_filter
|
||||
;)
|
||||
global sym(vp8_filter_block1d_h6_mmx)
|
||||
global sym(vp8_filter_block1d_h6_mmx) PRIVATE
|
||||
sym(vp8_filter_block1d_h6_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -125,7 +125,7 @@ sym(vp8_filter_block1d_h6_mmx):
|
||||
; unsigned int output_width,
|
||||
; short * vp8_filter
|
||||
;)
|
||||
global sym(vp8_filter_block1dc_v6_mmx)
|
||||
global sym(vp8_filter_block1dc_v6_mmx) PRIVATE
|
||||
sym(vp8_filter_block1dc_v6_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -213,7 +213,7 @@ sym(vp8_filter_block1dc_v6_mmx):
|
||||
; unsigned char *dst_ptr,
|
||||
; int dst_pitch
|
||||
;)
|
||||
global sym(vp8_bilinear_predict8x8_mmx)
|
||||
global sym(vp8_bilinear_predict8x8_mmx) PRIVATE
|
||||
sym(vp8_bilinear_predict8x8_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -370,7 +370,7 @@ sym(vp8_bilinear_predict8x8_mmx):
|
||||
; unsigned char *dst_ptr,
|
||||
; int dst_pitch
|
||||
;)
|
||||
global sym(vp8_bilinear_predict8x4_mmx)
|
||||
global sym(vp8_bilinear_predict8x4_mmx) PRIVATE
|
||||
sym(vp8_bilinear_predict8x4_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -525,7 +525,7 @@ sym(vp8_bilinear_predict8x4_mmx):
|
||||
; unsigned char *dst_ptr,
|
||||
; int dst_pitch
|
||||
;)
|
||||
global sym(vp8_bilinear_predict4x4_mmx)
|
||||
global sym(vp8_bilinear_predict4x4_mmx) PRIVATE
|
||||
sym(vp8_bilinear_predict4x4_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -33,7 +33,7 @@ extern sym(vp8_bilinear_filters_x86_8)
|
||||
; unsigned int output_width,
|
||||
; short *vp8_filter
|
||||
;)
|
||||
global sym(vp8_filter_block1d8_h6_sse2)
|
||||
global sym(vp8_filter_block1d8_h6_sse2) PRIVATE
|
||||
sym(vp8_filter_block1d8_h6_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -153,7 +153,7 @@ sym(vp8_filter_block1d8_h6_sse2):
|
||||
; even number. This function handles 8 pixels in horizontal direction, calculating ONE
|
||||
; rows each iteration to take advantage of the 128 bits operations.
|
||||
;*************************************************************************************/
|
||||
global sym(vp8_filter_block1d16_h6_sse2)
|
||||
global sym(vp8_filter_block1d16_h6_sse2) PRIVATE
|
||||
sym(vp8_filter_block1d16_h6_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -329,7 +329,7 @@ sym(vp8_filter_block1d16_h6_sse2):
|
||||
; Notes: filter_block1d8_v6 applies a 6 tap filter vertically to the input pixels. The
|
||||
; input pixel array has output_height rows.
|
||||
;*************************************************************************************/
|
||||
global sym(vp8_filter_block1d8_v6_sse2)
|
||||
global sym(vp8_filter_block1d8_v6_sse2) PRIVATE
|
||||
sym(vp8_filter_block1d8_v6_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -424,7 +424,7 @@ sym(vp8_filter_block1d8_v6_sse2):
|
||||
; Notes: filter_block1d16_v6 applies a 6 tap filter vertically to the input pixels. The
|
||||
; input pixel array has output_height rows.
|
||||
;*************************************************************************************/
|
||||
global sym(vp8_filter_block1d16_v6_sse2)
|
||||
global sym(vp8_filter_block1d16_v6_sse2) PRIVATE
|
||||
sym(vp8_filter_block1d16_v6_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -534,7 +534,7 @@ sym(vp8_filter_block1d16_v6_sse2):
|
||||
; const short *vp8_filter
|
||||
;)
|
||||
; First-pass filter only when yoffset==0
|
||||
global sym(vp8_filter_block1d8_h6_only_sse2)
|
||||
global sym(vp8_filter_block1d8_h6_only_sse2) PRIVATE
|
||||
sym(vp8_filter_block1d8_h6_only_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -647,7 +647,7 @@ sym(vp8_filter_block1d8_h6_only_sse2):
|
||||
; const short *vp8_filter
|
||||
;)
|
||||
; First-pass filter only when yoffset==0
|
||||
global sym(vp8_filter_block1d16_h6_only_sse2)
|
||||
global sym(vp8_filter_block1d16_h6_only_sse2) PRIVATE
|
||||
sym(vp8_filter_block1d16_h6_only_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -812,7 +812,7 @@ sym(vp8_filter_block1d16_h6_only_sse2):
|
||||
; const short *vp8_filter
|
||||
;)
|
||||
; Second-pass filter only when xoffset==0
|
||||
global sym(vp8_filter_block1d8_v6_only_sse2)
|
||||
global sym(vp8_filter_block1d8_v6_only_sse2) PRIVATE
|
||||
sym(vp8_filter_block1d8_v6_only_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -904,7 +904,7 @@ sym(vp8_filter_block1d8_v6_only_sse2):
|
||||
; unsigned int output_height,
|
||||
; unsigned int output_width
|
||||
;)
|
||||
global sym(vp8_unpack_block1d16_h6_sse2)
|
||||
global sym(vp8_unpack_block1d16_h6_sse2) PRIVATE
|
||||
sym(vp8_unpack_block1d16_h6_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -963,7 +963,7 @@ sym(vp8_unpack_block1d16_h6_sse2):
|
||||
; int dst_pitch
|
||||
;)
|
||||
extern sym(vp8_bilinear_filters_x86_8)
|
||||
global sym(vp8_bilinear_predict16x16_sse2)
|
||||
global sym(vp8_bilinear_predict16x16_sse2) PRIVATE
|
||||
sym(vp8_bilinear_predict16x16_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -1231,7 +1231,7 @@ sym(vp8_bilinear_predict16x16_sse2):
|
||||
; unsigned char *dst_ptr,
|
||||
; int dst_pitch
|
||||
;)
|
||||
global sym(vp8_bilinear_predict8x8_sse2)
|
||||
global sym(vp8_bilinear_predict8x8_sse2) PRIVATE
|
||||
sym(vp8_bilinear_predict8x8_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
; unsigned int output_height,
|
||||
; unsigned int vp8_filter_index
|
||||
;)
|
||||
global sym(vp8_filter_block1d8_h6_ssse3)
|
||||
global sym(vp8_filter_block1d8_h6_ssse3) PRIVATE
|
||||
sym(vp8_filter_block1d8_h6_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -177,7 +177,7 @@ vp8_filter_block1d8_h4_ssse3:
|
||||
; unsigned int output_height,
|
||||
; unsigned int vp8_filter_index
|
||||
;)
|
||||
global sym(vp8_filter_block1d16_h6_ssse3)
|
||||
global sym(vp8_filter_block1d16_h6_ssse3) PRIVATE
|
||||
sym(vp8_filter_block1d16_h6_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -284,7 +284,7 @@ sym(vp8_filter_block1d16_h6_ssse3):
|
||||
; unsigned int output_height,
|
||||
; unsigned int vp8_filter_index
|
||||
;)
|
||||
global sym(vp8_filter_block1d4_h6_ssse3)
|
||||
global sym(vp8_filter_block1d4_h6_ssse3) PRIVATE
|
||||
sym(vp8_filter_block1d4_h6_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -413,7 +413,7 @@ sym(vp8_filter_block1d4_h6_ssse3):
|
||||
; unsigned int output_height,
|
||||
; unsigned int vp8_filter_index
|
||||
;)
|
||||
global sym(vp8_filter_block1d16_v6_ssse3)
|
||||
global sym(vp8_filter_block1d16_v6_ssse3) PRIVATE
|
||||
sym(vp8_filter_block1d16_v6_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -601,7 +601,7 @@ sym(vp8_filter_block1d16_v6_ssse3):
|
||||
; unsigned int output_height,
|
||||
; unsigned int vp8_filter_index
|
||||
;)
|
||||
global sym(vp8_filter_block1d8_v6_ssse3)
|
||||
global sym(vp8_filter_block1d8_v6_ssse3) PRIVATE
|
||||
sym(vp8_filter_block1d8_v6_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -741,7 +741,7 @@ sym(vp8_filter_block1d8_v6_ssse3):
|
||||
; unsigned int output_height,
|
||||
; unsigned int vp8_filter_index
|
||||
;)
|
||||
global sym(vp8_filter_block1d4_v6_ssse3)
|
||||
global sym(vp8_filter_block1d4_v6_ssse3) PRIVATE
|
||||
sym(vp8_filter_block1d4_v6_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -880,7 +880,7 @@ sym(vp8_filter_block1d4_v6_ssse3):
|
||||
; unsigned char *dst_ptr,
|
||||
; int dst_pitch
|
||||
;)
|
||||
global sym(vp8_bilinear_predict16x16_ssse3)
|
||||
global sym(vp8_bilinear_predict16x16_ssse3) PRIVATE
|
||||
sym(vp8_bilinear_predict16x16_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -1143,7 +1143,7 @@ sym(vp8_bilinear_predict16x16_ssse3):
|
||||
; unsigned char *dst_ptr,
|
||||
; int dst_pitch
|
||||
;)
|
||||
global sym(vp8_bilinear_predict8x8_ssse3)
|
||||
global sym(vp8_bilinear_predict8x8_ssse3) PRIVATE
|
||||
sym(vp8_bilinear_predict8x8_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
%include "vpx_ports/x86_abi_support.asm"
|
||||
|
||||
;unsigned int vp8_get_mb_ss_mmx( short *src_ptr )
|
||||
global sym(vp8_get_mb_ss_mmx)
|
||||
global sym(vp8_get_mb_ss_mmx) PRIVATE
|
||||
sym(vp8_get_mb_ss_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -72,7 +72,7 @@ sym(vp8_get_mb_ss_mmx):
|
||||
; unsigned int *SSE,
|
||||
; int *Sum
|
||||
;)
|
||||
global sym(vp8_get8x8var_mmx)
|
||||
global sym(vp8_get8x8var_mmx) PRIVATE
|
||||
sym(vp8_get8x8var_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -320,7 +320,7 @@ sym(vp8_get8x8var_mmx):
|
||||
; unsigned int *SSE,
|
||||
; int *Sum
|
||||
;)
|
||||
global sym(vp8_get4x4var_mmx)
|
||||
global sym(vp8_get4x4var_mmx) PRIVATE
|
||||
sym(vp8_get4x4var_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -433,7 +433,7 @@ sym(vp8_get4x4var_mmx):
|
||||
; unsigned char *ref_ptr,
|
||||
; int recon_stride
|
||||
;)
|
||||
global sym(vp8_get4x4sse_cs_mmx)
|
||||
global sym(vp8_get4x4sse_cs_mmx) PRIVATE
|
||||
sym(vp8_get4x4sse_cs_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -522,7 +522,7 @@ sym(vp8_get4x4sse_cs_mmx):
|
||||
; int *sum,
|
||||
; unsigned int *sumsquared
|
||||
;)
|
||||
global sym(vp8_filter_block2d_bil4x4_var_mmx)
|
||||
global sym(vp8_filter_block2d_bil4x4_var_mmx) PRIVATE
|
||||
sym(vp8_filter_block2d_bil4x4_var_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -667,7 +667,7 @@ sym(vp8_filter_block2d_bil4x4_var_mmx):
|
||||
; int *sum,
|
||||
; unsigned int *sumsquared
|
||||
;)
|
||||
global sym(vp8_filter_block2d_bil_var_mmx)
|
||||
global sym(vp8_filter_block2d_bil_var_mmx) PRIVATE
|
||||
sym(vp8_filter_block2d_bil_var_mmx):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -17,7 +17,7 @@
|
||||
;(
|
||||
; short *src_ptr
|
||||
;)
|
||||
global sym(vp8_get_mb_ss_sse2)
|
||||
global sym(vp8_get_mb_ss_sse2) PRIVATE
|
||||
sym(vp8_get_mb_ss_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -80,7 +80,7 @@ sym(vp8_get_mb_ss_sse2):
|
||||
; unsigned int * SSE,
|
||||
; int * Sum
|
||||
;)
|
||||
global sym(vp8_get16x16var_sse2)
|
||||
global sym(vp8_get16x16var_sse2) PRIVATE
|
||||
sym(vp8_get16x16var_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -224,7 +224,7 @@ sym(vp8_get16x16var_sse2):
|
||||
; unsigned int * SSE,
|
||||
; int * Sum
|
||||
;)
|
||||
global sym(vp8_get8x8var_sse2)
|
||||
global sym(vp8_get8x8var_sse2) PRIVATE
|
||||
sym(vp8_get8x8var_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -413,7 +413,7 @@ sym(vp8_get8x8var_sse2):
|
||||
; unsigned int *sumsquared;;
|
||||
;
|
||||
;)
|
||||
global sym(vp8_filter_block2d_bil_var_sse2)
|
||||
global sym(vp8_filter_block2d_bil_var_sse2) PRIVATE
|
||||
sym(vp8_filter_block2d_bil_var_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -690,7 +690,7 @@ filter_block2d_bil_variance:
|
||||
; int *sum,
|
||||
; unsigned int *sumsquared
|
||||
;)
|
||||
global sym(vp8_half_horiz_vert_variance8x_h_sse2)
|
||||
global sym(vp8_half_horiz_vert_variance8x_h_sse2) PRIVATE
|
||||
sym(vp8_half_horiz_vert_variance8x_h_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -812,7 +812,7 @@ vp8_half_horiz_vert_variance8x_h_1:
|
||||
; int *sum,
|
||||
; unsigned int *sumsquared
|
||||
;)
|
||||
global sym(vp8_half_horiz_vert_variance16x_h_sse2)
|
||||
global sym(vp8_half_horiz_vert_variance16x_h_sse2) PRIVATE
|
||||
sym(vp8_half_horiz_vert_variance16x_h_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -928,7 +928,7 @@ vp8_half_horiz_vert_variance16x_h_1:
|
||||
; int *sum,
|
||||
; unsigned int *sumsquared
|
||||
;)
|
||||
global sym(vp8_half_vert_variance8x_h_sse2)
|
||||
global sym(vp8_half_vert_variance8x_h_sse2) PRIVATE
|
||||
sym(vp8_half_vert_variance8x_h_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -1035,7 +1035,7 @@ vp8_half_vert_variance8x_h_1:
|
||||
; int *sum,
|
||||
; unsigned int *sumsquared
|
||||
;)
|
||||
global sym(vp8_half_vert_variance16x_h_sse2)
|
||||
global sym(vp8_half_vert_variance16x_h_sse2) PRIVATE
|
||||
sym(vp8_half_vert_variance16x_h_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -1143,7 +1143,7 @@ vp8_half_vert_variance16x_h_1:
|
||||
; int *sum,
|
||||
; unsigned int *sumsquared
|
||||
;)
|
||||
global sym(vp8_half_horiz_variance8x_h_sse2)
|
||||
global sym(vp8_half_horiz_variance8x_h_sse2) PRIVATE
|
||||
sym(vp8_half_horiz_variance8x_h_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -1248,7 +1248,7 @@ vp8_half_horiz_variance8x_h_1:
|
||||
; int *sum,
|
||||
; unsigned int *sumsquared
|
||||
;)
|
||||
global sym(vp8_half_horiz_variance16x_h_sse2)
|
||||
global sym(vp8_half_horiz_variance16x_h_sse2) PRIVATE
|
||||
sym(vp8_half_horiz_variance16x_h_sse2):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -29,7 +29,7 @@
|
||||
;)
|
||||
;Note: The filter coefficient at offset=0 is 128. Since the second register
|
||||
;for Pmaddubsw is signed bytes, we must calculate zero offset seperately.
|
||||
global sym(vp8_filter_block2d_bil_var_ssse3)
|
||||
global sym(vp8_filter_block2d_bil_var_ssse3) PRIVATE
|
||||
sym(vp8_filter_block2d_bil_var_ssse3):
|
||||
push rbp
|
||||
mov rbp, rsp
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "vpx_config.h"
|
||||
#include "vp8/encoder/variance.h"
|
||||
#include "vp8/common/variance.h"
|
||||
#include "vp8/common/pragmas.h"
|
||||
#include "vpx_ports/mem.h"
|
||||
#include "vp8/common/x86/filter_x86.h"
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "vpx_config.h"
|
||||
#include "vp8/encoder/variance.h"
|
||||
#include "vp8/common/variance.h"
|
||||
#include "vp8/common/pragmas.h"
|
||||
#include "vpx_ports/mem.h"
|
||||
#include "vp8/common/x86/filter_x86.h"
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "vpx_config.h"
|
||||
#include "vp8/encoder/variance.h"
|
||||
#include "vp8/common/variance.h"
|
||||
#include "vp8/common/pragmas.h"
|
||||
#include "vpx_ports/mem.h"
|
||||
|
||||
@@ -57,6 +57,7 @@ static void read_kf_modes(VP8D_COMP *pbi, MODE_INFO *mi)
|
||||
if (mi->mbmi.mode == B_PRED)
|
||||
{
|
||||
int i = 0;
|
||||
mi->mbmi.is_4x4 = 1;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -138,30 +139,6 @@ static void read_mvcontexts(vp8_reader *bc, MV_CONTEXT *mvc)
|
||||
while (++i < 2);
|
||||
}
|
||||
|
||||
static int_mv sub_mv_ref(vp8_reader *bc, const vp8_prob *p, int_mv abovemv,
|
||||
int_mv leftmv, int_mv best_mv, const MV_CONTEXT * mvc)
|
||||
{
|
||||
int_mv blockmv;
|
||||
blockmv.as_int = 0;
|
||||
if( vp8_read(bc, p[0]) )
|
||||
{
|
||||
if( vp8_read(bc, p[1]) )
|
||||
{
|
||||
if( vp8_read(bc, p[2]) )
|
||||
{
|
||||
read_mv(bc, &blockmv.as_mv, (const MV_CONTEXT *) mvc);
|
||||
blockmv.as_mv.row += best_mv.as_mv.row;
|
||||
blockmv.as_mv.col += best_mv.as_mv.col;
|
||||
}
|
||||
return blockmv;
|
||||
}
|
||||
else
|
||||
return abovemv;
|
||||
}
|
||||
else
|
||||
return leftmv;
|
||||
}
|
||||
|
||||
static const unsigned char mbsplit_fill_count[4] = {8, 8, 4, 1};
|
||||
static const unsigned char mbsplit_fill_offset[4][16] = {
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
|
||||
@@ -171,8 +148,6 @@ static const unsigned char mbsplit_fill_offset[4][16] = {
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
static void mb_mode_mv_init(VP8D_COMP *pbi)
|
||||
{
|
||||
vp8_reader *const bc = & pbi->bc;
|
||||
@@ -235,11 +210,11 @@ const vp8_prob vp8_sub_mv_ref_prob3 [8][VP8_SUBMVREFS-1] =
|
||||
};
|
||||
|
||||
static
|
||||
const vp8_prob * get_sub_mv_ref_prob(const int_mv *l, const int_mv *a)
|
||||
const vp8_prob * get_sub_mv_ref_prob(const int left, const int above)
|
||||
{
|
||||
int lez = (l->as_int == 0);
|
||||
int aez = (a->as_int == 0);
|
||||
int lea = (l->as_int == a->as_int);
|
||||
int lez = (left == 0);
|
||||
int aez = (above == 0);
|
||||
int lea = (left == above);
|
||||
const vp8_prob * prob;
|
||||
|
||||
prob = vp8_sub_mv_ref_prob3[(aez << 2) |
|
||||
@@ -250,7 +225,8 @@ const vp8_prob * get_sub_mv_ref_prob(const int_mv *l, const int_mv *a)
|
||||
}
|
||||
|
||||
static void decode_split_mv(vp8_reader *const bc, MODE_INFO *mi,
|
||||
MB_MODE_INFO *mbmi, int mis, int_mv best_mv,
|
||||
const MODE_INFO *left_mb, const MODE_INFO *above_mb,
|
||||
MB_MODE_INFO *mbmi, int_mv best_mv,
|
||||
MV_CONTEXT *const mvc, int mb_to_left_edge,
|
||||
int mb_to_right_edge, int mb_to_top_edge,
|
||||
int mb_to_bottom_edge)
|
||||
@@ -273,7 +249,6 @@ static void decode_split_mv(vp8_reader *const bc, MODE_INFO *mi,
|
||||
}
|
||||
}
|
||||
|
||||
mbmi->need_to_clamp_mvs = 0;
|
||||
do /* for each subset j */
|
||||
{
|
||||
int_mv leftmv, abovemv;
|
||||
@@ -283,18 +258,60 @@ static void decode_split_mv(vp8_reader *const bc, MODE_INFO *mi,
|
||||
const vp8_prob *prob;
|
||||
k = vp8_mbsplit_offset[s][j];
|
||||
|
||||
leftmv.as_int = left_block_mv(mi, k);
|
||||
abovemv.as_int = above_block_mv(mi, k, mis);
|
||||
if (!(k & 3))
|
||||
{
|
||||
/* On L edge, get from MB to left of us */
|
||||
if(left_mb->mbmi.mode != SPLITMV)
|
||||
leftmv.as_int = left_mb->mbmi.mv.as_int;
|
||||
else
|
||||
leftmv.as_int = (left_mb->bmi + k + 4 - 1)->mv.as_int;
|
||||
}
|
||||
else
|
||||
leftmv.as_int = (mi->bmi + k - 1)->mv.as_int;
|
||||
|
||||
prob = get_sub_mv_ref_prob(&leftmv, &abovemv);
|
||||
if (!(k >> 2))
|
||||
{
|
||||
/* On top edge, get from MB above us */
|
||||
if(above_mb->mbmi.mode != SPLITMV)
|
||||
abovemv.as_int = above_mb->mbmi.mv.as_int;
|
||||
else
|
||||
abovemv.as_int = (above_mb->bmi + k + 16 - 4)->mv.as_int;
|
||||
}
|
||||
else
|
||||
abovemv.as_int = (mi->bmi + k - 4)->mv.as_int;
|
||||
|
||||
blockmv = sub_mv_ref(bc, prob, abovemv, leftmv, best_mv, mvc);
|
||||
prob = get_sub_mv_ref_prob(leftmv.as_int, abovemv.as_int);
|
||||
|
||||
if( vp8_read(bc, prob[0]) )
|
||||
{
|
||||
if( vp8_read(bc, prob[1]) )
|
||||
{
|
||||
blockmv.as_int = 0;
|
||||
if( vp8_read(bc, prob[2]) )
|
||||
{
|
||||
blockmv.as_mv.row = read_mvcomponent(bc, &mvc[0]) << 1;
|
||||
blockmv.as_mv.row += best_mv.as_mv.row;
|
||||
blockmv.as_mv.col = read_mvcomponent(bc, &mvc[1]) << 1;
|
||||
blockmv.as_mv.col += best_mv.as_mv.col;
|
||||
|
||||
mbmi->need_to_clamp_mvs |= vp8_check_mv_bounds(&blockmv,
|
||||
mb_to_left_edge,
|
||||
mb_to_right_edge,
|
||||
mb_to_top_edge,
|
||||
mb_to_bottom_edge);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
blockmv.as_int = abovemv.as_int;
|
||||
mbmi->need_to_clamp_mvs |= above_mb->mbmi.need_to_clamp_mvs;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
blockmv.as_int = leftmv.as_int;
|
||||
mbmi->need_to_clamp_mvs |= left_mb->mbmi.need_to_clamp_mvs;
|
||||
}
|
||||
|
||||
{
|
||||
/* Fill (uniform) modes, mvs of jth subset.
|
||||
@@ -318,15 +335,13 @@ static void decode_split_mv(vp8_reader *const bc, MODE_INFO *mi,
|
||||
mbmi->partitioning = s;
|
||||
}
|
||||
|
||||
static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
int mb_row, int mb_col)
|
||||
static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi)
|
||||
{
|
||||
vp8_reader *const bc = & pbi->bc;
|
||||
mbmi->ref_frame = (MV_REFERENCE_FRAME) vp8_read(bc, pbi->prob_intra);
|
||||
if (mbmi->ref_frame) /* inter MB */
|
||||
{
|
||||
enum {CNT_INTRA, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV};
|
||||
vp8_prob mv_ref_p [VP8_MVREFS-1];
|
||||
int cnt[4];
|
||||
int *cntx = cnt;
|
||||
int_mv near_mvs[4];
|
||||
@@ -335,9 +350,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
const MODE_INFO *above = mi - mis;
|
||||
const MODE_INFO *left = mi - 1;
|
||||
const MODE_INFO *aboveleft = above - 1;
|
||||
MV_CONTEXT *const mvc = pbi->common.fc.mvc;
|
||||
int *ref_frame_sign_bias = pbi->common.ref_frame_sign_bias;
|
||||
int propogate_mv_for_ec = 0;
|
||||
|
||||
mbmi->need_to_clamp_mvs = 0;
|
||||
|
||||
@@ -411,36 +424,13 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
cnt[CNT_INTRA] += 1;
|
||||
}
|
||||
|
||||
mv_ref_p[0] = vp8_mode_contexts [cnt[CNT_INTRA]] [0];
|
||||
|
||||
if( vp8_read(bc, mv_ref_p[0]) )
|
||||
if( vp8_read(bc, vp8_mode_contexts [cnt[CNT_INTRA]] [0]) )
|
||||
{
|
||||
int mb_to_left_edge;
|
||||
int mb_to_right_edge;
|
||||
|
||||
/* Distance of Mb to the various image edges.
|
||||
* These specified to 8th pel as they are always compared to MV
|
||||
* values that are in 1/8th pel units
|
||||
*/
|
||||
pbi->mb.mb_to_left_edge =
|
||||
mb_to_left_edge = -((mb_col * 16) << 3);
|
||||
mb_to_left_edge -= LEFT_TOP_MARGIN;
|
||||
|
||||
pbi->mb.mb_to_right_edge =
|
||||
mb_to_right_edge = ((pbi->common.mb_cols - 1 - mb_col) * 16) << 3;
|
||||
mb_to_right_edge += RIGHT_BOTTOM_MARGIN;
|
||||
|
||||
/* If we have three distinct MV's ... */
|
||||
if (cnt[CNT_SPLITMV])
|
||||
{
|
||||
/* See if above-left MV can be merged with NEAREST */
|
||||
if (nmv->as_int == near_mvs[CNT_NEAREST].as_int)
|
||||
cnt[CNT_NEAREST] += 1;
|
||||
}
|
||||
|
||||
cnt[CNT_SPLITMV] = ((above->mbmi.mode == SPLITMV)
|
||||
+ (left->mbmi.mode == SPLITMV)) * 2
|
||||
+ (aboveleft->mbmi.mode == SPLITMV);
|
||||
cnt[CNT_NEAREST] += ( (cnt[CNT_SPLITMV] > 0) &
|
||||
(nmv->as_int == near_mvs[CNT_NEAREST].as_int));
|
||||
|
||||
/* Swap near and nearest if necessary */
|
||||
if (cnt[CNT_NEAR] > cnt[CNT_NEAREST])
|
||||
@@ -454,48 +444,56 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
near_mvs[CNT_NEAR].as_int = tmp;
|
||||
}
|
||||
|
||||
mv_ref_p[1] = vp8_mode_contexts [cnt[CNT_NEAREST]] [1];
|
||||
|
||||
if( vp8_read(bc, mv_ref_p[1]) )
|
||||
if( vp8_read(bc, vp8_mode_contexts [cnt[CNT_NEAREST]] [1]) )
|
||||
{
|
||||
mv_ref_p[2] = vp8_mode_contexts [cnt[CNT_NEAR]] [2];
|
||||
|
||||
if( vp8_read(bc, mv_ref_p[2]) )
|
||||
if( vp8_read(bc, vp8_mode_contexts [cnt[CNT_NEAR]] [2]) )
|
||||
{
|
||||
int mb_to_top_edge;
|
||||
int mb_to_bottom_edge;
|
||||
int mb_to_left_edge;
|
||||
int mb_to_right_edge;
|
||||
MV_CONTEXT *const mvc = pbi->common.fc.mvc;
|
||||
int near_index;
|
||||
|
||||
mb_to_top_edge = pbi->mb.mb_to_top_edge;
|
||||
mb_to_bottom_edge = pbi->mb.mb_to_bottom_edge;
|
||||
mb_to_top_edge -= LEFT_TOP_MARGIN;
|
||||
mb_to_bottom_edge += RIGHT_BOTTOM_MARGIN;
|
||||
mb_to_right_edge = pbi->mb.mb_to_right_edge;
|
||||
mb_to_right_edge += RIGHT_BOTTOM_MARGIN;
|
||||
mb_to_left_edge = pbi->mb.mb_to_left_edge;
|
||||
mb_to_left_edge -= LEFT_TOP_MARGIN;
|
||||
|
||||
/* Use near_mvs[0] to store the "best" MV */
|
||||
if (cnt[CNT_NEAREST] >= cnt[CNT_INTRA])
|
||||
near_mvs[CNT_INTRA] = near_mvs[CNT_NEAREST];
|
||||
near_index = CNT_INTRA +
|
||||
(cnt[CNT_NEAREST] >= cnt[CNT_INTRA]);
|
||||
|
||||
mv_ref_p[3] = vp8_mode_contexts [cnt[CNT_SPLITMV]] [3];
|
||||
vp8_clamp_mv2(&near_mvs[near_index], &pbi->mb);
|
||||
|
||||
vp8_clamp_mv2(&near_mvs[CNT_INTRA], &pbi->mb);
|
||||
cnt[CNT_SPLITMV] = ((above->mbmi.mode == SPLITMV)
|
||||
+ (left->mbmi.mode == SPLITMV)) * 2
|
||||
+ (aboveleft->mbmi.mode == SPLITMV);
|
||||
|
||||
if( vp8_read(bc, mv_ref_p[3]) )
|
||||
if( vp8_read(bc, vp8_mode_contexts [cnt[CNT_SPLITMV]] [3]) )
|
||||
{
|
||||
decode_split_mv(bc, mi,
|
||||
mbmi, mis,
|
||||
near_mvs[CNT_INTRA],
|
||||
decode_split_mv(bc, mi, left, above,
|
||||
mbmi,
|
||||
near_mvs[near_index],
|
||||
mvc, mb_to_left_edge,
|
||||
mb_to_right_edge,
|
||||
mb_to_top_edge,
|
||||
mb_to_bottom_edge);
|
||||
mbmi->mv.as_int = mi->bmi[15].mv.as_int;
|
||||
mbmi->mode = SPLITMV;
|
||||
mbmi->is_4x4 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int_mv *const mbmi_mv = & mbmi->mv;
|
||||
read_mv(bc, &mbmi_mv->as_mv, (const MV_CONTEXT *) mvc);
|
||||
mbmi_mv->as_mv.row += near_mvs[CNT_INTRA].as_mv.row;
|
||||
mbmi_mv->as_mv.col += near_mvs[CNT_INTRA].as_mv.col;
|
||||
mbmi_mv->as_mv.row += near_mvs[near_index].as_mv.row;
|
||||
mbmi_mv->as_mv.col += near_mvs[near_index].as_mv.col;
|
||||
|
||||
/* Don't need to check this on NEARMV and NEARESTMV
|
||||
* modes since those modes clamp the MV. The NEWMV mode
|
||||
@@ -508,7 +506,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
mb_to_top_edge,
|
||||
mb_to_bottom_edge);
|
||||
mbmi->mode = NEWMV;
|
||||
propogate_mv_for_ec = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -516,7 +513,6 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
mbmi->mode = NEARMV;
|
||||
vp8_clamp_mv2(&near_mvs[CNT_NEAR], &pbi->mb);
|
||||
mbmi->mv.as_int = near_mvs[CNT_NEAR].as_int;
|
||||
propogate_mv_for_ec = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -524,19 +520,16 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
mbmi->mode = NEARESTMV;
|
||||
vp8_clamp_mv2(&near_mvs[CNT_NEAREST], &pbi->mb);
|
||||
mbmi->mv.as_int = near_mvs[CNT_NEAREST].as_int;
|
||||
propogate_mv_for_ec = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
mbmi->mode = ZEROMV;
|
||||
mbmi->mv.as_int = 0;
|
||||
propogate_mv_for_ec = 1;
|
||||
}
|
||||
|
||||
mbmi->uv_mode = DC_PRED;
|
||||
|
||||
#if CONFIG_ERROR_CONCEALMENT
|
||||
if(pbi->ec_enabled && propogate_mv_for_ec)
|
||||
if(pbi->ec_enabled && (mbmi->mode != SPLITMV))
|
||||
{
|
||||
mi->bmi[ 0].mv.as_int =
|
||||
mi->bmi[ 1].mv.as_int =
|
||||
@@ -566,6 +559,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
if ((mbmi->mode = read_ymode(bc, pbi->common.fc.ymode_prob)) == B_PRED)
|
||||
{
|
||||
int j = 0;
|
||||
mbmi->is_4x4 = 1;
|
||||
do
|
||||
{
|
||||
mi->bmi[j].as_mode = read_bmode(bc, pbi->common.fc.bmode_prob);
|
||||
@@ -594,7 +588,7 @@ static void read_mb_features(vp8_reader *r, MB_MODE_INFO *mi, MACROBLOCKD *x)
|
||||
}
|
||||
|
||||
static void decode_mb_mode_mvs(VP8D_COMP *pbi, MODE_INFO *mi,
|
||||
MB_MODE_INFO *mbmi, int mb_row, int mb_col)
|
||||
MB_MODE_INFO *mbmi)
|
||||
{
|
||||
/* Read the Macroblock segmentation map if it is being updated explicitly
|
||||
* this frame (reset to 0 above by default)
|
||||
@@ -612,10 +606,11 @@ static void decode_mb_mode_mvs(VP8D_COMP *pbi, MODE_INFO *mi,
|
||||
else
|
||||
mi->mbmi.mb_skip_coeff = 0;
|
||||
|
||||
mi->mbmi.is_4x4 = 0;
|
||||
if(pbi->common.frame_type == KEY_FRAME)
|
||||
read_kf_modes(pbi, mi);
|
||||
else
|
||||
read_mb_modes_mv(pbi, mi, &mi->mbmi, mb_row, mb_col);
|
||||
read_mb_modes_mv(pbi, mi, &mi->mbmi);
|
||||
|
||||
}
|
||||
|
||||
@@ -623,16 +618,20 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
{
|
||||
MODE_INFO *mi = pbi->common.mi;
|
||||
int mb_row = -1;
|
||||
int mb_to_right_edge_start;
|
||||
|
||||
mb_mode_mv_init(pbi);
|
||||
|
||||
pbi->mb.mb_to_top_edge = 0;
|
||||
pbi->mb.mb_to_bottom_edge = ((pbi->common.mb_rows - 1) * 16) << 3;
|
||||
mb_to_right_edge_start = ((pbi->common.mb_cols - 1) * 16) << 3;
|
||||
|
||||
while (++mb_row < pbi->common.mb_rows)
|
||||
{
|
||||
int mb_col = -1;
|
||||
|
||||
pbi->mb.mb_to_top_edge = -((mb_row * 16)) << 3;
|
||||
pbi->mb.mb_to_bottom_edge =
|
||||
((pbi->common.mb_rows - 1 - mb_row) * 16) << 3;
|
||||
pbi->mb.mb_to_left_edge = 0;
|
||||
pbi->mb.mb_to_right_edge = mb_to_right_edge_start;
|
||||
|
||||
while (++mb_col < pbi->common.mb_cols)
|
||||
{
|
||||
@@ -640,7 +639,7 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
int mb_num = mb_row * pbi->common.mb_cols + mb_col;
|
||||
#endif
|
||||
|
||||
decode_mb_mode_mvs(pbi, mi, &mi->mbmi, mb_row, mb_col);
|
||||
decode_mb_mode_mvs(pbi, mi, &mi->mbmi);
|
||||
|
||||
#if CONFIG_ERROR_CONCEALMENT
|
||||
/* look for corruption. set mvs_corrupt_from_mb to the current
|
||||
@@ -655,10 +654,13 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
|
||||
}
|
||||
#endif
|
||||
|
||||
pbi->mb.mb_to_left_edge -= (16 << 3);
|
||||
pbi->mb.mb_to_right_edge -= (16 << 3);
|
||||
mi++; /* next macroblock */
|
||||
}
|
||||
pbi->mb.mb_to_top_edge -= (16 << 3);
|
||||
pbi->mb.mb_to_bottom_edge -= (16 << 3);
|
||||
|
||||
mi++; /* skip left predictor each row */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "vp8/common/entropymode.h"
|
||||
#include "vp8/common/quant_common.h"
|
||||
#include "vpx_scale/vpxscale.h"
|
||||
#include "vpx_scale/yv12extend.h"
|
||||
#include "vp8/common/setupintrarecon.h"
|
||||
|
||||
#include "decodemv.h"
|
||||
@@ -54,7 +53,7 @@ void vp8cx_init_de_quantizer(VP8D_COMP *pbi)
|
||||
}
|
||||
}
|
||||
|
||||
void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd)
|
||||
void vp8_mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd)
|
||||
{
|
||||
int i;
|
||||
int QIndex;
|
||||
@@ -93,13 +92,14 @@ void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
|
||||
unsigned int mb_idx)
|
||||
{
|
||||
MB_PREDICTION_MODE mode;
|
||||
int i;
|
||||
#if CONFIG_ERROR_CONCEALMENT
|
||||
int corruption_detected = 0;
|
||||
#endif
|
||||
|
||||
if (xd->mode_info_context->mbmi.mb_skip_coeff)
|
||||
{
|
||||
@@ -117,7 +117,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
|
||||
mode = xd->mode_info_context->mbmi.mode;
|
||||
|
||||
if (xd->segmentation_enabled)
|
||||
mb_init_dequantizer(pbi, xd);
|
||||
vp8_mb_init_dequantizer(pbi, xd);
|
||||
|
||||
|
||||
#if CONFIG_ERROR_CONCEALMENT
|
||||
@@ -152,15 +152,26 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* do prediction */
|
||||
if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
|
||||
{
|
||||
vp8_build_intra_predictors_mbuv_s(xd);
|
||||
vp8_build_intra_predictors_mbuv_s(xd,
|
||||
xd->recon_above[1],
|
||||
xd->recon_above[2],
|
||||
xd->recon_left[1],
|
||||
xd->recon_left[2],
|
||||
xd->recon_left_stride[1],
|
||||
xd->dst.u_buffer, xd->dst.v_buffer,
|
||||
xd->dst.uv_stride);
|
||||
|
||||
if (mode != B_PRED)
|
||||
{
|
||||
vp8_build_intra_predictors_mby_s(xd);
|
||||
vp8_build_intra_predictors_mby_s(xd,
|
||||
xd->recon_above[0],
|
||||
xd->recon_left[0],
|
||||
xd->recon_left_stride[0],
|
||||
xd->dst.y_buffer,
|
||||
xd->dst.y_stride);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -172,16 +183,28 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
|
||||
if(xd->mode_info_context->mbmi.mb_skip_coeff)
|
||||
vpx_memset(xd->eobs, 0, 25);
|
||||
|
||||
vp8_intra_prediction_down_copy(xd);
|
||||
intra_prediction_down_copy(xd, xd->recon_above[0] + 16);
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
BLOCKD *b = &xd->block[i];
|
||||
int b_mode = xd->mode_info_context->bmi[i].as_mode;
|
||||
unsigned char *yabove;
|
||||
unsigned char *yleft;
|
||||
int left_stride;
|
||||
unsigned char top_left;
|
||||
|
||||
yabove = base_dst + b->offset - dst_stride;
|
||||
yleft = base_dst + b->offset - 1;
|
||||
left_stride = dst_stride;
|
||||
top_left = yabove[-1];
|
||||
|
||||
vp8_intra4x4_predict (base_dst + b->offset, dst_stride, b_mode,
|
||||
base_dst + b->offset, dst_stride );
|
||||
// vp8_intra4x4_predict (base_dst + b->offset, dst_stride, b_mode,
|
||||
// base_dst + b->offset, dst_stride );
|
||||
vp8_intra4x4_predict_d_c(yabove, yleft, left_stride,
|
||||
b_mode,
|
||||
base_dst + b->offset, dst_stride,
|
||||
top_left);
|
||||
|
||||
if (xd->eobs[i])
|
||||
{
|
||||
@@ -294,29 +317,88 @@ static int get_delta_q(vp8_reader *bc, int prev, int *q_update)
|
||||
FILE *vpxlog = 0;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static void
|
||||
decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd)
|
||||
static void decode_mb_rows(VP8D_COMP *pbi)
|
||||
{
|
||||
int recon_yoffset, recon_uvoffset;
|
||||
int mb_col;
|
||||
int ref_fb_idx = pc->lst_fb_idx;
|
||||
int dst_fb_idx = pc->new_fb_idx;
|
||||
int recon_y_stride = pc->yv12_fb[ref_fb_idx].y_stride;
|
||||
int recon_uv_stride = pc->yv12_fb[ref_fb_idx].uv_stride;
|
||||
VP8_COMMON *const pc = & pbi->common;
|
||||
MACROBLOCKD *const xd = & pbi->mb;
|
||||
|
||||
int ibc = 0;
|
||||
int num_part = 1 << pc->multi_token_partition;
|
||||
|
||||
int recon_yoffset, recon_uvoffset;
|
||||
int mb_row, mb_col;
|
||||
int mb_idx = 0;
|
||||
int dst_fb_idx = pc->new_fb_idx;
|
||||
int recon_y_stride = pc->yv12_fb[dst_fb_idx].y_stride;
|
||||
int recon_uv_stride = pc->yv12_fb[dst_fb_idx].uv_stride;
|
||||
|
||||
unsigned char *ref_buffer[MAX_REF_FRAMES][3];
|
||||
unsigned char *dst_buffer[3];
|
||||
int i;
|
||||
int ref_fb_index[MAX_REF_FRAMES];
|
||||
int ref_fb_corrupted[MAX_REF_FRAMES];
|
||||
|
||||
ref_fb_corrupted[INTRA_FRAME] = 0;
|
||||
|
||||
ref_fb_index[LAST_FRAME] = pc->lst_fb_idx;
|
||||
ref_fb_index[GOLDEN_FRAME] = pc->gld_fb_idx;
|
||||
ref_fb_index[ALTREF_FRAME] = pc->alt_fb_idx;
|
||||
|
||||
for(i = 1; i < MAX_REF_FRAMES; i++)
|
||||
{
|
||||
ref_buffer[i][0] = pc->yv12_fb[ref_fb_index[i]].y_buffer;
|
||||
ref_buffer[i][1] = pc->yv12_fb[ref_fb_index[i]].u_buffer;
|
||||
ref_buffer[i][2] = pc->yv12_fb[ref_fb_index[i]].v_buffer;
|
||||
|
||||
ref_fb_corrupted[i] = pc->yv12_fb[ref_fb_index[i]].corrupted;
|
||||
}
|
||||
|
||||
dst_buffer[0] = pc->yv12_fb[dst_fb_idx].y_buffer;
|
||||
dst_buffer[1] = pc->yv12_fb[dst_fb_idx].u_buffer;
|
||||
dst_buffer[2] = pc->yv12_fb[dst_fb_idx].v_buffer;
|
||||
|
||||
xd->up_available = 0;
|
||||
|
||||
/* Decode the individual macro block */
|
||||
for (mb_row = 0; mb_row < pc->mb_rows; mb_row++)
|
||||
{
|
||||
if (num_part > 1)
|
||||
{
|
||||
xd->current_bc = & pbi->mbc[ibc];
|
||||
ibc++;
|
||||
|
||||
if (ibc == num_part)
|
||||
ibc = 0;
|
||||
}
|
||||
|
||||
vpx_memset(&pc->left_context, 0, sizeof(pc->left_context));
|
||||
recon_yoffset = mb_row * recon_y_stride * 16;
|
||||
recon_uvoffset = mb_row * recon_uv_stride * 8;
|
||||
/* reset above block coeffs */
|
||||
|
||||
/* reset contexts */
|
||||
xd->above_context = pc->above_context;
|
||||
xd->up_available = (mb_row != 0);
|
||||
vpx_memset(xd->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));
|
||||
|
||||
xd->left_available = 0;
|
||||
|
||||
xd->mb_to_top_edge = -((mb_row * 16)) << 3;
|
||||
xd->mb_to_bottom_edge = ((pc->mb_rows - 1 - mb_row) * 16) << 3;
|
||||
|
||||
xd->recon_above[0] = dst_buffer[0] + recon_yoffset;
|
||||
xd->recon_above[1] = dst_buffer[1] + recon_uvoffset;
|
||||
xd->recon_above[2] = dst_buffer[2] + recon_uvoffset;
|
||||
|
||||
xd->recon_left[0] = xd->recon_above[0] - 1;
|
||||
xd->recon_left[1] = xd->recon_above[1] - 1;
|
||||
xd->recon_left[2] = xd->recon_above[2] - 1;
|
||||
|
||||
xd->recon_above[0] -= xd->dst.y_stride;
|
||||
xd->recon_above[1] -= xd->dst.uv_stride;
|
||||
xd->recon_above[2] -= xd->dst.uv_stride;
|
||||
|
||||
//TODO: move to outside row loop
|
||||
xd->recon_left_stride[0] = xd->dst.y_stride;
|
||||
xd->recon_left_stride[1] = xd->dst.uv_stride;
|
||||
|
||||
for (mb_col = 0; mb_col < pc->mb_cols; mb_col++)
|
||||
{
|
||||
/* Distance of Mb to the various image edges.
|
||||
@@ -352,35 +434,33 @@ decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd)
|
||||
}
|
||||
#endif
|
||||
|
||||
xd->dst.y_buffer = pc->yv12_fb[dst_fb_idx].y_buffer + recon_yoffset;
|
||||
xd->dst.u_buffer = pc->yv12_fb[dst_fb_idx].u_buffer + recon_uvoffset;
|
||||
xd->dst.v_buffer = pc->yv12_fb[dst_fb_idx].v_buffer + recon_uvoffset;
|
||||
xd->dst.y_buffer = dst_buffer[0] + recon_yoffset;
|
||||
xd->dst.u_buffer = dst_buffer[1] + recon_uvoffset;
|
||||
xd->dst.v_buffer = dst_buffer[2] + recon_uvoffset;
|
||||
|
||||
xd->left_available = (mb_col != 0);
|
||||
xd->pre.y_buffer = ref_buffer[xd->mode_info_context->mbmi.ref_frame][0] + recon_yoffset;
|
||||
xd->pre.u_buffer = ref_buffer[xd->mode_info_context->mbmi.ref_frame][1] + recon_uvoffset;
|
||||
xd->pre.v_buffer = ref_buffer[xd->mode_info_context->mbmi.ref_frame][2] + recon_uvoffset;
|
||||
|
||||
/* Select the appropriate reference frame for this MB */
|
||||
if (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME)
|
||||
ref_fb_idx = pc->lst_fb_idx;
|
||||
else if (xd->mode_info_context->mbmi.ref_frame == GOLDEN_FRAME)
|
||||
ref_fb_idx = pc->gld_fb_idx;
|
||||
else
|
||||
ref_fb_idx = pc->alt_fb_idx;
|
||||
|
||||
xd->pre.y_buffer = pc->yv12_fb[ref_fb_idx].y_buffer + recon_yoffset;
|
||||
xd->pre.u_buffer = pc->yv12_fb[ref_fb_idx].u_buffer + recon_uvoffset;
|
||||
xd->pre.v_buffer = pc->yv12_fb[ref_fb_idx].v_buffer + recon_uvoffset;
|
||||
|
||||
if (xd->mode_info_context->mbmi.ref_frame != INTRA_FRAME)
|
||||
{
|
||||
/* propagate errors from reference frames */
|
||||
xd->corrupted |= pc->yv12_fb[ref_fb_idx].corrupted;
|
||||
}
|
||||
xd->corrupted |= ref_fb_corrupted[xd->mode_info_context->mbmi.ref_frame];
|
||||
|
||||
decode_macroblock(pbi, xd, mb_row * pc->mb_cols + mb_col);
|
||||
decode_macroblock(pbi, xd, mb_idx);
|
||||
|
||||
mb_idx++;
|
||||
xd->left_available = 1;
|
||||
|
||||
/* check if the boolean decoder has suffered an error */
|
||||
xd->corrupted |= vp8dx_bool_error(xd->current_bc);
|
||||
|
||||
xd->recon_above[0] += 16;
|
||||
xd->recon_above[1] += 8;
|
||||
xd->recon_above[2] += 8;
|
||||
xd->recon_left[0] += 16;
|
||||
xd->recon_left[1] += 8;
|
||||
xd->recon_left[2] += 8;
|
||||
|
||||
|
||||
recon_yoffset += 16;
|
||||
recon_uvoffset += 8;
|
||||
|
||||
@@ -397,8 +477,10 @@ decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd)
|
||||
);
|
||||
|
||||
++xd->mode_info_context; /* skip prediction column */
|
||||
}
|
||||
xd->up_available = 1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int read_partition_size(const unsigned char *cx_size)
|
||||
{
|
||||
@@ -425,7 +507,7 @@ static unsigned int read_available_partition_size(
|
||||
{
|
||||
VP8_COMMON* pc = &pbi->common;
|
||||
const unsigned char *partition_size_ptr = token_part_sizes + i * 3;
|
||||
unsigned int partition_size;
|
||||
unsigned int partition_size = 0;
|
||||
ptrdiff_t bytes_left = fragment_end - fragment_start;
|
||||
/* Calculate the length of this partition. The last partition
|
||||
* size is implicit. If the partition size can't be read, then
|
||||
@@ -467,8 +549,8 @@ static void setup_token_decoder(VP8D_COMP *pbi,
|
||||
{
|
||||
vp8_reader *bool_decoder = &pbi->bc2;
|
||||
unsigned int partition_idx;
|
||||
int fragment_idx;
|
||||
int num_token_partitions;
|
||||
unsigned int fragment_idx;
|
||||
unsigned int num_token_partitions;
|
||||
const unsigned char *first_fragment_end = pbi->fragments[0] +
|
||||
pbi->fragment_sizes[0];
|
||||
|
||||
@@ -650,7 +732,6 @@ int vp8_decode_frame(VP8D_COMP *pbi)
|
||||
const unsigned char *data_end = data + pbi->fragment_sizes[0];
|
||||
ptrdiff_t first_partition_length_in_bytes;
|
||||
|
||||
int mb_row;
|
||||
int i, j, k, l;
|
||||
const int *const mb_feature_data_bits = vp8_mb_feature_data_bits;
|
||||
int corrupt_tokens = 0;
|
||||
@@ -827,6 +908,12 @@ int vp8_decode_frame(VP8D_COMP *pbi)
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No segmentation updates on this frame */
|
||||
xd->update_mb_segmentation_map = 0;
|
||||
xd->update_mb_segmentation_data = 0;
|
||||
}
|
||||
|
||||
/* Read the loop filter level and type */
|
||||
pc->filter_type = (LOOPFILTERTYPE) vp8_read_bit(bc);
|
||||
@@ -893,7 +980,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
|
||||
vp8cx_init_de_quantizer(pbi);
|
||||
|
||||
/* MB level dequantizer setup */
|
||||
mb_init_dequantizer(pbi, &pbi->mb);
|
||||
vp8_mb_init_dequantizer(pbi, &pbi->mb);
|
||||
}
|
||||
|
||||
/* Determine if the golden frame or ARF buffer should be updated and how.
|
||||
@@ -1040,39 +1127,21 @@ int vp8_decode_frame(VP8D_COMP *pbi)
|
||||
#endif
|
||||
|
||||
vpx_memset(pc->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) * pc->mb_cols);
|
||||
pbi->frame_corrupt_residual = 0;
|
||||
|
||||
#if CONFIG_MULTITHREAD
|
||||
if (pbi->b_multithreaded_rd && pc->multi_token_partition != ONE_PARTITION)
|
||||
{
|
||||
int i;
|
||||
pbi->frame_corrupt_residual = 0;
|
||||
unsigned int i;
|
||||
vp8mt_decode_mb_rows(pbi, xd);
|
||||
vp8_yv12_extend_frame_borders_ptr(&pc->yv12_fb[pc->new_fb_idx]); /*cm->frame_to_show);*/
|
||||
vp8_yv12_extend_frame_borders(&pc->yv12_fb[pc->new_fb_idx]); /*cm->frame_to_show);*/
|
||||
for (i = 0; i < pbi->decoding_thread_count; ++i)
|
||||
corrupt_tokens |= pbi->mb_row_di[i].mbd.corrupted;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
int ibc = 0;
|
||||
int num_part = 1 << pc->multi_token_partition;
|
||||
pbi->frame_corrupt_residual = 0;
|
||||
|
||||
/* Decode the individual macro block */
|
||||
for (mb_row = 0; mb_row < pc->mb_rows; mb_row++)
|
||||
{
|
||||
|
||||
if (num_part > 1)
|
||||
{
|
||||
xd->current_bc = & pbi->mbc[ibc];
|
||||
ibc++;
|
||||
|
||||
if (ibc == num_part)
|
||||
ibc = 0;
|
||||
}
|
||||
|
||||
decode_mb_row(pbi, pc, mb_row, xd);
|
||||
}
|
||||
decode_mb_rows(pbi);
|
||||
corrupt_tokens |= xd->corrupted;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,370 +15,230 @@
|
||||
#include "vpx_ports/mem.h"
|
||||
#include "detokenize.h"
|
||||
|
||||
#define BOOL_DATA unsigned char
|
||||
|
||||
#define OCB_X PREV_COEF_CONTEXTS * ENTROPY_NODES
|
||||
DECLARE_ALIGNED(16, static const unsigned char, coef_bands_x[16]) =
|
||||
{
|
||||
0 * OCB_X, 1 * OCB_X, 2 * OCB_X, 3 * OCB_X,
|
||||
6 * OCB_X, 4 * OCB_X, 5 * OCB_X, 6 * OCB_X,
|
||||
6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 6 * OCB_X,
|
||||
6 * OCB_X, 6 * OCB_X, 6 * OCB_X, 7 * OCB_X
|
||||
};
|
||||
#define EOB_CONTEXT_NODE 0
|
||||
#define ZERO_CONTEXT_NODE 1
|
||||
#define ONE_CONTEXT_NODE 2
|
||||
#define LOW_VAL_CONTEXT_NODE 3
|
||||
#define TWO_CONTEXT_NODE 4
|
||||
#define THREE_CONTEXT_NODE 5
|
||||
#define HIGH_LOW_CONTEXT_NODE 6
|
||||
#define CAT_ONE_CONTEXT_NODE 7
|
||||
#define CAT_THREEFOUR_CONTEXT_NODE 8
|
||||
#define CAT_THREE_CONTEXT_NODE 9
|
||||
#define CAT_FIVE_CONTEXT_NODE 10
|
||||
|
||||
#define CAT1_MIN_VAL 5
|
||||
#define CAT2_MIN_VAL 7
|
||||
#define CAT3_MIN_VAL 11
|
||||
#define CAT4_MIN_VAL 19
|
||||
#define CAT5_MIN_VAL 35
|
||||
#define CAT6_MIN_VAL 67
|
||||
|
||||
#define CAT1_PROB0 159
|
||||
#define CAT2_PROB0 145
|
||||
#define CAT2_PROB1 165
|
||||
|
||||
#define CAT3_PROB0 140
|
||||
#define CAT3_PROB1 148
|
||||
#define CAT3_PROB2 173
|
||||
|
||||
#define CAT4_PROB0 135
|
||||
#define CAT4_PROB1 140
|
||||
#define CAT4_PROB2 155
|
||||
#define CAT4_PROB3 176
|
||||
|
||||
#define CAT5_PROB0 130
|
||||
#define CAT5_PROB1 134
|
||||
#define CAT5_PROB2 141
|
||||
#define CAT5_PROB3 157
|
||||
#define CAT5_PROB4 180
|
||||
|
||||
static const unsigned char cat6_prob[12] =
|
||||
{ 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254, 0 };
|
||||
|
||||
|
||||
void vp8_reset_mb_tokens_context(MACROBLOCKD *x)
|
||||
{
|
||||
ENTROPY_CONTEXT *a_ctx = ((ENTROPY_CONTEXT *)x->above_context);
|
||||
ENTROPY_CONTEXT *l_ctx = ((ENTROPY_CONTEXT *)x->left_context);
|
||||
|
||||
vpx_memset(a_ctx, 0, sizeof(ENTROPY_CONTEXT_PLANES)-1);
|
||||
vpx_memset(l_ctx, 0, sizeof(ENTROPY_CONTEXT_PLANES)-1);
|
||||
|
||||
/* Clear entropy contexts for Y2 blocks */
|
||||
if (x->mode_info_context->mbmi.mode != B_PRED &&
|
||||
x->mode_info_context->mbmi.mode != SPLITMV)
|
||||
if (!x->mode_info_context->mbmi.is_4x4)
|
||||
{
|
||||
vpx_memset(x->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));
|
||||
vpx_memset(x->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));
|
||||
a_ctx[8] = l_ctx[8] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
------------------------------------------------------------------------------
|
||||
Residual decoding (Paragraph 13.2 / 13.3)
|
||||
*/
|
||||
static const uint8_t kBands[16 + 1] = {
|
||||
0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7,
|
||||
0 /* extra entry as sentinel */
|
||||
};
|
||||
|
||||
static const uint8_t kCat3[] = { 173, 148, 140, 0 };
|
||||
static const uint8_t kCat4[] = { 176, 155, 140, 135, 0 };
|
||||
static const uint8_t kCat5[] = { 180, 157, 141, 134, 130, 0 };
|
||||
static const uint8_t kCat6[] =
|
||||
{ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 };
|
||||
static const uint8_t* const kCat3456[] = { kCat3, kCat4, kCat5, kCat6 };
|
||||
static const uint8_t kZigzag[16] = {
|
||||
0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15
|
||||
};
|
||||
|
||||
#define VP8GetBit vp8dx_decode_bool
|
||||
#define NUM_PROBAS 11
|
||||
#define NUM_CTX 3
|
||||
|
||||
typedef const uint8_t (*ProbaArray)[NUM_CTX][NUM_PROBAS]; // for const-casting
|
||||
|
||||
static int GetSigned(BOOL_DECODER *br, int value_to_sign)
|
||||
{
|
||||
int split = (br->range + 1) >> 1;
|
||||
VP8_BD_VALUE bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8);
|
||||
int v;
|
||||
|
||||
if(br->count < 0)
|
||||
vp8dx_bool_decoder_fill(br);
|
||||
|
||||
if ( br->value < bigsplit )
|
||||
{
|
||||
br->range = split;
|
||||
v= value_to_sign;
|
||||
}
|
||||
else
|
||||
{
|
||||
vpx_memset(x->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES)-1);
|
||||
vpx_memset(x->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES)-1);
|
||||
br->range = br->range-split;
|
||||
br->value = br->value-bigsplit;
|
||||
v = -value_to_sign;
|
||||
}
|
||||
br->range +=br->range;
|
||||
br->value +=br->value;
|
||||
br->count--;
|
||||
|
||||
return v;
|
||||
}
|
||||
/*
|
||||
Returns the position of the last non-zero coeff plus one
|
||||
(and 0 if there's no coeff at all)
|
||||
*/
|
||||
static int GetCoeffs(BOOL_DECODER *br, ProbaArray prob,
|
||||
int ctx, int n, int16_t* out)
|
||||
{
|
||||
const uint8_t* p = prob[n][ctx];
|
||||
if (!VP8GetBit(br, p[0]))
|
||||
{ /* first EOB is more a 'CBP' bit. */
|
||||
return 0;
|
||||
}
|
||||
while (1)
|
||||
{
|
||||
++n;
|
||||
if (!VP8GetBit(br, p[1]))
|
||||
{
|
||||
p = prob[kBands[n]][0];
|
||||
}
|
||||
else
|
||||
{ /* non zero coeff */
|
||||
int v, j;
|
||||
if (!VP8GetBit(br, p[2]))
|
||||
{
|
||||
p = prob[kBands[n]][1];
|
||||
v = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!VP8GetBit(br, p[3]))
|
||||
{
|
||||
if (!VP8GetBit(br, p[4]))
|
||||
{
|
||||
v = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
v = 3 + VP8GetBit(br, p[5]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!VP8GetBit(br, p[6]))
|
||||
{
|
||||
if (!VP8GetBit(br, p[7]))
|
||||
{
|
||||
v = 5 + VP8GetBit(br, 159);
|
||||
} else
|
||||
{
|
||||
v = 7 + 2 * VP8GetBit(br, 165);
|
||||
v += VP8GetBit(br, 145);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const uint8_t* tab;
|
||||
const int bit1 = VP8GetBit(br, p[8]);
|
||||
const int bit0 = VP8GetBit(br, p[9 + bit1]);
|
||||
const int cat = 2 * bit1 + bit0;
|
||||
v = 0;
|
||||
for (tab = kCat3456[cat]; *tab; ++tab)
|
||||
{
|
||||
v += v + VP8GetBit(br, *tab);
|
||||
}
|
||||
v += 3 + (8 << cat);
|
||||
}
|
||||
}
|
||||
p = prob[kBands[n]][2];
|
||||
}
|
||||
j = kZigzag[n - 1];
|
||||
|
||||
out[j] = GetSigned(br, v);
|
||||
|
||||
if (n == 16 || !VP8GetBit(br, p[0]))
|
||||
{ /* EOB */
|
||||
return n;
|
||||
}
|
||||
}
|
||||
if (n == 16)
|
||||
{
|
||||
return 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
|
||||
#define FILL \
|
||||
if(count < 0) \
|
||||
VP8DX_BOOL_DECODER_FILL(count, value, bufptr, bufend);
|
||||
|
||||
#define NORMALIZE \
|
||||
/*if(range < 0x80)*/ \
|
||||
{ \
|
||||
shift = vp8_norm[range]; \
|
||||
range <<= shift; \
|
||||
value <<= shift; \
|
||||
count -= shift; \
|
||||
}
|
||||
|
||||
#define DECODE_AND_APPLYSIGN(value_to_sign) \
|
||||
split = (range + 1) >> 1; \
|
||||
bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); \
|
||||
FILL \
|
||||
if ( value < bigsplit ) \
|
||||
{ \
|
||||
range = split; \
|
||||
v= value_to_sign; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
range = range-split; \
|
||||
value = value-bigsplit; \
|
||||
v = -value_to_sign; \
|
||||
} \
|
||||
range +=range; \
|
||||
value +=value; \
|
||||
count--;
|
||||
|
||||
#define DECODE_AND_BRANCH_IF_ZERO(probability,branch) \
|
||||
{ \
|
||||
split = 1 + ((( probability*(range-1) ) )>> 8); \
|
||||
bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); \
|
||||
FILL \
|
||||
if ( value < bigsplit ) \
|
||||
{ \
|
||||
range = split; \
|
||||
NORMALIZE \
|
||||
goto branch; \
|
||||
} \
|
||||
value -= bigsplit; \
|
||||
range = range - split; \
|
||||
NORMALIZE \
|
||||
}
|
||||
|
||||
#define DECODE_AND_LOOP_IF_ZERO(probability,branch) \
|
||||
{ \
|
||||
split = 1 + ((( probability*(range-1) ) ) >> 8); \
|
||||
bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); \
|
||||
FILL \
|
||||
if ( value < bigsplit ) \
|
||||
{ \
|
||||
range = split; \
|
||||
NORMALIZE \
|
||||
Prob = coef_probs; \
|
||||
if(c<15) {\
|
||||
++c; \
|
||||
Prob += coef_bands_x[c]; \
|
||||
goto branch; \
|
||||
} goto BLOCK_FINISHED; /*for malformed input */\
|
||||
} \
|
||||
value -= bigsplit; \
|
||||
range = range - split; \
|
||||
NORMALIZE \
|
||||
}
|
||||
|
||||
#define DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(val) \
|
||||
DECODE_AND_APPLYSIGN(val) \
|
||||
Prob = coef_probs + (ENTROPY_NODES*2); \
|
||||
if(c < 15){\
|
||||
qcoeff_ptr [ scan[c] ] = (int16_t) v; \
|
||||
++c; \
|
||||
goto DO_WHILE; }\
|
||||
qcoeff_ptr [ 15 ] = (int16_t) v; \
|
||||
goto BLOCK_FINISHED;
|
||||
|
||||
|
||||
#define DECODE_EXTRABIT_AND_ADJUST_VAL(prob, bits_count)\
|
||||
split = 1 + (((range-1) * prob) >> 8); \
|
||||
bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); \
|
||||
FILL \
|
||||
if(value >= bigsplit)\
|
||||
{\
|
||||
range = range-split;\
|
||||
value = value-bigsplit;\
|
||||
val += ((uint16_t)1<<bits_count);\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
range = split;\
|
||||
}\
|
||||
NORMALIZE
|
||||
|
||||
int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x)
|
||||
{
|
||||
ENTROPY_CONTEXT *A = (ENTROPY_CONTEXT *)x->above_context;
|
||||
ENTROPY_CONTEXT *L = (ENTROPY_CONTEXT *)x->left_context;
|
||||
const FRAME_CONTEXT * const fc = &dx->common.fc;
|
||||
|
||||
BOOL_DECODER *bc = x->current_bc;
|
||||
|
||||
const FRAME_CONTEXT * const fc = &dx->common.fc;
|
||||
char *eobs = x->eobs;
|
||||
|
||||
ENTROPY_CONTEXT *a;
|
||||
ENTROPY_CONTEXT *l;
|
||||
int i;
|
||||
|
||||
int nonzeros;
|
||||
int eobtotal = 0;
|
||||
|
||||
register int count;
|
||||
|
||||
const BOOL_DATA *bufptr;
|
||||
const BOOL_DATA *bufend;
|
||||
register unsigned int range;
|
||||
VP8_BD_VALUE value;
|
||||
const int *scan;
|
||||
register unsigned int shift;
|
||||
unsigned int split;
|
||||
VP8_BD_VALUE bigsplit;
|
||||
short *qcoeff_ptr;
|
||||
ProbaArray coef_probs;
|
||||
ENTROPY_CONTEXT *a_ctx = ((ENTROPY_CONTEXT *)x->above_context);
|
||||
ENTROPY_CONTEXT *l_ctx = ((ENTROPY_CONTEXT *)x->left_context);
|
||||
ENTROPY_CONTEXT *a;
|
||||
ENTROPY_CONTEXT *l;
|
||||
int skip_dc = 0;
|
||||
|
||||
const vp8_prob *coef_probs;
|
||||
int stop;
|
||||
int val, bits_count;
|
||||
int c;
|
||||
int v;
|
||||
const vp8_prob *Prob;
|
||||
int start_coeff;
|
||||
|
||||
|
||||
i = 0;
|
||||
stop = 16;
|
||||
|
||||
scan = vp8_default_zig_zag1d;
|
||||
qcoeff_ptr = &x->qcoeff[0];
|
||||
coef_probs = fc->coef_probs [3] [ 0 ] [0];
|
||||
|
||||
if (x->mode_info_context->mbmi.mode != B_PRED &&
|
||||
x->mode_info_context->mbmi.mode != SPLITMV)
|
||||
if (!x->mode_info_context->mbmi.is_4x4)
|
||||
{
|
||||
i = 24;
|
||||
stop = 24;
|
||||
qcoeff_ptr += 24*16;
|
||||
eobtotal -= 16;
|
||||
coef_probs = fc->coef_probs [1] [ 0 ] [0];
|
||||
a = a_ctx + 8;
|
||||
l = l_ctx + 8;
|
||||
|
||||
coef_probs = fc->coef_probs [1];
|
||||
|
||||
nonzeros = GetCoeffs(bc, coef_probs, (*a + *l), 0, qcoeff_ptr + 24 * 16);
|
||||
*a = *l = (nonzeros > 0);
|
||||
|
||||
eobs[24] = nonzeros;
|
||||
eobtotal += nonzeros - 16;
|
||||
|
||||
coef_probs = fc->coef_probs [0];
|
||||
skip_dc = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
coef_probs = fc->coef_probs [3];
|
||||
skip_dc = 0;
|
||||
}
|
||||
|
||||
bufend = bc->user_buffer_end;
|
||||
bufptr = bc->user_buffer;
|
||||
value = bc->value;
|
||||
count = bc->count;
|
||||
range = bc->range;
|
||||
|
||||
start_coeff = 0;
|
||||
|
||||
BLOCK_LOOP:
|
||||
a = A + vp8_block2above[i];
|
||||
l = L + vp8_block2left[i];
|
||||
|
||||
c = start_coeff;
|
||||
|
||||
VP8_COMBINEENTROPYCONTEXTS(v, *a, *l);
|
||||
|
||||
Prob = coef_probs;
|
||||
Prob += v * ENTROPY_NODES;
|
||||
*a = *l = 0;
|
||||
|
||||
DO_WHILE:
|
||||
Prob += coef_bands_x[c];
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[EOB_CONTEXT_NODE], BLOCK_FINISHED);
|
||||
*a = *l = 1;
|
||||
|
||||
CHECK_0_:
|
||||
DECODE_AND_LOOP_IF_ZERO(Prob[ZERO_CONTEXT_NODE], CHECK_0_);
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[ONE_CONTEXT_NODE], ONE_CONTEXT_NODE_0_);
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[LOW_VAL_CONTEXT_NODE],
|
||||
LOW_VAL_CONTEXT_NODE_0_);
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[HIGH_LOW_CONTEXT_NODE],
|
||||
HIGH_LOW_CONTEXT_NODE_0_);
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[CAT_THREEFOUR_CONTEXT_NODE],
|
||||
CAT_THREEFOUR_CONTEXT_NODE_0_);
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[CAT_FIVE_CONTEXT_NODE],
|
||||
CAT_FIVE_CONTEXT_NODE_0_);
|
||||
|
||||
val = CAT6_MIN_VAL;
|
||||
bits_count = 10;
|
||||
|
||||
do
|
||||
for (i = 0; i < 16; ++i)
|
||||
{
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(cat6_prob[bits_count], bits_count);
|
||||
bits_count -- ;
|
||||
}
|
||||
while (bits_count >= 0);
|
||||
a = a_ctx + (i&3);
|
||||
l = l_ctx + ((i&0xc)>>2);
|
||||
|
||||
DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(val);
|
||||
nonzeros = GetCoeffs(bc, coef_probs, (*a + *l), skip_dc, qcoeff_ptr);
|
||||
*a = *l = (nonzeros > 0);
|
||||
|
||||
CAT_FIVE_CONTEXT_NODE_0_:
|
||||
val = CAT5_MIN_VAL;
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT5_PROB4, 4);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT5_PROB3, 3);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT5_PROB2, 2);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT5_PROB1, 1);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT5_PROB0, 0);
|
||||
DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(val);
|
||||
|
||||
CAT_THREEFOUR_CONTEXT_NODE_0_:
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[CAT_THREE_CONTEXT_NODE],
|
||||
CAT_THREE_CONTEXT_NODE_0_);
|
||||
val = CAT4_MIN_VAL;
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT4_PROB3, 3);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT4_PROB2, 2);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT4_PROB1, 1);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT4_PROB0, 0);
|
||||
DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(val);
|
||||
|
||||
CAT_THREE_CONTEXT_NODE_0_:
|
||||
val = CAT3_MIN_VAL;
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT3_PROB2, 2);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT3_PROB1, 1);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT3_PROB0, 0);
|
||||
DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(val);
|
||||
|
||||
HIGH_LOW_CONTEXT_NODE_0_:
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[CAT_ONE_CONTEXT_NODE],
|
||||
CAT_ONE_CONTEXT_NODE_0_);
|
||||
|
||||
val = CAT2_MIN_VAL;
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT2_PROB1, 1);
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT2_PROB0, 0);
|
||||
DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(val);
|
||||
|
||||
CAT_ONE_CONTEXT_NODE_0_:
|
||||
val = CAT1_MIN_VAL;
|
||||
DECODE_EXTRABIT_AND_ADJUST_VAL(CAT1_PROB0, 0);
|
||||
DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(val);
|
||||
|
||||
LOW_VAL_CONTEXT_NODE_0_:
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[TWO_CONTEXT_NODE], TWO_CONTEXT_NODE_0_);
|
||||
DECODE_AND_BRANCH_IF_ZERO(Prob[THREE_CONTEXT_NODE], THREE_CONTEXT_NODE_0_);
|
||||
DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(4);
|
||||
|
||||
THREE_CONTEXT_NODE_0_:
|
||||
DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(3);
|
||||
|
||||
TWO_CONTEXT_NODE_0_:
|
||||
DECODE_SIGN_WRITE_COEFF_AND_CHECK_EXIT(2);
|
||||
|
||||
ONE_CONTEXT_NODE_0_:
|
||||
DECODE_AND_APPLYSIGN(1);
|
||||
Prob = coef_probs + ENTROPY_NODES;
|
||||
|
||||
if (c < 15)
|
||||
{
|
||||
qcoeff_ptr [ scan[c] ] = (int16_t) v;
|
||||
++c;
|
||||
goto DO_WHILE;
|
||||
}
|
||||
|
||||
qcoeff_ptr [ 15 ] = (int16_t) v;
|
||||
BLOCK_FINISHED:
|
||||
eobs[i] = c;
|
||||
eobtotal += c;
|
||||
nonzeros += skip_dc;
|
||||
eobs[i] = nonzeros;
|
||||
eobtotal += nonzeros;
|
||||
qcoeff_ptr += 16;
|
||||
|
||||
i++;
|
||||
|
||||
if (i < stop)
|
||||
goto BLOCK_LOOP;
|
||||
|
||||
if (i == 25)
|
||||
{
|
||||
start_coeff = 1;
|
||||
i = 0;
|
||||
stop = 16;
|
||||
coef_probs = fc->coef_probs [0] [ 0 ] [0];
|
||||
qcoeff_ptr -= (24*16 + 16);
|
||||
goto BLOCK_LOOP;
|
||||
}
|
||||
|
||||
if (i == 16)
|
||||
coef_probs = fc->coef_probs [2];
|
||||
|
||||
a_ctx += 4;
|
||||
l_ctx += 4;
|
||||
for (i = 16; i < 24; ++i)
|
||||
{
|
||||
start_coeff = 0;
|
||||
coef_probs = fc->coef_probs [2] [ 0 ] [0];
|
||||
stop = 24;
|
||||
goto BLOCK_LOOP;
|
||||
a = a_ctx + ((i > 19)<<1) + (i&1);
|
||||
l = l_ctx + ((i > 19)<<1) + ((i&3)>1);
|
||||
|
||||
nonzeros = GetCoeffs(bc, coef_probs, (*a + *l), 0, qcoeff_ptr);
|
||||
*a = *l = (nonzeros > 0);
|
||||
|
||||
eobs[i] = nonzeros;
|
||||
eobtotal += nonzeros;
|
||||
qcoeff_ptr += 16;
|
||||
}
|
||||
|
||||
FILL
|
||||
bc->user_buffer = bufptr;
|
||||
bc->value = value;
|
||||
bc->count = count;
|
||||
bc->range = range;
|
||||
return eobtotal;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "onyxd_int.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "vp8/common/alloccommon.h"
|
||||
#include "vpx_scale/yv12extend.h"
|
||||
#include "vp8/common/loopfilter.h"
|
||||
#include "vp8/common/swapyv12buffer.h"
|
||||
#include "vp8/common/threading.h"
|
||||
@@ -42,20 +41,6 @@ extern void vp8cx_init_de_quantizer(VP8D_COMP *pbi);
|
||||
static int get_free_fb (VP8_COMMON *cm);
|
||||
static void ref_cnt_fb (int *buf, int *idx, int new_idx);
|
||||
|
||||
|
||||
void vp8dx_initialize()
|
||||
{
|
||||
static int init_done = 0;
|
||||
|
||||
if (!init_done)
|
||||
{
|
||||
vp8_initialize_common();
|
||||
vp8_scale_machine_specific_config();
|
||||
init_done = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct VP8D_COMP * vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
|
||||
{
|
||||
VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP));
|
||||
@@ -73,7 +58,6 @@ struct VP8D_COMP * vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
|
||||
}
|
||||
|
||||
pbi->common.error.setjmp = 1;
|
||||
vp8dx_initialize();
|
||||
|
||||
vp8_create_common(&pbi->common);
|
||||
|
||||
@@ -163,7 +147,7 @@ vpx_codec_err_t vp8dx_get_reference(VP8D_COMP *pbi, VP8_REFFRAME ref_frame_flag,
|
||||
"Incorrect buffer dimensions");
|
||||
}
|
||||
else
|
||||
vp8_yv12_copy_frame_ptr(&cm->yv12_fb[ref_fb_idx], sd);
|
||||
vp8_yv12_copy_frame(&cm->yv12_fb[ref_fb_idx], sd);
|
||||
|
||||
return pbi->common.error.error_code;
|
||||
}
|
||||
@@ -203,7 +187,7 @@ vpx_codec_err_t vp8dx_set_reference(VP8D_COMP *pbi, VP8_REFFRAME ref_frame_flag,
|
||||
|
||||
/* Manage the reference counters and copy image. */
|
||||
ref_cnt_fb (cm->fb_idx_ref_cnt, ref_fb_ptr, free_fb);
|
||||
vp8_yv12_copy_frame_ptr(sd, &cm->yv12_fb[*ref_fb_ptr]);
|
||||
vp8_yv12_copy_frame(sd, &cm->yv12_fb[*ref_fb_ptr]);
|
||||
}
|
||||
|
||||
return pbi->common.error.error_code;
|
||||
@@ -316,7 +300,7 @@ int vp8dx_receive_compressed_data(VP8D_COMP *pbi, unsigned long size, const unsi
|
||||
if (pbi->num_fragments == 0)
|
||||
{
|
||||
/* New frame, reset fragment pointers and sizes */
|
||||
vpx_memset(pbi->fragments, 0, sizeof(pbi->fragments));
|
||||
vpx_memset((void*)pbi->fragments, 0, sizeof(pbi->fragments));
|
||||
vpx_memset(pbi->fragment_sizes, 0, sizeof(pbi->fragment_sizes));
|
||||
}
|
||||
if (pbi->input_fragments && !(source == NULL && size == 0))
|
||||
@@ -367,7 +351,7 @@ int vp8dx_receive_compressed_data(VP8D_COMP *pbi, unsigned long size, const unsi
|
||||
const int prev_idx = cm->lst_fb_idx;
|
||||
cm->fb_idx_ref_cnt[prev_idx]--;
|
||||
cm->lst_fb_idx = get_free_fb(cm);
|
||||
vp8_yv12_copy_frame_ptr(&cm->yv12_fb[prev_idx],
|
||||
vp8_yv12_copy_frame(&cm->yv12_fb[prev_idx],
|
||||
&cm->yv12_fb[cm->lst_fb_idx]);
|
||||
}
|
||||
/* This is used to signal that we are missing frames.
|
||||
@@ -484,9 +468,9 @@ int vp8dx_receive_compressed_data(VP8D_COMP *pbi, unsigned long size, const unsi
|
||||
if(cm->filter_level)
|
||||
{
|
||||
/* Apply the loop filter if appropriate. */
|
||||
vp8_loop_filter_frame(cm, &pbi->mb);
|
||||
vp8_loop_filter_frame(cm, &pbi->mb, cm->frame_type);
|
||||
}
|
||||
vp8_yv12_extend_frame_borders_ptr(cm->frame_to_show);
|
||||
vp8_yv12_extend_frame_borders(cm->frame_to_show);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,8 +32,6 @@ typedef struct
|
||||
{
|
||||
MACROBLOCKD mbd;
|
||||
int mb_row;
|
||||
int current_mb_col;
|
||||
short *coef_ptr;
|
||||
} MB_ROW_DEC;
|
||||
|
||||
typedef struct
|
||||
@@ -64,7 +62,7 @@ typedef struct VP8D_COMP
|
||||
volatile int b_multithreaded_rd;
|
||||
int max_threads;
|
||||
int current_mb_col_main;
|
||||
int decoding_thread_count;
|
||||
unsigned int decoding_thread_count;
|
||||
int allocated_decoding_thread_count;
|
||||
|
||||
int mt_baseline_filter_level[MAX_MB_SEGMENTS];
|
||||
|
||||
@@ -1,943 +0,0 @@
|
||||
/*
|
||||
* 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 "vpx_config.h"
|
||||
#include "vpx_rtcd.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "onyxd_int.h"
|
||||
|
||||
/* For skip_recon_mb(), add vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) and
|
||||
* vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x).
|
||||
*/
|
||||
|
||||
void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
|
||||
{
|
||||
unsigned char *yabove_row; /* = x->dst.y_buffer - x->dst.y_stride; */
|
||||
unsigned char *yleft_col;
|
||||
unsigned char yleft_buf[16];
|
||||
unsigned char ytop_left; /* = yabove_row[-1]; */
|
||||
unsigned char *ypred_ptr = x->predictor;
|
||||
int r, c, i;
|
||||
|
||||
if (pbi->common.filter_level)
|
||||
{
|
||||
yabove_row = pbi->mt_yabove_row[mb_row] + mb_col*16 +32;
|
||||
yleft_col = pbi->mt_yleft_col[mb_row];
|
||||
} else
|
||||
{
|
||||
yabove_row = x->dst.y_buffer - x->dst.y_stride;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
yleft_buf[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
|
||||
yleft_col = yleft_buf;
|
||||
}
|
||||
|
||||
ytop_left = yabove_row[-1];
|
||||
|
||||
/* for Y */
|
||||
switch (x->mode_info_context->mbmi.mode)
|
||||
{
|
||||
case DC_PRED:
|
||||
{
|
||||
int expected_dc;
|
||||
int i;
|
||||
int shift;
|
||||
int average = 0;
|
||||
|
||||
|
||||
if (x->up_available || x->left_available)
|
||||
{
|
||||
if (x->up_available)
|
||||
{
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
average += yabove_row[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (x->left_available)
|
||||
{
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
average += yleft_col[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
shift = 3 + x->up_available + x->left_available;
|
||||
expected_dc = (average + (1 << (shift - 1))) >> shift;
|
||||
}
|
||||
else
|
||||
{
|
||||
expected_dc = 128;
|
||||
}
|
||||
|
||||
vpx_memset(ypred_ptr, expected_dc, 256);
|
||||
}
|
||||
break;
|
||||
case V_PRED:
|
||||
{
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
|
||||
((int *)ypred_ptr)[0] = ((int *)yabove_row)[0];
|
||||
((int *)ypred_ptr)[1] = ((int *)yabove_row)[1];
|
||||
((int *)ypred_ptr)[2] = ((int *)yabove_row)[2];
|
||||
((int *)ypred_ptr)[3] = ((int *)yabove_row)[3];
|
||||
ypred_ptr += 16;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case H_PRED:
|
||||
{
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
|
||||
vpx_memset(ypred_ptr, yleft_col[r], 16);
|
||||
ypred_ptr += 16;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case TM_PRED:
|
||||
{
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
for (c = 0; c < 16; c++)
|
||||
{
|
||||
int pred = yleft_col[r] + yabove_row[ c] - ytop_left;
|
||||
|
||||
if (pred < 0)
|
||||
pred = 0;
|
||||
|
||||
if (pred > 255)
|
||||
pred = 255;
|
||||
|
||||
ypred_ptr[c] = pred;
|
||||
}
|
||||
|
||||
ypred_ptr += 16;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case B_PRED:
|
||||
case NEARESTMV:
|
||||
case NEARMV:
|
||||
case ZEROMV:
|
||||
case NEWMV:
|
||||
case SPLITMV:
|
||||
case MB_MODE_COUNT:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
|
||||
{
|
||||
unsigned char *yabove_row; /* = x->dst.y_buffer - x->dst.y_stride; */
|
||||
unsigned char *yleft_col;
|
||||
unsigned char yleft_buf[16];
|
||||
unsigned char ytop_left; /* = yabove_row[-1]; */
|
||||
unsigned char *ypred_ptr = x->predictor;
|
||||
int r, c, i;
|
||||
|
||||
int y_stride = x->dst.y_stride;
|
||||
ypred_ptr = x->dst.y_buffer; /*x->predictor;*/
|
||||
|
||||
if (pbi->common.filter_level)
|
||||
{
|
||||
yabove_row = pbi->mt_yabove_row[mb_row] + mb_col*16 +32;
|
||||
yleft_col = pbi->mt_yleft_col[mb_row];
|
||||
} else
|
||||
{
|
||||
yabove_row = x->dst.y_buffer - x->dst.y_stride;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
yleft_buf[i] = x->dst.y_buffer [i* x->dst.y_stride -1];
|
||||
yleft_col = yleft_buf;
|
||||
}
|
||||
|
||||
ytop_left = yabove_row[-1];
|
||||
|
||||
/* for Y */
|
||||
switch (x->mode_info_context->mbmi.mode)
|
||||
{
|
||||
case DC_PRED:
|
||||
{
|
||||
int expected_dc;
|
||||
int i;
|
||||
int shift;
|
||||
int average = 0;
|
||||
|
||||
|
||||
if (x->up_available || x->left_available)
|
||||
{
|
||||
if (x->up_available)
|
||||
{
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
average += yabove_row[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (x->left_available)
|
||||
{
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
average += yleft_col[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
shift = 3 + x->up_available + x->left_available;
|
||||
expected_dc = (average + (1 << (shift - 1))) >> shift;
|
||||
}
|
||||
else
|
||||
{
|
||||
expected_dc = 128;
|
||||
}
|
||||
|
||||
/*vpx_memset(ypred_ptr, expected_dc, 256);*/
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
vpx_memset(ypred_ptr, expected_dc, 16);
|
||||
ypred_ptr += y_stride; /*16;*/
|
||||
}
|
||||
}
|
||||
break;
|
||||
case V_PRED:
|
||||
{
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
|
||||
((int *)ypred_ptr)[0] = ((int *)yabove_row)[0];
|
||||
((int *)ypred_ptr)[1] = ((int *)yabove_row)[1];
|
||||
((int *)ypred_ptr)[2] = ((int *)yabove_row)[2];
|
||||
((int *)ypred_ptr)[3] = ((int *)yabove_row)[3];
|
||||
ypred_ptr += y_stride; /*16;*/
|
||||
}
|
||||
}
|
||||
break;
|
||||
case H_PRED:
|
||||
{
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
|
||||
vpx_memset(ypred_ptr, yleft_col[r], 16);
|
||||
ypred_ptr += y_stride; /*16;*/
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case TM_PRED:
|
||||
{
|
||||
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
for (c = 0; c < 16; c++)
|
||||
{
|
||||
int pred = yleft_col[r] + yabove_row[ c] - ytop_left;
|
||||
|
||||
if (pred < 0)
|
||||
pred = 0;
|
||||
|
||||
if (pred > 255)
|
||||
pred = 255;
|
||||
|
||||
ypred_ptr[c] = pred;
|
||||
}
|
||||
|
||||
ypred_ptr += y_stride; /*16;*/
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case B_PRED:
|
||||
case NEARESTMV:
|
||||
case NEARMV:
|
||||
case ZEROMV:
|
||||
case NEWMV:
|
||||
case SPLITMV:
|
||||
case MB_MODE_COUNT:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void vp8mt_build_intra_predictors_mbuv(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
|
||||
{
|
||||
unsigned char *uabove_row; /* = x->dst.u_buffer - x->dst.uv_stride; */
|
||||
unsigned char *uleft_col; /*[16];*/
|
||||
unsigned char uleft_buf[8];
|
||||
unsigned char utop_left; /* = uabove_row[-1]; */
|
||||
unsigned char *vabove_row; /* = x->dst.v_buffer - x->dst.uv_stride; */
|
||||
unsigned char *vleft_col; /*[20];*/
|
||||
unsigned char vleft_buf[8];
|
||||
unsigned char vtop_left; /* = vabove_row[-1]; */
|
||||
unsigned char *upred_ptr = &x->predictor[256];
|
||||
unsigned char *vpred_ptr = &x->predictor[320];
|
||||
int i, j;
|
||||
|
||||
if (pbi->common.filter_level)
|
||||
{
|
||||
uabove_row = pbi->mt_uabove_row[mb_row] + mb_col*8 +16;
|
||||
vabove_row = pbi->mt_vabove_row[mb_row] + mb_col*8 +16;
|
||||
uleft_col = pbi->mt_uleft_col[mb_row];
|
||||
vleft_col = pbi->mt_vleft_col[mb_row];
|
||||
} else
|
||||
{
|
||||
uabove_row = x->dst.u_buffer - x->dst.uv_stride;
|
||||
vabove_row = x->dst.v_buffer - x->dst.uv_stride;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
uleft_buf[i] = x->dst.u_buffer [i* x->dst.uv_stride -1];
|
||||
vleft_buf[i] = x->dst.v_buffer [i* x->dst.uv_stride -1];
|
||||
}
|
||||
uleft_col = uleft_buf;
|
||||
vleft_col = vleft_buf;
|
||||
}
|
||||
utop_left = uabove_row[-1];
|
||||
vtop_left = vabove_row[-1];
|
||||
|
||||
switch (x->mode_info_context->mbmi.uv_mode)
|
||||
{
|
||||
case DC_PRED:
|
||||
{
|
||||
int expected_udc;
|
||||
int expected_vdc;
|
||||
int i;
|
||||
int shift;
|
||||
int Uaverage = 0;
|
||||
int Vaverage = 0;
|
||||
|
||||
if (x->up_available)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
Uaverage += uabove_row[i];
|
||||
Vaverage += vabove_row[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (x->left_available)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
Uaverage += uleft_col[i];
|
||||
Vaverage += vleft_col[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (!x->up_available && !x->left_available)
|
||||
{
|
||||
expected_udc = 128;
|
||||
expected_vdc = 128;
|
||||
}
|
||||
else
|
||||
{
|
||||
shift = 2 + x->up_available + x->left_available;
|
||||
expected_udc = (Uaverage + (1 << (shift - 1))) >> shift;
|
||||
expected_vdc = (Vaverage + (1 << (shift - 1))) >> shift;
|
||||
}
|
||||
|
||||
|
||||
vpx_memset(upred_ptr, expected_udc, 64);
|
||||
vpx_memset(vpred_ptr, expected_vdc, 64);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case V_PRED:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
vpx_memcpy(upred_ptr, uabove_row, 8);
|
||||
vpx_memcpy(vpred_ptr, vabove_row, 8);
|
||||
upred_ptr += 8;
|
||||
vpred_ptr += 8;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case H_PRED:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
vpx_memset(upred_ptr, uleft_col[i], 8);
|
||||
vpx_memset(vpred_ptr, vleft_col[i], 8);
|
||||
upred_ptr += 8;
|
||||
vpred_ptr += 8;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case TM_PRED:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
int predu = uleft_col[i] + uabove_row[j] - utop_left;
|
||||
int predv = vleft_col[i] + vabove_row[j] - vtop_left;
|
||||
|
||||
if (predu < 0)
|
||||
predu = 0;
|
||||
|
||||
if (predu > 255)
|
||||
predu = 255;
|
||||
|
||||
if (predv < 0)
|
||||
predv = 0;
|
||||
|
||||
if (predv > 255)
|
||||
predv = 255;
|
||||
|
||||
upred_ptr[j] = predu;
|
||||
vpred_ptr[j] = predv;
|
||||
}
|
||||
|
||||
upred_ptr += 8;
|
||||
vpred_ptr += 8;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case B_PRED:
|
||||
case NEARESTMV:
|
||||
case NEARMV:
|
||||
case ZEROMV:
|
||||
case NEWMV:
|
||||
case SPLITMV:
|
||||
case MB_MODE_COUNT:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void vp8mt_build_intra_predictors_mbuv_s(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
|
||||
{
|
||||
unsigned char *uabove_row; /* = x->dst.u_buffer - x->dst.uv_stride; */
|
||||
unsigned char *uleft_col; /*[16];*/
|
||||
unsigned char uleft_buf[8];
|
||||
unsigned char utop_left; /* = uabove_row[-1]; */
|
||||
unsigned char *vabove_row; /* = x->dst.v_buffer - x->dst.uv_stride; */
|
||||
unsigned char *vleft_col; /*[20];*/
|
||||
unsigned char vleft_buf[8];
|
||||
unsigned char vtop_left; /* = vabove_row[-1]; */
|
||||
unsigned char *upred_ptr = x->dst.u_buffer; /*&x->predictor[256];*/
|
||||
unsigned char *vpred_ptr = x->dst.v_buffer; /*&x->predictor[320];*/
|
||||
int uv_stride = x->dst.uv_stride;
|
||||
int i, j;
|
||||
|
||||
if (pbi->common.filter_level)
|
||||
{
|
||||
uabove_row = pbi->mt_uabove_row[mb_row] + mb_col*8 +16;
|
||||
vabove_row = pbi->mt_vabove_row[mb_row] + mb_col*8 +16;
|
||||
uleft_col = pbi->mt_uleft_col[mb_row];
|
||||
vleft_col = pbi->mt_vleft_col[mb_row];
|
||||
} else
|
||||
{
|
||||
uabove_row = x->dst.u_buffer - x->dst.uv_stride;
|
||||
vabove_row = x->dst.v_buffer - x->dst.uv_stride;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
uleft_buf[i] = x->dst.u_buffer [i* x->dst.uv_stride -1];
|
||||
vleft_buf[i] = x->dst.v_buffer [i* x->dst.uv_stride -1];
|
||||
}
|
||||
uleft_col = uleft_buf;
|
||||
vleft_col = vleft_buf;
|
||||
}
|
||||
utop_left = uabove_row[-1];
|
||||
vtop_left = vabove_row[-1];
|
||||
|
||||
switch (x->mode_info_context->mbmi.uv_mode)
|
||||
{
|
||||
case DC_PRED:
|
||||
{
|
||||
int expected_udc;
|
||||
int expected_vdc;
|
||||
int i;
|
||||
int shift;
|
||||
int Uaverage = 0;
|
||||
int Vaverage = 0;
|
||||
|
||||
if (x->up_available)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
Uaverage += uabove_row[i];
|
||||
Vaverage += vabove_row[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (x->left_available)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
Uaverage += uleft_col[i];
|
||||
Vaverage += vleft_col[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (!x->up_available && !x->left_available)
|
||||
{
|
||||
expected_udc = 128;
|
||||
expected_vdc = 128;
|
||||
}
|
||||
else
|
||||
{
|
||||
shift = 2 + x->up_available + x->left_available;
|
||||
expected_udc = (Uaverage + (1 << (shift - 1))) >> shift;
|
||||
expected_vdc = (Vaverage + (1 << (shift - 1))) >> shift;
|
||||
}
|
||||
|
||||
|
||||
/*vpx_memset(upred_ptr,expected_udc,64);
|
||||
vpx_memset(vpred_ptr,expected_vdc,64);*/
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
vpx_memset(upred_ptr, expected_udc, 8);
|
||||
vpx_memset(vpred_ptr, expected_vdc, 8);
|
||||
upred_ptr += uv_stride; /*8;*/
|
||||
vpred_ptr += uv_stride; /*8;*/
|
||||
}
|
||||
}
|
||||
break;
|
||||
case V_PRED:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
vpx_memcpy(upred_ptr, uabove_row, 8);
|
||||
vpx_memcpy(vpred_ptr, vabove_row, 8);
|
||||
upred_ptr += uv_stride; /*8;*/
|
||||
vpred_ptr += uv_stride; /*8;*/
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case H_PRED:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
vpx_memset(upred_ptr, uleft_col[i], 8);
|
||||
vpx_memset(vpred_ptr, vleft_col[i], 8);
|
||||
upred_ptr += uv_stride; /*8;*/
|
||||
vpred_ptr += uv_stride; /*8;*/
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case TM_PRED:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
int predu = uleft_col[i] + uabove_row[j] - utop_left;
|
||||
int predv = vleft_col[i] + vabove_row[j] - vtop_left;
|
||||
|
||||
if (predu < 0)
|
||||
predu = 0;
|
||||
|
||||
if (predu > 255)
|
||||
predu = 255;
|
||||
|
||||
if (predv < 0)
|
||||
predv = 0;
|
||||
|
||||
if (predv > 255)
|
||||
predv = 255;
|
||||
|
||||
upred_ptr[j] = predu;
|
||||
vpred_ptr[j] = predv;
|
||||
}
|
||||
|
||||
upred_ptr += uv_stride; /*8;*/
|
||||
vpred_ptr += uv_stride; /*8;*/
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case B_PRED:
|
||||
case NEARESTMV:
|
||||
case NEARMV:
|
||||
case ZEROMV:
|
||||
case NEWMV:
|
||||
case SPLITMV:
|
||||
case MB_MODE_COUNT:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void vp8mt_predict_intra4x4(VP8D_COMP *pbi,
|
||||
MACROBLOCKD *xd,
|
||||
int b_mode,
|
||||
unsigned char *predictor,
|
||||
int stride,
|
||||
int mb_row,
|
||||
int mb_col,
|
||||
int num)
|
||||
{
|
||||
int i, r, c;
|
||||
|
||||
unsigned char *Above; /* = *(x->base_dst) + x->dst - x->dst_stride; */
|
||||
unsigned char Left[4];
|
||||
unsigned char top_left; /* = Above[-1]; */
|
||||
|
||||
BLOCKD *x = &xd->block[num];
|
||||
int dst_stride = xd->dst.y_stride;
|
||||
unsigned char *base_dst = xd->dst.y_buffer;
|
||||
|
||||
|
||||
/*Caution: For some b_mode, it needs 8 pixels (4 above + 4 above-right).*/
|
||||
if (num < 4 && pbi->common.filter_level)
|
||||
Above = pbi->mt_yabove_row[mb_row] + mb_col*16 + num*4 + 32;
|
||||
else
|
||||
Above = base_dst + x->offset - dst_stride;
|
||||
|
||||
if (num%4==0 && pbi->common.filter_level)
|
||||
{
|
||||
for (i=0; i<4; i++)
|
||||
Left[i] = pbi->mt_yleft_col[mb_row][num + i];
|
||||
}else
|
||||
{
|
||||
Left[0] = (base_dst)[x->offset - 1];
|
||||
Left[1] = (base_dst)[x->offset - 1 + dst_stride];
|
||||
Left[2] = (base_dst)[x->offset - 1 + 2 * dst_stride];
|
||||
Left[3] = (base_dst)[x->offset - 1 + 3 * dst_stride];
|
||||
}
|
||||
|
||||
if ((num==4 || num==8 || num==12) && pbi->common.filter_level)
|
||||
top_left = pbi->mt_yleft_col[mb_row][num-1];
|
||||
else
|
||||
top_left = Above[-1];
|
||||
|
||||
switch (b_mode)
|
||||
{
|
||||
case B_DC_PRED:
|
||||
{
|
||||
int expected_dc = 0;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
expected_dc += Above[i];
|
||||
expected_dc += Left[i];
|
||||
}
|
||||
|
||||
expected_dc = (expected_dc + 4) >> 3;
|
||||
|
||||
for (r = 0; r < 4; r++)
|
||||
{
|
||||
for (c = 0; c < 4; c++)
|
||||
{
|
||||
predictor[c] = expected_dc;
|
||||
}
|
||||
|
||||
predictor += stride;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case B_TM_PRED:
|
||||
{
|
||||
/* prediction similar to true_motion prediction */
|
||||
for (r = 0; r < 4; r++)
|
||||
{
|
||||
for (c = 0; c < 4; c++)
|
||||
{
|
||||
int pred = Above[c] - top_left + Left[r];
|
||||
|
||||
if (pred < 0)
|
||||
pred = 0;
|
||||
|
||||
if (pred > 255)
|
||||
pred = 255;
|
||||
|
||||
predictor[c] = pred;
|
||||
}
|
||||
|
||||
predictor += stride;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case B_VE_PRED:
|
||||
{
|
||||
|
||||
unsigned int ap[4];
|
||||
ap[0] = (top_left + 2 * Above[0] + Above[1] + 2) >> 2;
|
||||
ap[1] = (Above[0] + 2 * Above[1] + Above[2] + 2) >> 2;
|
||||
ap[2] = (Above[1] + 2 * Above[2] + Above[3] + 2) >> 2;
|
||||
ap[3] = (Above[2] + 2 * Above[3] + Above[4] + 2) >> 2;
|
||||
|
||||
for (r = 0; r < 4; r++)
|
||||
{
|
||||
for (c = 0; c < 4; c++)
|
||||
{
|
||||
|
||||
predictor[c] = ap[c];
|
||||
}
|
||||
|
||||
predictor += stride;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case B_HE_PRED:
|
||||
{
|
||||
|
||||
unsigned int lp[4];
|
||||
lp[0] = (top_left + 2 * Left[0] + Left[1] + 2) >> 2;
|
||||
lp[1] = (Left[0] + 2 * Left[1] + Left[2] + 2) >> 2;
|
||||
lp[2] = (Left[1] + 2 * Left[2] + Left[3] + 2) >> 2;
|
||||
lp[3] = (Left[2] + 2 * Left[3] + Left[3] + 2) >> 2;
|
||||
|
||||
for (r = 0; r < 4; r++)
|
||||
{
|
||||
for (c = 0; c < 4; c++)
|
||||
{
|
||||
predictor[c] = lp[r];
|
||||
}
|
||||
|
||||
predictor += stride;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case B_LD_PRED:
|
||||
{
|
||||
unsigned char *ptr = Above;
|
||||
predictor[0 * stride + 0] = (ptr[0] + ptr[1] * 2 + ptr[2] + 2) >> 2;
|
||||
predictor[0 * stride + 1] =
|
||||
predictor[1 * stride + 0] = (ptr[1] + ptr[2] * 2 + ptr[3] + 2) >> 2;
|
||||
predictor[0 * stride + 2] =
|
||||
predictor[1 * stride + 1] =
|
||||
predictor[2 * stride + 0] = (ptr[2] + ptr[3] * 2 + ptr[4] + 2) >> 2;
|
||||
predictor[0 * stride + 3] =
|
||||
predictor[1 * stride + 2] =
|
||||
predictor[2 * stride + 1] =
|
||||
predictor[3 * stride + 0] = (ptr[3] + ptr[4] * 2 + ptr[5] + 2) >> 2;
|
||||
predictor[1 * stride + 3] =
|
||||
predictor[2 * stride + 2] =
|
||||
predictor[3 * stride + 1] = (ptr[4] + ptr[5] * 2 + ptr[6] + 2) >> 2;
|
||||
predictor[2 * stride + 3] =
|
||||
predictor[3 * stride + 2] = (ptr[5] + ptr[6] * 2 + ptr[7] + 2) >> 2;
|
||||
predictor[3 * stride + 3] = (ptr[6] + ptr[7] * 2 + ptr[7] + 2) >> 2;
|
||||
|
||||
}
|
||||
break;
|
||||
case B_RD_PRED:
|
||||
{
|
||||
|
||||
unsigned char pp[9];
|
||||
|
||||
pp[0] = Left[3];
|
||||
pp[1] = Left[2];
|
||||
pp[2] = Left[1];
|
||||
pp[3] = Left[0];
|
||||
pp[4] = top_left;
|
||||
pp[5] = Above[0];
|
||||
pp[6] = Above[1];
|
||||
pp[7] = Above[2];
|
||||
pp[8] = Above[3];
|
||||
|
||||
predictor[3 * stride + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
|
||||
predictor[3 * stride + 1] =
|
||||
predictor[2 * stride + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
|
||||
predictor[3 * stride + 2] =
|
||||
predictor[2 * stride + 1] =
|
||||
predictor[1 * stride + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
|
||||
predictor[3 * stride + 3] =
|
||||
predictor[2 * stride + 2] =
|
||||
predictor[1 * stride + 1] =
|
||||
predictor[0 * stride + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
|
||||
predictor[2 * stride + 3] =
|
||||
predictor[1 * stride + 2] =
|
||||
predictor[0 * stride + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
|
||||
predictor[1 * stride + 3] =
|
||||
predictor[0 * stride + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
|
||||
predictor[0 * stride + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2;
|
||||
|
||||
}
|
||||
break;
|
||||
case B_VR_PRED:
|
||||
{
|
||||
|
||||
unsigned char pp[9];
|
||||
|
||||
pp[0] = Left[3];
|
||||
pp[1] = Left[2];
|
||||
pp[2] = Left[1];
|
||||
pp[3] = Left[0];
|
||||
pp[4] = top_left;
|
||||
pp[5] = Above[0];
|
||||
pp[6] = Above[1];
|
||||
pp[7] = Above[2];
|
||||
pp[8] = Above[3];
|
||||
|
||||
|
||||
predictor[3 * stride + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
|
||||
predictor[2 * stride + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
|
||||
predictor[3 * stride + 1] =
|
||||
predictor[1 * stride + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
|
||||
predictor[2 * stride + 1] =
|
||||
predictor[0 * stride + 0] = (pp[4] + pp[5] + 1) >> 1;
|
||||
predictor[3 * stride + 2] =
|
||||
predictor[1 * stride + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
|
||||
predictor[2 * stride + 2] =
|
||||
predictor[0 * stride + 1] = (pp[5] + pp[6] + 1) >> 1;
|
||||
predictor[3 * stride + 3] =
|
||||
predictor[1 * stride + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
|
||||
predictor[2 * stride + 3] =
|
||||
predictor[0 * stride + 2] = (pp[6] + pp[7] + 1) >> 1;
|
||||
predictor[1 * stride + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2;
|
||||
predictor[0 * stride + 3] = (pp[7] + pp[8] + 1) >> 1;
|
||||
|
||||
}
|
||||
break;
|
||||
case B_VL_PRED:
|
||||
{
|
||||
|
||||
unsigned char *pp = Above;
|
||||
|
||||
predictor[0 * stride + 0] = (pp[0] + pp[1] + 1) >> 1;
|
||||
predictor[1 * stride + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
|
||||
predictor[2 * stride + 0] =
|
||||
predictor[0 * stride + 1] = (pp[1] + pp[2] + 1) >> 1;
|
||||
predictor[1 * stride + 1] =
|
||||
predictor[3 * stride + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
|
||||
predictor[2 * stride + 1] =
|
||||
predictor[0 * stride + 2] = (pp[2] + pp[3] + 1) >> 1;
|
||||
predictor[3 * stride + 1] =
|
||||
predictor[1 * stride + 2] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
|
||||
predictor[0 * stride + 3] =
|
||||
predictor[2 * stride + 2] = (pp[3] + pp[4] + 1) >> 1;
|
||||
predictor[1 * stride + 3] =
|
||||
predictor[3 * stride + 2] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
|
||||
predictor[2 * stride + 3] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
|
||||
predictor[3 * stride + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case B_HD_PRED:
|
||||
{
|
||||
unsigned char pp[9];
|
||||
pp[0] = Left[3];
|
||||
pp[1] = Left[2];
|
||||
pp[2] = Left[1];
|
||||
pp[3] = Left[0];
|
||||
pp[4] = top_left;
|
||||
pp[5] = Above[0];
|
||||
pp[6] = Above[1];
|
||||
pp[7] = Above[2];
|
||||
pp[8] = Above[3];
|
||||
|
||||
|
||||
predictor[3 * stride + 0] = (pp[0] + pp[1] + 1) >> 1;
|
||||
predictor[3 * stride + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
|
||||
predictor[2 * stride + 0] =
|
||||
predictor[3 * stride + 2] = (pp[1] + pp[2] + 1) >> 1;
|
||||
predictor[2 * stride + 1] =
|
||||
predictor[3 * stride + 3] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
|
||||
predictor[2 * stride + 2] =
|
||||
predictor[1 * stride + 0] = (pp[2] + pp[3] + 1) >> 1;
|
||||
predictor[2 * stride + 3] =
|
||||
predictor[1 * stride + 1] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2;
|
||||
predictor[1 * stride + 2] =
|
||||
predictor[0 * stride + 0] = (pp[3] + pp[4] + 1) >> 1;
|
||||
predictor[1 * stride + 3] =
|
||||
predictor[0 * stride + 1] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2;
|
||||
predictor[0 * stride + 2] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2;
|
||||
predictor[0 * stride + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case B_HU_PRED:
|
||||
{
|
||||
unsigned char *pp = Left;
|
||||
predictor[0 * stride + 0] = (pp[0] + pp[1] + 1) >> 1;
|
||||
predictor[0 * stride + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;
|
||||
predictor[0 * stride + 2] =
|
||||
predictor[1 * stride + 0] = (pp[1] + pp[2] + 1) >> 1;
|
||||
predictor[0 * stride + 3] =
|
||||
predictor[1 * stride + 1] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2;
|
||||
predictor[1 * stride + 2] =
|
||||
predictor[2 * stride + 0] = (pp[2] + pp[3] + 1) >> 1;
|
||||
predictor[1 * stride + 3] =
|
||||
predictor[2 * stride + 1] = (pp[2] + pp[3] * 2 + pp[3] + 2) >> 2;
|
||||
predictor[2 * stride + 2] =
|
||||
predictor[2 * stride + 3] =
|
||||
predictor[3 * stride + 0] =
|
||||
predictor[3 * stride + 1] =
|
||||
predictor[3 * stride + 2] =
|
||||
predictor[3 * stride + 3] = pp[3];
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and
|
||||
* to the right prediction have filled in pixels to use.
|
||||
*/
|
||||
void vp8mt_intra_prediction_down_copy(VP8D_COMP *pbi, MACROBLOCKD *x, int mb_row, int mb_col)
|
||||
{
|
||||
unsigned char *above_right; /* = *(x->block[0].base_dst) + x->block[0].dst - x->block[0].dst_stride + 16; */
|
||||
unsigned int *src_ptr;
|
||||
unsigned int *dst_ptr0;
|
||||
unsigned int *dst_ptr1;
|
||||
unsigned int *dst_ptr2;
|
||||
int dst_stride = x->dst.y_stride;
|
||||
unsigned char *base_dst = x->dst.y_buffer;
|
||||
|
||||
|
||||
if (pbi->common.filter_level)
|
||||
above_right = pbi->mt_yabove_row[mb_row] + mb_col*16 + 32 +16;
|
||||
else
|
||||
above_right = base_dst + x->block[0].offset - dst_stride + 16;
|
||||
|
||||
src_ptr = (unsigned int *)above_right;
|
||||
/*dst_ptr0 = (unsigned int *)(above_right + 4 * x->block[0].dst_stride);
|
||||
dst_ptr1 = (unsigned int *)(above_right + 8 * x->block[0].dst_stride);
|
||||
dst_ptr2 = (unsigned int *)(above_right + 12 * x->block[0].dst_stride);*/
|
||||
dst_ptr0 = (unsigned int *)(base_dst + x->block[0].offset + 16 + 3 * dst_stride);
|
||||
dst_ptr1 = (unsigned int *)(base_dst + x->block[0].offset + 16 + 7 * dst_stride);
|
||||
dst_ptr2 = (unsigned int *)(base_dst + x->block[0].offset + 16 + 11 * dst_stride);
|
||||
*dst_ptr0 = *src_ptr;
|
||||
*dst_ptr1 = *src_ptr;
|
||||
*dst_ptr2 = *src_ptr;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user