John Koleszar [Fri, 19 Aug 2011 18:06:00 +0000 (14:06 -0400)]
New RTCD implementation
This is a proof of concept RTCD implementation to replace the current
system of nested includes, prototypes, INVOKE macros, etc. Currently
only the decoder specific functions are implemented in the new system.
Additional functions will be added in subsequent commits.
Overview:
RTCD "functions" are implemented as either a global function pointer
or a macro (when only one eligible specialization available).
Functions which have RTCD specializations are listed using a simple
DSL identifying the function's base name, its prototype, and the
architecture extensions that specializations are available for.
Advantages over the old system:
- No INVOKE macros. A call to an RTCD function looks like an ordinary
function call.
- No need to pass vtables around.
- If there is only one eligible function to call, the function is
called directly, rather than indirecting through a function pointer.
- Supports the notion of "required" extensions, so in combination with
the above, on x86_64 if the best function available is sse2 or lower
it will be called directly, since all x86_64 platforms implement
sse2.
- Elides all references to functions which will never be called, which
could reduce binary size. For example if sse2 is required and there
are both mmx and sse2 implementations of a certain function, the
code will have no link time references to the mmx code.
- Significantly easier to add a new function, just one file to edit.
Disadvantages:
- Requires global writable data (though this is not a new requirement)
- 1 new generated source file.
John Koleszar [Fri, 27 Jan 2012 18:13:20 +0000 (10:13 -0800)]
Hook up VP8D_GET_LAST_REF_USED
Commit 892e23a5b introduced support for the VP8D_GET_LAST_REF_USED,
but missed the mapping of the control id to the underlying function,
so it was unavailable to applications.
In addition, the underlying function vp8_references_buffer() is
moved from common/postproc.c to decoder/onyxd_if.c as postproc.c is
not built in all configurations.
John Koleszar [Wed, 25 Jan 2012 22:55:49 +0000 (14:55 -0800)]
Correct clamping in use of vp8_find_near_mvs()
Commit e06c242ba introduced a change to call vp8_find_near_mvs() only
once instead of once per reference frame by observing that the only
effect that the frame had was on the bias applied to the motion
vector. By keeping track of the sign_bias value, the mv to use could
be flip-flopped by multiplying its components by -1.
This behavior was subtley wrong in the case when clamping was applied
to the motion vectors found by vp8_find_near_mvs(). A motion vector
could be in-bounds with one sign bias, but out of bounds after
inverting the sign, or vice versa. The clamping must match that done
by the decoder.
This change modifies vp8_find_near_mvs() to remove the clamping from
that function. The vp8_pick_inter_mode() and vp8_rd_pick_inter_mode()
functions instead track the correctly clamped values for both bias
values, switching between them by simple assignment. The common
clamping and inversion code is in vp8_find_near_mvs_bias()
John Koleszar [Tue, 24 Jan 2012 23:32:08 +0000 (15:32 -0800)]
Revert "Multithreaded encoder, late sync loopfilter"
This commit is incomplete, as it does not synchronize the loop filter
before returning a handle to the reconstructed frame in
vpx_codec_get_preview_frame(), which can cause (false?) failures
when running the test_reconstruct_buffer test.
This may be related to a bug that does cause visible artifacts, which
is also under investigation.
Fritz Koenig [Thu, 19 Jan 2012 23:18:31 +0000 (15:18 -0800)]
Disconnect ARM tgt_isa from dsp extensions
A processor with ARMv7 instructions does not
necessarily have NEON dsp extensions. This CL
has the added side effect of allowing the ability
to enable/disable the dsp extensions cleanly.
Deb Mukherjee [Fri, 20 Jan 2012 03:06:55 +0000 (19:06 -0800)]
Overhauling the thresholds and mixing proportions for mfqe postprocessor.
Makes the thresholds for the multiframe quality enhancement module
depend on the difference between the base quantizers. Also modifies
the mixing function to weigh the current low quality frame less if
the difference in quantizer is large. With the above modifications
mfqe works well for both scalable patterns as well as low quality
key frames.
Fritz Koenig [Fri, 6 Jan 2012 19:50:05 +0000 (11:50 -0800)]
Add makefile for building libvpx for Android.
Android.mk file for using the Android NDK build
system to compile. Adds option for SDK path to
use the compiler that comes with android for testing
compiler compliance.
Deb Mukherjee [Wed, 18 Jan 2012 17:15:24 +0000 (09:15 -0800)]
Merge "Modifying the base q propagation in the mfqe post processing filter in a way such that when there is a single bad frame, the post-processing is applied not only to just that frame but a few subsequent frames as well."
Deb Mukherjee [Tue, 17 Jan 2012 17:23:28 +0000 (09:23 -0800)]
Modifying the base q propagation in the mfqe post processing
filter in a way such that when there is a single bad frame, the
post-processing is applied not only to just that frame but a
few subsequent frames as well.
Adrian Grange [Fri, 13 Jan 2012 22:09:40 +0000 (14:09 -0800)]
Fixed bugs in multi-layer code related to changing params
When running multi-layer (ML) encodes and dynamically
changing coding parameters on the fly (e.g. frame
duration/rate, bandwidths allocated to each layer)
the encoder would not produce sensible output.
In certain cases the rate targeting would be
hideously inaccurate.
These fixes make it possible to change these coding
parameters correctly and to maintain accurate control
of the rate targeting.
I also added the specification of the input timebase
into the test program, vp8_scalable_patterns.c.
Patch 2: Moved declaration to appease MS compiler)
Deb Mukherjee [Tue, 10 Jan 2012 00:48:45 +0000 (16:48 -0800)]
Allowing the mfqe post-processing filter to be used in conjunction
with deblock or demacroblock filters. When --mfqe is used together
with --demacroblock or --deblock, mfqe is applied first and then
demacroblock/deblock is applied to the mfqe result.
Fritz Koenig [Mon, 9 Jan 2012 19:42:30 +0000 (11:42 -0800)]
Remove armv4 optimized scaler code.
Code was from a time when the compiler was
not good at optimizing. Compilers are better
and instruction sets have increased to make
this code obsolete.
Ralph Giles [Thu, 5 Jan 2012 16:39:38 +0000 (10:39 -0600)]
Reduce the default kf_max_dist to 128.
The default maximum keyframe interval is 9999, or over five minutes
at normal video rates. When the encoder produces streams with such
a long interval seeking (with correct output) is more expensive,
and live streaming is impossible.
Of course the encoding application should set this parameter
based on its knowledge of the intended use of the stream, but
reducing the default gives better results for applications
which do not.
Scott LaVarnway [Wed, 4 Jan 2012 16:56:50 +0000 (11:56 -0500)]
Reduced the size of Y1Dequant and friends to [128][2]
This patch removes the local copies of the dequantize
constants and implements John's idea as described
in "Make a local copy of the dequantized data" commit.
Deb Mukherjee [Tue, 20 Dec 2011 22:50:31 +0000 (14:50 -0800)]
Multiframe quality enhancement postprocessing
Adds a multiframe postprocessing module to enhance the quality of
certain frames that are coded at lower quality than preceding frames.
The module can be invoked from the commandline by use of the --mfqe
option, and will be most beneficial for enhancing the quality of
frames decoded using scalable patterns.
Uses the vp8_variance_var16x16 and vp8_variance_sad16x16 function
pointers to compute SAD and Variance of blocks.
John Koleszar [Thu, 22 Dec 2011 00:11:31 +0000 (16:11 -0800)]
Remove unnecessary ternary constructs
The code had a number of constructs like (condition)?1:0,
which is redundant with C's semantics. In the cases where a boolean
operator was used in the condition, simply remove the ternary part.
Otherwise adjust the surrounding expression to remove the condition
(eg, for rounding up. See pickinter.c and rdopt.c)
John Koleszar [Mon, 19 Dec 2011 21:51:11 +0000 (13:51 -0800)]
remove armv6 files from armv5 build
Make bilinearfilter_arm.c compiled only when HAVE_ARMV6, as its definitions
are v6 only. This is normally not a problem for static builds as the file
is elided at link time, but this was not being done properly for the
--enable-shared --enable-pic build.
Yunqing Wang [Fri, 16 Dec 2011 21:50:29 +0000 (16:50 -0500)]
Merge mr_pick_inter_mode and pick_inter_mode
Merged multi-resolution motion estimation with regular motion
estimation function in order to remove duplicated part. This
caused slight changes in multi-resulotion encoder quality &
performance.
John Koleszar [Fri, 16 Dec 2011 19:26:53 +0000 (11:26 -0800)]
Avoid heap allocation of firstpass stats
The total_stats, this_frame_stats, and total_left_stats structures
were previously create by a heap allocation, despite being of fixed
size. These structures were allocated and deallocated during
{de,}allocate_compressor_data, which is reinvoked whenever the frame
size changes. Unfortunately, this clobbers the total_stats and
total_left_stats data.
Historically, these were variable size at one time, due to the first
pass motion map, which necessitated their being created by a unique
heap allocation. However, this bug with the total_stats being
clobbered has probably been present since that initial implementation.
These structures are instead moved to be stored within the struct
twopass_rc directly, rather than being heap allocated separately.
Scott LaVarnway [Fri, 16 Dec 2011 18:48:01 +0000 (13:48 -0500)]
Fixed mb_skip_coeff bug
When mb_skip_coeff is set, the idct is not necessary. Prior
to this patch, the code would call idcts based on leftover
eob information. This patch will now skip the idct for
SPLIT_MV and clear out the eobs for B_PRED, forcing the idct
to be skipped.
Scott LaVarnway [Thu, 15 Dec 2011 19:23:36 +0000 (14:23 -0500)]
Moved dequant idct into common
These functions are now used by the encoder.
This is WIP with the goal of creating a common idct/add for
the encoder and decoder. A boost of 1.8% was seen for
the HD rt test clip used.
Yunqing Wang [Wed, 14 Dec 2011 20:35:04 +0000 (15:35 -0500)]
Only call vp8_find_near_mvs() once for each macroblock
While doing motion search on a macroblock, we usually call
vp8_find_near_mvs once per reference frame. Actually, for
different reference frames, the only difference in calculating
these near_mvs is they may have different sign_bias, which
causes a sign change in resulting near_mvs. In this change, we
only do find_near_mvs for the first reference frame. For other
reference frames, only need to adjust the near_mvs according to
that reference frame's sign_bias value.