Commit Graph

69 Commits

Author SHA1 Message Date
Debargha Mukherjee
7ceba7c26b Fix a spatial svc assert failure
Fixes spatial svc rc assert failure introdcued in:
https://chromium-review.googlesource.com/#/c/312959/1

Change-Id: I6096bfbc484859d71a5fb55e6a3248a31885af61
2015-12-01 14:24:50 -08:00
Marco
eed5494fc6 vp9-svc: Fix to key frame counter for spatial layers.
Existing condition only applied to temporal layers.

Change-Id: Icef20a59d0afc61d4e14dea01aff4786fa9e41ae
2015-11-18 14:31:37 -08:00
Marco
4fb2ba2861 VP9-SVC: Allow frame dropping due to overshoot for spatial layers.
For 1 pass CBR mode.

Change-Id: I8bceb489a850ec26f05382eecb5c0c32a1bb8883
2015-10-27 14:51:47 -07:00
Marco
7266bedc04 Add first_spatial_layer_to_encode to SVC.
Use the existing VP9_SET_SVC control to set the
first spatial layer to encode.

Since we loop over all spatial layers inside the encoder, the
setting of spatial_layer_id via VP9_SET_SVC has no relevance.
Use it instead to set the first_spatial_layer_to_encode,
which allows an application to skip encoding lower layer(s).

Change only affects the 1 pass CBR SVC.

Change-Id: I5d63ab713c3e250fdf42c637f38d5ec8f60cd1fb
2015-10-06 08:56:15 -07:00
Marco
c05c58f8ff aq-mode for SVC: Add consec_zero_mv to layer context.
Change-Id: I63fadf1c7240d4b2893384f75c519311e9659d47
2015-09-29 10:01:53 -07:00
Marco
730cdefd3e Add SVC codec control to set frame flags and buffer indices.
Add SVC codec control to set the frame flags and buffer indices
for each spatial layer of the current (super)frame to be encoded.
This allows the application to set (and change on the fly) the
reference frame configuration for spatial layers.

Added an example layer pattern (spatial and temporal layers)
in vp9_spatial_svc_encoder for the bypass_mode using new control.

Change-Id: I05f941897cae13fb9275b939d11f93941cb73bee
2015-09-17 09:37:15 -07:00
Marco Paniconi
f6097ef243 Merge "SVC fix to set worst/best_quality per layer." 2015-09-15 22:06:13 +00:00
Marco
15c43d9ac7 SVC fix to set worst/best_quality per layer.
Allow the worst/best_quality to be set per layer via the
VP9E_SET_SVC_PARAMETERS control.

Change-Id: Icba5ec8ac757152f3bb7860d6010d9174a7bd578
2015-09-15 14:16:07 -07:00
Marco
eb53c69ece Add cyclic refresh parameters to svc-layer context.
For 1 pass CBR spatial-SVC:
Add cyclic refresh parameters to the svc-layer context.

This allows cyclic refresh (aq-mode=3) to be applied to
the whole super-frame (all spatial layers).
This gives a performance improvement for spatial layer encoding.

Addd the aq_mode mode on/off setting as command line option.

Change-Id: Ib9c3b5ba3cb7851bfb8c37d4f911664bef38e165
2015-09-15 10:06:36 -07:00
Johann
c5f11912ae Include vpx_dsp_common.h when using VPXMIN/MAX
Change-Id: I2e387a06484a06301f3cd6600c4ba2f4335b61ee
2015-08-31 14:36:35 -07:00
James Zern
5e16d397bd vpx_dsp_common: add VPX prefix to MIN/MAX
prevents redeclaration warnings;
vp8 has its own define which will be resolved in a future commit

Change-Id: Ic941fef3dd4262fcdce48b73075fe6b375f11c9c
2015-08-26 20:11:32 -07:00
James Zern
a390b90f01 vp9_update_layer_...config: delete dead assignment
Change-Id: I7401a70a3f33d13fa1ab0393e59fceb5ef083534
2015-08-25 18:45:05 -07:00
Debargha Mukherjee
653832ea06 Prevent an ASAN failure for svc tests
This patch just fixes the test for the time being, but does not
actually solve the underlying issue, which still needs investigation.

Change-Id: I54a35de839723f5b499b57e38dd2bdd400adc427
2015-08-24 10:28:02 -07:00
Jingning Han
89af744ba6 Change vp9_ prefix function names in vpx_scale to vpx_
Change-Id: Iac85902cbbb3e752801dc85de9a3c778e47304aa
2015-08-14 15:27:43 -07:00
Marco
24b3ede251 Remove redundant second declaration in svc_layercontext.c
Change-Id: Ia3b1c1db54204fd92a56b7f698a9f26d27ee572a
2015-06-15 14:06:43 -07:00
Marco
8f7e7663ad Bugfx in setting layer framerate.
Index for ts_rate_decimator should be temporal layer (tl) index.

Change-Id: I0320b7f7ae987ef64fdfe7c45099e7978a8fef17
2015-06-04 13:12:09 -07:00
Marco
c139b81a13 Vidyo patch: Rate control for SVC, 1 pass CBR mode.
-Make Rate control work for SVC 1 pass CBR mode.
-Added temporal layering mode.
-Fixed bug in non-rd variance partition.
-Modified/updated the sample encoders (vp9_spatial_svc_encoder, vpx_temporal_svc_encoder).
-Added datarate unittest(s) for 1 pass CBR SVC.

Change-Id: Ie94b1b68a56ea1267b5087c625e5df04def2ee48
2015-06-02 07:54:13 -07:00
Minghai Shang
15353216c5 [svc] Make size of empty frame to be 16x16 all the time
Change-Id: Ibab09aa0e8c69cf5efea2f0ec035e5da9cc894b0
2015-05-26 16:04:36 -07:00
paulwilkins
e0786c280e Adjust ARF min and max interval.
Previously limit on max interval  set to 0.5 seconds.
Though this helped some low frame rate material it
appears to be a bit too aggressive for some 24 and 25 fps
content. This patch relaxes the limit to 0.75 seconds.

The patch also adds a new minimum interval variable
to replace the current hard wired value. This allows us
to impose a limit on the maximum number of primary
arfs per second for high frame rate (e.g. 50 & 60fps)
content. This is to address concerns regarding playback
performance on some platforms if there is a high base
frame rate and very frequent arfs.

Change-Id: I373e8b6b2a8ef522eced6c6d2cceb234ff763fcf
2015-05-01 15:11:49 +01:00
James Zern
f58011ada5 vpx_mem: remove vpx_memset
vestigial. replace instances with memset() which they already were being
defined to.

Change-Id: Ie030cfaaa3e890dd92cf1a995fcb1927ba175201
2015-04-28 20:00:59 -07:00
Adrian Grange
3807dd82ab Make encoder buffer allocation dynamic
Frame buffers are now allocated dynamically on-demand.

Entries in the reference frame map, cm->ref_frame_map,
may now be set to -1 (INVALID_IDX) to indicate that
there is not a valid reference buffer in that "slot".

All slots in the reference frame map are now initialized
to the empty state (-1) and each buffer is initialized
to have a reference count of 0.

Change-Id: Id1afe98de98db4ae8b2dfefed7889c3b28c68582
2015-03-04 07:58:32 -08:00
Alex Converse
6ea83fdfcb Make SVC compatible with external resize.
Fixes https://code.google.com/p/webm/issues/detail?id=943

Change-Id: I6177bf6ab6b31a22d2652732f579b8aed3f28887
2015-02-25 14:05:51 -08:00
Minghai Shang
220bc3a013 [two pass temporal svc]Fix crash issue in transcoder app caused by last fix.
Change-Id: I78ecc8ec3fa3ba5f69bb23813e68a5255d0534e1
2015-01-15 16:59:54 -08:00
Minghai Shang
a14415d171 [twopass temporal svc] Fix decoding error on seek.
Don't put small empty frame in front of a key frame. We will
put key frame flag in webm container if there's a visible key
frame. But there will be decoding error when we seek to here
if we put the small empty frame, which will be inter frame,
in front of it.

Change-Id: Id50c2c1fd31da0405ff6faa7375cc2f49c55402d
2015-01-13 15:44:22 -08:00
Frank Galligan
c4f7079ad4 Revert "Revert "Add support for setting byte alignment.""
This reverts commit 91471d6aad.

Fixes the compile issues if post_proc is enabled.

Change-Id: Ib40a15ce2c194f9b5adfa65a17ab01ddf60f5a59
2014-12-15 12:20:37 -08:00
Paul Wilkins
91471d6aad Revert "Add support for setting byte alignment."
Fails to compile. Bad calls to vp9_alloc_frame_buffer
and vp9_realloc_frame_buffer in postproc.c

This reverts commit 399823b6f5.

Change-Id: I29f0e173f8e185d3a303cfdb17813e1eccb51e3a
2014-12-15 11:54:13 +00:00
Frank Galligan
399823b6f5 Add support for setting byte alignment.
Add support for setting byte alignment on the Y, U, and V plane of the
reference buffers. The byte alignment must be a power of 2, from 32 to
1024. A value of 0 sets legacy alignment.

Change-Id: I7c1399622f7aa68e123646369216b32047dda73d
2014-12-12 13:34:36 -08:00
Marco
b660f723b4 Modify active_worst_quality setting for one pass CBR.
Current setting had active_worst_quality set too high (close to worst_quality)
for first frame(s) following first key frame. This changes that to be somewhat
more aggressive in allowing active_worst_quality to be lower following key frame.

Also remove the 4/5 reduction in active_worst for key frame as
this should be set by the user qp_max setting.

Change-Id: I0530b3ddcc85c00e3eb7568de1b14a31206c4a4c
2014-11-17 11:46:49 -08:00
Paul Wilkins
6f0ae3a2d1 Extend --auto-alt-ref so it can enable multi-alt ref.
Extend --auto-alt-ref from parameter so we can use it to
turn multi-arf on and off from the command line.

For now the range is 0-off, 1-on, 2-multi-arf on.

Rename play_alternate to enable_auto_arf

Change-Id: Id7b64407cfbe76ba0090a83b588a03e22a240386
2014-10-20 16:09:37 +01:00
Minghai Shang
68b550f551 [spatial svc]Another workaround to avoid using prev_mi
We encode a empty invisible frame in front of the base layer frame to
avoid using prev_mi. Since there's a restriction for reference frame
scaling factor, we have to make it smaller and smaller gradually until
its size is 16x16.

Change remerged.

Change-Id: I9efab38bba7da86e056fbe8f663e711c5df38449
2014-10-16 16:09:40 +01:00
Paul Wilkins
468032961d Revert "[spatial svc]Another workaround to avoid using prev_mi"
This reverts commit c113457af9.

Temporary revert to allow clean revert of another commit.

Change-Id: Ia9b7b755e6c48e1b6e383329f121fef175a24b27
2014-10-16 15:52:08 +01:00
Minghai Shang
c113457af9 [spatial svc]Another workaround to avoid using prev_mi
We encode a empty invisible frame in front of the base layer frame to
avoid using prev_mi. Since there's a restriction for reference frame
scaling factor, we have to make it smaller and smaller gradually until
its size is 16x16.
Change-Id: I60b680314e33a60b4093cafc296465ee18169c19
2014-10-14 16:26:39 -07:00
Minghai Shang
38b6aed8fd Merge "[spatial svc] Remove vpx_svc_parameters_t and the loop that sets it for each layer" 2014-09-22 14:01:24 -07:00
Minghai Shang
209ee12110 [spatial svc] Remove vpx_svc_parameters_t and the loop that sets it for each layer
vpx_svc_parameters_t contains id, resolution and min/max qp for each spatial layer.

In this change we will use extra config to send min/max qp and scaling factors, then calculate layer resolution inside encoder.

Change-Id: Ib673303266605fe803c3b067284aae5f7a25514a
2014-09-18 18:05:07 -07:00
Minghai Shang
f780b16bb8 [spatial svc] Use same golden frame for all temporal layers
Overhead goes down from 8% to 3% for 1080 60p

Change-Id: Idf3e5ca8712402a914a8cb79df17d3cdab63b163
2014-09-18 11:16:29 -07:00
Minghai Shang
be3b08da3e [svc] Temporal svc with two pass rate control
It's built based on current spatial svc code.
We only support one spatial two temporal layers at this time.
Change-Id: I1fdc8584354b910331e626bfae60473b3b701ba1
2014-09-02 12:05:14 -07:00
Minghai Shang
42ad07a138 Merge "[spatial svc]Multiple frame context feature" 2014-08-25 14:29:49 -07:00
Minghai Shang
d4a407c051 [spatial svc]Multiple frame context feature
We can use one frame context for each layer so that we don't have
to reset the probs every frame. But we can't use prev_mi since we
may drop enhancement layers. So we have to generate a non vp9
compatible bitstream and modify it in the player.
1. We need to code all frames as invisible frame to let prev_mi
   not to be used. But in the bitstream we need to code the
   show_frame flag to 1 so that the publisher will know it's
   supposed to be a visible frame.
2. In the player we need to change the show_frame flag to 0 for
   all frames. Then add an one byte frame into the super frame
   to tell the decoder which layer we want to show.
Change-Id: I75b7304cf31f0ab952f043e33c034495e88f01f3
2014-08-25 10:02:45 -07:00
Dmitry Kovalev
7025d72cd8 Revert "Removing unnecessary casts to int64_t."
My fault, that was a float (not integer) which was converted to int64_t.

This reverts commit a885e1cbf0

Change-Id: Ic50708b959e1c3cb3e37da1429d334fafc3391d6
2014-08-20 11:24:48 -07:00
Dmitry Kovalev
a885e1cbf0 Removing unnecessary casts to int64_t.
Change-Id: I156419fdf68056759a4cd4206cc829a00025ef78
2014-08-18 14:37:56 -07:00
Dmitry Kovalev
1acc96fb80 Removing vp9_rescale().
Now everything is int64_t, so we don't need that function.

Change-Id: I7dd2023677b4943ecd968d68cc06f9d4862c3c3f
2014-08-15 17:02:10 -07:00
Dmitry Kovalev
5a78c40657 Moving framerate from VP9EncoderConfig to VP9_COMP.
Framerate changes over time, VP9EncoderConfig supposed to have static
read-only data.

Change-Id: I36580a7ee71243c1eabb57691089691731d03e67
2014-08-08 15:29:37 -07:00
Minghai Shang
390ad737b8 [spatial svc]Add is_spatial_svc() helper function.
Change-Id: Ice5376100d8e27cbdaddfd3cd06898cedd2720fe
2014-08-06 15:20:51 -07:00
Minghai Shang
5de4368b43 [spatial svc]Enabl golden frame for base layer and fix wrong ref_frame_flag for upper layers in first frame
Change-Id: I1fec9c084b499b2f445b79726066d01b136b59fa
2014-08-04 15:06:21 -07:00
Minghai Shang
24c9d6ad43 [spatial svc]Use #if instead of #ifdef on macro CONFIG_SPATIAL_SVC
Change-Id: Ifc94377a0d05d66e3d21b007893a985b66db6082
2014-07-22 11:11:55 -07:00
Minghai Shang
e899859c48 [spatial svc]Implement alt reference frames
All changes are for spatial svc only.
1. Enable encoding hidden frames in each layer and use alt reference idex to reference the hidden frame in each layer
2. Use golden reference idx for spatial reference
3. For those layers that don't have hidden frames (caused by lack of frame buffers), reference a hidden frame in lower layers
4. Add "auto-alt-refs" in svc options
Change-Id: Idf27d1fd2fb5f3ffd9e86d2119235e3dad36c178
2014-07-14 11:24:17 -07:00
Minghai Shang
277338f748 [spatial svc]Implement lag in frames for spatial svc
Change-Id: I930dced169c9d53f8044d2754a04332138347409
2014-06-24 14:01:17 -07:00
Paul Wilkins
2e430cba61 Experiment for mid group second arf.
This patch implements a mechanism for inserting a second
arf at the mid position of arf groups.

It is currently disabled by default using the flag multi_arf_enabled.

Results are currently down somewhat in initial testing if
multi-arf is enabled. Most of the loss is attributable to the
fact that code to preserve the previous golden frame
(in the arf buffer) in cases where we are coding an overlay
frame, is currently disabled in the multi-arf case.

Change-Id: I1d777318ca09f147db2e8c86d7315fe86168c865
2014-06-24 12:59:14 +01:00
Dmitry Kovalev
1cdc238902 Adding buffer levels to RATE_CONTROL struct.
Change-Id: Ib35ff854378764dc3c6745844c67a33dee545663
2014-06-03 13:56:46 -07:00
Paul Wilkins
d009c2360e Merge "Re-factor some duplicate code." 2014-05-30 06:14:06 -07:00