Commit Graph

277 Commits

Author SHA1 Message Date
Johann
b87250c56e clang-format v5.0.0 vpxenc.c
Treat the formatted string as one distinct parameter to fprintf

Change-Id: I62cfd5657c4cefc6b3fa45247ba9f33515a292b1
2018-01-12 09:15:12 -08:00
Johann
f5b2dd2a66 adopt some clang 5.0.0 formatting
At least the changes that don't conflict with 4.0.1

Change-Id: I9b6a7c14dadc0738cd0f628a10ece90fc7ee89fd
2018-01-11 12:35:24 -08:00
James Zern
c5f5f4ed17 vpx{enc,dec}: add --help
only output short usage to stderr on error, with --help use stdout

Change-Id: I7089f3bca829817e14b14c766f4f3eaee6f54e5c
2017-11-28 20:49:54 -08:00
paulwilkins
a73cee2870 New content type to improve grain retention.
For new VP9 only content type adjust  the rate distortion and ARF
filter based on the relative spatial variance of the source and
reconstruction.

In regards to the RD loop the method favors modes where the
reconstruction variance is similar to the source variance. However it
is currently only applied to regions where the source variance is quite
low.

For very low variance blocks it applies a further bias against intra
coding and large prediction block sizes (the later in particular limit
the usefulness of the loop filter).

The final part of this change is to lower the strength of the ARF
filter for blocks where the source has very low spatial variance, to
encourage some low amplitude texture or noise to pass through
the filter.

This change improves the retention of film grain and fine noise /
texture in spatially flat regions, but as expected causes a significant
drop in PSNR on many clips. This is to be expected because similar
but misaligned noise or texture will give a lower PSNR than a flat
noise free reconstruction. However, it is worth noting that most clips
show a strong gain in FAST SSIM.

The features are enabled on the vpxenc command line by setting
--tune-content=film.

VPX_ENCODER_ABI_VERSION bumped for this change and cvbr.

Change-Id: I26a4e4edfa3dc5cacead82fa701fe7a9118ccd0a
2017-11-13 16:57:23 +00:00
paulwilkins
93e83fd7cf CVBR command line option.
Added command line control of Corpus VBR.

The new corpus vbr mode is a variant of standard
VBR (end-usage=0) where the complexity distribution
mid point is passed in rather than calculated for a specific
clip or chunk.

The new variant is enabled by setting a new command line
parameter --corpus-complexity to a zero value. Omitting
this parameter or setting it to 0 will cause the codec to use
standard vbr mode.

The correct value for a given corpus needs to be derived
experimentally using a training set such that the average
rate for the corpus is close to the target value.

For example our using our low res test set with upper and lower
vbr limits of 50%-150% and a corpus complexity value of 650
gives a similar average data rate across the set to using standard
vbr. However, with the corpus mode easier clips will be allocated
fewer bits and harder clips more bits rather than having the same
rate target for all.

Change-Id: I03f0fc8c6fb0ee32dc03720fea6a3f1949118589
2017-11-08 10:41:04 +00:00
Hui Su
c3a6943c16 VP9 level targeting: add a new AUTO mode
In the new AUTO mode, restrict the minimum alt-ref interval and max column
tiles adaptively based on picture size, while not applying any rate control
constraints.

This mode aims to produce encodings that fit into levels corresponding to
the source picture size, with minimum compression quality lost. However, the
bitstream is not guaranteed to be level compatible, e.g., the average bitrate
may exceed level limit.

BUG=b/64451920

Change-Id: I02080b169cbbef4ab2e08c0df4697ce894aad83c
2017-09-14 16:20:29 +00:00
clang-format
7587a97551 apply clang-format
Change-Id: If4c3e8a396d0fcb304f407b44e28cac3219f038c
2017-09-01 01:24:03 -07:00
Vignesh Venkatasubramanian
5881601488 vp9: Rename new_mt to row_mt
new_mt is a very generic name that will get obsolete soon enough.
Since this is exposed as a codec control, renaming it to row_mt to
signify row level paralellism. Also renaming the ETHREAD_BIT_MATCH
codec control to ROW_MT_BIT_EXACT.

Change-Id: Ic7872d78bb3b12fb4cf92ba028ec8e08eb3a9558
2017-02-27 09:43:26 -08:00
Ranjit Kumar Tulabandu
8b0c11c358 Multi-threading of first pass stats collection
(yunqingwang)
1. Rebased the patch. Incorporated recent first pass changes.
2. Turned on the first pass unit test.

Change-Id: Ia2f7ba8152d0b6dd6bf8efb9dfaf505ba7d8edee
2017-01-24 15:48:02 -08:00
Jerome Jiang
380a26112c Fix compile warnings for target=armv7-android-gcc
Fix compile warnings about implicit type conversion for
target=armv7-android-gcc in vpxenc.c.

BUG=webm:1348

Change-Id: I9fbabd843512f2a1a09f4bb934cd091e834eed9c
2016-12-22 14:56:20 -08:00
Marco
ff38b8dfae vp8: Add control for gf boost for 1 pass cbr.
Control already exists for vp9, adding it to vp8.
Usage is only when error_resilient is off.
Added a datarate unittest for non-zero boost.

Change-Id: I4296055ebe2f4f048e8210f344531f6486ac9e35
2016-10-19 09:43:53 -07:00
clang-format
5f6d143b41 apply clang-format
Change-Id: I501597b7c1e0f0c7ae2aea3ee8073f0a641b3487
2016-09-15 15:07:53 -07:00
Johann
bce23ab36b webmenc: remove unused 'fps' parameter
Cleans -Wextra/-Wunused-parameter warning:
warning: unused parameter ‘fps’

Change-Id: Ia5f9338f11ae8d0708a87c6d4e7d7e924fc3b19b
2016-09-13 14:25:40 -07:00
Yury Gitman
d7c20079a6 Add --alt-ref-aq=<int> option
In the future this option will activate adaptive quantization special
for altref frames. Encoder will  create the adaptive quantization map
on the basis of lookahead buffers similarity which is the estimate of
the future motion compensation performance.

Change-Id: Ia0088b3babb0f9a4899c79d8d819947ba5a03df2
2016-08-24 15:49:25 -07:00
clang-format
033dab9ca0 top-level: apply clang-format
Change-Id: Ibd5395bf8956a80f7c0df4d539c7a42c927a1fc7
2016-07-19 14:34:19 -07:00
Marco
05fe0f20a6 vp9: Allow usage of lookahead for real-time, 1 pass vbr.
Allow usage of lookahead for VBR in real-time mode, for 1 pass vbr.

Current usage is for fast checking of future scene cuts/changes,
and adjusting rate control (gf interval and active_worst/target size).

Added unittests (datarate) for 1 pass vbr mode, with non-zero lag.

Added an experimental option to limit QP based on lookahead.

Overall positive gain in metrics on ytlive set:
avgPNSR/SSIM up on average ~1-3%; several clips up by 5, 7%.

Change-Id: I960d57dfc89de121c4824b9a9bf88d2814e74b56
2016-07-18 15:20:17 -07:00
James Zern
67edc5e83b remove vp10
development has moved to the nextgenv2 branch and a snapshot from here
was used to seed aomedia

BUG=b/29457125

Change-Id: Iedaca11ec7870fb3a4e50b2c9ea0c2b056a0d3c0
2016-06-17 18:26:08 -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
Vignesh Venkatasubramanian
9441f10b51 TODO cleanup: s/EbmlGlobal/WebmOutputContext/
This brings the struct's name in line with WebmInputContext.

Change-Id: I1a1c7ae60b006ae5de8253177d6d996f5867866d
2016-04-25 13:30:08 -07:00
Yunqing Wang
dc5f7712f2 Prevent encoder crash caused by row tile dependencies
In multi-thread case, the encoder may crash if using encoder option
tile-rows > 0. To prevent that, force tile-rows=0 in this situation.
This is a workaround for WebM issue 1095:
https://bugs.chromium.org/p/webm/issues/detail?id=1095

The further fix can be done by adding synchronizations after a tile
row is encoded. But this will hurt multi-threaded encoder performance.
So, it is recommended to use tile-rows=0 while encoding with threads
> 1.

Change-Id: I656cbcc200f8d0410d09530e7981ad8f32fe7bc9
2016-03-22 16:15:12 -07:00
James Zern
14828e756f vp9: set kf_max_dist to a reasonable default (128)
the same as vp8, with the same reasoning from:
2a0d7b1 Reduce the default kf_max_dist to 128.

see also:
https://trac.ffmpeg.org/ticket/4904
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815673

+ restore vpxenc behavior of taking the library default rather than
  forcing 5s

This change also exposes an issue with one-pass svc in cbr mode, keep
the old default in datarate_test.cc for now.

Change-Id: Id6d1244f42490b06fefc1a7b4e12a423a1f83e88
2016-02-25 12:34:12 -08:00
James Zern
c8e5a7749c vpxenc: quiet unused param warning
Change-Id: Ib6ed1b8c03f6c269f8d667b21b895b35363cee9e
2016-02-11 19:22:30 -08:00
hui su
06bcd852ad Add high bit depth args to arg list
So that their usage info. will show up with --help.

Change-Id: I8542240dcc98e8be29ac63d081f5abb932627cbf
2016-02-02 18:08:54 -08:00
Ronald S. Bultje
9134e9f8bb Use input framerate as timebase if none was explicitly specified.
After patch:
$ vpxenc tennis_sif.y4m --end-usage=q -q 20 -o x.ivf --ivf --codec=vp9 --limit=30
$ ffmpeg -i x.ivf -i tennis_sif.y4m -lavfi psnr -f null -
[..]
[Parsed_psnr_0 @ 0x7f8913c21e40] PSNR y:43.270594 u:46.300362 v:47.011172 average:44.097994 min:43.460704 max:52.509271

Before patch:
$ vpxenc tennis_sif.y4m --end-usage=q -q 20 -o x.ivf --ivf --codec=vp9 --limit=30
$ ffmpeg -i x.ivf -i tennis_sif.y4m -lavfi psnr -f null -
[..]
[Parsed_psnr_0 @ 0x7fbdaac22780] PSNR y:27.427366 u:41.505376 v:36.853477 average:28.990890 min:22.219454 max:52.509271
$ ffmpeg -i x.ivf -f rawvideo x.yuv
$ ffmpeg -f rawvideo -vcodec rawvideo -video_size 352x240 -framerate 29.97 -i x.yuv -i tennis_sif.y4m -lavfi psnr -f null -
[..]
[Parsed_psnr_0 @ 0x7fadf9e013a0] PSNR y:43.270594 u:46.300362 v:47.011172 average:44.097994 min:43.460704 max:52.509271

Change-Id: Ifac2d6c2ff8379b2d318fe5cfe4be0bf1bc9f27f
2016-01-18 14:05:07 -05: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
Ronald S. Bultje
3977507339 vpxenc: don't warn about libwebm availability if writing IVF.
Change-Id: I1a9635a9948458e6c83f5b58764b7e720d98e2ea
2015-12-16 13:35:59 -05:00
hui su
ede323a119 Specify feasible parameter values for lossless mode
Change-Id: I53d9719dcb81fa83fe3c920a552db5a0f1cacefa
2015-10-29 16:07:55 -07:00
Tom Finegan
ed0d9dc836 vpxenc: Allow non i420 input for VP10.
BUG=https://code.google.com/p/webm/issues/detail?id=1066

Change-Id: I3bd26a516ef3d2742c523af570f639f9312df6df
2015-09-29 10:45:00 -07:00
James Zern
bb55193448 vpxenc: fix DECODER ifdef
CONFIG_VP10_ENCODER -> CONFIG_VP10_DECODER

Change-Id: I6f1a798835acc4ef66bd2c5d6ffb02247c74b1d6
2015-08-21 16:08:36 -07:00
hui su
82331e000a create vp10_arg_ctrl_map
Change-Id: Ibe49acb022f1d557ffccb91e7bd2558870ff1a0b
2015-08-17 10:13:41 -07:00
hui su
db14911ccb remove unused high-bit-depth args from arg list
Change-Id: I8373a0e980aaaa0d0cab8b2e69d1a897ff5aec2d
2015-08-17 09:44:40 -07:00
Yaowu Xu
72889a2a60 Remove vp10's build dependency on vp9
CONFIG_VP9_HIGHBITDEPTH is currently used by both vp9 and vp10, but in
many place outside vp9/vp10, the macro was used in conjunction of
CONFIG_VP9. This created a dependency on vp9 for vp10 to build. This
commit removes the dependency by use CONFIG_VP9_HIGHBITDEPTH only in
these places.

Change-Id: I8cc007fc9cf132394c6498ce6759e606b64a6ad0
2015-08-14 12:16:07 -07:00
Yaowu Xu
2b18c9a09b Add vpxenc help info
1. information on --test-decode
2. vp10 specific parameters, currently shared with vp9

Change-Id: Ida4b691052441e68b9352746988027e5a2a26f48
2015-08-12 12:43:19 -07:00
Jingning Han
8af092dbd7 Fix high bit depth in vp10 codebase
Change-Id: Iacbfac29898ac7954eb6375e83873dbb7390fd47
2015-08-12 01:59:04 +00:00
Jingning Han
3ee6db6c81 Fork VP9 and VP10 codebase
This commit folks the VP9 and VP10 codebase and makes libvpx
support VP8, VP9, and VP10.

Change-Id: I81782e0b809acb3c9844bee8c8ec8f4d5e8fa356
2015-08-11 17:05:28 -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
James Zern
f82cfc2ee8 vpxenc: relocate vp8/vp9 only options
move them under their respective config check to avoid some unused
variable warnings when disabled

Change-Id: Ic5e5280cf1bc1f56e8349676f0bedae4acef34ea
2015-06-05 16:14:14 -07:00
Frank Galligan
09acd267bc vpxenc: Add support for pixel aspect ratio.
WebM files will adjust the display width and height according to the
input pixel aspect ratio. The default pixel aspect ratio is 1:1.

BUG=https://code.google.com/p/webm/issues/detail?id=1005

Change-Id: I23e0a601b7259fa9513cb86110c41b8437769808
2015-06-05 09:56:50 -07:00
Yaowu Xu
f990b35fa4 Make vp9 the default codec for vpxenc
Change-Id: Ic3b4f3c9a6d8f9b04efb8b5ee080880895063564
2015-06-04 08:28:12 -07:00
James Zern
5c337fd08a vpxenc: make some functions static
silences missing-prototype warnings

Change-Id: I641a61b21f9de135e59e3769a2063d5a94f34746
2015-05-11 20:55:03 -07:00
James Zern
59e7a47c41 tools_common.h: fix usage_exit() prototype
+ the definitions in the examples

silences a missing-prototype warning

Change-Id: I7c064cacd6d2073a6107de6c3e2cc46ef8a68411
2015-05-11 20:54:55 -07:00
Yaowu Xu
268f10669a Provide information on codec controls
The commit updates the comments in vp8cx.h to make it clear which
codec support each of codec control functions.

Change-Id: Ibf876e289d4325bbb61ce19311da60d384624c2f
2015-03-13 11:56:35 -07:00
Yaowu Xu
416529069b Rename a vp9 only control with vp9e prefix
Also updated comments and doc to make it clear that the control is
supported in VP9 only.

Change-Id: I6f120b65135fc1185695e9e3dc29fbe0d430824b
2015-03-12 18:33:47 -07:00
Adrian Grange
d240180022 Remove redundant test
Change-Id: I11e4fd8dcd44b0475f3bff0545a035feb223ce55
2015-02-13 14:57:14 -08:00
Yaowu Xu
fc99636f1b Add --color-space to vpxenc
This enbale the encoder to set color space information for the input
video, so it is then coded in the output bitstream.

Change-Id: Ife03deab3c762425ccd27c4c190902c4d94a76f4
2015-02-10 16:37:21 -08:00
Johann
b50e518ab6 Require webm when explicitly requested
https://code.google.com/p/webm/issues/detail?id=906

Change-Id: I72841078ff81152d21d84ccf4d5548e757685a6d
2015-02-02 08:35:56 -08:00
Yaowu Xu
e94b415c34 Add encoder control for setting color space
This commit adds encoder side control for vp9 to set color space info
in the output compressed bitstream.

It also amends the "vp9_encoder_params_get_to_decoder" test to verify
the correct color space information is passed from the encoder end to
decoder end.

Change-Id: Ibf5fba2edcb2a8dc37557f6fae5c7816efa52650
2015-01-14 10:17:14 -08:00
Yaowu Xu
a16f075375 Corrected value range of --cpu-used for vp9
This commit removes undefined value options of cpu-used for VP9 and
changed vpxenc prompt to reflect the usable range of [-8,8]

Change-Id: Ib80fef3dbb6ec9aabac45ed13e8ab6fbaf94f55e
2014-12-17 15:18:01 -08:00
Johann
80b344dec5 Silence -Werror=unused-parameter
Cast away remaining issues so that new ones don't get lost in the noise.

Change-Id: Iacd6999b0686ce80f9835730d68db6382690fa92
2014-12-16 12:47:08 -08:00
Marco
af898b56bb Various updates to vp8.
Change-Id: Icc7a816491897107764e4c936288e9000e6319b8
2014-12-03 16:01:28 -08:00