Tom Finegan [Wed, 16 Jun 2010 17:24:55 +0000 (13:24 -0400)]
Avoid encoding garbage when ivfenc encounters an unsupported Y4M file.
This change stops ivfenc from treating unsupported Y4M files as raw
input.
For example, if given an interlaced Y4M file, ivfenc treated the input
as if it were raw data because the unsupported Y4M file case previously
fell through without being handled.
James Zern [Fri, 4 Jun 2010 22:05:12 +0000 (18:05 -0400)]
VisualStudio projects: asm tool updates
vs8
- pull yasm.rules [1] into the source tree to avoid need to install
file into VC/VCProjectDefaults
- reference same w/ToolFile & RelativePath
- update arm branch to match
John Koleszar [Mon, 14 Jun 2010 12:33:54 +0000 (08:33 -0400)]
ivfenc: fix two-pass support of raw files
Commit 3245d46 "ivfenc: support reading/writing from a pipe" broke
support for two pass encodes of raw files when done in two
invocations of ivfenc. The raw image was only set up on pass 0,
which was never hit when running with --pass=2 --passes=2.
John Koleszar [Sat, 12 Jun 2010 18:11:51 +0000 (14:11 -0400)]
Make this/next iiratio unsigned.
This patch addresses issue #79, which is a regression since commit 28de670 "Fix RD bug." If the coded error value is zero, the iiratio
calculation effectively multiplies by 1000000 by the
DOUBLE_DIVIDE_CHECK macro. This can result in a value larger than
INT_MAX, giving a negative ratio. Since the error values are
conceptually unsigned (though they're stored in a double) this patch
makes the iiratio values unsigned, which allows the clamping to work
as expected.
John Koleszar [Fri, 11 Jun 2010 17:05:08 +0000 (13:05 -0400)]
require --enable-psnr to build ssim
ssim.c comiles in a huge (512M) amount of global scratch space. Allocating
this data on the heap would be a better solution, but this file doesn't
need to be built at all in most cases, so as a first pass, disable it
except when doing opsnr.stt output (--enable-psnr).
John Koleszar [Thu, 10 Jun 2010 12:56:31 +0000 (08:56 -0400)]
replace while(0) construct with if/else
No good reason to be tricky here. I don't know why 'break' occurred to me
as the natrual replacement for the 'return', but an if/else block is
definitely clearer.
The new scheme introduced in I68d35a2f did not clamp chroma MVs in the SPLITMV
case, and clamped them incorrectly (to the luma plane bounds) in every other
case.
Because chroma MVs are computed from the luma MVs before clamping occurs, they
could still point outside of the frame buffer and cause crashes.
This clamping happens outside of the MV prediction loop, and so should not
affect bitstream decoding.
Yunqing Wang [Thu, 10 Jun 2010 15:48:48 +0000 (11:48 -0400)]
Improve vp8_sixtap_predict functions
Restructure vp8_sixtap_predict functions to eliminate extra 5-line
calculation while doing first-pass only. Also, combline functions
to eliminate usage of intermediate buffer. This gives decoder a 3%
performance gain on my test clips.
Using uname fails e.g. on a 64-bit machine with a 32-bit toolchain.
The following gcc -dumpmachine strings have been verified:
* 32-bit Linux gives i486-linux-gnu
* 64-bit Linux gives x86_64-linux-gnu
* Mac OS X 10.5 gives i686-apple-darwin9
* MinGW gives mingw32
*darwin8* and *bsd* can safely be assumed to be correct, but *cygwin*
is a guess.
John Koleszar [Wed, 9 Jun 2010 15:29:20 +0000 (11:29 -0400)]
Remove secondary mv clamping from decode stage
This patch removes the secondary MV clamping from the MV decoder. This
behavior was consistent with limits placed on non-split MVs by the
reference encoder, but was inconsistent with the MVs generated in the
split case.
The purpose of this secondary clamping was only to prevent crashes on
invalid data. It was not intended to be a behaviour an encoder could or
should rely on. Instead of doing additional clamping in a way that
changes the entropy context, the secondary clamp is removed and the
border handling is made implmentation specific. With respect to the
spec, the border is treated as essentially infinite, limited only by
the clamping performed on the near/nearest reference and the maximum
encodable magnitude of the residual MV.
This does not affect any currently produced streams.
John Koleszar [Thu, 3 Jun 2010 14:29:04 +0000 (10:29 -0400)]
shared library support (.so)
This patch adds support for building shared libraries when configured
with the --enable-shared switch.
Building DLLs would require more invasive changes to the sample
utilities than I want to make in this patch, since on Windows you can't
use the address of an imported symbol in a static initializer. The best
way to work around this is proably to build the codec interface mapping
table with an init() function, but dll support is of questionable value
anyway, since most windows users will probably use a media framework
lib like webmdshow, which links this library in staticly.
Add support for reading YUV4MPEG2 files to ivfenc.
A large collection of example files may be found at
http://media.xiph.org/video/derf/
This also fixes a bug in ivfenc for uncompressed IVF input, which previously
appeared not to skip past the file header the second time it opened the file.
I don't actually have an IVF file with which to test this fix, however.
Yunqing Wang [Fri, 28 May 2010 18:34:39 +0000 (14:34 -0400)]
Remove costly memory reads/writes in vp8_reset_mb_tokens_context()
Tests on x86 showed this function costed 2.7% of total decoding time
because of all the memory reads/writes. After modification, it only
costs about 0.7% of decoding time, which gives a 2% gain.
John Koleszar [Fri, 28 May 2010 14:11:58 +0000 (10:11 -0400)]
configure: update script headers
The libvpx build system was influenced by the clever design of the
FFmpeg configure script. Say so in the script header, and provide a
little introduction.
Yaowu Xu [Thu, 27 May 2010 17:04:36 +0000 (10:04 -0700)]
Increase the size of output packet list
This is to accommodate output packets for both compressed
data and psnr stats. For each frame, there are at least
one packet for compressed data and one for psnr stats. For
a max lag of 25, 64 is large enough to cover all lagged
frames at the end of encoding.
John Koleszar [Wed, 26 May 2010 19:57:42 +0000 (15:57 -0400)]
configure: support --prefix, --libdir
Support --prefix, --libdir as a conventional way of specifying the default
installation directories. libdir is required to be a subdirectory of prefix
at this time.
John Koleszar [Tue, 25 May 2010 12:33:57 +0000 (08:33 -0400)]
examples: use I420 input for encoders
The output of simple_decoder, as well as the default format for the
ivf{enc,dec} tools, is I420. The encoder examples are changed to default
to I420 as well. This is desirable because passing the output of
simple_encoder to simple_decoder would otherwise have the chroma planes
flipped, which is unexpected.
John Koleszar [Mon, 24 May 2010 15:39:59 +0000 (11:39 -0400)]
install includes in DIST_DIR/include/vpx, move vpx_codec/ to vpx/
This renames the vpx_codec/ directory to vpx/, to allow applications
to more consistently reference these includes with the vpx/ prefix.
This allows the includes to be installed in /usr/local/include/vpx
rather than polluting the system includes directory with an
excessive number of includes.
John Koleszar [Mon, 24 May 2010 14:16:44 +0000 (10:16 -0400)]
make: make install target behave as expected
Split the 'make install' target into two: install and dist. dist
retains the old make install behavior of building a "distribution"
release, with source files, build system, etc. install does what
one one expects -- installs into a tree in the filesystem, /usr/local
by default.
John Koleszar [Mon, 24 May 2010 15:55:17 +0000 (11:55 -0400)]
configure: support --enable-pic for generic-gnu
Allows the default generic-gnu target, which is selected if no
target is specified, to be build in PIC mode. The generic-gnu target
was not being selected as a gcc target, because it doesn't end in
gcc.
Yaowu Xu [Wed, 19 May 2010 22:48:00 +0000 (15:48 -0700)]
Fixed an encoder debug/relese mismatch in x86_64-win64-vs8
Visual c++ compiler uses xmm registers for floating point
operations for 64 bit architecture, therefore its calling
convention requires the preservation of xmm6-xmm15 in any
function that have used these registers. However, the sse2
functions, that were originally written for 32 bit windows,
may have used xmm6 and xmm7 without preserving the content.
In this particular case, the compiler used xmm6 to save
the variable "two_pass_min_rate", the value of the variable
is mucked up by our sse2 optimized loop filter functions,
hence the results of release/debug mismatching.