Age | Commit message (Collapse) | Author |
|
|
|
Undamped adjustment is used for the first frame
of each frame type while updating the rate
correction factors.
Change-Id: I42f80daa123c4cd4e45c18c6960cc7a67e7df7e6
|
|
Factor out common conditions for better readability.
Change-Id: I2a2b576e7d3e5cf036e9e355fc7ce0509ecb3d7e
|
|
|
|
Postencode drop is only checked on base spatial
layers, and if set, whole superframe is dropped and
and next superframe is encoded at max-q.
Fix here is to make sure all layers are encoded at
max-q on a postencode dropped frame.
Change-Id: I2313d83ee29a382465bcec1085d8c73c37ce26d6
|
|
|
|
If scene/slide change is detected on current
superframe and max-q set because of high overshoot:
then if the lower/base spatial layer are skipped on
the current superframe, max-q is forced on the
next encoded base/lower spatial layers.
Change-Id: Id61efda86ee545395012e19476d19845e3932678
|
|
Feature works also for non-screen content mode,
so rename it.
Change-Id: I665362d50cf9a4017f114973586ad0eead066ddd
|
|
Remove unneeded VPX_Q condition check.
Change-Id: I46b09ae522caa47fa7ea4441b6a6ac2840315d1c
|
|
Decouple the constant q mode qp selection from vbr/cbr/cq modes.
Skip vp9_frame_type_qdelta() adjustment for non-ARF inter frames,
instead keep using the cq-level. It improves the compresson
performance:
avg PSNR overall PSNR SSIM
lowres -0.17% -0.20% -0.1%
midres -0.21% -0.24% -0.08%
hdres -0.15% -0.19% -0.04%
Change-Id: I52fd5f8edbd3fdcbeda31ee3a6d6eb016091a7e3
|
|
Factor out this common code needed all rate control modes.
Change-Id: If17850fbebcdce7ff24afb211aa2e6054486b814
|
|
Change-Id: I67b92182ee80ec5548c5a97345b6252e49033c4a
|
|
In the limited test set, it improves the cq mode compression
performance by 1.9% in PSNR and 6% in SSIM as compared to use
same quantization parameter for all ARFs.
Change-Id: I35c4d7097b5838ab0b92d7f9937520721e3bb84b
|
|
Reuse existing function for resetting temporal
layer pattern.
And fix to use first spatial layer to encode, and
some refactoring in encode_without_recode_loop().
Change-Id: Ifb22bb9de793ecb8e73f410e125c7c12383da1d2
|
|
Condition the pre-encode buffer update based on
TS diff on temporal layers = 1 for now, as some
fix is needed for the case where #temporal_layers > 1.
Change-Id: I58163b956db415217e4687a31f8ba110545b09f5
|
|
Refactor the code with some changes.
Split update into two parts: move the fillup
(with per-frame-bandwidth) before the encoding, and
keep the leaking part (with encoded_frame_size) after
the encoding (postencode).
For SVC with ref_frame_config usage: allow usage of timestamp
delta for the fillup part of buffer, instead of the (average)
framerate passed in via the duration.
Moving the buffer fillup (+per-frame-bandwidth) part to the
pre-encode causes some difference in performance
(since buffer level affects active_worst/QPand frame-dropping),
but the change is observed to be small.
Made small adjustment to active_worst_quality to compensate.
Adjust some thresholds in datarate tests.
Change-Id: I81a5562367034f318cffd451304bc4a34bf02a1d
|
|
|
|
Encode the next frame at max q.
For layers: post_encode_drop is only check on base
spatial layer, and if base is post-encoded-dropped,
then whole superframe is dropped.
Added API to guard postencode dropping. Turned off by default.
Added unittest.
BUG=b/112990050
Change-Id: I42fee279014aca616f7a4d9b582cb2bf5da2f2e7
|
|
Increase search area, use NSTEP, and in some cases avoid
bsize below 16x16. This for base spatial layer when many blocks
in the frame have motion (from scene detection analysis).
Improves quality for scrolling motion.
Change-Id: If77b43e738a6c43610d4727a95712667088db564
|
|
Space the quantization parameter distribution according to the
layer depth for multi-layer ARF coding structure. This allows
lower layers to have relatively smaller quantization parameters
than higher layers. It improves the compression performance
in constant q mode for multi-layer ARF system:
avg PSNR overall PSNR SSIM
lowres -0.33% -0.31% -1.44%
midres -0.29% -0.38% -1.14%
hdres -0.27% -0.49% -1.02%
Change-Id: I9cfe2f27e6c0029c30614970a46de3045840264e
|
|
After the frame quantizer estimate run in tpl model, reset the
actual value assigned to the current coding frame. This would
avoid certain frame update flags being overwritten by different
frame types' update.
Change-Id: Idde2ba1108f1f68747b14149b211f882965c99f0
|
|
Properly compute the extended GOP frames' buffer offsets.
Change-Id: I9aed14f4b8d623f1832e782828dce07aa546507d
|
|
Make it support both single- and multi-layer ARF GOP structure.
Change-Id: I760a95804d1b583b057120f6d6be65195a0e6c19
|
|
If we are using keyframe only coding - either coding a
single frame, or a sequence of keyframes - in the end-usage=q
mode, use the cq_level directly as the quality of each
coded frame, rather than boost them.
Ported from AV1: 563a0d1eb92bdc1e987df071a568d8406c4ffa92
Change-Id: I6dc929b8b4f0aa18e279139077f3a87958c92245
|
|
|
|
Add a MID_OVERLAY_UPDATE abstract to support multi-layer
ARF-Overlay frame based approach. When setting the frame update
type to be USE_BUF_FRAME, the encoder will use show_existing_frame
to process the intermediate ARF frames. When setting the frame
update type to be MID_OVERLAY_UPDATE, the intermediate ARF frames
will go through an overlay frame for display.
Change-Id: Ia0c91452c09d39312ac22d855cdf681b7da851c5
|
|
When multi-layer ARF is enabled, use the corresponding gfu_boost
factor assigned to each ARF to compute the best_quality_index
adjustment. This on average improves the coding performance by
0.2% for lowres and hdres, 0.4% for ntflx2k. It seems this change
will only affect a small group of clips, e.g., pamphlet, bowing,
mobcal_720p, etc., which tend to gain 4-5%, whereas the rest
clips remain largely identical coding statistics.
Change-Id: Ie19636a6cf32214aefd73e21ead2aea647ddbca8
|
|
Make direct use of frame type in the available VP9_COMMON structure.
Eliminate the need to map through rf_level to fetch the frame type.
This change doesn't alter the coding stats. It simplifies the
vp9_frame_type_qdelta() function logic and removes unnecessary
reference to rf_level.
Change-Id: I1a7b2f5abcae39aa4a60d08a6011dde38ecf3b58
|
|
This rate control bug in the original patch is not the underlying cause
of the quality regression but simply unmasked a problem which stems
from applying 0 bits to the last frame in a short KF group at the start
of a chunk.
This reverts commit d10b1f233657054b1465d40f0b409c20029a540b.
Change-Id: I32c91a24a14d013853bb8e5587aa69600e6a0063
|
|
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
|