Commit Graph

182 Commits

Author SHA1 Message Date
hui su
72d4890caf Add vp9 encoder API VP9E_GET_LEVEL to provide bitstream level
Change-Id: I1ef3df0192491035728fe9d5eb25cc66dc2965de
2016-06-15 12:53:28 -07:00
hui su
be3f0698b0 Add VP9 encoder API for level specification.
Add control API VP9E_SET_TARGET_LEVEL that allows the encoder to
control the output bitstream level and/or keep level related
statistics.

Usage:
               255         do not care about level (default)
               0           keep level related stats only
               10          target for level 1
               11          target for level 1.1
               .
               .
               .
               62          target for level 6.2

Usage for vpxenc:

--target-level=0/255/10/11...

Change-Id: I31d1aeca19358b893e7577b4e63748c8e614034a
2016-05-10 11:48:16 -07:00
hui su
667f6320b0 Fix comment for target_bandwidth in VP9 and VP10
Unlike in VP8, it is in units of bits per second in VP9 and VP10.

Change-Id: Iee1936cc58cdfaff205624c2fe87cecdf7eda123
2016-05-09 16:43:02 -07:00
Marco
adf8533cee vp9: Move consec_zero_mv from cyclic refresh to cpi struct.
So it can be used even with aq-mode=3 not enabled.
Also cleans up some code in the places where its used.

No change in behavior.

Change-Id: Ib6b265308dbd483f691200da9a0be4da4b380dbc
2016-04-22 08:09:39 -07:00
Marco
c83bcb3474 vp9-svc: Allow for 2 stage downscaling for spatial layers.
For 1 pass cbr mode: allow for two-stage 1:2 scaling
(which will use the 1:2 optimized scaler) if the spatial
layer is 1/4x1/4 of souce.

Without this change, the base layer for 3 spatial layers would
be using the non-normative scaler which is un-optimized/C code.

Change-Id: I9d73f92a4a96927d0f1d6bf75315c1e60513226a
2016-03-01 15:48:42 -08:00
James Zern
8062e10162 Revert "vp9-svc: Fix speed issue with source downscaling for spatial layers."
This reverts commit f51f0998e1.

This causes datarate tests to fail. Some are due to the new default
keyframe distance, another causes an assert even forcing 9999:

[ RUN      ] VP9/DatarateOnePassCbrSvc.OnePassCbrSvc3SpatialLayers/0
test_libvpx:
vpx_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c:853: scaledconvolve2d:
Assertion `y_step_q4 <= 32' failed.

Change-Id: I4ee4fea97f47e4f1a23b82a62e6afc6280961e38
2016-02-26 16:53:26 -08:00
Marco
f51f0998e1 vp9-svc: Fix speed issue with source downscaling for spatial layers.
For 1 pass cbr mode: allow for two-stage 1:2 scaling
(which will use the 1:2 optimized scaler) if the spatial
layer is 1/4x1/4 of souce.

Without this change, the base layer for 3 spatial layers would
be using the non-normative scaler which is un-optimized/C code.

Change-Id: Ifcf526ec2aaf3e5fa7924588d9dd8660bf02fb46
2016-02-26 08:11:37 -08:00
Marco
34d12d1160 vp9-resize: Force reference masking off for external dynamic-resizing.
An issue exists with reference_masking in non-rd pickmode for spatial
scaling. It was kept off for internal dynamic resizing and svc, this
change is to keep it off also for external dynamic resizing.

Update to external resize test, and update TODO to re-enable this
at frame level when references have same scale as source.

Change-Id: If880a643572127def703ee5b2d16fd41bdbf256c
2016-02-11 08:35:57 -08:00
Marco
734dc36173 vp9: Add flag to control usage of skin detection.
Set off as default; on for 1 pass cbr mode, speed >=5, non-screen-content.

Change-Id: I03f2497e4028b354fd83b8a7d0e072c2a6bec878
2016-02-01 11:57:56 -08:00
Debargha Mukherjee
02345be986 Adding an aq mode for 360 videos
Different quality levels are used for different regions in
the frame depending on how far they are vertically from the
center. Specifically, three segments are used based on the
mi_row index with respect number to the number of mi_rows in
the frame.

Change-Id: Ifc8b777bc58ea8521dffc4640360c67d99f8d381
2016-01-13 16:17:37 -08:00
paulwilkins
0149fb3d6b Changes to exhaustive motion search.
This change alters the nature and use of exhaustive motion search.

Firstly any exhaustive search is preceded by a normal step search.
The exhaustive search is only carried out if the distortion resulting
from the step search is above a threshold value.

Secondly the simple +/- 64 exhaustive search is replaced by a
multi stage mesh based search where each stage has a range
and step/interval size. Subsequent stages use the best position from
the previous stage as the center of the search but use a reduced range
and interval size.

For example:
  stage 1: Range +/- 64 interval 4
  stage 2: Range +/- 32 interval 2
  stage 3: Range +/- 15 interval 1

This process, especially when it follows on from a normal step
search, has shown itself to be almost as effective as a full range
exhaustive search with step 1 but greatly lowers the computational
complexity such that it can be used in some cases for speeds 0-2.

This patch also removes a double exhaustive search for sub 8x8 blocks
which also contained  a bug (the two searches used different distortion
metrics).

For best quality in my test animation sequence this patch has almost
no impact on quality but improves encode speed by more than 5X.

Restricted use in good quality speeds 0-2 yields significant quality gains
on the animation test of 0.2 - 0.5 db with only a small impact on encode
speed. On most clips though the quality gain and speed impact are small.

Change-Id: Id22967a840e996e1db273f6ac4ff03f4f52d49aa
2015-11-13 10:16:31 +00:00
hui su
6ab6ac450b Use accurate bit cost for uv_mode in UV intra mode RD selection
On derflr, +0.1% for VP10; however, -0.03% on VP9.

Change-Id: I09c724232ede74254043d61d3cadc506256af0af
2015-11-06 14:45:43 -08:00
Marco
c7da053d4b Move noise level estimate outside denoiser.
Source noise level estimate is also useful for
setting variance encoder parameters (variance thresholds,
qp-delta, mode selection, etc), so allow it to be used also
if denoising is not on.

Change-Id: I4fe23d47607b4e17a35287057f489c29114beed1
2015-11-02 12:15:26 -08:00
Yaowu Xu
568429512e Add a new enum type vpx_color_range_t
to make meaning of color_range obvious.

Change-Id: I303582e448b82b3203b497e27b22601cc718dfff
2015-10-16 16:27:18 -07:00
Ronald S. Bultje
812945a8f1 vp9/10: improve support for render_width/height.
In the decoder, map this to the output variable vpx_image_t.r_w/h.
This is intended as an improved version of VP9D_GET_DISPLAY_SIZE,
which doesn't work with parallel frame decoding. In the encoder,
map this to a codec control func (VP9E_SET_RENDER_SIZE) that takes
a w/h pair argument in a int[2] (identical to VP9D_GET_DISPLAY_SIZE).

Also add render_size to the encoder_param_get_to_decoder unit test.

See issue 1030.

Change-Id: I12124c13602d832bf4c44090db08c1009c94c7e8
2015-09-25 22:18:22 -04:00
Ronald S. Bultje
eeb5ef0a24 Add support for color-range.
In decoder, export (eventually) into vpx_image_t.range field. In
encoder, use oxcf->color_range to set it (same way as for
color_space).

See issue 1059.

Change-Id: Ieabbb2a785fa58cc4044bd54eee66f328f3906ce
2015-09-16 06:41:46 -04:00
Marco
4d1424faf9 For 1 pass: always use the normative filter in vp9_scale_if_required()
The normative (convolve8) filter is optimized/faster than
the nonnormative one. Pass usage of scaler (normative/nonomorative)
to vp9_scale_if_required(), and always use normative one for 1 pass.

Change-Id: I2b71d9ff18b3c7499b058d1325a9554de993dd52
2015-09-14 13:13:32 -07:00
James Zern
5e35c3c9a0 vp9_encoder: make vp9_alloc_compressor_data private
Change-Id: I38b4de692f4f7e880766316783981cbd1134bed9
2015-08-28 18:53:57 -07:00
Marco
93ffe9d6dc Update to dynamic resize for 1 pass CBR: source scaling.
Switch to use the normative (convolve8) filter for source scaling,
only for 1/2x1/2 scaling for now. This is faster and has better
quality than either the vpx_scale_frame or the nonnormative scaler.

Remove the vp9_scale_if_required_fast, which is now not used.

Change-Id: I2f7d73950589d19baafb1fa650eac987d531bcc8
2015-08-20 16:34:01 -07:00
Alex Converse
c7b7011b9b Move VP9 SSIM metrics to vpx_dsp.
Change-Id: I20c7b42631b579fade6cf7ebf6d4c69b2fcb5e5e
2015-08-06 18:25:25 -07:00
Yunqing Wang
b2446fb6be Remove tx_select_threshes
Removed unused tx_select_threshes and tx_select_diff.

Change-Id: I5e9e7ad170056efe14b5f071e94d0c5a36e4a34c
2015-07-27 12:02:05 -07:00
Yaowu Xu
bf82514b54 vpx_dsp/bitreader.h: vp9_->vpx_
Replace vp9_ in names to vpx_ as they are not codec specific.

Change-Id: I2e583aa63dee769353ada4b42417aa15c4074ebb
2015-07-20 18:06:31 -07:00
Marco
4bbd95512a Dynamic resize for real-time: source scaling
Use faster scaling on source.

Change-Id: I968df97239a86834c96126b86832d3d6d0875a53
2015-07-10 11:04:18 -07:00
Johann
6a82f0d7fb Move sub pixel variance to vpx_dsp
Change-Id: I66bf6720c396c89aa2d1fd26d5d52bf5d5e3dff1
2015-07-07 15:51:04 -07:00
Debargha Mukherjee
9852643373 Expose params min-gf-interval/max-gf-interval
Adds two new vp9 parameters --min-gf-interval and --max-gf-interval
to enable testing based on frequency of alt-ref frames.

Also adds a unit-test to test enforcement of min-gf-interval.

For both these parameters the default value is 0, which indicates
they are picked by the encoder, based on resolution and framerate
considerations. If they are greater than zero, the specified
parameter is honored.

(Additional note by paulwilkins)
Note that there is a slight oddity in that key frames are also GFs and
considered part of  GF only group. However they are treated as not
being part of an arf group because for arf groups the previous GF is
assumed to be the terminal or overlay frame for the previous group.

(end note)

Change-Id: Ibf0c30b72074b3f71918ab278ccccc02a95a70a0
2015-07-06 12:24:59 -07:00
Jingning Han
d1b30ceaa3 Rename vpx_thread to vpx_util
Change the dir name to include more util tools.

Change-Id: Id5b16062803ce5eed872fe2edb36d7e56b32eed8
2015-07-02 10:02:37 -07:00
Jingning Han
8565a1c99a Merge "Use vpx prefix for codec independent threading functions" 2015-07-02 04:24:54 +00:00
Jingning Han
66cf8098e6 Merge "Move multi-threading module functions into vpx_thread folder" 2015-07-02 04:24:37 +00:00
Jingning Han
04d2e57425 Use vpx prefix for codec independent threading functions
Replace vp9_ prefix with vpx_ for common multi-threading functions.

Change-Id: I941a5ead9bfe8213fdad345511d2061b07797b55
2015-07-02 00:47:54 +00:00
Jingning Han
3a3b0be09a Move multi-threading module functions into vpx_thread folder
This commit moves the primitive multi-threading files from vp9
folder to vpx_thread, which will be accessible by all vpx codec.

Change-Id: Ib51e66e9c69801c10631fab56d35a0c0aaed5883
2015-07-01 17:45:49 -07:00
Scott LaVarnway
c06d56cc7d VP9: Move ref_mvs[][] and mode_context[] from MB_MODE_INFO
to MB_MODE_INFO_EXT.  This saves 36 bytes per 8x8 area for
both the decoder and encoder. (encoder has two MODE_INFO
buffers)

Change-Id: If006abb2224acaf326df3c2be09e77e967662107
2015-06-29 12:46:47 -07:00
Marco
d77f51ba9e Add dynamic resize logic for 1 pass CBR.
Decision to scale down/up is based on buffer state and average QP
over previous time window. Limit the total amount of down-scaling
to be at most one scale down for now.

Reset certain quantities after resize (buffer level, cyclic refresh,
rate correction factor).

Feature is enable via the setting rc_resize_allowed = 1.

Change-Id: I9b1a53024e1e1e953fb8a1e1f75d21d160280dc7
2015-06-18 17:13:37 -07:00
Yunqing Wang
2c838ede68 Allocate tile data adaptively to accommodate the frame size increase
If the frame size increases, the tile data buffer needs to be
re-allocated according to the number of tiles existing in current
frame. This patch makes the multi-tile encoding work in spatial
SVC usage case, and partially solved WebM issue 1018.

Change-Id: I1ad6f33058cf5ce6f60ed5024455a709ca80c5ad
2015-06-11 11:30:18 -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
Jim Bankoski
a6e9ae9066 Adds worst frame metrics for a bunch of metrics.
Change-Id: Ieaccc36ed1bee024bb644a9cfaafdaaa65d31772
2015-04-22 06:45:56 -07:00
Jim Bankoski
ee87e20d53 Adds a new temporal consistency metric to libvpx.
Change-Id: Id61699ebf57ae4f8af96a468740c852b2f45f8e1
2015-04-21 10:05:37 -07:00
Jim Bankoski
03829f2fea Merge "Adds a blockiness metric to internal stats." 2015-04-17 16:06:26 -07:00
Jim Bankoski
3d2f037a44 Merge "adds psnrhvs to internal stats." 2015-04-17 16:06:10 -07:00
Jim Bankoski
f2cbee9a04 Merge "Adds a fastssim metric to VPX internal stats." 2015-04-17 16:05:53 -07:00
Jim Bankoski
1777413a2a Adds a blockiness metric to internal stats.
Change-Id: Iedceeb020492050063acf3fd2326f96c29db9ae5
2015-04-17 11:13:18 -07:00
Jim Bankoski
9757c1aded adds psnrhvs to internal stats.
PSNR HVS is a human visual system weighted version of SNR that's
gained some popularity from academia and apparently better matches
MOS testing.

This code is borrowed from the Daala Project but uses our FDCT code.

Change-Id: Idd10fbc93129f7f4734946f6009f87d0f44cd2d7
2015-04-17 10:29:27 -07:00
Jim Bankoski
3f7f194304 Adds a fastssim metric to VPX internal stats.
This code appeared in the Daala project first and was originally
committed by Nathan Egge.

Change-Id: Iadce416a091929c51b46637ebdec984cddcaf18c
2015-04-17 10:23:24 -07:00
Marco Paniconi
f76ccce5bc Revert "Revert "Force_split on 16x16 blocks in variance partition.""
This reverts commit 004b9d83e3

Change-Id: I2f2d0bdb9368c2c07f1d29a69cd461267a3a8743
2015-04-16 17:52:13 -07:00
Yunqing Wang
004b9d83e3 Revert "Force_split on 16x16 blocks in variance partition."
This reverts commit eb8c667570.
The patch caused mismatch while using multi-threads.

Change-Id: Icd646340af25b5d91e32f03ed3ea212e00e3e0be
2015-04-14 15:19:31 -07:00
Marco
eb8c667570 Force_split on 16x16 blocks in variance partition.
Force split on 16x16 block (to 8x8) based on the minmax over the 8x8 sub-blocks.

Also increase variance threshold for 32x32, and add exit condiiton in choose_partition
(with very safe threshold) based on sad used to select reference frame.

Some visual improvement near moving boundaries.
Average gain in psnr/ssim: ~0.6%, some clips go up ~1 or 2%.
Encoding time increase (due to more 8x8 blocks) from ~1-4%, depending on clip.

Change-Id: I4759bb181251ac41517cd45e326ce2997dadb577
2015-04-13 12:05:07 -07:00
Yunqing Wang
cae03a7ef5 Set vbp thresholds for aq3 boosted blocks
The vbp thresholds are set seperately for boosted/non-boosted
superblocks according to their segment_id. This way we don't
have to force the boosted blocks to split to 32x32.

Speed 6 RTC set borg test result showed some quality gains.
Overall PSNR: +0.199%; Avg PSNR: +0.245%; SSIM: +0.802%.
No speed change was observed.

Change-Id: I37c6643a3e2da59c4b7dc10ebe05abc8abf4026a
2015-04-02 15:48:32 -07:00
Yunqing Wang
fc98114761 Merge "Rename vbp thresholds" 2015-03-31 16:33:30 -07:00
Yunqing Wang
c28ff1a9de Rename vbp thresholds
Code refactoring

Change-Id: I410fcce1bc6d95c62c474445f4c97ea8469f1e79
2015-03-31 15:14:44 -07:00
Alex Converse
4dcb839607 VP9E_GET_ACTIVE_MAP API function.
This is useful when aq mode 3 (cyclic refresh) reactivates segments for refresh.

Change-Id: I3ad1d9410b899ede393d82bb8db14e2da4d84eca
2015-03-24 11:19:47 -07:00
Alex Converse
1bfacd3529 Reconcile active_map and cyclic refresh
Change-Id: Id7f8654aeeb20caa402bc822521b1d72c658f4f9
2015-03-12 16:19:49 -07:00