Commit Graph

9982 Commits

Author SHA1 Message Date
Jerome Jiang
2acb7fc1d3 Clean up is_two_pass_svc.
Change-Id: I9e92616471be380d3ba4e2b85399d7eb9f687d2f
2018-04-13 15:36:39 -07:00
Paul Wilkins
768b018d18 Merge "Add extra case to wq_err_divisor()" 2018-04-12 10:42:50 +00:00
Marco Paniconi
0ea4e229a7 vp9-svc: Make constrained_layer_drop default for svc.
Switch the order of constrained and layer drop mode,
and keep constrained_layer_drop as the default.
Update the svc datarate tests.

Change-Id: I764270f7b4964b87b0cd3da6c2f96a628f212a30
2018-04-09 09:53:28 -07:00
Marco Paniconi
7255ff9b85 vp9-svc: Hybrid search on spatial layers whose base is key.
For spatial layers whose base is a key frame, i.e., when
svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame = 1,
allow for hybrid search, similar to what we do on key frames.

For small blocks (<= 8x8) rd-based intra search will be used,
otherwise non-rd pick mode is used.

Feature is controlled by nonrd_keyframe, which is set to 1
for now on non-base spatial layers, so this change has
currently no effect.

Small change only when inter-layer prediction is off, as we now
call vp9_pick_intra_mode instead of vp9_pick_inter_mode on key frame.
But this change is very small/insignificant.

Change-Id: I5372470f720812926ebbe6c4ce68c04336ce0bdd
2018-04-06 11:36:48 -07:00
Marco Paniconi
4934e52e43 Revert "vp9-svc: Fix to first superframe when inter_layer is off."
This reverts commit 5cc8df5bcf.

Reason for revert: <INSERT REASONING HERE>
We need to do this on all key frames in the stream (not just the first one). Will make another cleaner change for this.

Original change's description:
> vp9-svc: Fix to first superframe when inter_layer is off.
> 
> When the application selects the setting INTER_LAYER_PRED_OFF
> each spatial stream should be decodeable separately.
> For this we need to force key frames on all spatial layers
> on the first superframe.
> 
> In order to maintain the quality at the beginning of the stream
> the active_worst for spatial layer of the second superframe is set
> to the last_QP of the correspondng spatial layer of the first superframe.
> Also make sure nonrd_keyframe is set for non-base spatial layers.
> 
> Change only affects SVC mode wit number_spatial_layers > 1 and
> svc->disable_inter_layer_pred == INTER_LAYER_PRED_OFF.
> And only affects first and second frame of sequence.
> 
> Change-Id: I8ee9a0873ab1d3a02515774571f719617771ad41

TBR=marpan@google.com,builds@webmproject.org,jianj@google.com

Change-Id: If73d9f3932224fc6751e773763adf7e8ee67d17f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2018-04-06 05:41:56 +00:00
Marco Paniconi
5cc8df5bcf vp9-svc: Fix to first superframe when inter_layer is off.
When the application selects the setting INTER_LAYER_PRED_OFF
each spatial stream should be decodeable separately.
For this we need to force key frames on all spatial layers
on the first superframe.

In order to maintain the quality at the beginning of the stream
the active_worst for spatial layer of the second superframe is set
to the last_QP of the correspondng spatial layer of the first superframe.
Also make sure nonrd_keyframe is set for non-base spatial layers.

Change only affects SVC mode wit number_spatial_layers > 1 and
svc->disable_inter_layer_pred == INTER_LAYER_PRED_OFF.
And only affects first and second frame of sequence.

Change-Id: I8ee9a0873ab1d3a02515774571f719617771ad41
2018-04-05 21:25:55 -07:00
Marco Paniconi
a4e453f668 vp9-svc: Fix to disable cyclic refresh on key superframes.
Cyclic refresh is disabled on key frames, but we did not
disable it for for spatial layers whose base is a key frame
(i.e., on a key-superframe).

This fix means generally somewhat lower frame-level QP will be
used for those spatial layers whose base is a key frame,
which will generally mean little better quality for the
key-superframes.

Change-Id: Idf090651aa2f5856fb6696c89198a9f6d5d50280
2018-04-05 15:58:36 -07:00
Marco Paniconi
9336197663 Merge "vp9-svc: Fix in choose_partitioning for different scaling." 2018-04-04 05:59:00 +00:00
Marco Paniconi
c9b6c5d5ad vp9-svc: Fix in choose_partitioning for different scaling.
In the SVC encoder LAST ref frame should be the last temporal
reference at the same resolution. This is the case for the default/fixed
patterns, but may not be the case for arbitrary pattern in flexible mode.

Add check that the LAST reference frame has same resolution as the current frame.
If the reference scale for LAST is different from current treat the current
frame as key frame just for the purpose of superblock partitioning.
This avoids potential segfault in vp9_int_pro_motion_estimation() for different
scaled reference.

Change-Id: I4276ff616de46cd4e12c73316f85ae313f170242
2018-04-03 16:21:44 -07:00
Linfeng Zhang
47f22fc5fb rm CONVERT_TO_SHORTPTR in vpx_highbd_comp_avg_pred
BUG=webm:1388

Change-Id: I1d0dd9af52a1461e3e2b2d60e8c4b6b74c3b90b0
2018-04-03 15:36:41 -07:00
Linfeng Zhang
c3ba5c521e Merge changes I5704bd66,I4d548e97
* changes:
  Shrink size of mode_map in struct TileDataEnc
  Update sad4d x86 functions
2018-04-02 16:05:05 +00:00
Marco Paniconi
81e78a1d5f Merge "vp9-svc: Fix in pickmode for key frames." 2018-03-29 18:49:26 +00:00
Jerome Jiang
70b86af22e VP9 SVC: Add enum type for framedrop_mode.
Change-Id: I3d4697b00729553e0860762b9264e29b8a89b9d4
2018-03-29 10:49:06 -07:00
paulwilkins
e0b28ad696 Add extra case to wq_err_divisor()
Add extra case for 360P and smaller.
This hurts a little in psnr for the derf cif set but helps a little
in terms of average rate accuracy. Most clips come in a little
smaller with this patch.

No impact on larger formats.

Change-Id: I5056246cb53b90f961ff9ea5813937f33778aa4c
2018-03-29 12:52:15 +01:00
Marco Paniconi
fe72ba15ac vp9-svc: Fix in pickmode for key frames.
For the fixed/default SVC patterns, GOLDEN is the
spatial reference, except on key frames, where LAST
is labeled as the spatial reference.

The current code was assuming GOLDEN is always the
spatial reference for the purpose of selecting the
subpel motion (due to the downsampling filter).

Fix is make sure flag_svc_subpel is set and used
with spatial_ref, which is labeled as the proper
spatial reference before entering mode check.

Some quality improvement on key frames.
Change-Id: Id236bcd47055b035731cc910ed84449d7e29f50c
2018-03-28 16:57:08 -07:00
Marco Paniconi
e358cf0a43 vp9-svc: Modify logic for frame dropping with spatial layers.
In the constrained framedrop mode for svc: modify the buffer check
condition relative to (non-zero) dropmark to include uppper spatial layers,
in addition to the current spatial layer.

But keep the single layer check if the buffer goes below zero, since
in this case (buffer underflow) we should force drop of that layer
regardless of upper layers.

Change-Id: Id277f0b4a3ae6275effdd5f5f0c80e3229c17424
2018-03-28 13:00:00 -07:00
Linfeng Zhang
cd83802885 Shrink size of mode_map in struct TileDataEnc
To reduce the memcpy() cycles in vp9_rd_pick_inter_mode_sb().
The maximum value of mode_map is (MAX_MODES - 1) = 29.

Change-Id: I5704bd66838ea0b075f0afb001f5cbebfd3f1602
2018-03-28 12:50:31 -07:00
Marco Paniconi
7b9984b386 vp9-svc: Add logic to enable for constrained framedrop.
Add the logic for the constrained framdrop mode for SVC.

Add test case in datarate unittests.
Also lower target bitrates in the tests to better test
frame dropper.

Change-Id: I8ee1b8cb56d835c233ad1fbe0fc1456cb2e7291f
2018-03-27 15:02:12 -07:00
Marco Paniconi
223f9e3671 vp9-svc: Allow for setting frame drop thresholds per layer.
Add encoder control to set the frame drop thresholds per
spatial layer, and add a frame drop mode: 0 = per-layer drop,
and 1 = constrained drop mode (a drop on a given layer forces
drops to all upper layers).

Default is mode 0 (per-layer dropping).
Implementation for mode 1 will come in subsequent change.

If the control is not used, then the spatial layer frame
drop thresholds (water mark) are all equal and set to the value
given by the encoder config (oxcf->drop_frames_water_mark).

Bump up the ABI version.

Change-Id: Id038d4181b86fa98b3d44d026f96d5f344d81629
2018-03-26 13:56:55 -07:00
Paul Wilkins
2b800d9394 Merge "Adjustment to initial q range estimate and kf boost." 2018-03-24 11:27:12 +00:00
James Zern
c13aaf7a3e Merge changes Ied91c7ef,If2dcc6e2,Ib7397e71,Ib6392c79
* changes:
  Fix implicit-fallthrough warnings
  Fix dangling-else warnings
  Fix a strict-overflow warning
  Rename several static NEON iht functions
2018-03-23 03:56:50 +00:00
Jerome Jiang
4bff5bca92 Merge "vp9 svc frame drop: enable adaptive rd for row mt." 2018-03-23 01:41:21 +00:00
Jerome Jiang
1ae97b4a4d vp9 svc frame drop: enable adaptive rd for row mt.
adaptive_rd_threshold_mt is set to 1 when speed >= 7 for SVC.
QVGA in SVC uses speed 5 which set adaptive_rd_threshold_mt to 0.
If VGA or HD is dropped for the last super frame, the flag is still 0
when the encoder is destroyed. Thus memory won't be released.

Change the bitrate threshold in datarate test.

Change-Id: I55352cc0b030568d38eb735d99c2fa29058d3690
2018-03-22 17:11:05 -07:00
Linfeng Zhang
5192ce92b8 Fix a strict-overflow warning
Compiler -- gcc (Debian 7.3.0-5) 7.3.0

./libvpx/vp9/encoder/vp9_denoiser.c:374:9: assuming signed overflow
does not occur when assuming that (X + c) < X is always false
[-Wstrict-overflow]
         for (j = 0; j < xmis; j++) {

Change-Id: Ib7397e718ff717bdabc088fc4c6e1771381fb522
2018-03-22 11:42:25 -07:00
Linfeng Zhang
a09acf7e19 Rename several static NEON iht functions
Change-Id: Ib6392c79d0269a43dbe180a89f2571482d98844d
2018-03-22 11:13:12 -07:00
James Zern
62c4747532 Merge "vp9_highbd_iht8x8_add_neon: rm unused functions" 2018-03-21 17:52:47 +00:00
Jerome Jiang
1f82e06122 VP9 SVC: Add control to disable inter layer prediction.
Add VP9E_SET_SVC_INTER_LAYER_PRED to disable inter layer (spatial)
prediction.
0: prediction on
1: prediction off for all frames
2: prediction off for non key frames

Bump up ABI version.

Change-Id: I5ab2a96b47e6bef202290fe726bed5f99bd4951f
2018-03-20 19:28:12 -07:00
Marco Paniconi
126a3718fc vp9-svc: Improve frame dropper for spatial layers.
SVC frame dropper: modify the logic to allow for individual
spatial layers to drop. This removes the constraint that all
upper spatial layers must drop when a given spatial layer drops.

Add a flag to the pkt to indicate whether a spatial layer is
encoded or dropped. This is needed for applications that enable
this feature (frame dropping for SVC).

For a current spatial layer, if its previous spatial layer is
dropped, then disable certain features for that layer:
inter-layer prediction, base_mv, partition_reuse, copy partition.

Also add the constraint to never drop a spatial layer if its
base layer is a key frame.

Updates to sample encoder (vp9_spatial_svc_encoder) and the
SVC datarate unittests to properly handle frame dropping.

Bump up ABI version.
Change-Id: I7d14ccf67b8d014a7abfce5ba3989fc623e94067
2018-03-20 10:34:45 -07:00
James Zern
0dad4e2997 vp9_highbd_iht8x8_add_neon: rm unused functions
their use was removed in:
d8424d289 Fix a bug in vp9_highbd_iht8x8_64_add_neon

Change-Id: I041800f3fb34ffbb7cfa7401370c5a5ceeab01c6
2018-03-18 18:24:41 -07:00
paulwilkins
da7a7089c6 Adjustment to initial q range estimate and kf boost.
Adjustment to initial active based on image size.
Add extra breakout case for kf boost loop.
Small adjustment to q delta calculation for key frames.

Net % improvements for all standard tests sets (-ve values) measured
using c-bvr mode.

(Overall PSNR, SSIM, PSNR-HVS)
Low Res:  -0.223	-0.229	-0.107
Mid Res:  -0.175	0.008	-0.180
High Res: -0.131	0.106	-0.206
NFlix 2K:   -0.390	-0.271	-0.489
NFlix 4K:   -1.370	-0.825	-1.590

Change-Id: I06a39de43594e1a99bb0cb281af15cdb8058a8ed
2018-03-16 12:24:54 +00:00
Marco Paniconi
2640f25072 vp9-svc: Frame dropper for SVC.
If a given spatial layer decides to drop, due to the
buffer/overshoot conditions for that layer, then drop
that current spatial layer and all spatial layers above.

In the current implementation the svc frame counter
(and hence the pattern for the non-flexible SVC case)
are updated on frame drops.

Also add last spatial layer encoded to the pkt.
This is useful for RTC applications that enable
frame dropping for SVC.

Update to the SVC datarate tests:
enabled frame dropper on all SVC datarate tests, and
made a fix to properly set the temporal_layer_id, which
works now even on frame drops.

Change-Id: If828c193f3cb6b1839803fd52fe9fbbda5b5a039
2018-03-15 21:04:59 -07:00
James Zern
b986ba84b3 Merge "Revert "vp9_loopfilter.c: zero lfl_uv"" 2018-03-16 02:11:52 +00:00
James Zern
e97804c67d Revert "vp9_loopfilter.c: zero lfl_uv"
This reverts commit 13d0955b25.

Reason for revert:
this should be investigated further to ensure the memset is really
necessary outside of the static analysis pass.

Original change's description:
> vp9_loopfilter.c: zero lfl_uv
> 
> The initialization depends on cm and mi_row which static
> analysis does not approve of.
> 
> Clears a static analysis warning:
> warning: The right operand of '+' is a garbage value
> const loop_filter_thresh *lfi = lfthr + *lfl;
> 
> Change-Id: I8c863ced2b1e9a7e10103b7281098f20941a6ca2

TBR=johannkoenig@google.com,marpan@google.com,builds@webmproject.org,jianj@google.com

Change-Id: Icadb6438fbcddba747622f06f2eadebdb333edf6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2018-03-15 21:43:29 +00:00
Johann Koenig
b24e377008 Merge changes I5501d0d6,I8c863ced,I19895d06,Ifa39353d,I09bd209b
* changes:
  vp9_resize.c: assert vp9_highbd_resize_plane conditions
  vp9_loopfilter.c: zero lfl_uv
  vp8 rdopt.c: zero rd.[rate_uv|distortion_uv]
  vp8 mfqe: zero map[]
  temporal svc: zero layer_target_bitrate
2018-03-15 21:16:43 +00:00
Johann Koenig
f3adb45914 Merge "remove spatial svc experiment" 2018-03-15 19:26:16 +00:00
Linfeng Zhang
5dfb01bb30 Merge "Add vp9_highbd_iht16x16_256_add_neon()" 2018-03-15 19:21:36 +00:00
Linfeng Zhang
ddb3d7a8a1 Merge changes I9e0bf2c7,I695b4090
* changes:
  Fix a bug in vp9_highbd_iht8x8_64_add_neon
  Fix a bug in vp9_highbd_iht4x4_16_add_neon()
2018-03-15 18:05:08 +00:00
Marco Paniconi
881c8ec816 vp9-svc: Bugfix to dyanmic enabling/disabling of layers.
Fix a bug when middle and top spatial layer are skip encoded
(disabled) and then re-enabled again, during the sequence.

Issue is that pending_frame_count in the packing may
be incremented on middle layer, even though that layer is skipped
(not encoded and hence zero size). Fix is to add size check.

Modified existing unitest to reproduce the issue.

Change-Id: I86d806a112d468e06b04fbf7c46ae07db9e0ad93
2018-03-14 17:31:59 -07:00
Johann
a3f09c03b8 vp9_resize.c: assert vp9_highbd_resize_plane conditions
Clears static analysis warnings similar to the low bitdepth version:
commit c4367b9b51
Author: James Zern <jzern@google.com>
Date:   Wed Mar 18 14:34:30 2015 -0700

    vp9_resize_plane: quiet some static analysis warnings

Change-Id: I5501d0d6ad7c7720d746d53ec07078cb9051d0d7
2018-03-14 16:42:14 -07:00
Johann
0e97e70496 remove spatial svc experiment
Change-Id: Ifda11caaf992d10f2d93d6cd1d07b79b6047be05
2018-03-14 22:00:28 +00:00
Johann
13d0955b25 vp9_loopfilter.c: zero lfl_uv
The initialization depends on cm and mi_row which static
analysis does not approve of.

Clears a static analysis warning:
warning: The right operand of '+' is a garbage value
const loop_filter_thresh *lfi = lfthr + *lfl;

Change-Id: I8c863ced2b1e9a7e10103b7281098f20941a6ca2
2018-03-14 14:22:08 -07:00
Marco Paniconi
f50ad31ec1 vp9-svc: Fix to update layer counters when layer is skipped.
Update layer counters when layer is skipped,
for any spatial layer.

Change-Id: Ie37c4a16ccafdef3390b651dec473beb5d926896
2018-03-14 11:51:01 -07:00
Linfeng Zhang
9351f96069 Add vp9_highbd_iht16x16_256_add_neon()
BUG=webm:1403

Change-Id: I2293c11666786be276909d48ee78dacb40a89e25
2018-03-13 17:39:23 -07:00
Linfeng Zhang
d8424d2890 Fix a bug in vp9_highbd_iht8x8_64_add_neon
This bug was introduced in 29b6a30c.

BUG=webm:1403

Change-Id: I9e0bf2c7a01d8ff1c714c12236f7985b772b0540
2018-03-13 17:38:29 -07:00
Linfeng Zhang
88dc0d6062 Fix a bug in vp9_highbd_iht4x4_16_add_neon()
This bug was introduced in 36363304.

BUG=webm:1403

Change-Id: I695b409047e41ab7e0460981524310d78753751a
2018-03-13 16:10:00 -07:00
Marco Paniconi
312745cac4 vp9-svc: Update layer frame counters when layer is skipped.
When an enhancement spatial layer is skipped, we should check
for updating the layer frame counters.

Change-Id: Ib79d0955c62fb465f59ef2f9ac45240ae2614d7b
2018-03-12 12:21:10 -07:00
Marco Paniconi
3223a3f892 vp9-SVC: Fix to choose_partition when LAST ref is NULL.
This causes assert to trigger in choose_partitioning().
This can happen in some cases when enhancement layers
are enabled midway during the stream.

Change-Id: I69c3c8b4b1e3f1c7d8d7294d633ca5ddca148e8b
2018-03-12 09:13:25 -07:00
Paul Wilkins
7987f35391 Merge "Change to KF frame boost calculation." 2018-03-08 13:34:15 +00:00
Linfeng Zhang
d18477b449 Fix a bug in vp9_iht16x16_256_add_neon()
This bug was introduced in 88c23864.

BUG=webm:1403

Change-Id: If96fd6f102be6b9bda866e55e574257287746f4a
2018-03-05 16:14:35 -08:00
Linfeng Zhang
c244a86234 Fix a bug in vp9_iht8x8_64_add_neon()
This bug was introduced in b14b616d.

BUG=webm:1403

Change-Id: I84b2733734982e52b66548850d61758c772b5494
2018-03-05 15:33:37 -08:00