Marco [Mon, 23 Oct 2017 17:58:28 +0000 (10:58 -0700)]
vp9-svc: Allow for adapt_rd_thresh with row-mt.
Set adaptive_row_thresh_mt = 1 at speed >= 7,
for svc when multi-threading is used with row-mt.
This allow the adaptive_rd_thresh feature to be used
in the nonrd-pickmode.
~1-2% speedup for SVC encoding with small quality
loss (< 0.6%) on RTC set.
Jerome Jiang [Thu, 12 Oct 2017 22:03:22 +0000 (15:03 -0700)]
vp8: Enable use of ROI map.
Disable cyclic refresh if ROI is used and add flag to properly handle
the static_thresh deltas.
Remove the ROI test for cyclic refresh (it's allowed but disabled if ROI
is used).
Add an example in vpx_temporal_svc_encoder.c. Turned off by default.
paulwilkins [Wed, 11 Oct 2017 09:31:57 +0000 (10:31 +0100)]
Prevent double application of min rate in two pass.
The initial allocation of bits in the two pass code to each frame
should be within the min max limits on the command line. However,
when forming an ARF group the cost of the ARF is shared by frames
in that group such that the residual bits for a frame could drop below
the min value. This change prevents the minimum being re-applied
after the cost of the ARF has been deducted as this may otherwise
cause low rate sections to overshoot their target.
Test runs comparing to a baseline run with min and max section pct
0-2000% vs one closer to the YT use case (50-150%) suggest that
this fix not only results in better rate control but also gives a better
rd outcome.
For example the HD set vs 0-2000% baseline (opsnr, ssim).
Old code (50-150): +0.751, +1.099
New code(50-150): +0.241, -0.009
Marco [Tue, 10 Oct 2017 00:53:21 +0000 (17:53 -0700)]
Adjustment to scene detection and key frame.
For 1 pass vbr: use higher threshold on avg_sad
and force key frame under scene cut detection if
above the threshold. Allow it for speed >= 6 for now,
since it does not use the full nonrd_pickmode partition
(as in speed 5).
Improves quality somewhat on scene cut frames.
Neutral on overall metrics and fps for speed 6 on
ytlive set.
paulwilkins [Thu, 17 Aug 2017 13:13:29 +0000 (14:13 +0100)]
Further Corpus VBR change.
Change to the bit allocation within a GF/ARF group.
Normal VBR and CQ mode allocate bits to a GF/ARF group based of the mean
complexity score of the frames in that group but then share bits evenly between
the "normal" frames in that group regardless of the individual frame complexity
scores (with the exception of the middle and last frames).
This patch alters the behavior for the experimental "Corpus VBR" mode such that
the allocation is always based on the individual complexity scores.
paulwilkins [Fri, 19 May 2017 14:08:15 +0000 (15:08 +0100)]
Corpus Wide VBR test implementation.
This patch makes further changes to support an experimental
corpus wide VBR mode that uses a corpus complexity
number as the midpoint of the distribution used to allocate bits
within a clip, rather than some average error score derived from the
clip itself.
At the moment the midpoint number is hard wired for testing and
the mode is enabled or disabled through a #ifdef. Ultimately this
would need to be controlled by command line parameters.
Reason for revert:
Notice small regression in some clips.
Will revisit in another change.
Original change's description:
> Speed >=5 real-time: add TM intra mode for high_source_sad.
>
> Small/neutral change in metrics or speed for ytlive.
> Some improvement in quality on frames with big content change.
>
> Change-Id: Ib3b0703a5f28ea6710e90324436e27598ab7384d
Marco [Wed, 4 Oct 2017 22:27:45 +0000 (15:27 -0700)]
Avoid nonrd_pick_partition for speed >= 6.
For 1 pass vbr speed >= 6: when REFERENCE_PARTITION is selected,
avoid doing the full nonrd_pickmode based partition.
No change in overall metrics or speed.
Reduces encode times on scene cuts by 10-20%.
Marco [Fri, 29 Sep 2017 18:34:00 +0000 (11:34 -0700)]
vp9: 1 pass vbr: Limit qpdelta on high_source_sad.
For 1 pass vbr: when significant content/scene change is detected
(high_source_sad = 1) reduce/turnoff the additional qdelta on the
active_worst_quality. This helps somewhat to reduce the occurrence
of large frame sizes and large encode times.
Allow it only when use_altef_onepass is enabled.
Marco [Tue, 3 Oct 2017 17:55:55 +0000 (10:55 -0700)]
Use adapt_partition for ARF in 1 pass.
For speed 6 real-time mode: use adapt_partition
on ARF frame instead of REFERENCE_PARTITION (which is slower).
This requires enabling compute_source_sad_onepass for no-show_frames.
Speedup of ~3-5% on some clips that heavily use ARF,
small loss (~0.2%) in quality on ytlive set.
Scale 3x3 block instead of 16x16 block in each loop. Disabled by
default.
Benefits:
1. Reduced number of different phase_scaler from 16 to 3.
Optimization code will be smaller and faster.
2. Maximum phase_scaler drifting will be reduced from 5/16 to 1/24.
(The drifting is 1/(3*16) in each step.)
Marco [Thu, 28 Sep 2017 17:47:34 +0000 (10:47 -0700)]
Set rc->high_source_sad = 0 before scene detection.
Only has effect when sf->use_altref_onepass is enabled,
as in that case scene detection is skipped for non-show frame
and so high_source_sad does not get reset to 0.
This is actually used in CBR to reset the rate control if high source sad is detected.
Original change's description:
> Remove the speed condition on scene detection in 1 pass code.
>
> Scene detection is used for VBR mode and for screen_content mode.
>
> It was also enabled for CBR mode via the speed condition,
> but currently the analysis in the scene detection is not used
> in CRB mode (similar computations are done locally at superblock level
> when the source_sad feature is enabled).
>
> For 1 pass code.
> No change in behavior. Small speed gain, ~0.5%.
>
> Change-Id: I59991d7ef2af320bea7af4b907596e057affa42f
Marco [Wed, 27 Sep 2017 17:11:24 +0000 (10:11 -0700)]
Remove the speed condition on scene detection in 1 pass code.
Scene detection is used for VBR mode and for screen_content mode.
It was also enabled for CBR mode via the speed condition,
but currently the analysis in the scene detection is not used
in CRB mode (similar computations are done locally at superblock level
when the source_sad feature is enabled).
For 1 pass code.
No change in behavior. Small speed gain, ~0.5%.
vp9_dx_iface: Stop using iter parameter incorrectly
'iter' parameter is being checked for NULL in every call to
decoder_get_frame which is quite pointless because it is always
going to be NULL unless the application changed it. The code works
as described only because vp9_get_raw_frame returns -1 on all
subsequent calls after the first.