Commit Graph

90 Commits

Author SHA1 Message Date
Jerome Jiang
8ac72859e1 vp9 svc sample: set fps from y4m file
Change-Id: I082c0409910da4cda5bf852b20ffa11ba5c2ebd6
2022-05-03 10:46:46 -04:00
James Zern
872732b2c9 examples: add missing argv_dup alloc checks
Change-Id: Ia3080cbf50071d599c7168a20466392a963f101a
2022-04-28 17:45:47 -07:00
Marco Paniconi
232ad814de rtc-vp9: Fix intra-only for bypass mode
Allow intra-only frame in svc to also work
in bypass (flexible-svc) mode.

Added unittest for the flexible svc case.

And fix the gld_fb_idx for (SL0, TL1) in bypass/flexible
mode pattern in the sample encoder: force it to be 0
(same as lst_fb_idx), since the slot is unused on SL0.

Change-Id: Iada9d1b052e470a0d5d25220809ad0c87cd46268
2022-02-08 13:40:24 -08:00
Jerome Jiang
02392eeccc Remove two pass related code from svc sample encoder.
SVC sample encoder is only supposed to be used for realtime SVC.

Bug: webm:1705
Change-Id: I5c0c3491732db3e148073aaf7f90ee8d662b57b5
2021-02-18 09:28:45 -08:00
Jerome Jiang
7e8ea22e40 Add codec control to disable loopfilter for vp9
Change-Id: I6d693e84570c353d20ec314acea43363956c0590
2020-10-02 12:09:01 -07:00
Marco Paniconi
d1a78971eb vp9-rtc: Add control to disable maxq on overshoot
Add encoder control to disable feature to increase Q
on overshoot detection, for CBR. Default (no usage
of the control) means the feature is internally enabled.

Add the control to the sample encoders, but keep it
disabled as default (set to 0, so feature is on).

Change-Id: Ia2237bc4aaea9770e5080dab20bfff9e3fd09199
2020-08-25 13:06:41 -07:00
Marco Paniconi
529c29bb0f rtc-vp9: Fix to rcstats in vp9_spatial_svc_encoder
Fixes the rcstats for case when #spatial_layers = 1.

Change-Id: Ie28d99852033307bc4c69c7e738e1d4cab4e8cf5
2020-08-17 21:52:12 -07:00
Jerome Jiang
1b9c527c62 Revert "Disable mismatch check on vp9 svc examples."
This reverts commit a1857812ea.

Change-Id: Ib33f49af7631c9a6917539a58c447624df325f7f
2019-04-10 10:48:03 -07:00
Jerome Jiang
a1857812ea Disable mismatch check on vp9 svc examples.
Change-Id: I49902a750758ba0ffe733be9b1efd0cdea44f936
2019-03-27 17:02:44 -07:00
Jerome Jiang
4bfa583c6e fix redundant cast in examples.
Change-Id: I84280de82053f9056bda9d813baa6165ca9bcd1e
2019-03-21 19:04:38 -07:00
Jerome Jiang
c72dc3963e Merge "vp9: map speed > 9 to speed 9." 2019-03-11 22:45:47 +00:00
Jerome Jiang
ae8763f153 Merge "vp9 svc: add simulcast mode when inter-layer pred is off." 2019-03-08 03:41:44 +00:00
Jerome Jiang
3529526e11 vp9 svc: add simulcast mode when inter-layer pred is off.
Force all upper spatial layers to be key frame if the base layer is key.
Mode only works for inter-layer pred=off and non-flexible mode.

Add flag to write out bitstream for each spatial layer in example
encoder.

Change-Id: I5db4543cf8697544ae49464f2157e692640d5256
2019-03-07 15:20:13 -08:00
Marco Paniconi
f93d5dd0e6 vp9-svc: Fix to sample encoder for 1 layer
Fix to vp9_spatial_svc_encoder to run case of
1 spatial, 1 temporal layer.

Change-Id: I93675c3c4bd2c55cb1c971679588525a8e5b889d
2019-03-07 12:31:59 -08:00
Jerome Jiang
0b3d922688 vp9: map speed > 9 to speed 9.
Report warning in example encoder.

Change-Id: Iec4cdffce9faa65241756fbdac498214c8b93cc1
2019-03-05 15:22:16 -08:00
Jerome Jiang
269b36ef43 vp9 svc example: use CONFIG_VP9_DECODER guarding decoding.
Change-Id: I91f2955f2936303c3e09e9b2dc60e32305ebae17
2019-03-05 11:11:16 -08:00
Jerome Jiang
c10833faa6 Test decode and find mismatch in vp9 svc example encoder.
Also write it to opsnr.stt when internal stats is enabled.

Removed some redundant code in vpxenc.c and vp9cx_set_ref.c

Change-Id: I3700137fff0be92a23e4ab75713db72da1dc4076
2019-02-11 20:18:07 -08:00
Jerome Jiang
37e1295c61 refactor vp9 svc example encoder.
Put rc stats related code into a separate function.

Change-Id: I11808bb947079b5fd9e53dfa5894bf227ed0c4c6
2019-02-11 09:37:37 -08:00
Jerome Jiang
2221ec88d5 vp9 svc example encoder accept -o (--output) for output.
Make it same as vpxenc so easier to run on borg.

Change-Id: Ie19db6e828ced773cba9aef715c8fbd0f4715b27
2019-02-08 15:47:17 -08:00
Jerome Jiang
af9aa25eb3 Merge "vp9: Write height and width to ivf header in SVC example encoder." 2019-02-07 19:31:50 +00:00
Jerome Jiang
b1ef3919b9 vp9: Write height and width to ivf header in SVC example encoder.
Write height and width of top layer to ivf header in SVC.

vpxdec Can't decode it correctly when output is y4m.

Change-Id: I9b2f1d54696611a30e252bdfd182897d191d92b5
2019-02-07 10:38:14 -08:00
Jerome Jiang
a4525dccec No vpx_img_alloc for y4m input in example encoders.
Y4M reader has its own allocation.

Change-Id: Ie02440a183126072ea773860f4e9dc9b412772f5
2019-02-05 14:12:54 -08:00
Jerome Jiang
7199f78783 add y4m support to vp9 example encoders.
vp9_spatial_svc_encoder and vpx_temporal_svc_encoder.

Change-Id: I8dfa1dfad83c83a26ddac4e7c57b5f1ff161e588
2019-01-30 12:47:10 -08:00
Johann
17c6f62628 svc examples: resolve missing declarations
BUG=webm:1584

Change-Id: Icb7ba5bb5a6d460c4d0419b76ee54af461ca4a52
2018-12-21 00:03:15 +00:00
Marco Paniconi
04b3d49bac vp9-svc: Allow for setting framerate per spatial layer.
Add duration to set_svc_ref_frame_config.

BUG=b/113346831

Change-Id: I63613aed6b1183f98d04831600a6bdd645c740df
2018-09-05 08:55:57 -07:00
Marco Paniconi
e5d2860216 vp9: Fix rate control stats for bypass mode in sample encoder
Allow rate control stats to work for bypass mode
in vp9_spatial_svc_encoder.c

Change-Id: I66764a006a73b1fd13c07b4fc4e0c88b2bb2a035
2018-08-30 13:01:34 -07:00
Marco Paniconi
b2f9b627e3 vp9-svc: Change default pattern for bypass mode
For sample encoder: keep default pattern for bypass
mode to example#0.

Change-Id: Icddc4600d750a23a44b26517a327b546fd8eb412
2018-08-27 12:08:29 -07:00
Jerome Jiang
d85c8515e3 Merge "SVC: extend api to specify temporal id for each spatial layers." 2018-08-27 17:54:52 +00:00
Jerome Jiang
ed8f189ccc Refactor: move svc example files to from vpx/ to examples/
svc_encodeframe.c and svc_context.h are only used by the example
encoder.

Change-Id: Idb41a5a9d6a229a0bc7d2bc8dbe6575a74efc54c
2018-08-16 14:44:12 -07:00
Jerome Jiang
a5c17a689f SVC: extend api to specify temporal id for each spatial layers.
BUG=b/112294545

Change-Id: I5be230c8969d69af3ad87068fdf3834ef1af11d9
2018-08-16 10:28:34 -07:00
Jerome Jiang
a66da31380 vp9-svc: Update to SET/GET_SVC_REF_FRAME_CONFIG api
Add update_buffer_slot to SVC API to allow for refreshing
any of the 8 reference buffers. Remove frame_flags from
the struct.

Remove svc tests from vp8 build.

BUG=b/112292577
Change-Id: I0551c349d2b311227245a8ed1639cdbbaf5bc5db
2018-08-09 13:56:46 -07:00
Sergey Silkin
c94dacc231 vp9-svc: add more command line options to test app.
This adds the following command line options to
vp9_spatial_svc_encoder test app:
--drop-frame=<arg>        Temporal resampling threshold (buf %)
--tune-content=<arg>      Tune content type default, screen, film
--inter-layer-pred=<arg>  0 - 3: On, Off, Key-frames, Constrained

Change-Id: I653d1924fb6e525edb2d1e84739be0b88e773e1c
2018-07-04 08:03:54 +00:00
Sergey Silkin
c5b8a93ce0 vp9-svc: fix strings concatenation in test app.
Change-Id: I292a1a5c19fd4f23b332e346d0ccac1a9c8455fc
2018-06-29 09:41:20 +02:00
Marco Paniconi
e1921294f9 vp9-svc: Add frame dropper control to sample encoder.
Disabled as default as enc_cfg.rc_dropframe_thresh is
set to 0 as default.

Change-Id: Ia888aa16b1a86a716ec33ea041e8b16b19bf93be
2018-05-29 19:31:23 -07:00
Marco Paniconi
ce11afb0e0 vp9: Changes for scene detection overshoot and SVC.
Refactor the scene detection for 1 pass cbr to allow the
scene detection to be checked once per superframe (on the base layer),
using the full resolution sources.

If scene change is detected: check for re-encoding due to
large overshoot for all spatial layers withing the superframe.

Add speed feature to control the re-encode step.
Keep the re-encode step on for now.

Small change in nonrd_pickmode to remove the possible skip of golden
reference for SVC, when the high_source_sad is set for the superframe.

Change only affects SVC encoding with screen-content mode enabled.

Change-Id: If4cfb52cb0dd0f0fce1c4214fa8b413f8f803d56
2018-04-18 12:39:56 -07:00
Jerome Jiang
be4561248d Fix settings for num of tiles in samples & tests.
The control is set by log2 of number of threads (such that the number of
tiles is the same of number of threads).

Thus it should be log2(num_threads) instead of (num_threads >> 1).

Change-Id: I2ccec5557e660048dad3e561534e1c74fc8eec1f
2018-04-06 12:52:53 -07:00
Marco Paniconi
cb63aefa45 Fix to svc sample enocoder for visual studio build.
Fix to sample encoder, for visual studio buid failure:
conversion from 'uint64_t' to 'int'.

Change-Id: I385ab8482e1ee97da9872437f8286d9071e38e0e
2018-04-03 15:09:09 -07:00
Marco Paniconi
ee37046f1b vp9-svc: Fix to svc sample encoder for write_out.
When writing out stream for spatial layer N,
make sure to include all spatial layers up to N.

Fixes an issue with the streams when frame dropping occurs.

Change-Id: I1e20b7dac6b94dcda751043541dd8a12f7df6d8c
2018-04-02 12:57:35 -07:00
Jerome Jiang
1d6f930517 VP9 SVC: Write bitstream for each spatial layer in sample.
Added control for denoiser in the sample SVC encoder.

Change-Id: I8e62aa2fc13a943eb110cb33e419e912a898bbc7
2018-03-30 15:31:35 -07:00
Marco Paniconi
3cb9c5ffe9 vp9-svc: Fix to sample encoder
Get the correct computation of number of input
layers to account for frame drops.

Change-Id: I39637381e1981b53c930da67a5c525191de6907d
2018-03-21 16:47:59 -07: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
Johann
6b2cc75622 spatial svc: set window_size to 15
Static analysis does not recognize that output_rc_stat guards
the usage of window_size. Clears this warning:
The right operand of '>' is a garbage value
if (frame_cnt > (unsigned int)rc.window_size) {

set_rate_control_stats sets window_size to 15. Zeroing it
just introduces another static analysis warning.

Change-Id: Ieee7b81a385f986e42189101cfa39279e519b368
2018-03-14 19:30:38 +00:00
Johann
f0a3979063 spatial svc: zero sizes
This should be taken care of by parse_superframe_index but
the static analysis is not recognizing it because it depends
on 'marker' which is read from the bitstream.

Clears a static analysis warning:
The right operand of '*' is a garbage value
rc.layer_encoding_bitrate[layer] += 8.0 * sizes[sl];

Change-Id: I8ee48a98f907bc7b46869fd27a351f33e2e7de71
2018-03-13 18:22:50 -07:00
Johann
b0d57f682d spatial svc: remove vpx_svc_get_message
Print error messages as they are encountered. This was the default
behavior.

Removes a static analysis warning regarding the use of strncat:
Null pointer argument in call to string length function

As this is the only use of strncat in the library, remove it and the
associated public function.

Change-Id: Id55305c5a4d65f11da88c3a2203ff824200f526f
2018-03-13 17:58:24 -07:00
Johann
6f9163db95 spatial svc: remove unused locals
Clears static analysis warning:
Value stored to 'tl' is never read

Change-Id: If047a74f508288c63d5b83ed0f3ad34f791f9312
2018-03-13 17:12:35 -07:00
Johann
7b278e3072 spatial svc: rescope sl
sl was passed to set_frame_flags_bypass_mode, triggering
an uninitialized variable warning. Inside the function it
is only used as a local variable.

Change-Id: If743626e9e10fd41d135e3b4ad6196dc4dc90172
2018-03-13 14:38:05 -07:00
Marco Paniconi
efa786d464 vp9 svc: Make top layer non-ref: for 2 TL case
Only affects 2 temporal layer case.
Modified the flags for 2 temporal layers to make
top layer (top spatial, top temporal) a non-reference
frame, conistent with the 3 TL case.

Add mismatch check to the datarate test of changing
svc pattern on the fly, which is test for 2 temporal
layers.

This re-applies the change: 254e2f5501,
that was reverted in: 658eb1d675.

Change-Id: Ib5fd4a7a0312c0c05329ae75baac480af34b4694
2018-01-31 09:17:43 -08:00
Marco Paniconi
7edd1a6cea Revert "vp9 svc: fix to make top layer frame non-ref"
This reverts commit 254e2f5501.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> vp9 svc: fix to make top layer frame non-ref
> 
> Add mismatch check to the datarate test of changing svc pattern on the
> fly.
> 
> Change-Id: I6a878736de44e6a40c077ed6430aabd7fadabdd9

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

Change-Id: Ibcb600438098f8dc380fe7e1de90cb81fc367468
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2018-01-31 16:49:16 +00:00
Jerome Jiang
254e2f5501 vp9 svc: fix to make top layer frame non-ref
Add mismatch check to the datarate test of changing svc pattern on the
fly.

Change-Id: I6a878736de44e6a40c077ed6430aabd7fadabdd9
2018-01-29 18:38:46 -08:00