Age | Commit message (Collapse) | Author |
|
VP9E_SET_SVC_LAYER_ID sets the first spatial layer to
encoder per superframe, so add this parameter to svc encoder.
This is needed, for example, to properly set is_key_frame for
spatial layers when base spatial layer is skipped encoded.
Change-Id: Ifd4ac77f539197ec021e62f4c624a6cc79d64f43
|
|
This reverts commit 416b7051d7f610ed6d62dff18af7776ec520fd9c.
Reason for revert: it causes visual quality drop as described in b/112953058.
Original change's description:
> 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
>
> Change-Id: I715da7b130bf53ba8aa609532aa9e18b84f5e2ef
TBR=yaowu@google.com,paulwilkins@google.com,debargha@google.com,builds@webmproject.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ic9849e4e0db64e9d92bbb9df9cc923230a15c4df
|
|
Match the decoder expectation, set off refresh_fame_context flag
in show_existing_frame mode.
Change-Id: I5258635b715ea04f41a4a087178709f707449b71
|
|
The enum USE_BUF_FRAME makes the use of show_existing_frame. In
this setting, all the reference frame buffer condition will stay
unchanged.
Change-Id: I5b7b28488dbd94982f721667128f004e4e6a00d8
|
|
Change-Id: I70997d35a2371bb4614d716ef0c587fa12ea0f4a
|
|
For CBR real-time mode: refactor usage of speed feature to
handle overshoot on slide/scene change. Add 2 modes to indicate
how slide/scene change is processed for re-setting Q/rate control.
Keep the speed setting to 1 for speed >= 5, otherwise set to 0.
Video content and screen content are now handled in similar way,
though with different thresholds.
Some fixes to thresholds and reset: correct the reset of the buffer
level to optimal level for each temporal layer, if scene change
frame will be encoded at max_q.
Also increase the min_thresh for video mode (non-screen content):
this is to avoid scene change detection on cases like large
lighting changes, cameras focus. And increase in min_thresh
makes it more robust to sudden increase in noise level.
Change-Id: I256d350da6e92d2ddc09f100fc06ac147cbc1e49
|
|
For spatial layers: use the correct mi_cols/rows in the
scene detection. The scene detection for spatial layers
is only called once per superframe, but we were using wrong
mi_cols/rows (those for base spatial were being used).
Also increase frame_since_key threshold to account for spatial
layers.
Change-Id: I2731da49684a798c4718693a0468eda7db82d2bd
|
|
For real-time screen-content mode: increase the
qp_thresh for max_Q setting on slide changes.
This will make bitrate spikes less likely on slide changes.
Change-Id: Ie13524a06490214456b1c9c042a864ea0d0750c5
|
|
For real-time screen-content mode: makes the
scene/slide change detection more robust.
Change-Id: I28d8d28b42bb92d527811f814bf14bbbbb53ab25
|
|
|
|
For real-time screen-content mode: increase min_thresh
to avoid some false detection.
Change-Id: I3e93dea63cbd65e3ad5d0af7eabf0d3686fe9943
|
|
For real-time screen content mode: for speed >= 6 disable
the re_encode_overshoot feature. This means for speed >= 6
the Q and rate control is reset on slide changes based on
the scene/slide detection and the current Q (and not on a
first pass encoded frame at current Q).
This reduces encode time on slide changes, but may be less
accurate in deciding when to reset/max-out the Q.
Change-Id: Id0fdcafd55bc43bd8b3afee211e524f37c8ddce6
|
|
|
|
For real-time screen content mode: when slide change
is detected, for spatially flat blocks (source_variance = 0) on
the re-encoded frame, skip inter modes (so force intra) if
non-zero temporal variance is detected for the coding block.
Add flag to keep track of re-encoded frame at max Q.
Reduces artifacts on slide change.
Change-Id: I28151f412aba6ab8cb03f30087c7ce16d443654b
|
|
This patch limits the active min Q for normal frames based on the previous
KF/GF/ARF. In a few cases, especially at the end of a clip where there
has been systemic underspend, (as is often the case with slide shows),
this prevents the encoder rapidly dropping Q on normal frames (just to
try and use up bits), such that they end up with a lower Q than the key
frame / GF / ARF off which they key.
Change-Id: Ic8def5c0d1e37ca2202e007ec1d13e501c0a91dd
|
|
This patch adds in detection of slide show content and allows
for coding of long GF only groups up to a length of 240 frames rather
than coding a large number of shorter ARF groups that gradually
lower the Q.
In test samples this patch gave rise to a substantial improvement in
overall psnr and a drop in data rate. In some cases the average psnr
fell, however, with the boost and minQ values set as they are.
This is to be expected because average psnr is dominated by the
best frames in the sequence and previously a relatively poor key frame
could be followed by progressively better alt refs. For example a key
frame at q7.5 but subsequent alt refs improving it to lossless.
For slides displayed for several seconds, savings of >= 20% (or
commensurate quality gains) are likely.
This patch allows for long GF groups in static sections before and after
complex transitions (e.g. fades) with one or more normal ARF groups
during the transition. However, it enforces a single "normal" length
GF group after the transition before any extended group is allowed.
The reason for this is that the ARF that spans the transition my not have
a very high quality and hence may not be a good GF for the long static
section that follows.
Change-Id: I66cc404c3b85e87dae9829b49d9d631cbf04e037
|
|
For screen-content real-time CBR mode: on a detected slide change
that is encoded at max Q (to prevent excessive overshoot), increase
the perc_refresh in the cyclic refresh following the slide change.
Use counter to increase refresh up to some #frames from slide change.
This is attempt to increase quality ramp-up after slide change without
causing too much excess overshoot.
Change-Id: Ie4ec4361082803a522f4a8794b3bb0178c9cf307
|
|
|
|
For real-time screen content mode: when scene/slide change
is detected and re-encode is decided, force hybrid_intra
mode search if slide change is big and alot of Intra modes
were used. hybrid_intra mode will use rd-based intra mode
search for small blocks.
Overall better PSNR on clip with slide changes, with similar
encoded frame size. Encode time lightly higher on average with
this change.
Change-Id: I503835253b777b9f98d74e75a52a8000b76c310c
|
|
Assign the estimated qp for the overlay frame too. Cap the minimum
quantization parameter to be 1 to avoid lossless coding in the
temporal dependency model setup.
Change-Id: I8acbc7182045dbf3017b6712a119b18407b76ab0
|
|
Assign the estimate frame quantization parameter in the tpl_frame
data structure.
Change-Id: I6149bdb1e15dbdae348f06ff61bf814004462232
|
|
Gather the availabel statistics to estimate the frame level
quantization parameter set in a group of pictures. This will be
called in the tpl model construction. No visible coding stats
change would occur.
Change-Id: Ic412e4afd9a60f1317a5f8eab6a4f6d5e48c4c07
|
|
Send the gf_group index as argument into the function. This
prepares later re-use of this function in the tpl model.
Change-Id: Id6203105629e687172c651a013d38c207b60ace7
|
|
Use case is for layered (SVC) coding to allow higher
resolution layers to continue decoding with temporal references,
while base spatial layer is intra-only frame.
Made encoder changes to real-time path for encoding intra-only
frame. The intra-only frame will be followed by the overlay/copy
frame (with both packed in the same superframe).
Use existing control to enable intra_only frame.
Intra only is only applied to base spatial layer, and only
allowed under fixed/non-flexible SVC mode, and only for
1 < number_spatial_layers < 4.
Added svc datarate unittest for inserting intra_only frame
as sync frame. Added svc end to end tests to check mismatch.
Change-Id: I2f4f0106b2c4f51ce77aa2c1c6823ba83ff2f7a0
Signed-off-by: Marco Paniconi <marpan@google.com>
|
|
The avg_frame_low_motion metric is only computed on the
top spatial layer, and since its part of the layer context
struct, it needs to written to all lower spatial layers for
consistency.
Small/minor change in metrics.
Change-Id: I92a001c37aeb332e613212288b13a2ed9745af88
|
|
Fix condition in frame dropper for SVC to handle case
where spatial layer is skipped encoded (due to 0 bitrate).
Change-Id: I24185178774d73e8bb1c406acc0292422dfbe174
|
|
Add encoder control to allow application to insert
spatial layer sync frame. The sync frame disables
temporal prediction for that spatial layer.
This is useful for RTC application to have receiver
start decoding a higher spatial layer, without inserting
a key frame on base spatial layer.
If the layer sync is requested on the base spatial layer
this then force a key frame, otherwise it only disables
the temporal reference for that spatial layer, allowing
temporal prediction to continue for the other layers.
Although the temporal prediction is disabled and reset
on a layer sync frame, the inter-layer prediction for the
sync frame is enabled on INTER frames. So the meaning of
INTER_LAYER_PRED_OFF_NONKEY is modified to mean disable
inter-layer prediction on non-key and non-sync frames.
Added unittest for inserting layer sync frames.
Bump up ABI version.
Change-Id: Id458acc400a77c853551f125c4e7b6d001991f03
|
|
|
|
When the second (gf) temporal reference is used in SVC:
the reference is refreshed on base TL superframes, and so
the rc->frames_since_golden counter was also only updated on
base TL frames. But this was disabling the golden reference
from being used as a temporal reference for TL > 0 frames
(since frames_since_golden was 0/not updated on TL > 0 frames).
Fix is to copy the update of rc->frames_since_golden to all
upper temporal layers. This allows TL > 0 frames to test the
golden inter mode.
Gain on RTC set: ~2%, ~8% on desktop_vga clip.
Encode time increase ~5-8% on linux, 3SL-3TL run with 1 thread.
For now keep this off for TL > 0 frames in speed features, so
this change does not change current behavior for speed >= 7.
Change-Id: I405708f3f80039ae47bd64ec53e66f92160acd9e
|
|
Change-Id: I3c9aefd3ea5028797b9105d7e49b1cb2f762a9fc
|
|
For the feature of using second temporal reference (when
inter-layer is off): move the buffer_idx assignement and
refresh flag settings further down to vp9_rc_get_svc_params(),
since is_key_frame is set there for every frame/layer.
Otherwise it was using the setting from the previous frame/layer.
This makes the refresh more consistent for both layers for
2 spatial layers case.
Small/negligible change in metrics.
Change-Id: I88279243bc27898448e8891dba38143d936cf6d5
|
|
Bump up ABI version.
Change-Id: I4498d7ea4ed72994c5f847aa98e75b0150dd7f82
|
|
When inter-layer prediction is disabled on INTER frames, allow
for next highest resolution to have second temporal reference.
Current code allowed for only top/highest spatial layer.
Change-Id: I102137273e3e4d57512a13d95e8ccb9c5b0a7b4b
|
|
For the case where a second (long term) temoral reference is
used in the SVC: this additional parameter is to make sure the
buffer slot selected for this reference is available for usage,
i.e., it is never used for any of the 3 references set for the
fixed SVC patterns.
And some code cleanup (replace cpi->svc).
No change in behavior.
Change-Id: Icba46edfbbefb94d5ea8e2d5c24cccd85a406ee6
|
|
Allow for second temporal reference for top spatial layer in SVC,
when inter-layer prediction is disabled on INTER frames.
The second temporal reference is labelled as the golden reference
and the update/refresh of this reference buffer is only on base
temporal layer superframes. For now the period of refresh is
fixed at every 20 TL0 superframes.
Average gain is ~4% on RTC set, several clips up
by ~8-12%. Speed loss is about ~2% on mac.
Feature is disabled as default for now.
Change-Id: I2e5db5052c62dbe958a3b14be97d043823b7a529
|
|
Add condition of LAST frame to the consec_zeromv and
avg_frame_low_motion metrics. This is needed for SVC as
the golden reference is a spatial reference and should
not be included in the metric computation.
Small/negligible change in metrics on RTC set.
Change-Id: I6ea16298fae566bb288c34cf50d120b509146eee
|
|
The avg_frame_low_motion and consec_zeromv are frame-level
metrics that are updated on every frame. For SVC these should be
updated on top spatial layer (full resolution).
Small/negligible change in metrics.
Change-Id: Ibe14f05be3b82daa9dd60378097ff11a27f1b95e
|
|
Move the adjustment code to separate function.
Change-Id: I876b246a5c26095f262bb9a19f03d1f17077225d
|
|
|
|
This is a combination of the following 3 reverts. The changes cause
issues on certain hardware devices. We'll pull them for now to allow for
further investigation.
Revert "Experiment regarding playback problems on Bravia TVs."
This reverts commit 624f8105f5ae7e0bc82bdc7e10a4253295134a8b.
Revert "Improved slide show coding"
This reverts commit f4091bc30eef0fcacb5d5bd74ab7cfbc3c8aab5f.
Revert "Improved coding on slide show content."
This reverts commit 2fa333c2ae1b6fcc1864de12a7ad344a16e2ac0a.
BUG=b/77492144
Change-Id: Ifba937792d644a9286307262f050216408e8ecf4
|
|
For CBR mode with aq-mode=3: reduce delta-q for second
segment and limit how much the frame-level q can decreae
from one frame to the next.
Reduces bitrate spikes in slide/sreen content.
Change-Id: Id9ac4b7270f07e09690380755cfbef4aec5c26dc
|
|
Move frame dropper to after scene detection and noise estimation.
Scene detection and noise estimation operate on source data and
update metrics along sequence, so they should be moved before
the frame dropper.
Also we don't want to drop on scene change, as the scene detection
and (possible) re-encode step will be missed.
Change-Id: I3d9e16d785bd5ace6707db2abce77ddc110bfef4
|
|
For any spatial, limits the amount of consecutive frame drop.
Change-Id: I692d90363f329f571f2b59e12cc680ad2e76065d
|
|
For screen content mode: changes to reduce occurence of
significant QP decrease (from one frame to next),
which can cause large frames (overshoot/delay).
-cap the buffer increase to optimal level for frame drop
mode where full superframe can drop
-reduce the max_adjustment_down due to buffer overflow
-reduce qp threshold to trigger re-encode on large frame
Change-Id: I3e30e4814192b5f728abff3f7359eb64f561b8f0
|
|
This will check for dropping full superframe if any
spatial layer is overshooting.
Change-Id: Ic656807028ebef5552301b6d10399fbe3a6c890c
|
|
Keep a lower rate threshold for video case.
Also lower the exiting threshold somewhat for screen-content mode.
Change-Id: I79649a36678d802fd4d4080754fd366e78904214
|
|
To save a branch.
Change-Id: Ifa2be7583e95c6991784731c654bbd4cce31e993
|
|
|
|
For CBR mode: modify the qp clamping to allow q to respond
faster to overshoot. Can reduce some suprious overshoot events
observed in screen content coding.
Change-Id: I0b3f54b0d1b4086182f834e557a4121950b176d4
|
|
This piece was carried over the VBR routine, for CBR
mode we don't want to apply this limit.
Change-Id: Ib9e9937eabeff8cfd30e11c9bd17444cc2b591aa
|