Commit Graph

169 Commits

Author SHA1 Message Date
Dmitry Kovalev
096ab11012 Removing pass number check from ivf_write_file_header().
Putting appropriate check to open_output_file() and close_output_file().
Before that the output file has been opened twice during two-pass encoding.

Change-Id: I290cecf00513d6a31ca3f45bc20fef7efcb10190
2014-01-13 15:21:48 -08:00
Alex Converse
64b89f1b4b Fix encoding Raw yv12 and i420 from a pipe.
rewind() does not work on pipes.

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

Change-Id: I057f1e25c3f5662012d6e33ff4c97c88f50df357
2014-01-06 16:31:09 -08:00
Tom Finegan
249366b1ac vpxenc: Move config check code into its own source files.
- Add command line args that allow display of warnings without prompting
  for user input.
- Extend warning code to make it somewhat scalable.

Change-Id: I2bad8f9315f6eed120c2e1bbe0a2a5ede15fbf35
2013-11-25 12:05:45 -08:00
Paul Wilkins
644bd87e8e In frame Q adjustment experiment.
The idea here is to allow "in frame" adjustment of the final Q
value used to encode each SB64, using segmentation.

There is also adjustment of the rd mult in regions of overspend.

Activated using aq_mode=2

Change-Id: I2f140cd898c9f877c32cd6d2e667f5e11ada4b1c
2013-11-25 10:22:55 -08:00
Tom Finegan
49dc9cafa6 vpxenc: Add vpxenc.h and move/rename the global_config struct
- Rename the struct to VpxEncoderConfig.
- The idea behind this is to enable checking the global settings against
  stream specific settings in source files other than vpxenc.c.

Change-Id: Ic736cbb714845b9466acb34671780d65b83ad1a8
2013-11-21 16:46:40 -08:00
Tom Finegan
44dd3274da vpxenc: Warn users about incorrect quantizer settings.
Also, clean up stylistically questionable code near my changes.

Change-Id: I92c96a274cb339b7b74174a608f94ae86aba8354
2013-11-20 17:18:28 -08:00
Guillaume Martres
b00057c88a Merge "vpxenc: add --aq-mode flag to control adaptive quantization" 2013-11-20 08:13:28 -08:00
Guillaume Martres
17084657e6 vpxenc: add --aq-mode flag to control adaptive quantization
Change-Id: I57e1ad4bed3487df12893ced77c49093f8755706
2013-11-15 19:42:20 +01:00
Tom Finegan
00a35aab7c vpx[dec|enc]: Extract IVF support from the apps.
- Move IVF reading support into ivfdec.c and ivfdec.h
- Move IVF writing support into ivfenc.c and ivfenc.h
- Removed IVF writing code from the SVC example in favor of ivfenc.

Change-Id: I70adf6240d0320fdd232d8546ed573f0f68dd793
2013-11-15 08:33:24 -08:00
Tom Finegan
78cb2e6553 vpxenc: clean up; move stats code out of vpxenc.c
Change-Id: I6b245ef5017c49373ba33e30f8fbf3d1b97409b5
2013-11-11 16:30:18 -08:00
Tom Finegan
ab38f4f8fc Merge "vpx[dec|enc]: Clean up target OS based IO focused preproc abuse." 2013-11-11 11:53:33 -08:00
Tom Finegan
e657919ddf vpx[dec|enc]: Clean up target OS based IO focused preproc abuse.
Relocate it to tools_common.h so we can stop duping this code
everywhere.

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

Change-Id: If8aa49b74d297273cd9fd7006b2767837055a359
2013-11-11 11:23:09 -08:00
Tom Finegan
6c270ed087 vpxenc: Remove support for IVF input.
Change-Id: Ida0e1b2df89e992b8140672b70517d8623cf9ede
2013-11-08 14:07:11 -08:00
Tom Finegan
03848f5ca7 Move WebM writing support out of vpxenc.c.
This is mainly a clean up patchset. It moves the WebM writing support
out of vpxenc and into its own source file. Changes to tools_common and
vpxdec result from relocation of shared bits of code.

Change-Id: Iee55d3285f56e0a548f791094fb14c5ac5346a26
2013-11-06 06:49:55 -08:00
Yaowu Xu
47e784eab6 Prevent first pass from outputing invalid info
First pass does not produce compressed data, therefore encode/decode
match check is not initialized.

Change-Id: I1971a6747337872a850987cc70ba267bd0f1d564
2013-10-16 16:29:28 -07:00
Dmitry Kovalev
86f4681450 Moving libmkv library to third_party folder.
Change-Id: Id0bfaedf54ff3f59d4cf361c170a0b5a5711e5f2
2013-10-07 13:06:53 -07:00
Tom Finegan
9ba08208d3 vpxenc: Stop writing the WebM FrameRate element.
The FrameRate element has been deprecated.

Change-Id: I68ac496e7b33685a100a45d2772e0ff30eb6a811
2013-09-24 09:18:54 -07:00
Yaowu Xu
b0211e7edf Merge "fix vp8-only build" 2013-09-19 09:27:59 -07:00
Yaowu Xu
014acfa2af fix integer overflow errors
Change-Id: I76f440a917832c02d7a727697b225bac66b99f56
2013-09-19 08:14:26 -07:00
James Zern
a0fcbcfa5f fix vp8-only build
Change-Id: Id9ce44f3364dd57b30ea491d956a2a0d6186be05
2013-09-17 18:47:25 -07:00
Deb Mukherjee
e378a89bd6 Support a constant quality mode in VP9
Adds a new end-usage option for constant quality encoding in vpx. This
first version implemented for VP9, encodes all regular inter frames
using the quality specified in the --cq-level= option, while encoding
all key frames and golden/altref frames at a quality better than that.

The current performance on derfraw300 is +0.910% up from bitrate control,
but achieved without multiple recode loops per frame.

The decision for qp for each altref/golden/key frame will be improved
in subsequent patches based on better use of stats from the first pass.
Further, the qp for regular inter frames may also be varied around the
provided cq-level.

Change-Id: I6c4a2a68563679d60e0616ebcb11698578615fb3
2013-09-06 10:30:53 -07:00
Deb Mukherjee
0d8723f8d5 Make "good" quality 2-pass vpxenc encoding default
Currently, the best quality mode in VP9 is not very well developed,
and unnecessarily makes the encode too slow. Hence the command line
default is changed to "good" quality. Also, the number of passes
default is changed to 2 passes as well, since 1-pass encoding is
not very efficient in VP9.

Besides, a number of VP9 defaults are set to the currently
recommended settings. With these changes, vpxenc
run with --codec=vp9 --kf-max-dist=9999 --cpu-used=0 should
work about the same as our borg results.
Note when the --cpu-used=0 option is dropped there will be a slight
difference in the output, because of a difference in the cpu-used
value for the first pass. Specifically, the default when unspecified
is to use cpu_used=1 for the first pass and cpu_used=0 for the
second pass. But when specified, both passes will use the cpu-used
value specified.

Note that this also changes the default for VP8 as being "good"
but other options stay unchanged.

Change-Id: Ib23c1a05ae2f36ee076c0e34403efbda518c5066
2013-08-21 12:41:26 -07:00
James Zern
8cb09719a3 vpxenc: open output file after setting pass #
write_ivf_file_header would incorrectly skip writing the file header in
the 2nd pass, causing the initial frame header to be overwritten on
close potential causing an overly large frame header to be read and a
crash.

most likely broken since:
9e50ed7 vpxenc: initial implementation of multistream support

fixes issue #585

Change-Id: I7e863e295dd6344c33b3e9c07f9f0394ec496e7b
2013-08-14 18:34:44 -07:00
John Koleszar
b9e2761019 vpxenc: send usage to stderr
Thanks to hiiragikei AT gmail.com for the fix.

Change-Id: Iab6c0822593fc5557d86efbb014ff6409ff05b35
2013-06-25 09:17:41 -07:00
Scott LaVarnway
0450a8891a Removed hardcoded global->limit
Looks like test code.

Change-Id: I5deae2bf14ea6fdcbb9b9d993966c9abef95eb2e
2013-06-17 15:28:45 -04:00
John Koleszar
119c9812a5 Add vp9 test vectors unit test
These files can stand in until we get proper syntax vectors. They
should provide some additional assurance against inadvertant
bitstream changes.

Change-Id: I12f6c9a5f054e30df40a7ff1f33145abf7e1d59d
2013-06-13 12:54:01 -07:00
John Koleszar
cc0eeda6dd Fix mismatch check output
Fixes a condition where the address of the mismatching pixels was not
being found/printed.

Change-Id: Ifac5cd3471bc2437448128591eea7c7b87e2d8fe
2013-06-11 11:28:38 -07:00
John Koleszar
beae501e96 vpxenc: fix mismatch check for non-4:2:0
Change-Id: Iffe7c2e6c6cb14b637420ffc368a5003f5db42fa
2013-05-09 20:14:31 -07:00
John Koleszar
8dd8287e16 Y4M input support for 4:2:2, 4:4:4, 4:4:4:4
Adds a new experiment CONFIG_NON420 that allows other chroma subsamplings
to be passed to the codec. This commit allows the data to be passed from
a y4m input file through vpxenc to the codec, where they're currently
rejected. Later commits will finish support for this inside the codec.

Change-Id: Ib3aac604d8cad9e24cef395fa1067f16ba7e8e43
2013-05-06 14:35:19 -07:00
Jingning Han
12bf0796e6 Clamp inferred motion vectors only
Clamp only the motion vectors inferred from neighboring reference
macroblocks. The motion vectors obtained through motion search in
NEWMV mode are constrained during the search process, which allows
a relatively larger referencing region than the inferred mvs.
Hence further clamping the best mv provided by the motion search may
affect the efficacy of NEWMV mode.

Synchronized the decoding process. The decoded mvs in NEWMV modes
should be guaranteed to fit in the effective range. Put a mv range
clamping function there for security purpose.

This improves the coding performance of high motion sequences, e.g.,
derf set:
foreman 0.233%
husky   0.175%
icd     0.135%
mother_daughter 0.337%
pamphlet        0.561%

stdhd set:
blue_sky 0.408%
city     0.455%
also saw sunflower goes down by -0.469%.

Change-Id: I3fcbba669e56dab779857a8126a91b926e899cb5
2013-04-08 11:37:03 -07:00
John Koleszar
81708cc326 Convert g_frame_parallel_decoding to control interface
Restore ABI compatibility with the master branch.

Change-Id: Ic57e7e1de09ab33bd37990e52a63ba7c8f1432a4
2013-03-27 11:07:26 -07:00
John Koleszar
771fc832f3 Merge branch 'master' into experimental
Pick up VP8 encryption, quantization changes, and some fixes to vpxenc

Conflicts:
	test/decode_test_driver.cc
	test/decode_test_driver.h
	test/encode_test_driver.cc
	vp8/vp8cx.mk
	vpxdec.c
	vpxenc.c

Change-Id: I9fbcc64808ead47e22f1f22501965cc7f0c4791c
2013-03-27 10:46:19 -07:00
Deb Mukherjee
23144d2345 Implicit weighted prediction experiment
Adds an experiment to use a weighted prediction of two INTER
predictors, where the weight is one of (1/4, 3/4), (3/8, 5/8),
(1/2, 1/2), (5/8, 3/8) or (3/4, 1/4), and is chosen implicitly
based on consistency of the predictors to the already
reconstructed pixels to the top and left of the current macroblock
or superblock.

Currently the weighting is not applied to SPLITMV modes, which
default to the usual (1/2, 1/2) weighting. However the code is in
place controlled by a macro. The same weighting is used for Y and
UV components, where the weight is derived from analyzing the Y
component only.

Results (over compound inter-intra experiment)
derf: +0.18%
yt: +0.34%
hd: +0.49%
stdhd: +0.23%

The experiment suggests bigger benefit for explicitly signaled weights.

Change-Id: I5438539ff4485c5752874cd1eb078ff14bf5235a
2013-03-26 16:58:56 -07:00
Dmitry Kovalev
8015a9aedc Fixing fourcc for VP8 and VP9.
Changing 0x00 ('') fourcc byte to 0x30 ('0'). For VP8 from
0x00385056 to 0x30385056, for VP9 from 0x00395056 to 0x30395056.

Change-Id: I26b1b603c20dd41f7aeabf8cd7893dfd5b1c8b59
2013-03-22 11:56:02 -07:00
John Koleszar
b3c350a1a9 Add VP9_GET_REFERENCE control
This is like VP8_COPY_REFERENCE, but returns a pointer to the reference
frame rather than a copy of it. This is useful when the application
doesn't know what the size of the reference is, as is the case when
scaling is in effect.

Change-Id: I63667109f65510364d0e397ebe56217140772085
2013-03-13 19:08:06 -07:00
John Koleszar
2bf563c335 vpxenc: improve progress indicators with --skip
Account for skipped input frames when calculating frame rates, ETA.

Fixes https://code.google.com/p/webm/issues/detail?id=556

Change-Id: I9c8b51e02e9ff0ab2cf6f16fc9382fc7f6c77b80
2013-03-11 15:03:00 -07:00
Ronald S. Bultje
97dd7342b8 vpxenc: actually report mismatch on stderr.
Because ctx->err is not set in that case, it will not report the error
on stderr.

Change-Id: Ifacbf5a03e676fd56522b03c0281d6c723c563ee
2013-03-04 16:49:00 -08:00
John Koleszar
406ec6b62e Fix rollover and pass 1 time estimate
Fixes a rollover of the cx_time variable for encodes that take
over ~4200 seconds. Also enable the time estimate in first pass.

Change-Id: Ib5a98ee71bccd79a804d709cec7260651d0b7141
2013-03-04 13:21:54 -08:00
John Koleszar
7dfec96059 vpxenc: support scaling prior to encoding
Scales the input of the encoder using libyuv's "box filter". Each stream
may have a different width and height specified. If the width (or
height) parameter is missing (or is explicitly set to 0) then the value
will be calculated based on the specified height (or width) and the
input file's dimensions, preserving its aspect ratio. Leaving the height
unspecified behaves similarly.

Change-Id: I700ef89ce54fb87588420a71c39c0e3e73b1a40e
2013-03-04 13:21:47 -08:00
Ronald S. Bultje
2d13e7b33e Don't exit on decode errors in vpxenc.
Allows the user to specify whether decode errors should be fatal or not.
Also makes mismatches optionally fatal.

Change-Id: I58cff4a82f3d42f5653b91cf348a7f669377e632
2013-03-04 13:19:09 -08:00
John Koleszar
60d8c50514 Add estimated completion time to vpxenc
Make the progress line more useful by providing per-frame updates of
processing frame rate and estimated time remaining.

Fixes issue #534.

Change-Id: Ic91551878ff4b2f5db1cedaafb588add220cfa52
2013-03-04 13:18:55 -08:00
John Koleszar
69c67c9531 Merge master branch into experimental
Picks up some build system changes, compiler warning fixes, etc.

Change-Id: I2712f99e653502818a101a72696ad54018152d4e
2013-03-01 11:06:05 -08:00
John Koleszar
d962bd530d Merge "Fix rollover and pass 1 time estimate" into experimental 2013-02-27 17:43:03 -08:00
John Koleszar
ebf8b9fc6d Fix rollover and pass 1 time estimate
Fixes a rollover of the cx_time variable for encodes that take
over ~4200 seconds. Also enable the time estimate in first pass.

Change-Id: Ib5a98ee71bccd79a804d709cec7260651d0b7141
2013-02-27 12:29:25 -08:00
John Koleszar
34882b9bf5 vpxenc: support scaling prior to encoding
Scales the input of the encoder using libyuv's "box filter". Each stream
may have a different width and height specified. If the width (or
height) parameter is missing (or is explicitly set to 0) then the value
will be calculated based on the specified height (or width) and the
input file's dimensions, preserving its aspect ratio. Leaving the height
unspecified behaves similarly.

Change-Id: Ic7026810b13be030826be80dc6f7fc4aaf0c35d0
2013-02-27 08:22:40 -08:00
Jingning Han
babbd5d170 Forward butterfly hybrid transform
This patch includes 4x4, 8x8, and 16x16 forward butterfly ADST/DCT
hybrid transform. The kernel of 4x4 ADST is sin((2k+1)*(n+1)/(2N+1)).
The kernel of 8x8/16x16 ADST is of the form sin((2k+1)*(2n+1)/4N).

Change-Id: I8f1ab3843ce32eb287ab766f92e0611e1c5cb4c1
2013-02-21 18:24:28 -08:00
Ronald S. Bultje
9837bf4d40 Don't exit on decode errors in vpxenc.
Allows the user to specify whether decode errors should be fatal or not.
Also makes mismatches optionally fatal.

Change-Id: I58cff4a82f3d42f5653b91cf348a7f669377e632
2013-02-21 12:27:00 -08:00
Yaowu Xu
d262e26cc7 Merge lossless experiment
Change-Id: I7b7b8d4fda3a23699e0c920d727f8c15d37d43aa
2013-02-20 07:54:28 -08:00
John Koleszar
34732576c1 Merge "Add estimated completion time to vpxenc" into experimental 2013-02-19 10:51:42 -08:00
Ronald S. Bultje
89a206ef2f Add support for tile rows.
These allow sending partial bitstream packets over the network before
encoding a complete frame is completed, thus lowering end-to-end
latency. The tile-rows are not independent.

Change-Id: I99986595cbcbff9153e2a14f49b4aa7dee4768e2
2013-02-13 12:31:00 -08:00