John Koleszar [Thu, 19 Apr 2012 17:00:33 +0000 (10:00 -0700)]
multi-res: restore v1.0.0 API
Move the notion of 0 bitrate implying skip deeper into the codec,
rather than doing it at the multi-encoder API level. This preserves
v1.0.0 ABI compatibility, rather than forcing a bump to v2.0.0 over a
minor change. Also, this allows the case where the application can
selectively enable and disable the larger resolution(s) without having
to reinitialize the codec instace (for instance, if no target is
receiving the full resolution stream).
It's not clear how deep to push this check. It may be valuable to
allow the framerate adaptation code to run, for example. Currently put
the check as early as possible for simplicity, should reevaluate this
as this feature gains real use.
Adrian Grange [Fri, 27 Apr 2012 16:01:17 +0000 (09:01 -0700)]
Modified ARNR MC-filter to ignore ARF frame
The ARNR filter uses MC to find the best match between the
ARF and other nearby frames in the filter-set. Since the
ARF is a member of the filter-set, MC in that case is
unnecesssary. This patch modifies the filter so it does
not apply MC in this case.
Adrian Grange [Thu, 26 Apr 2012 22:41:38 +0000 (15:41 -0700)]
Removed MV costing from ARNR filtering
The ARNR filter uses a motion compensated temporal filter,
but the motion estimation implementation accounts for the
cost of the mv in its decision making process. The ARNR
filter uses a dummy cost table initialized to 0 as a way
to ignore the mv costs (which are irrelevant to the filter).
This CL modifies the ARNR filter implementation so that
the mv costing is ignored without the requirement for
dummy tables.
Attila Nagy [Tue, 24 Apr 2012 12:33:44 +0000 (15:33 +0300)]
Moves error concealment allocations from common parts to decoder
The backup MODE_INFO buffer used in the error concealment was
allocated in the codec common parts allocation even though this is a
decoder only resource. Moved the allocation to the decoder side.
No need to update_mode_info_border as mode_info buffers are zero
allocated.
This fixes also a potential memory leak as the EC overlaps buffer was not
properly released before reallocation after a frame size change.
Attila Nagy [Tue, 17 Apr 2012 07:40:56 +0000 (10:40 +0300)]
Shares one set of RD costs tables between all encoding threads
RD costs were local to MACROBLOCK data and had to be copied all the
time to each thread's MACROBLOCK data. Tables moved to a common place
and only pointers are setup for each encoding thread.
vp8_cost_tokens() generates 'int' costs so changed all types to be
int (i.e. removed unsigned).
NOTE: Could do some more cleaning in vp8cx_init_mbrthread_data().
Attila Nagy [Mon, 23 Apr 2012 12:20:07 +0000 (15:20 +0300)]
Optimizes precalculated decoder block ptrs&offs
The block pointers and offset do not need to be calculated for every
frame. Block internal predictors can be update once when decoder is
allocated. Destination and previous buffer offsets have to be updated
just when frame size is changing.
Attila Nagy [Mon, 23 Apr 2012 09:53:30 +0000 (12:53 +0300)]
Removes duplication of key frame mode probabilities
Key frame macrobock and block mode probabilities are constant.
Remove the allocation of tables for each codec instance and use
instead the default const prob tables.
Scott LaVarnway [Thu, 19 Apr 2012 21:35:20 +0000 (17:35 -0400)]
Makes all mode token tables const part 2
(see Change I9b2ccc88: Makes all mode token tables const)
Further remove runtime table initialization and use
precalculated const data. Data footprint reduced
by 4112 bytes.
Attila Nagy [Wed, 11 Apr 2012 12:20:13 +0000 (15:20 +0300)]
Fix vpx_rtcd.h dependency in Android.mk
Failed to build on Linux (as described in Android.mk) with NDK r7b.
Set vpx_rtcd.h dependency after libvpx sources are added to
LOCAL_SRC_FILES so that vpx_rtcd.h is generated before any libvpx file
is touched.
Deb Mukherjee [Tue, 3 Apr 2012 21:02:58 +0000 (14:02 -0700)]
Fixes to disable MFQE when there is motion.
This patch includes:
1. fixes to disable block based termporal mixing when motion
is detected (because this version of mfqe only handles zero motion).
2. The criterion used for determining whether to mix or
not are changed to use squared differences rather than
absolute differences.
3. Additional checks on color mismatch and excessive block
flatness added. If the block as decoded has very low activity
it is unlikely to yield benefits for mixing.
John Koleszar [Fri, 30 Mar 2012 18:34:36 +0000 (11:34 -0700)]
MFQE: apply threshold to subblocks and chroma.
In cases where you have a flat background occluded by a moving object
of similar luminosity in the foreground, it was likely that the
foreground blocks would persist for a few frames after the background
is uncovered. This is particularly noticable when the object has a
different color than the background, so add the chroma planes in as an
additional check.
In addition, for block sizes of 8 and 16, the luma threshold is
applied on four subblocks independently, which helps when only part of
the background in the block has been uncovered.
This fixes issue #392, which includes a test clip to reproduce the
issue.
Johann [Mon, 2 Apr 2012 22:08:18 +0000 (15:08 -0700)]
Allow disabling disabled codecs
When using 'make dist' after --disable-vp8[encoder|decoder] it would
fail to recognize the option. This would only occur when also specifying
--enable-install-docs and --enable-install-srcs but not
--enable-codec-srcs
Including vpx/ fixes builds with --enable-codec-srcs
James Zern [Fri, 30 Mar 2012 01:13:27 +0000 (18:13 -0700)]
tools/wrap-commit-msg.py: fix file truncation
truncate() operates from the current file pointer position. On at least
Linux specifying 0 without resetting the pointer will pad the file with
zeros to the current offset.
John Koleszar [Wed, 28 Mar 2012 23:41:16 +0000 (16:41 -0700)]
FTFY: support wordwrapping commit messages
It's common for commit messages to be wrapped at odd places. git-gui
is often to blame. Adds support for automatically fixing up these
messages if running ftfy --amend, and adds a new option --msg-only for
fixing only the commit message.
Scott LaVarnway [Fri, 23 Mar 2012 20:55:22 +0000 (16:55 -0400)]
MB_MODE_INFO size reduction
Reduced the size of the struct by 8 bytes, which would be
a memory savings of 64800 bytes for 1080 resolutions. Had
an extra byte, so created an is_4x4 for B_PRED or SPLITMV
modes. This simplified the mode checks in
vp8_reset_mb_tokens_context and vp8_decode_mb_tokens.
John Koleszar [Tue, 27 Mar 2012 23:28:41 +0000 (16:28 -0700)]
FTFY: an automated style corrector
This is a utility for applying a limited amount of style correction on
a change-by-change basis. Rather than a big-bang reformatting, this
tool attempts to only correct the style in diff hunks that you touch.
This should make the cosmetic changes small enough that we can mix them
with functional changes without destroying the diffs, and there's an
escape hatch for separating the reformatting to a second commit for
purists and cases where it hurts readability.
At this time, the script requires a clean working tree, so run it after
you've commited your changes. Run without arguments, the style
corrections will be applied and left unstaged in your working copy. It
also supports the --amend option, which will automatically amend your
HEAD with the corrected style, and --commit, which will create a new
change dependent on your HEAD that contains only the whitespace changes.
There are a number of ways this could be applied in an automated manner
if this proves to be useful, either on a project-wide or per-user
basis. This doesn't buy anything in terms of real code quality, the
intent here would be to keep formatting nits out of review comments in
favor of more meaningful ones and help people whose habitual style
doesn't match the baseline.
Requires astyle[1] 1.24 or newer.
[1]: http://astyle.sourceforge.net/
Scott LaVarnway [Fri, 23 Mar 2012 19:50:08 +0000 (15:50 -0400)]
New vp8_decode_mb_tokens()
This new vp8_decode_mb_tokens() uses a modified version of
WebP's GetCoeffs function. For now, the dequant does not
occur in GetCoeffs.
Tests showed performance improvements up to 2.5% depending
on material.
Deb Mukherjee [Thu, 22 Mar 2012 16:13:18 +0000 (09:13 -0700)]
Miscellaneous changes in mfqe and postproc modules
Adds logic to disable mfqe for the first frame after a configuration
change such as change in resolution. Also adds some missing
if CONFIG_POSTPROC macro checks.
Yunqing Wang [Wed, 14 Mar 2012 14:03:39 +0000 (10:03 -0400)]
Add motion search skipping in first pass
This change added a motion search skipping mechanism similar
to what we did in second pass. For a macroblock that is very
similar to the macroblock at same location on last frame,
we can set its mv to be zero, and skip motion search. This
improves first-pass performance for slide shows and video
conferencing clips with a slight PSNR loss.
John Koleszar [Tue, 21 Feb 2012 22:41:39 +0000 (14:41 -0800)]
Update XCode SDK search paths
Newer XCodes have moved the SDK path from /Developer/SDKs
Use a suggestion from jorgenisaksson@gmail.com to locate it
osx_sdk_dir is not required to be set. Apple now offers a set
command line tools which do not require this. isysroot is also
not required in newer versions of XCode so only set it when we
are confident in the location.
There remain issues with the iOS configure steps which will be
addressed later
James Zern [Thu, 15 Mar 2012 23:51:51 +0000 (16:51 -0700)]
doxy: fix conditional usage, ref warnings
doxygen < 1.7.? seems to have been more tolerant of single line
\if/\endif
This change fixes warnings such as:
mainpage.dox:13: warning: unable to resolve reference to `vp8_encoder-'
for \ref command
vpx_decoder.h:193: warning: explicit link request to 'n' could not be
resolved
Johann [Fri, 27 Jan 2012 18:23:52 +0000 (10:23 -0800)]
RFC: Reorganize MFQE loops
Break MFQE code into it's own file.
It is currently only valid for 16x16 and 8x8 Y blocks. It also filters
4x4 U/V blocks.
Refactor filtering and add associated assembly. Limited test cases show
--mfqe introduces a penalty of ~20% with HD content. The assembly
reduces the penalty to ~15%
Johann [Tue, 6 Mar 2012 00:36:23 +0000 (16:36 -0800)]
include CHANGELOG in CODEC_SRCS
build/make/version.sh requires CHANGELOG to generate vpx_version.h
The file is already included when building the documentation. However,
documentation is not build if doxygen/php are not present.
This is necessary when using '--enable-install-srcs --enable-codec-srcs'
and 'make dist'
Johann [Fri, 2 Mar 2012 00:12:53 +0000 (16:12 -0800)]
Fix encoder debug setting
Propagate debug setting to the EBML struct. When writing the application
name, this allows us to strip the version code and keep the output
metadata static.
Yunqing Wang [Wed, 29 Feb 2012 13:24:53 +0000 (08:24 -0500)]
vpxenc: fix time and fps calculation in 2-pass encoding
When we do 2-pass encoding, elapsed time is accumulated through
whole 2-pass process, which gives incorrect time and fps results
for second pass. This change fixed that by resetting the time
accumulator for second pass.
Attila Nagy [Thu, 9 Feb 2012 10:37:03 +0000 (12:37 +0200)]
Packing bitstream on-the-fly with delayed context updates
Produce the token partitions on-the-fly, while processing each MB.
Context is updated at the beginning of each frame based on the
previoud frame's counters. Optimally encoder outputs partitions in
separate buffers. For frame based output, partitions are concatenated
internally.
Limitations:
- enabled just in combination with realtime-only mode
- number of encoding threads has to be equal or less than the
number of token partitions. For this reason, by default the encoder
will do 8 token partitions.
- vpxenc supports partition output (-P) just in combination with
IVF output format (--ivf)
Performance:
- Realtime encoder can be up to 13% faster (ARM) depending on the number
of threads and bitrate settings. Constant gain over the 5-16 speed
range.
- Token buffer reduced from one frame to 8 MBs
Quality:
- quality is affected by the delayed context updates. This again
dependents on input material, speed and bitrate settings. For VC
style input the loss seen is up to 0.2dB. If error-resilient=2
mode is used than the effect of this change is negligible.