John Koleszar [Wed, 6 Feb 2013 23:54:52 +0000 (15:54 -0800)]
Initial support for resolution changes on P-frames
Allows inter-frames to change resolution. Currently these are
almost equivalent to keyframes, as only intra prediction modes
are allowed, but without the other context resets that occur on
keyframes.
John Koleszar [Wed, 6 Feb 2013 22:22:17 +0000 (14:22 -0800)]
Avoid allocating memory when resizing frames
As long as the new frame is smaller than the size that was originally
allocated, we don't need to free and reallocate the memory allocated.
Instead, do the allocation on the size of the first frame. We could
make this passed in from the application instead, if we wanted to
support external upscaling.
John Koleszar [Wed, 6 Feb 2013 20:44:20 +0000 (12:44 -0800)]
Adds a test for the VP8E_SET_SCALEMODE control
Tests that the external interface to set the internal codec scaling
works as expected. Also updates the test to pull the height from
the decoded frame size rather than parsing the keyframe header,
in anticipation of allowing resolution changes on non-keyframes.
John Koleszar [Fri, 8 Feb 2013 01:00:37 +0000 (17:00 -0800)]
Restore SSSE3 subpixel filters in new convolve framework
This commit adds the 8 tap SSSE3 subpixel filters back into the code
underneath the convolve API. The C code is still called for 4x4
blocks, as well as compound prediction modes. This restores the
encode performance to be within about 8% of the baseline.
John Koleszar [Tue, 29 Jan 2013 00:59:03 +0000 (16:59 -0800)]
Convert subpixel filters to use convolve framework
Update the code to call the new convolution functions to do subpixel
prediction rather than the existing functions. Remove the old C and
assembly code, since it is unused. This causes a 50% performance
reduction on the decoder, but that will be resolved when the asm for
the new functions is available.
There is no consensus for whether 6-tap or 2-tap predictors will be
supported in the final codec, so these filters are implemented in
terms of the 8-tap code, so that quality testing of these modes
can continue. Implementing the lower complexity algorithms is a
simple exercise, should it be necessary.
This code produces slightly better results in the EIGHTTAP_SMOOTH
case, since the filter is now applied in only one direction when
the subpel motion is only in one direction. Like the previous code,
the filtering is skipped entirely on full-pel MVs. This combination
seems to give the best quality gains, but this may be indicative of a
bug in the encoder's filter selection, since the encoder could
achieve the result of skipping the filtering on full-pel by selecting
one of the other filters. This should be revisited.
Quality gains on derf positive on almost all clips. The only clip
that seemed to be hurt at all datarates was football
(-0.115% PSNR average, -0.587% min). Overall averages 0.375% PSNR,
0.347% SSIM.
John Koleszar [Fri, 25 Jan 2013 17:47:09 +0000 (09:47 -0800)]
Add 8-tap generic convolver
This commit introduces a new convolution function which will be used to
replace the existing subpixel interpolation functions. It is much the
same as the existing functions, but allows for changing the filter
kernel on a per-pixel basis, and doesn't bake in knowledge of the
filter to be applied or the size of the resulting block into the
function name.
Replacing the existing subpel filters will come in a later commit.
Ronald S. Bultje [Wed, 30 Jan 2013 05:46:31 +0000 (21:46 -0800)]
Default superblock skip flag to 32x32 for skip-blocks.
This is identical to the later decisions made in encode_superblock().
This commit doesn't actually change anything, but makes the mbmi state
more consistent between the RD loop and the final encode result.
Ronald S. Bultje [Sat, 26 Jan 2013 00:08:19 +0000 (16:08 -0800)]
Fix block pointer corruption in intra8x8 prediction with 4x4 transform.
The RD loop would change the pointer after the first mode (DC) was tested,
leading to corrupt block objects being provided for the others. This
would essentially render the i8x8 predictor useless.
Paul Wilkins [Tue, 29 Jan 2013 13:33:17 +0000 (13:33 +0000)]
Remove eob_max_offset markers.
Remove eob_max_offset markers and replace
with the generic skip_block flag to indicate
to the quantizer that all coeffs to be set to 0
and eob position set to 0;
Paul Wilkins [Thu, 24 Jan 2013 18:28:33 +0000 (18:28 +0000)]
Simplify Zero bin and zero bin run code.
Simplification to eliminate a number of very large data
data structures. All zero run, zbin boosts for different
transform sizes are now limited to a maximum run length
of 15 before they max out the boost.
Some further work still needs be done to refactor, rationalize
and optimize the multiple quantizer functions.
The simplification coupled with tweaks to the 16 element array
now used for all transform sizes, has minimal effect on quality.
Deb Mukherjee [Fri, 25 Jan 2013 19:30:28 +0000 (11:30 -0800)]
Adding a frame parallel decoding mode
Adds a flag to disable features that would inhibit frame parallel
decoding. This includes backward adaptation and MV sorting based
on search in ref frame buffer.
Deb Mukherjee [Tue, 15 Jan 2013 14:43:35 +0000 (06:43 -0800)]
Adds an error-resilient mode with test
Adds an error-resilient mode where frames can be continued
to be decoded even when there are errors (due to network losses)
on a prior frame. Specifically, backward updates are turned off
and probabilities of various symbols are reset to defaults at
the beginning of each frame. Further, the last frame's mvs are
not used for the mv reference list, and the sorting of the
initial list based on search on previous frames is turned off
as well.
Also adds a test where an arbitrary set of frames are skipped
from decoding to simulate errors. The test verifies (1) that if
the error frames are droppable - i.e. frame buffer updates have
been turned off - there are no mismatch errors for the remaining
frames after the error frames; and (2) if the error-frames are non
droppable, there are not only no decoding errors but the mismatch
PSNR between the decoder's version of the post-error frames and the
encoder's version is at least 20 dB.
John Koleszar [Fri, 18 Jan 2013 19:51:12 +0000 (11:51 -0800)]
Support multiple codecs in test infrastructure
This commit starts to convert the tests to a system where the codec
to be used is provided by a factory object. Currently no tests are
instantiated for VP9 since they all fail for various reasons, but it
was verified that they're called and the correct codec is
instantiated.
John Koleszar [Tue, 22 Jan 2013 16:31:55 +0000 (08:31 -0800)]
Merge changes Ia82cef79,I7324a75a,I7b66daad,I73344451,I91dc210f,I5945b5ce into experimental
* changes:
Use alt-ref frame context for keyframes
Preserve the previous golden frame on golden updates
Generalize and increase frame coding contexts
Start to anonymize reference frames
Update encoder to use fb_idx_ref_cnt
Remove buffer-to-buffer copy logic
John Koleszar [Fri, 18 Jan 2013 22:35:20 +0000 (14:35 -0800)]
Use alt-ref frame context for keyframes
This matches the behavior prior to generalizing the frame context
selection, and intuitively makes sense in that the first forward ref
is immediately after the keyframe, so it's quality is improved a bit
by using the keyframe's entropy context rather than the default.
Yaowu Xu [Thu, 17 Jan 2013 21:26:24 +0000 (13:26 -0800)]
a minor change to a portion of loop filtering
The loop filtering used for MB edge or internal edge of a MB using 8x8
tranform was reading 5 pixel each side and writting 3 pixel each side.
With suggestion from Aki and Scott on hardware&software performance,
this commit changed to read 4 pixel each side and write 3 pixel each
side.
John Koleszar [Wed, 16 Jan 2013 20:19:42 +0000 (12:19 -0800)]
Preserve the previous golden frame on golden updates
This commit restores the quality lost when the buffer-to-buffer copy
logic was removed. Note that this is specific to the current use of
golden frames and will need rework when RTC functionality is added.
John Koleszar [Tue, 15 Jan 2013 23:57:11 +0000 (15:57 -0800)]
Generalize and increase frame coding contexts
Previously there were two frame coding contexts tracked, one for normal
frames and one for alt-ref frames. Generalize this by signalling the
context to use in the bitstream, rather than tieing it to the alt ref
refresh bit. Also increase the number of contexts available to 4, which
may be useful for temporal scalability.
John Koleszar [Tue, 15 Jan 2013 21:49:44 +0000 (13:49 -0800)]
Start to anonymize reference frames
Remove lst_fb_idx, gld_fb_idx, alt_fb_idx, refresh_last_frame,
refresh_golden_frame, refresh_alt_ref_frame from common. Gold/Alt are
encode side conventions. From the decoder's perspective, we want to be
dealing with numbered references.
Updates to active_ref 2 signal mode context switches, vestigial from
refresh_alt_ref_frame. This needs some clean up to make sense with
increased numbers of reference frames, as well as reimplementing the
swapping of alt/golden which was previously done using the
buffer-to-buffer copy mechanism removed in an earlier commit.
John Koleszar [Mon, 14 Jan 2013 22:44:39 +0000 (14:44 -0800)]
Remove buffer-to-buffer copy logic
This is the first in a series of commits to add additional reference
frames to the codec. Each frame will be able to update any of the
available references, but copying between references is not
supported.
John Koleszar [Mon, 14 Jan 2013 19:49:30 +0000 (11:49 -0800)]
Use INT64_MAX instead of LLONG_MAX
These variables have the type int64_t, not long long. long long could
be a larger type than 64 bits. Emulate INT64_MAX for older versions of
MSVC, and remove the unreferenced vpx_ports/vpxtypes.h
Yaowu Xu [Mon, 14 Jan 2013 17:28:35 +0000 (09:28 -0800)]
changed UV plane loop filtering for TX_8X8
In commit 9a1d73d, loop filtering was added for UV 4x4 boundaries
when TX_8X8 is used by a MB. This commit further refined the decision
to be based on the actual transform used for the UV planes. When
UV planes use 4x4 transform, i.e. when prediction mode used is either
I8X8_PRED or SPLITMV, UV planes are filtered on 4x4 boundaries, and no
filtering is applied on 4x4 block boundaries when UV planes use 8X8
transform.
Ronald S. Bultje [Mon, 14 Jan 2013 20:43:12 +0000 (12:43 -0800)]
Reset x->skip for each iteration in the RD loop.
This prevents ill-defined behaviour, such as setting x->skip for a mode
that is excluded because of frame-level flags (e.g. filter selection,
compound prediction selection), then not breaking out of the RD loop
because the mode is not allowed, but keeping the flag on. Whatever mode
is iterated through next in the RD loop will then carry this flag, and
all sort of bad stuff happens, such as x->skip being set on intra pred
modes.
Deb Mukherjee [Wed, 9 Jan 2013 14:26:54 +0000 (06:26 -0800)]
Further enhancements/fixes on dct/dwt hybrid txfm
Fixes some scaling issues. Adds an option to only compute the
dct on the low-low subband for 32x32 and 64x64 blocks using
only a single 16x16 dct after 1 and 2 wavelet decomposition
levels respectively. Also adds an option to use a 8x8 dct
as building block.
Currenlty with the 2/6 filter and with a single 16x16 dct on
the low low band, the reuslts compared to full 32x32 dct is
as follows:
derf: -0.15%
yt: -0.29%
std-hd: -0.18%
hd: -0.6%
These are my current recommended settings, since the 2/6 filter
is very simple.
Scott LaVarnway [Sat, 12 Jan 2013 01:11:04 +0000 (17:11 -0800)]
WIP: Added sse2 version of vp9_mb_lpf_horizontal_edge_w
and vp9_mb_lpf_vertical_edge_w_sse2. This was quickly done so we can
run some tests over the weekend. Future commits will optimize/refactor these
functions further.
The decoder performance improved by ~17% for the clip used.
Adrian Grange [Tue, 8 Jan 2013 22:14:01 +0000 (14:14 -0800)]
New prediction filter
This patch removes the old pred-filter experiment and replaces it
with one that is implemented using the switchable filter framework.
If the pred-filter experiment is enabled, three interopolation
filters are tested during mode selection; the standard 8-tap
interpolation filter, a sharp 8-tap filter and a (new) 8-tap
smoothing filter.
The 6-tap filter code has been preserved for now and if the
enable-6tap experiment is enabled (in addition to the pred-filter
experiment) the original 6-tap filter replaces the new 8-tap smooth
filter in the switchable mode.
The new experiment applies the prediction filter in cases of a
fractional-pel motion vector. Future patches will apply the filter
where the mv is pel-aligned and also to intra predicted blocks.
Deb Mukherjee [Tue, 8 Jan 2013 20:18:16 +0000 (12:18 -0800)]
Adds 64x64 hybrid dct/dwt transform
This is to add to the 64x64 transform experiment as an alternative to
a 64x64 DCT.
Two levels of wavelet decomposition is used on a 64x64 block, followed
by 16x16 DCT on the four lowest subbands. The highest three subbands
are left untransformed after the first level DWT.
Yaowu Xu [Wed, 19 Dec 2012 19:34:49 +0000 (11:34 -0800)]
minor loop filter refactoring and cleanup
This commit did a couple of minor cleanup/refactoring to prepare for
futher loop filter experiments. It merged y_only version of loop filter
function into the regular one, which makes sure that same logic is used
for functions for picking level and for actual loop filtering.
Paul Wilkins [Thu, 3 Jan 2013 15:14:36 +0000 (15:14 +0000)]
Further change to mv reference search.
This experimental change reorders the search so
that all possible references that match the target
reference frame are tested first and these in order
of distance from the current block. These will usually
be the highest scoring candidates.
If we do not find enough good candidates this way
we try non matching cases. These will usually be lower
scoring candidates.
The change in order together with breakouts when
we have found enough candidates should reduce
the computational cost and especially reduce the number
of sort operations.
Quality Results:
Std Hd +0.228%, Hd +0.074%, YT +0.046%, derf +0.137%
This effect is probably due to the fact that more distant
weak candidates are now less likely to get "promoted" over
near candidates even if they are repeated.