summaryrefslogtreecommitdiff
path: root/vpxenc.c
AgeCommit message (Collapse)Author
2013-02-20Merge lossless experimentYaowu Xu
Change-Id: I7b7b8d4fda3a23699e0c920d727f8c15d37d43aa
2013-02-19Merge "Add estimated completion time to vpxenc" into experimentalJohn Koleszar
2013-02-13Add support for tile rows.Ronald S. Bultje
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-12Add estimated completion time to vpxencJohn Koleszar
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-02-07Butterfly ADST based hybrid transformJingning Han
Refactor the 8x8 inverse hybrid transform. It is now consistent with the new inverse DCT. Overall performance loss (due to the use of this variant ADST, and the rounding errors in the butterfly implementation) for std-hd is -0.02. Fixed BUILD warning. Devise a variant of the original ADST, which allows butterfly computation structure. This new transform has kernel of the form: sin((2k+1)*(2n+1) / (4N)). One of its butterfly structures using floating-point multiplications was reported in Z. Wang, "Fast algorithms for the discrete W transform and for the discrete Fourier transform", IEEE Trans. on ASSP, 1984. This patch includes the butterfly implementation of the inverse ADST/DCT hybrid transform of dimension 8x8. Change-Id: I3533cb715f749343a80b9087ce34b3e776d1581d
2013-02-05[WIP] Add column-based tiling.Ronald S. Bultje
This patch adds column-based tiling. The idea is to make each tile independently decodable (after reading the common frame header) and also independendly encodable (minus within-frame cost adjustments in the RD loop) to speed-up hardware & software en/decoders if they used multi-threading. Column-based tiling has the added advantage (over other tiling methods) that it minimizes realtime use-case latency, since all threads can start encoding data as soon as the first SB-row worth of data is available to the encoder. There is some test code that does random tile ordering in the decoder, to confirm that each tile is indeed independently decodable from other tiles in the same frame. At tile edges, all contexts assume default values (i.e. 0, 0 motion vector, no coefficients, DC intra4x4 mode), and motion vector search and ordering do not cross tiles in the same frame. t log Tile independence is not maintained between frames ATM, i.e. tile 0 of frame 1 is free to use motion vectors that point into any tile of frame 0. We support 1 (i.e. no tiling), 2 or 4 column-tiles. The loopfilter crosses tile boundaries. I discussed this briefly with Aki and he says that's OK. An in-loop loopfilter would need to do some sync between tile threads, but that shouldn't be a big issue. Resuls: with tiling disabled, we go up slightly because of improved edge use in the intra4x4 prediction. With 2 tiles, we lose about ~1% on derf, ~0.35% on HD and ~0.55% on STD/HD. With 4 tiles, we lose another ~1.5% on derf ~0.77% on HD and ~0.85% on STD/HD. Most of this loss is concentrated in the low-bitrate end of clips, and most of it is because of the loss of edges at tile boundaries and the resulting loss of intra predictors. TODO: - more tiles (perhaps allow row-based tiling also, and max. 8 tiles)? - maybe optionally (for EC purposes), motion vectors themselves should not cross tile edges, or we should emulate such borders as if they were off-frame, to limit error propagation to within one tile only. This doesn't have to be the default behaviour but could be an optional bitstream flag. Change-Id: I5951c3a0742a767b20bc9fb5af685d9892c2c96f
2013-01-25Adding a frame parallel decoding modeDeb Mukherjee
Adds a flag to disable features that would inhibit frame parallel decoding. This includes backward adaptation and MV sorting based on search in ref frame buffer. Also includes some minor clean-ups. Change-Id: I434846717a47b7bcb244b37ea670c5cdf776f14d
2013-01-24MSVS compiler errorPaul Wilkins
Visual Studio reports and error on the line static const int bsize2 = bsize >> 1; "error C2099: initializer is not a constant" Also warnings on signed/unsigned mismatch Change-Id: I76cb06f736bd9c90107a26bfb3c130ec3f6c33de
2013-01-23Adds an error-resilient mode with testDeb Mukherjee
Adds an error-resilient mode where frames can be continued to be decoded even when there are errors (due to network losses) on a prior frame. Specifically, backward updates are turned off and probabilities of various symbols are reset to defaults at the beginning of each frame. Further, the last frame's mvs are not used for the mv reference list, and the sorting of the initial list based on search on previous frames is turned off as well. Also adds a test where an arbitrary set of frames are skipped from decoding to simulate errors. The test verifies (1) that if the error frames are droppable - i.e. frame buffer updates have been turned off - there are no mismatch errors for the remaining frames after the error frames; and (2) if the error-frames are non droppable, there are not only no decoding errors but the mismatch PSNR between the decoder's version of the post-error frames and the encoder's version is at least 20 dB. Change-Id: Ie6e2bcd436b1e8643270356d3a930e8989ff52a5
2012-12-27Merge branch 'vp9-preview' of review:webm/libvpxJohn Koleszar
Merge the vp9-preview branch into master. Change-Id: If700b9054676f24bed9deb59050af546c1ca5296
2012-12-26Build fixes to merge vp9-preview into masterJohn Koleszar
Various fixups to resolve issues when building vp9-preview under the more stringent checks placed on the experimental branch. Change-Id: I21749de83552e1e75c799003f849e6a0f1a35b07
2012-11-28Fixing 8x8/4x4 ADST for intra modes with tx selectDeb Mukherjee
This patch allows use of 8x8 and 4x4 ADST correctly for Intra 16x16 modes and Intra 8x8 modes when the block size selected is smaller than the prediction mode. Also includes some cleanups and refactoring. Rebase. Change-Id: Ie3257bdf07bdb9c6e9476915e3a80183c8fa005a
2012-11-17vpxenc: don't print STATS_PKT size w/--quietJames Zern
missed in 1fc3cc8 Change-Id: I80ffc1179245bc124e9938aad92a4d5fdfee187b
2012-11-15webm: add support for V_VP9John Koleszar
Tags VP9 tracks with the V_VP9 video type when writing to .webm files, and supports decoding both from vpxdec without specifying --codec. Change-Id: I0ef61dee06f4db2a74032b142a4b4976c51faf6e
2012-11-15support building vp8 and vp9 into a single libJohn Koleszar
Change-Id: Ib8f8a66c9fd31e508cdc9caa662192f38433aa3d
2012-11-10Fix frame number on which the mismatch is reported in vpxenc.Ronald S. Bultje
Change-Id: I962be949845f881df551d101708e6ba9d8a3d6a2
2012-11-09Fix another crash in vpxenc with --pass=1 and --test-decode.Ronald S. Bultje
Change-Id: Id23917ce2555519d2e9172dd6ce3a283f2235d26
2012-11-08fix a crash in 2-pass encoding with test-decode onYaowu Xu
only call decoding when encoder produce compressed data Change-Id: I1840762246afaaad76db6c6d29032ad15aa38afd
2012-11-07Rough merge of master into experimentalJohn Koleszar
Creates a merge between the master and experimental branches. Fixes a number of conflicts in the build system to allow *either* VP8 or VP9 to be built. Specifically either: $ configure --disable-vp9 $ configure --disable-vp8 --disable-unit-tests VP9 still exports its symbols and files as VP8, so that will be resolved in the next commit. Unit tests are broken in VP9, but this isn't a new issue. They are fixed upstream on origin/experimental as of this writing, but rebasing this merge proved difficult, so will tackle that in a second merge commit. Change-Id: I2b7d852c18efd58d1ebc621b8041fe0260442c21
2012-11-06vpxenc: merge with masterJohn Koleszar
Change-Id: Ic3e3559384a0e72abdc9b66a19865474c2a41b38
2012-11-06vpx: merge with masterJohn Koleszar
Change-Id: I44b3ad780cef6f448fa17ff8e28fea87ef9cd518
2012-11-01Rename vp8/ codec directory to vp9/.Ronald S. Bultje
Change-Id: Ic084c475844b24092a433ab88138cf58af3abbe4
2012-10-26vpxenc: add -quiet optionJames Zern
suppresses encoder progress Change-Id: Iacc04d98de970f13697c002363ee3a40a03f021b
2012-10-11Add encoder/decoder mismatch information to internal stats file.Ronald S. Bultje
Change-Id: Ibb6ba26e8718d3af27553ca59443a8c6aec7749d
2012-08-20silent compiling warnings for VC9 buildYaowu Xu
Change-Id: Iaa947e640f27e6f6eaf7d845f243536bca2df513
2012-08-14Fix warnings.Christian Duvivier
Change-Id: I4b911e4173da30c164bde7ea50bc80a70fbbb745
2012-07-24Added const specifier to remove warningAdrian Grange
The "codecs" array is defined as const so too should the local variable that points too it. Change-Id: I536a9ced52257dc44a04fc1a3cad94c1e86f69aa
2012-07-23Dll build of libvpxJim Bankoski
Change-Id: I74e50b4dfbe73eb98e1dce1695a9973f637220c0
2012-07-17Restyle codeJohn Koleszar
Approximate the Google style guide[1] so that that there's a written document to follow and tools to check compliance[2]. [1]: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml [2]: http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py Change-Id: Idf40e3d8dddcc72150f6af127b13e5dab838685f
2012-06-28Add lossless compression mode.Hui Su
This commit adds lossless compression capability to the experimental branch. The lossless experiment can be enabled using --enable-lossless in configure. When the experiment is enabled, the encoder will use lossless compression mode by command line option --lossless, and the decoder automatically recognizes a losslessly encoded clip and decodes accordingly. To achieve the lossless coding, this commit has changed the following: 1. To encode at lossless mode, encoder forces the use of unit quantizer, i.e, Q 0, where effective quantization is 1. Encoder also disables the usage of 8x8 transform and allows only 4x4 transform; 2. At Q 0, the first order 4x4 DCT/IDCT have been switched over to a pair of forward and inverse Walsh-Hadamard Transform (http://goo.gl/EIsfy), with proper scaling applied to match the range of the original 4x4 DCT/IDCT pair; 3. At Q 0, the second order remains to use the previous walsh-hadamard transform pair. However, to maintain the reversibility in second order transform at Q 0, scaling down is applied to first order DC coefficients prior to forward transform, and scaling up is applied to the second order output prior to quantization. Symmetric upscaling and downscaling are added around inverse second order transform; 4. At lossless mode, encoder also disables a number of minor features to ensure no loss is introduced, these features includes: a. Trellis quantization optimization b. Loop filtering c. Aggressive zero-binning, rounding and zero-bin boosting d. Mode based zero-bin boosting Lossless coding test was performed on all clips within the derf set, to verify that the commit has achieved lossless compression for all clips. The average compression ratio is around 2.57 to 1. (http://goo.gl/dEShs) Change-Id: Ia3aba7dd09df40dd590f93b9aba134defbc64e34
2012-06-20Fix compilation with -werrorJohn Koleszar
Fix a last few warnings with multithread, arm, 32 bit Change-Id: Ic7c67616c370d0ff87562a232fb1e5df0702dc86
2012-06-11Fix pedantic compiler warningsJohn Koleszar
Allows building the library with the gcc -pedantic option, for improved portabilty. In particular, this commit removes usage of C99/C++ style single-line comments and dynamic struct initializers. This is a continuation of the work done in commit 97b766a46, which removed most of these warnings for decode only builds. Change-Id: Id453d9c1d9f44cc0381b10c3869fabb0184d5966
2012-06-04Explicitly discard fwrite/fread return valuesJohann
Using if(); triggers an empty body warning with clang Change-Id: I0fa2ee676400a974b40f8eaafca9ae668107eebb
2012-05-18examples: use alignment > 1 w/vpx_img_allocJames Zern
aligned buffers improve performace. this change brings vpxenc & vp8_scalable_patterns in line with the other examples. Change-Id: I4cf9f3e4728b901161905dd7ccb092e774ffb15f
2012-05-01Added usage info on command line optionsYaowu Xu
This commit added usage information that was missed in usage output. Change-Id: If1a85bcc20131314f5d047c6db4e76a40d945e66
2012-04-27Reset output frames counter for second passAdrian Grange
The frame counter was not being reset at the start of the first pass. Change-Id: I2ef7c6edf027e43f83f470c52cbcf95bf152e430
2012-04-25Have vpxenc use a default kf_max_rate of 5 seconds.Ralph Giles
Rather than using the static default maximum keyframe spacing provided by vpx_codec_enc_config_default() set the default value to 5 times the frame rate. Five seconds is too long for live streaming applications, but is a compromise between seek efficiency and giving the encoder freedom to choose keyframe locations. The five second value is from James Zern's suggestion in http://article.gmane.org/gmane.comp.multimedia.webm.user/2945 Change-Id: Ib7274dc248589c433c06e68ca07232e97f7ce17f
2012-04-25vpxenc: validate rational argumentsJohn Koleszar
Trap negative values and zero denominators at the point where they're parsed. Change-Id: I1ec9da5d4e95d3ef539860883041330ecec2f345
2012-04-11Superblock encoding orderAdrian Grange
This is the first patch to add superblock (32x32) coding order capabilities. It does not yet do any mode selection at the SB level, that will follow in a further patch. This patch encodes rows of SBs rather than MBs, each SB contains 2x2 MBs. Two intra prediction modes have been disabled since they require reconstructed data for the above-right MB which may not have been encoded yet (e.g. for the bottom right MB in each SB). Results on the one test clip I have tried (720p GIPS clip) suggest that it is somewhere around 0.2dB worse than the baseline version, so there may be bugs. It has been tested with no experiments enabled and with the following 3 experiments enabled: --enable-enhanced_interp --enable-high_precision_mv --enable-sixteenth_subpel_uv in each case the decode buffer matches the recon buffer (using "cmp" to compare the dumped/decoded frames). Note: Testing these experiments individually created errors. Some problems were found with other experiments but it is unclear what state these experiments are in: --enable-comp_intra_pred --enable-newentropy --enable-uvintra This code has not been extensively tested yet, so there is every likelihood that further bugs remain. I also intend to do some code cleanup & refactoring in tandem with the next patch that adds the 32x32 modes. Change-Id: I1eba7f740a70b3510df58db53464535ef881b4d9
2012-03-26bug fix: fix mem leak error in vpxencJames Berry
fixes memory leak bug in vpxenc. Change-Id: I3933026d16177947576c61ebf58f8c58147e4ba0
2012-03-14Added encode/decode recon buffer match test to vpxencYaowu Xu
The commit added a new command line option --test-decode to vpxenc. The option enables encoder to decode compressed frames and test recon buffers from the decode against those from encode for mismatch. There are a few limitations on this option currently, one of them being the match test is not done on a number of lagged frames at the end of an encoding. Change-Id: I80c29b46dcdcea9f48107a506b235743068862fe
2012-03-14Added option to skip first n frame to vpxencYaowu Xu
this commit added a command line option to skip first n frames from input file to facilitate debugging and testing. Change-Id: I4ffc5f85fa7e193ea4bdee08cb236717de8beef1
2012-03-07Changed MAX_PSNR to be consistent with internal statsYaowu Xu
The maximum psnr has a marginal impact on the overall output in high quality encodings, the change will make sure the psnr output to be consistent with encoder internal stats. Change-Id: I35cf2f85008ec127a7d91c9eb69fa7811798ae32
2012-03-01Fix encoder debug settingJohann
Propagate debug setting to the EBML struct. When writing the application name, this allows us to strip the version code and keep the output metadata static. Change-Id: I8e06c6abd743bedbff5af6242bbdae5d55754538
2012-03-01Merge "Packing bitstream on-the-fly with delayed context updates"Scott LaVarnway
2012-02-29vpxenc: fix time and fps calculation in 2-pass encodingYunqing Wang
When we do 2-pass encoding, elapsed time is accumulated through whole 2-pass process, which gives incorrect time and fps results for second pass. This change fixed that by resetting the time accumulator for second pass. Change-Id: Ie6cbf0d0e66e6874e7071305e253c6267529cf20
2012-02-29Packing bitstream on-the-fly with delayed context updatesAttila Nagy
Produce the token partitions on-the-fly, while processing each MB. Context is updated at the beginning of each frame based on the previoud frame's counters. Optimally encoder outputs partitions in separate buffers. For frame based output, partitions are concatenated internally. Limitations: - enabled just in combination with realtime-only mode - number of encoding threads has to be equal or less than the number of token partitions. For this reason, by default the encoder will do 8 token partitions. - vpxenc supports partition output (-P) just in combination with IVF output format (--ivf) Performance: - Realtime encoder can be up to 13% faster (ARM) depending on the number of threads and bitrate settings. Constant gain over the 5-16 speed range. - Token buffer reduced from one frame to 8 MBs Quality: - quality is affected by the delayed context updates. This again dependents on input material, speed and bitrate settings. For VC style input the loss seen is up to 0.2dB. If error-resilient=2 mode is used than the effect of this change is negligible. Example: ./configure --enable-realtime-only --enable-onthefly-bitpacking ./vpxenc --rt --end-usage=1 --fps=30000/1000 -w 640 -h 480 --target-bitrate=1000 --token-parts=3 --static-thresh=2000 --ivf -P -t 4 -o strm.ivf tanya_640x480.yuv Change-Id: I127295cb85b835fc287e1c0201a67e378d025d76
2012-02-16vpxenc: initial implementation of multistream supportJohn Koleszar
Add the ability to specify multiple output streams on the command line. Streams are delimited by --, and most parameters inherit from previous streams. In this implementation, resizing streams is still not supported. It does not make use of the new multistream support in the encoder either. Two pass support runs all streams independently, though it's theoretically possible that we could combine firstpass runs in the future. The logic required for this is too tricky to do as part of this initial implementation. This is mostly an effort to get the parameter passing and independent streams working from the application's perspective, and a later commit will add the rescaling and multiresolution support. Change-Id: Ibf18c2355f54189fc91952c734c899e5c072b3e0
2012-02-16vpxenc: factor out input open/closeJohn Koleszar
Simplify some of the file I/O for later commits which will add multistream support Change-Id: Idf1a05f3a29c95331d0c4a6ea5960904e4897fd4
2012-02-16vpxenc: add warning()/fatal() helpersJohn Koleszar
Cosmetic. Allows exiting with an error message without opening a new scope. Change-Id: If227b29b825f0241acea79dd38f19e524552ee18