Yunqing Wang [Thu, 13 Nov 2014 21:38:23 +0000 (13:38 -0800)]
vp9_ethread: modify the cyclic refresh struct
Two members in struct CYCLIC_REFRESH
int64_t projected_rate_sb;
int64_t projected_dist_sb;
are updated at the superblock level, which makes them shared data
in the multi-thread situation, and requires extra work to handle
them. However, those values are updated and used immediately, and
therefore can be removed. This patch cleaned up the code and
removed the two members.
Yaowu Xu [Mon, 10 Nov 2014 19:46:58 +0000 (11:46 -0800)]
Use normal rate_correction_factor for gf in CBR mode
I0c5f010 changed to allow update golden reference buffer in CBR mode,
this commit changes the use of rate_correction_factor for those frames
to be aligned with the new usage. This commit attempts to solve two
issues:
a. Initialization of rate correction factor for Golden Frame
Prior to this patch, even the regular inter frame has been update
the rate correction factor based on content and encoding results,
the first golden frame would still use the ininitialized value
that can be way off.
b. Allowing rate correction factor update to be slightly faster
Prior to this patch, when the rate correction factor is off, the
update to the factor is too slow, the factor could not get close
to a semi-correct value even after many frames.
The commit helps all clips in psnr/ssim metric, but especially to
a few clip in RTC set that rate correction was way off. For example
thaloundeskmtgvga gained about .5dB for both overall/average psnr.
Deb Mukherjee [Fri, 7 Nov 2014 19:01:53 +0000 (11:01 -0800)]
Vidyo: Support for one-pass rc-enabled SVC encoder
Adds support for one-pass rc-enabled SVC encoder with callbacks for
getting per-layer packets.
- the callback function registration is implemented as an encoder
control function.
- if the callback function is not registered, the old way of
aggregating packets with superframe will take effect.
- one more control function “VP9E_GET_SVC_LAYER_ID” has been
implemented to get the temporal/spatial id from the encoder
within the callback. This can be used to get the ids to put on RTP
packet.
Yaowu Xu [Fri, 7 Nov 2014 03:09:30 +0000 (19:09 -0800)]
Change the use of a reserved color space entry
This commit rename a reserved color space entry to BT_2020, it intends
to provide support for VP9 bitstream to pass along the color space
type defined in BT.2020(Rec.2020)
please note this entry does not have any effect on encoding/decoding
behavior, but allow applications to the pass the information along
from encoding end to decoding end.
Johann [Thu, 31 Jul 2014 21:19:31 +0000 (14:19 -0700)]
Remove asm offset dependencies
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.
Yunqing Wang [Thu, 30 Oct 2014 01:38:18 +0000 (18:38 -0700)]
Modify the frame context memory deallocation
This patch was to fix the vpxdec fuzzing3 test failure. When an
error occurs, setjmp() is invoked, which calls the decoder
removing routine. In multiple thread situation, other threads
could try to access the frame context memory that is already
deallocated, thus causing a segfault.
Paul Wilkins [Tue, 4 Nov 2014 13:13:39 +0000 (13:13 +0000)]
Add intra complexity and brightness weight to first pass.
The aim of this patch is to apply a positive weighting to
frames that have a significant number of blocks that are
of low spatial complexity and are dark. The rationale behind
this is that artifacts tend to be more visible in such frames.
In this patch the weight is only applied in regard to the distribution
of bits between frames. Hence if all the frames share similar
characteristics (as is the case for most of our short test clips) there
will be little or no net effect.
However, the effect can be seen on some longer form test content.
For example Tears of steel baseline test:
2323.09 Kbit/s opsnr 39.915 ssim 74.729
With this patch:-
2213.34 Kbit/s opsnr 39.963 ssim 74.808
(Sligtly better metrics and about 5% smaller)
The weighting may well need some further tuning along side changes
to the aq modes.
Jingning Han [Tue, 4 Nov 2014 22:32:04 +0000 (14:32 -0800)]
Rework cut-off decisions in cyclic refresh aq mode
This commit removes the cyclic aq mode dependency on
in_static_area and reworks the corresponding cut-off thresholds.
It improves the compression performance of speed -5 by 1.47% in
PSNR and 2.07% in SSIM, and the compression performance of speed
-6 by 3.10% in PSNR and 5.25% in SSIM. Speed wise, about 1% faster
in both settings at high bit-rates.
Johann [Wed, 5 Nov 2014 20:56:04 +0000 (12:56 -0800)]
Fix SSSE3 partial_idct_test detection
The test filter is not a prefix matcher. It requires test type to
contain no more than the optimization type. In this example, SSSE3_64
fails to match and the test is not skipped even when SSSE3 is not
available.
Johann [Tue, 4 Nov 2014 18:46:24 +0000 (10:46 -0800)]
Avoid divide-by-zero in vp8 initialization
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.
Jingning Han [Mon, 3 Nov 2014 19:36:34 +0000 (11:36 -0800)]
Skip ref frame mode search conditioned on predicted mv residuals
This commit makes the RTC coding mode to conditionally skip the
reference frame mode search, when the predicted motion vector of
the current reference frame gives more than two times sum of
absolute difference compared to that of other reference frames.
It reduces the runtim by 1% - 4% for speed -5 and -6. The average
compression performance is improved by about 0.1% in both settings.
It is of particular benefit to light change scenarios. The
compression performance of test clip mmmovingvga.y4m is improved by
6.39% and 15.69% at high bit rates for speed -5 and -6, respectively.
Speed -5
vidyo1 16555 b/f, 40.818 dB, 12422 ms ->
16552 b/f, 40.804 dB, 12100 ms
nik 33211 b/f, 39.138 dB, 11341 ms ->
33228 b/f, 39.139 dB, 11023 ms
mmmoving 33263 b/f, 40.935 dB, 13508 ms ->
33256 b/f, 41.068 dB, 12861 ms
Speed -6
vidyo1 16541 b/f, 40.227 dB, 8437 ms ->
16540 b/f, 40.220 dB, 8216 ms
nik 33272 b/f, 38.399 dB, 7610 ms ->
33267 b/f, 38.414 dB, 7490 ms
mmmoving 33255 b/f, 40.555 dB, 7523 ms ->
33257 b/f, 40.975 dB, 7493 ms
Marco [Mon, 3 Nov 2014 06:10:56 +0000 (22:10 -0800)]
Allow disable of refresh golden for more than 1 layer encoding.
The current logic was allowing for disabling golden refresh only
for two pass svc encoding. This change disables it as long as
more than 1 layer encoding is used (for example temporal layers under 1pass CBR).
levytamar82 [Thu, 16 Oct 2014 23:56:37 +0000 (16:56 -0700)]
WORKAROUND FIX FOR GCC4.9.1
In the function mb_lpf_horizontal_edge_w_avx2_16 the usage of the intrinsic
_mm256_cvtepu8_epi16 cause a compiler bug in gcc 4.9.1.
until it will be fixed I created a workaround that create the up convert by
using broadcast128+shuffle.
The bug was reported here:
https://code.google.com/p/webm/issues/detail?id=867
Yaowu Xu [Sat, 1 Nov 2014 00:27:54 +0000 (17:27 -0700)]
Fix speed 7 and speed 12 for rt
A recent change has introduced big quality drops for speed 7 and 12
for --rt mode. The change reverted the big drop and improved quality
by 9.5% for speed 7 and 13.4% for speed 12.
hkuang [Mon, 27 Oct 2014 23:19:04 +0000 (16:19 -0700)]
Bind motion vectors with frame buffer structure.
This will save a lot of memory for decoder due to removing of prev_mi,
but prev_mi is still needed in encoder. So this will increase a little bit
memory for encoder.
Johann [Mon, 20 Oct 2014 23:03:28 +0000 (16:03 -0700)]
vp8 quantization -> intrinsics
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.
Jingning Han [Wed, 29 Oct 2014 23:37:16 +0000 (16:37 -0700)]
Rework pred pixel buffer system in non-RD coding mode
This commit makes the inter prediction buffer system to support
hybrid partition search. It reduces the runtime of speed -5 by
about 3%. No compression performance change.
Jingning Han [Tue, 28 Oct 2014 21:50:10 +0000 (14:50 -0700)]
Enable mode search threshold update in non-RD coding mode
Adaptively adjust the mode thresholds after each mode search round
to skip checking less likely selected modes. Local tests indicate
5% - 10% speed-up in speed -5 and -6. Average coding performance
loss is -1.055%.
speed -5
vidyo1 720p 1000 kbps
16533 b/f, 40.851 dB, 12607 ms -> 16556 b/f, 40.796 dB, 11831 ms
nik 720p 1000 kbps
33229 b/f, 39.127 dB, 11468 ms -> 33235 b/f, 39.131 dB, 10919 ms
speed -6
vidyo1 720p 1000 kbps
16549 b/f, 40.268 dB, 10138 ms -> 16538 b/f, 40.212 dB, 8456 ms
nik 720p 1000 kbps
33271 b/f, 38.433 dB, 7886 ms -> 33279 b/f, 38.416 dB, 7843 ms
JackyChen [Sat, 25 Oct 2014 17:51:51 +0000 (10:51 -0700)]
vp9_denoiser_sse2: refactor the code.
Combined vp9_denoiser_8xM_sse2 and vp9_denoiser_4xM_sse2 into one
function vp9_denoiser_NxM_sse2_small and passed the bitexact testing.
Changed the name of the function vp9_denoiser_64_32_16xM_sse2 to
vp9_denoiser_NxM_sse2_big.
Yaowu Xu [Fri, 17 Oct 2014 19:13:16 +0000 (12:13 -0700)]
Allow update of golden refernce buffer in CBR mode
This commit changes to allow the usage of golden reference frame in
VP9 CBR mode to improve quality. VP9 supports potentially up to 8
reference buffers, it has reference buffers available for this
purpose. This was not possible in VP8 as golden and alt-ref buffers
were used for temporal scalability purpose in CBR mode in WebRTC.
For frames that update golden frame, there can be a quality boost.
The amount of allowed bitrate boost can be controlled via parameter
rc_max_inter_bitrate_pct. The inital value of the boost ratior is
currently based on over_shoot_pct. Further experiments will work
out the adaption of this boost value.
Paul Wilkins [Tue, 28 Oct 2014 13:03:06 +0000 (13:03 +0000)]
Relax maximum Q for extreme overshoot.
Added code to relax the active maximum Q in response
to extreme local overshoot to reduce bandwidth peaks.
The impact is small in metrics terms, but it this helps reduce
bandwidth spikes and overall overshoot in a number of
clips in our tests sets (especially the YT test set).
In particular this should help prevent very big spikes where a clip
is mainly easy but has a short hard section. In such a case a choice
of maximum Q for the clip as a whole may allow us to hit the overall
target rate but give some extreme spikes. The chunked encoding in YT
mitigates this problem but it can show up where a longer clip is
coded as a single chunk.
Jingning Han [Mon, 27 Oct 2014 19:03:47 +0000 (12:03 -0700)]
Use zero motion vector in choose_partitioning
The zero motion vector was effectively used in the subsampled pixel
based variance calculation. This commit makes it directly use zero
mv to generate prediction.
Yaowu Xu [Mon, 27 Oct 2014 20:13:14 +0000 (13:13 -0700)]
Add a new control of golden frame boost in CBR mode
0 means that golden boost is off, and uses average frame target rate,
a non-zero number means the percentage of boost over average frame
bitrate is given initially to golden frames in CBR mode.
Jingning Han [Thu, 23 Oct 2014 23:54:45 +0000 (16:54 -0700)]
Tile based adaptive mode search in RD loop
Make the spatially adaptive mode search in rate-distortion
optimization loop inter tile independent. Experiments suggest that
this does not significantly change the coding staticstics.
Single tile, speed 3:
pedestrian_area 1080p 1500 kbps
59192 b/f, 40.611 dB, 101689 ms
blue_sky 1080p 1500 kbps
58505 b/f, 36.347 dB, 62458 ms
mobile_cal 720p 1000 kbps
13335 b/f, 35.646 dB, 45655 ms
as compared to 4 column tiles, speed 3:
pedestrian_area 1080p 1500 kbps
59329 b/f, 40.597 dB, 101917 ms
blue_sky 1080p 1500 kbps
58712 b/f, 36.320 dB, 62693 ms
mobile_cal 720p 1000 kbps
13191 b/f, 35.485 dB, 45319 ms
Marco [Fri, 24 Oct 2014 16:31:38 +0000 (09:31 -0700)]
vp8: Updates to noise level estimate.
-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.