the vpx_decoder layer guarantees that when called directly this won't
receive NULL data and the reuse via decode() is protected by a NULL data
check and 0 size check (NULL data and non-zero data size is protected by
the vpx_decoder layer).
Change-Id: I7437fb5ca4e4aa431963d55b909d4d920f339be3
This patch was to fix a reported Hangouts deadlock/freezing issue
in VP8 encoder(issue 27232610). The original encoder loopfilter
synchronization happened in the following frame, which was prone
to causing problems in some complex use cases. This patch simplified
the synchronization logic.
More testing needs to be done.
Change-Id: I38fd3f35d11f98fae1e44546aa5e4c6d6e19c4be
the lookahead buffer allocation is deferred to receipt of the first
frame to allow profile changes. if the encoder was flushed before
supplying any frames the encoder would crash trying to dereference the
NULL buffer. vp8 is unaffected.
fixes mozilla bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1237848
Change-Id: Icee4b64de760476eee0d33b568f0a1010335ff13
Use multiple clusters instead of one and decrease
the distance thresholds.
Add a define to switch between models.
Default is set to existing (1 cluster) model.
Change-Id: I802cd9bb565437ae8983ef39453939f5d5073bb1
Make it consistent with the comment/intended behavior,
that is, only denoise if current block is zero_mv.
Change-Id: I3909761e802e80089752a493ab3646dc32698ded
There are flaws in current implementation of VP8 multithreading encoder
and decoder as reported in the following issue:
https://code.google.com/p/chromium/issues/detail?id=158922
Although the data race warnings are harmless, and wouldn't cause real
problems while encoding and decoding videos, it is better to fix the
warnings so that VP8 code could pass the TSan test.
To synchronize the thread-shared data access and maintain the speed
(i.e. decoding speed), use multiple mutexes based on mb_rows to reduce
the number of synchronizations needed, make the reads and writes of
the shared data protected, and reduce the number of mb_col writes by
nsync times.
The decoder speed tests showed < 3% speed loss while using 2 ~ 4
threads.
Change-Id: Ie296defffcd86a693188b668270d811964227882
the loop filter level is transmitted as 6-bits + sign so needs to be clamped in
the delta + absolute case.
BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1224363
Change-Id: Icbdca4fdbf043466429bd5c9d59dbe913bf153bc
the quantizer is transmitted as 7-bits + sign so needs to be clamped in
the delta + absolute case.
BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1224361
Change-Id: I9115f5d1d5cf7e0a1d149d79486d9d17de9b9639
VP8E_UPD_ENTROPY, VP8E_UPD_REFERENCE and VP8E_USE_REFERENCE have been
deprecated since the initial public release
Change-Id: Ied16b441eec13434d85f1ab115d49ccaf5f2f7b0
This experiment allows using full above/right edges for all transform
sizes whenever available (for d45/d63), and adds bottom/left edges for
d207.
See issue 1043.
Change-Id: I5cf7f345e783e8539bb6b6d2c9972fb1d6d0a78b
The x86 simd expects this. Identical alignment can be found in vp9
and vp10 also. Fixes crashes on 32bit x86 systems.
Change-Id: I229c88d8f696acbef5337c8fa9503528df4e1c40
I've added a few new functions (d45e, d63e, he, ve) to cover the
filtered h/v 4x4 predictors that are vp8-specific, the "correct"
d45 with the correctly filtered bottom-right pixel (as opposed to
the unfiltered version in vp9), and the "broken" d63 with weirdly
filtered bottom-right pixels (which is correctly filtered in vp9).
There may be a minor performance impact on all systems because we
have to do an extra copy of the Above pixel array to incorporate
the topleft pixel in the same array (thus fitting the vpx_dsp API).
In addition, armv6 will have a more serious performance impact b/c
I removed the armv6/vp8-specific assembly. I'm not sure anyone
cares...
Change-Id: I7f9e5ebee11d8e21aca2cd517a69eefc181b2e86
Update rate correction factor when we drop the frame due to overshoot.
Only affects when the drop_overshoot feature is on: screen_content_mode = 2.
Change-Id: I67e24de979b4c74744151d2ceb3cd75fec2a1e7a
In the decoder, map this to the output variable vpx_image_t.r_w/h.
This is intended as an improved version of VP9D_GET_DISPLAY_SIZE,
which doesn't work with parallel frame decoding. In the encoder,
map this to a codec control func (VP9E_SET_RENDER_SIZE) that takes
a w/h pair argument in a int[2] (identical to VP9D_GET_DISPLAY_SIZE).
Also add render_size to the encoder_param_get_to_decoder unit test.
See issue 1030.
Change-Id: I12124c13602d832bf4c44090db08c1009c94c7e8
For 3 temporal layers, reduce somewhat the
cyclic_refresh_mode_max_mbs_perframe parameter, from 20% to ~14%.
Small increase in PSNR/SSIM metrics.
Change-Id: Ia216fa5474048f1ef7fe3db88cd60dfef2a1bf8a
* changes:
Only build ssse3 filter functions on 64 bit
Clean up unused function warnings in vp8 encoder
Clean up unused function warnings in vp8 onyx_if.c
Mark functions in findnearmv.h, invtrans.h and setupintrarecon.h
with INLINE.
Hide function in postproc.h behind the same #if as it's callers.
Change-Id: Ic1e014a943d2aca280f137019218b9d4f1443d61
This is a leftover of the XMA code which was removed a long time ago.
Found while looking for unused functions.
Change-Id: I07a3d542ae55440af59380dcdcf9a6c11cdfcb75
This commit adds clamp of new vectors similar to the logic in RD loop.
Such clamp is not necessary from the perspective of VP8 bitstream, but
is added to improve ChromeCast mirroring's robustness.
Change-Id: I42f6adbc60ffce283b994869364230858632d6fa
For each block in pickinter: use average of four middle
pixels (instead of single pixel) to set skin map.
This can help a little in reducing false skin detection in
some cases.
Change-Id: Ic247af75e9c2948b08ab977a39e061adacd8ec97
Chromium puts all the yasm output in the same directory. Looking at ways
to improve this but in the meantime get rid of collisions.
Change-Id: I923c5231d14e895ab96521eb89807ede868a0753
This commit replaces the vp8_ prefixed subtract function with the
common vpx_subtract_block function. It removes redundant SIMD
optimization codes and unit tests.
Change-Id: I42e086c32c93c6125e452dcaa6ed04337fe028d9
only uint8 is required; each use only loads one value as a uint8
quiets a few type conversion warnings
Change-Id: I03dc0dc0eb01ac23a6e8673daa2b77c6c57bf1b0
There is a naming conflict in the chromium build system.
The rest of the variance functions will move to vpx_dsp soon.
Change-Id: Iff78da2aafb0d7380eda73e38d7dac72110a1e47
fails unit tests:
[ FAILED ] NEON/VP8SubpelVarianceTest.ExtremeRef/0, where GetParam() = (3, 3, 0x14e36d, 0)
[ FAILED ] NEON/VP8SubpelVarianceTest.Ref/0, where GetParam() = (3, 3, 0x14e36d, 0)
the tests were recently enabled in:
eb88b17 Make vp9 subpixel match vp8
the functions likely haven't changed since being converted from assembly
Change-Id: I6141717b111b8f735f436c160d74270af53ef722
Clang adds alignment hints when casting up the loads/stores. Although
this should be safe for most paths, it's causing some crashes. Either
the source of the misalignment needs to be determined and adjusted or
the intrinsics need to be rewritten to avoid using the cast to load the
data.
BUG=817,892
Change-Id: Ia3aa824d6a4cd97e14325ff49dc730b6f85ec7e8
Numerator was being range checked against the
denominator - preventing any frame rate slower
than 1 fps.
I've tested this on a Mac using using ffmpeg and
results are comparable to mp4 and ogg files generated
at the same time.
Not yet tested on Windows.
Johnny Klonaris
google@jawknee.com
Change-Id: Idb358dbc2e7dc000037880ede4a1b0df248a42c8
This allows rate control to react to content of current frame being encoded.
Enabling this feature via the setting: screen_content_mode = 2.
Change-Id: Ib2c6670551d96f4907495d5b7b76bb8c49e673db
this macro was used inconsistently and only differs in behavior from
DECLARE_ALIGNED when an alignment attribute is unavailable. this macro
is used with calls to assembly, while generic c-code doesn't rely on it,
so in a c-only build without an alignment attribute the code will
function as expected.
Change-Id: Ie9d06d4028c0de17c63b3a27e6c1b0491cc4ea79
Create a new component, vpx_dsp, for code that can be shared
between codecs. Move the SAD code into the component.
This reduces the size of vpxenc/dec by 36k on x86_64 builds.
Change-Id: I73f837ddaecac6b350bf757af0cfe19c4ab9327a
While CONFIG_INTERNAL_STATS=1, PSNR is calculated while encoding.
The aligned width/height were used mistakenly in the calculation.
This patch fixed it, and used the orignal image width/height.
Change-Id: Iad5334f8693af761b71ebb78f2587db8a3404ecf
In vp8_sub_pixel_variance8x8_neon the temp2 buffer is only initialized
to kHeight8 * kWidth8. However, in the case that xoffset != 0 and
yoffset == 0, var_filter_block2d_bil_w8 is called with output_width
kHeight8PlusOne.
Thanks to cmugurel for diagnosing and yulius for the patch.
Change-Id: Ib71ffd96ffad963c92b8b7ca23f303942785b8e0
https://code.google.com/p/webrtc/issues/detail?id=4190
By using 0xff for a short it was not setting the high bits. When
comparing the output with vtst to find non-zero elements it was skipping
vaules which had no low bits set such as -512 / 0xFE00.
Using -8191 as the first element of coeff will generate this condition.
BUG=883
Change-Id: Ia1e10fb809d1e7866f28c56769fe703e6231a657
The obj_int_extract code is no longer worth maintaining. It creates
significant issues when adapting for different build systems and no
longer offers as significant of a performance benefit due to
improvements in intrinsics.
Source files will remain until the various third-party builds are updated.
The neon fast quantizer has been moved to intrinsics. The armv6 version
has been removed because so few remaining targets require it.
Compilers and processors have improved significantly since the
pack_tokens code was written. The assembly is no longer faster than the
C code.
pack_tokens were the only optimizations for the armv5te targets so the targets
will be removed after the test infrastructure has been updated.
BUG=710
Change-Id: Ic785b167cd9f95eeff31c7c76b7b736c07fb30eb
Check that the numerator is not zero. If it is, guess 30fps.
Fixes a clang IOC error in the quantize test. It's very unlikely for
this to occur in the wild because the setup in the quantize test is very
nonstandard.
Change-Id: Icdab7b81d4e168d3423e14db20787f960052e0c3
Use intrinsics for neon quantization. Slight loss (<5%) of performance
compared to the assembly. Roughly 10x faster on arm64 because that was
running C code before.
Change-Id: I7cf5242d8f29b7eab5bca6a1c20c89c9fc9ca66d
-Use full bandwidth (when temporal layers is on) for checking switching.
-Normalize metric wrt num_blocks.
-Rounding fix to update of average noise level metric.
-Make default internal denoiser mode == kDenoiserOnYUV (in denoiser set_parameters()).
-Adjust some thresholds.
Change-Id: Ib827512b25a7bf1f66c76d3045f3a68ce56b1cd2
If the GOLDEN or ALTREF frame was last updated > x frames in the past,
don't use them for denoising (only consider LAST). Using an old reference
frame for denoising, e.g., if it is a long-term reference or the last key frame,
can cause some visible artifacts, in particular in the aggressive denoising mode.
Change-Id: I239c9fbb092c36cba7e95328f1fa67a58d6a7ed9
The version of gcc4.6 included with the Android NDK through r10b
fails to compile this function. Replace it with C code.
BUG=860
Change-Id: Ifcc0476664071aec46a171cdd5ad17305930986a
A left shift of negative value causes IOC runtime warnings, this
commit converts two such left shifts to multiply to avoid IOCs.
Change-Id: I8811428768d7135e6e16af4b3094d0341589a995
Allow for option to apply spatial blur for temporal
denoising, under the aggressive denoising mode.
Change-Id: I41c5fdc0b6cf32d8f8d1d4236b25fa5aa406e89e
This issue is found when the denoising mode is set to kDenoiserOnYUVAggressive.
Updated the C code to make it the same with SSE version.
I also changed several lines in VP9 denoiser for the code style.
Change-Id: I640d48cf946fe8c6a400e6e252107501d1e226d3
make bifilter4_coeff[][] uint8_t, no values exceed this range and
they're loaded with vdup_n_u8().
Change-Id: I921983e9edd828d29820e40ac30a7801dbe0fb4f
Use the right return values - vget_low_s64 returns int64x1_t, not
a normal int64_t.
Also make __builtin_prefetch a no-op on MSVC for this file.
Change-Id: I4d2fce01d0ba106b98d3d53b137803119c2c2c08
vp8_build_intra_predictors_mbuv_s().
This patch replaces the assembly version with an intrinsic
version.
On a Nexus 7, vpxenc (in realtime mode, speed -12)
reported a performance improvement of ~2.6%.
Change-Id: I9ef65bad929450c0215253fdae1c16c8b4a8f26f
Adds config parameter vp9_highbitdepth, to support highbitdepth profiles.
Also includes most vpx level high bit-depth functions. However
encode/decode in the highbitdepth profiles will not work until
the rest of the code is in place.
Change-Id: I34c53b253c38873611057a6cbc89a1361b8985a6
In order to understand memory layout consider the declaration of the
following structs. The first one is a part of our API:
struct vpx_codec_ctx {
// ...
struct vpx_codec_priv *priv;
};
The second one is defined in vpx_codec_internal.h:
struct vpx_codec_priv {
// ...
};
The following struct is defined 4 times for encoder/decoder VP8/VP9:
struct vpx_codec_alg_priv {
struct vpx_codec_priv base;
// ...
};
Private data allocation for the given ctx:
struct vpx_codec_ctx *ctx = <get>
struct vpx_codec_alg_priv *alg_priv = <allocate>
ctx->priv = (struct vpx_codec_priv *)alg_priv;
The cast works because vpx_codec_alg_priv has a
vpx_codec_priv instance as a first member 'base'.
Change-Id: I10d1afc8c9a7dfda50baade8c7b0296678bdb0d0
Scale min_consec_zero_last wrt to #temporal layers,
and use full framerate as factor in noise metric.
Change-Id: Id0842b90164ce468d1236173c51965e7620c0e12
When configuring the buffer make sure to set all the (now) required
fields. Use the canonical variables and match the style from vpx_scale.
https://code.google.com/p/webm/issues/detail?id=841
Change-Id: I71b43d4a03756b8b2d6d60fdf8d7bf41b8041787
On key frame, will always start with normal denoising mode,
but based on a computed noise metric (normalized mse on source diff)
may switch to aggressive mode (and back down again).
Change-Id: I20330b2dcf3056287be37223302b2cab5fc103eb
Modify zero_mv bias condition to include check that "closest" reference is last_frame.
This is needed for temporal layers, where the last_frame is not always the closest reference.
Also, constain zeromv_count to be for last_frame reference.
Change-Id: I7af54a809ebf01ef43b9933c9d4095b6cb189390
if the decode of the first frame fails, frame_to_show may not be set.
fixes a crash in vpxdec with corrupt data.
Change-Id: I5ab9476d005778a13fd42a39d05876bb6c90a93c
This is needed to update the width/height and stride parameters
for the reference buffers that the denoiser uses.
Change-Id: Id51b3bdcb56bbbc8187865544ccd3d872a0d51fe
When no more data is available, vpx_codec_decode should
be called with NULL as data and 0 as data_sz.
vpx_codec_get_frame iterates over a list of the frames
available for display. The iterator storage should be initialized
to NULL to start the iteration. Iteration is complete when this
function returns NULL.
Also change the unit test to conform to the api spec.
Change-Id: I4b258b309f5df3d37d10c82f01492c0394181c2a
Since the UV decision to denoise is based on Y, we need to set
the default/initial denoiser decision_u/v to COPY_BLOCK,
to make sure if no uv_denoiser is applied we still update
(uv)running_avg with source.
Change-Id: I5af1c2afbd40c498cd3de208bea88c837099b24d
On a key frame, the denoised-running_avg for all references
frames should be updated with the source.
The altref denoised-running_avg was not being updated on key frame,
this fixes that.
Change-Id: Ie02cd0ba5383e013af59240e6df7e185d11703f6
For gcc, when libvpx config option debug is disabled, added the
flag -DNDEBUG to disable the assertions in libvpx for some speedup.
Change-Id: Ifcb7b9e8ef5cbe5d07a24407b53b9a2923f596ee
Sets the bit-depth field as default 8 in the image structure in vp8.
Generalizes yuv read in preparation for support for reading 422/444
for 8-bit and 10/12-bit.
Change-Id: I560c13c348b122fd028e408431156376b895058c
All changes are for spatial svc only.
1. Enable encoding hidden frames in each layer and use alt reference idex to reference the hidden frame in each layer
2. Use golden reference idx for spatial reference
3. For those layers that don't have hidden frames (caused by lack of frame buffers), reference a hidden frame in lower layers
4. Add "auto-alt-refs" in svc options
Change-Id: Idf27d1fd2fb5f3ffd9e86d2119235e3dad36c178
vp8/encoder/x86/denoising_sse2.c:35:10: error: taking the absolute value
of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
Change-Id: I749ba8e6f55dbd9b822bfd4260a8397554f5e524
Set the proper number of mb_rows/cols.
Also remove warnings (unused variable) when configured with temporal-denoising disabled.
Change-Id: I8abd2372394ee55295feb87a66efd294ea6989d0
C version and sse2 version, and off by default.
For the test clip used, the sse2 performance improved by ~5.6%
Change-Id: Ic2d815968849db51b9d62085d7a490d0e01574f6
Allow for an option to selectively apply the deblocking loop filter to the denoised
raw block, based on the denoised state (no-filter, filter with zero motion, or filter with non-zero motion)
of the current block and its upper and left denoised block.
This helps to reduce some blocking artifacts from the motion-compensated denoising.
Change-Id: I0ac4e70076df69a98c5391979e739a2681e24ae6
When this compiler flag is enabled, the encoder will write a denoised,
uncompressed, version of the input to denoised.yuv.
Change-Id: Ie0247f76b23219d95fe97dd70f23e097d742c249
By enabling the OUTPUT_YUV_SRC compiler flag, the encoder will write the raw
input to bd.yuv.
The functionality was mostly implemented, but in its previous state did not
compile.
Change-Id: Ia331ad0f4c6e6f9f51e8d42cd33ba8cc146b3dbf
Now match the "C" version of "Fix to reduce block
artifacts from vp8 temporal denoiser."
(see change id Id9b56e59e33f3c22e79d2f89f763bdde246fdf3f)
Change-Id: I99e569bb6af4ae3532621127e12bf917a48ba08e
In the current logic, if the sse for zero motion is smaller
than the sse for new_mv (i.e., best_sse), we may still end up
using the non-zero mv for denoising (if the magnitude of new_mv is above threshold).
This can happen for very noisy content, and can lead to artifacts.
This change ensures that we always use zero_mv (over new_mv) for
denoisng if sse_zero_mv <= best_sse.
Change-Id: I8ef9294d837b077013b77a46c9a71d17c648b48a
Fixes a bug introduced in
https://gerrit.chromium.org/gerrit/#/c/69779/13, where
uninitialized frame buffers due to corrupt and short
buffer sizes, may cause a crash.
This patch fixes the currently failing
video/processing/static_image/vp8_convert_test
Change-Id: I1b09e21482f292c11a2bfb4e570aef1d643410a7
If the denoiser filter causes too big a change in the absolute pixel difference
(between source and denoised signal), the block is not denoised, which can cause
visual block artifacts. This change applies a second adjustment to the temporal filter
to effectively allow for a (weaker) denoising for such blocks (which can keep
the absolute differnence within the tolerance range in most cases).
This helps to reduce some of the block artifacts from the denoising.
The additional cost of re-applying the filter to this set of blocks is low,
as the percentage of blocks per frame (with too big a change in absolute pixel difference)
is typically small, 2-5%.
Change-Id: Id9b56e59e33f3c22e79d2f89f763bdde246fdf3f
Renames all x86_64 specific assembly files to consistently
end in _x86_64.asm. This will be useful for build systems to
handle these files differently.
All new 64-bit specific assembly files should use the new
naming convention.
Change-Id: I36c89584967c82ffc4088b1b5044ac15d2bb7536
MMX variance code in vp8 was reading out of bounds..
TODO(JBB): The best fix would involve removing duplicate library
functions between vp8 and vp9...
Change-Id: I5722853a6a58d3b55257ff385fa54c773bf98ded
As a side-effect, the max_sad check is removed from the
C-implementation of VP8, for consistency with VP9, and to
ensure that the SAD tests common to VP8/VP9 pass.
That will make the VP8 C implementation of sad a little slower
but given that is rarely used in practice, the impact will be
minimal.
Change-Id: I7f43089fdea047fbf1862e40c21e4715c30f07ca