summaryrefslogtreecommitdiff
path: root/vp8/vp8_cx_iface.c
AgeCommit message (Collapse)Author
2013-07-12yv12config: remove YUV_TYPEJames Zern
this was never fleshed out in the context of VP8, for which it was added. for VP9 it has no meaning. Change-Id: Iba2ecc026d9e947067b96690245d337e51e26eff
2013-04-16Merge branch 'experimental' into masterJohn Koleszar
VP9 preview bitstream 2, commit '868ecb55a1528ca3f19286e7d1551572bf89b642' Conflicts: vp9/vp9_common.mk Change-Id: I3f0f6e692c987ff24f98ceafbb86cb9cf64ad8d3
2013-03-27Convert g_frame_parallel_decoding to control interfaceJohn Koleszar
Restore ABI compatibility with the master branch. Change-Id: Ic57e7e1de09ab33bd37990e52a63ba7c8f1432a4
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-11Upstream changes from Chromium Android Clang build.Frank Galligan
See https://codereview.chromium.org/11875006/ Change-Id: Ied2a17df2b3222635f84aef120eaa9feb53750d2
2012-11-15support building vp8 and vp9 into a single libJohn Koleszar
Change-Id: Ib8f8a66c9fd31e508cdc9caa662192f38433aa3d
2012-08-20silent compiling warnings for VC9 buildYaowu Xu
Change-Id: Iaa947e640f27e6f6eaf7d845f243536bca2df513
2012-08-08fix timestamp calculation rollover w/altrefJames Zern
using large values for the timebase, e.g., {33333, 1000000} could rollover the timestamp calculation in vp8e_encode as it was not using 64-bit math. originally reported on ffmpeg's trac: https://ffmpeg.org/trac/ffmpeg/ticket/1014 BUG=468 Change-Id: Iedb4e11de086a3dda75097bfaf08f2488e2088d8
2012-07-26multi-res: add drop_frame supportYunqing Wang
Added drop_frame support in multi-resolution encoder. If one frame is dropped at a lower-resolution level, the next upper-resolution level encoder needs to encode that frame independently without any lower-resolution level motion information. Another issue is that if one frame is dropped at some but not all resolution levels, a frame after that one may use different set of reference frames at different resolution levels. This reference frame asynchronization could degrade motion search precision in upper-resolution level encoding, which uses lower-resolution level motion result. This change compares the lower-resolution and upper- resolution level's reference frames. If they are not the same, the upper-resolution level encoder can not use lower-resolution level motion result. Change-Id: I61afa4f313630e75b7cbdd5742e230e8724a988a
2012-07-13multi-res: add parameter validity checkingYunqing Wang
Added validity checking in multi-res encoder. Disable spatial resampling and frame dropping before we have those supports. Also, deallocate the memory for all resolution levels once error occurs. Change-Id: Ia5d65a645381cad1a49940ab3a19bb5696c39c09
2012-07-13Remove unused parameter in encoder interface codeYunqing Wang
Removed encoding_mode, which is not used anymore. Change-Id: I569b2d4afe4d2f57bda8248615108c7cfc40134c
2012-06-19Merge "disable lagged encoding in one-pass"John Koleszar
2012-06-15Remove threading dependencies with --disable-multithreadJohn Koleszar
Avoid a pthreads dependency via pthread_once() when compiled with --disable-multithread. In addition, this synchronization is disabled for Win32 as well, even though we can be sure that the required primatives exist, so that the requirements on the application when built with --disable-multithread are consistent across platforms. Users using libvpx built with --disable-multithread in a multithreaded context should provide their own synchronization. Updated the documentation to vpx_codec_enc_init_ver() and vpx_codec_dec_init_ver() to note this requirement. Moved the RTCD initialization call to match this description, as previously it didn't happen until the first frame. Change-Id: Id576f6bce2758362188278d3085051c218a56d4a
2012-06-13disable lagged encoding in one-passJames Zern
This currently has no effect and can create an artificial lag in e.g., realtime. Change-Id: Ia1c7c6dbe7c6fe82a944f087f1b0d1dbbc0aa1b6
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-04Remove extra enumJohann
VP8_REFFRAME is the same as vpx_ref_frame_type Change-Id: I63c2ddfb39f6ec87d1e5eb6a8852846464552b1b
2012-05-23Prevent external frame size changes in two-passJohn Koleszar
The two-pass code does not support the case where the application changes the frame size dynamically. Add this case to the validation checks in the vpx_codec_enc_config_set() path. Change-Id: Idadc42c7c3bd566ecdbce30d8dd720add097f992
2012-05-23multi-res: modify memory allocation codeYunqing Wang
Reverted part of change in memory alllocation code, which ensures that the function returns 0 and encoder works correctly when CONFIG_MULTI_RES_ENCODING isn't turned on. Change-Id: Id5d5e7f2c8bd9e961a6dca79d257e8185f0d592a
2012-05-22Merge "multi-res: force Key frame sychronization"Yunqing Wang
2012-05-16multi-res: force Key frame sychronizationYunqing Wang
In multi-resolution encoding, frame_type decision for each frame is made by the lowest-resolution encoder. For all other higher- resolution encoders, kf_mode is always set to VPX_KF_DISABLED, and they are forced to use the same frame_type picked by the lowest-resolution encoder. Change-Id: Ic4d52ec65bbc012ca9c2d236210e28a295591eaf
2012-05-11fix warnings for building on win32Scott Graham
Change-Id: If6e11ba3d681e831d7d98662c0abdd2ac16b3811
2012-05-11Merge branch 'origin/eider' into masterJohn Koleszar
Conflicts: vp8/common/entropymode.c vp8/common/entropymode.h vp8/encoder/encodeframe.c vp8/vp8_cx_iface.c Change-Id: I708b0f30449b9502b382e47b745d56f5ed2ce265
2012-05-08Use consistent range for VP8E_SET_NOISE_SENSITIVITYJohn Koleszar
Accept the same range of inputs for the VP8E_SET_NOISE_SENSITIVITY control, regardless of whether temporal denoising is enabled or not. This is important for maintaining compatibility with existing applications. Change-Id: I94cd4bb09bf7c803516701a394cf1a63bfec0097
2012-05-04remove deprecated pre-v0.9.0 APIJohn Koleszar
Remove a bunch of compatibility code dating back to before the initial libvpx release. Change-Id: Ie50b81e7d665955bec3d692cd6521c9583e85ca3
2012-05-04Make global data constAttila Nagy
Removes all runtime initialization of global data. This commit is a squashed version of the following series cherry-picked from master. This is necessary because of a change that was merged to the tester that depends on the scaler being moved to the RTCD framework, which is a worthwhile thing to include in Eider anyway. - a91b42f02 Makes all global data in entropy.c const - b35a0db0e Makes all global data in tokenize.c const - 441cac8ea Makes all mode token tables const - 5948a0210 Ports vpx_xcaler to new RTCD method - 317d4244c Makes all mode token tables const part 2 Change-Id: Ifeaea24df2b731e7c509fa6c6ef6891a374afc26
2012-05-02multi-res: restore v1.0.0 APIJohn Koleszar
Move the notion of 0 bitrate implying skip deeper into the codec, rather than doing it at the multi-encoder API level. This preserves v1.0.0 ABI compatibility, rather than forcing a bump to v2.0.0 over a minor change. Also, this allows the case where the application can selectively enable and disable the larger resolution(s) without having to reinitialize the codec instace (for instance, if no target is receiving the full resolution stream). It's not clear how deep to push this check. It may be valuable to allow the framerate adaptation code to run, for example. Currently put the check as early as possible for simplicity, should reevaluate this as this feature gains real use. Change-Id: I371709b8c6b52185a1c71a166a131ecc244582f0
2012-04-20multi-res: restore v1.0.0 APIJohn Koleszar
Move the notion of 0 bitrate implying skip deeper into the codec, rather than doing it at the multi-encoder API level. This preserves v1.0.0 ABI compatibility, rather than forcing a bump to v2.0.0 over a minor change. Also, this allows the case where the application can selectively enable and disable the larger resolution(s) without having to reinitialize the codec instace (for instance, if no target is receiving the full resolution stream). It's not clear how deep to push this check. It may be valuable to allow the framerate adaptation code to run, for example. Currently put the check as early as possible for simplicity, should reevaluate this as this feature gains real use. Change-Id: I371709b8c6b52185a1c71a166a131ecc244582f0
2012-04-19Ports vpx_xcaler to new RTCD methodAttila Nagy
We can get rid of all remaining global initializers now: vp8_scale_machine_specific_config() vp8_initialize() vp8dx_initialize() Change-Id: I2825cea5d1c01ad9f6c45df49a0f86d803bfeb69
2012-03-13Adds a motion compensated temporal denoiser to the encoder.Stefan Holmer
Some refactoring in rdopt.c and pickinter.c. Change-Id: I4f50020eb3313c37f4d441d708fedcaf219d3038
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-07support changing resolution with vpx_codec_enc_config_setJohn Koleszar
Allow the application to change the frame size during encoding. This is only supported when not using lagged compress. Change-Id: I89b585d703d5fd728a9e3dedf997f1b595d0db0f
2012-01-13Fixed bugs in multi-layer code related to changing paramsAdrian Grange
When running multi-layer (ML) encodes and dynamically changing coding parameters on the fly (e.g. frame duration/rate, bandwidths allocated to each layer) the encoder would not produce sensible output. In certain cases the rate targeting would be hideously inaccurate. These fixes make it possible to change these coding parameters correctly and to maintain accurate control of the rate targeting. I also added the specification of the input timebase into the test program, vp8_scalable_patterns.c. Patch 2: Moved declaration to appease MS compiler) Change-Id: Ic8bb5a16daa924bb64974e740696e040d07ae363
2012-01-06Reduce the default kf_max_dist to 128.Ralph Giles
The default maximum keyframe interval is 9999, or over five minutes at normal video rates. When the encoder produces streams with such a long interval seeking (with correct output) is more expensive, and live streaming is impossible. Of course the encoding application should set this parameter based on its knowledge of the intended use of the stream, but reducing the default gives better results for applications which do not. Change-Id: I900b15d74ce72ecc3ade4d43f758c5cf97a2098a
2011-12-21Remove opaque pointer VP8_PTRJohn Koleszar
Use an opaque struct rather than typecasting through VP8_PTR, an int*. Change-Id: I5ed4d9238ba2e8d51bfa07a8da87a2eb4c8fa43a
2011-12-16Merge mr_pick_inter_mode and pick_inter_modeYunqing Wang
Merged multi-resolution motion estimation with regular motion estimation function in order to remove duplicated part. This caused slight changes in multi-resulotion encoder quality & performance. Change-Id: Ib4ecc7acfebfe5eea959b5b91febae6db7b95fd1
2011-12-14add check to ensure that cq_level falls within min and max qJames Berry
Add the notion of deferred validation of parameters. We don't want to validate the cq_level at initialization time, because it won't have been set via set_param() yet. Change-Id: Ia1308395e8c10e0b1dc4e9af3a09b2bd6744cc30
2011-12-05Multiple-resolution encoderYunqing Wang
The example encoder down-samples the input video frames a number of times with a down-sampling factor, and then encodes and outputs bitstreams with different resolutions. Support arbitrary down-sampling factor, and down-sampling factor can be different for each encoding level. For example, the encoder can be tested as follows. 1. Configure with multi-resolution encoding enabled: ../libvpx/configure --target=x86-linux-gcc --disable-codecs --enable-vp8 --enable-runtime_cpu_detect --enable-debug --disable-install-docs --enable-error-concealment --enable-multi-res-encoding 2. Run make 3. Encode: If input video is 1280x720, run: ./vp8_multi_resolution_encoder 1280 720 input.yuv 1.ivf 2.ivf 3.ivf 1 (output: 1.ivf(1280x720); 2.ivf(640x360); 3.ivf(320x180). The last parameter is set to 1/0 to show/not show PSNR.) 4. Decode: ./simple_decoder 1.ivf 1.yuv ./simple_decoder 2.ivf 2.yuv ./simple_decoder 3.ivf 3.yuv 5. View video: mplayer 1.yuv -demuxer rawvideo -rawvideo w=1280:h=720 -loop 0 -fps 30 mplayer 2.yuv -demuxer rawvideo -rawvideo w=640:h=360 -loop 0 -fps 30 mplayer 3.yuv -demuxer rawvideo -rawvideo w=320:h=180 -loop 0 -fps 30 The encoding parameters can be modified in vp8_multi_resolution_encoder.c, for example, target bitrate, frame rate... Modified API. John helped a lot with that. Thanks! Change-Id: I03be9a51167eddf94399f92d269599fb3f3d54f5
2011-11-11avoid resetting framerate during vpx_codec_enc_config_set()John Koleszar
The calculated frame_rate is a state variable in the codec, and shouldn't be maintained in the configuration struct. Move it to the main part of cpi so that it isn't clobbered when the configuration struct is updated. The initial framerate estimate is moved from the vp8_cx_iface.c wrapper into the body of init_config() in onyx_if.c, so that it is only called once and not reset on every call to vp8_change_config(). Change-Id: I8d9a3d1283330d1ee297d07e9d78d1f2875f2465
2011-10-24Fix: Increase default cx_data_sizeJames Berry
Prior size could be too small in some instances resulting in an error. Change-Id: Ic601e49cbae92c98a0e7fb51ba8c186b352ffba6
2011-10-20Fix: check cx_data buffer prior to writeJames Berry
check to make sure that cx_data buffer has enough room before writting to it, prior behavior did not which could result in a crash. Change-Id: I3fab6f2bc4a96d7c675ea81acd39ece121738b28
2011-10-11Added rate-targeted temporal scalabilityAdrian Grange
Added the ability to create rate-targeted, temporally scalable, VP8 compatible bitstreams. The application vp8_scalable_patterns.c demonstrates how to use this capability. Users can create output bitstreams containing upto 5 temporally separable streams encoded as a single VP8 bitstream. (previously abandoned as: I92d1483e887adb274d07ce9e567e4d0314881b0a) Change-Id: I156250a3fe930be57c069d508c41b6a7a4ea8d6a
2011-07-28Convert rc_max_intra_bitrate_pct to controlJohn Koleszar
Since this is the only ABI incompatible change since the last release, convert it to use the control interface instead. The member of the configuration struct is replaced with the VP8E_SET_MAX_INTRA_BITRATE_PCT control. More significant API changes were expected to be forthcoming when this control was first introduced, and while they continue to be expected, it's not worth breaking compatibility for only this change. Change-Id: I799d8dbe24c8bc9c241e0b7743b2b64f81327d59
2011-07-26cosmetics: consistently use [u]int64_tJames Zern
Removes mixed usage of (unsigned) long long and INT64. Fixes Issue #208. Change-Id: I220d3ed5ce4bb1280cd38bb3715f208ce23cf83a
2011-07-20encoder: don't set the fragment bit for the last partitionAttila Nagy
Change-Id: Icb4e4f0d7c3074a8507852178be87541a1cb5bac
2011-07-07Set VPX_FRAME_IS_DROPPABLEJohn Koleszar
Allow the encoder to inform the application that the encoded frame will not be used as a reference. Change-Id: I90e41962325ef73d44da03327deb340d6f7f4860
2011-06-28New ways of passing encoded data between encoder and decoder.Stefan Holmer
With this commit frames can be received partition-by-partition from the encoder and passed partition-by-partition to the decoder. At the encoder-side this makes it easier to split encoded frames at partition boundaries, useful when packetizing frames. When VPX_CODEC_USE_OUTPUT_PARTITION is enabled, several VPX_CODEC_CX_FRAME_PKT packets will be returned from vpx_codec_get_cx_data(), containing one partition each. The partition_id (starting at 0) specifies the decoding order of the partitions. All partitions but the last has the VPX_FRAME_IS_FRAGMENT flag set. At the decoder this opens up the possibility of decoding partition N even though partition N-1 was lost (given that independent partitioning has been enabled in the encoder) if more info about the missing parts of the stream is available through external signaling. Each partition is passed to the decoder through the vpx_codec_decode() function, with the data pointer pointing to the start of the partition, and with data_sz equal to the size of the partition. Missing partitions can be signaled to the decoder by setting data != NULL and data_sz = 0. When all partitions have been given to the decoder "end of data" should be signaled by calling vpx_codec_decode() with data = NULL and data_sz = 0. The first partition is the first partition according to the VP8 bitstream + the uncompressed data chunk + DCT address offsets if multiple residual partitions are used. Change-Id: I5bc0682b9e4112e0db77904755c694c3c7ac6e74
2011-04-25Merge "Change rc undershoot/overshoot semantics"John Koleszar
2011-04-25Add rc_max_intra_bitrate_pct controlJohn Koleszar
Adds a control to limit the maximum size of a keyframe, as a function of the per-frame bitrate. See this thread[1] for more detailed discussion: [1]: http://groups.google.com/a/webmproject.org/group/codec-devel/browse_thread/thread/271b944a5e47ca38 Change-Id: I7337707642eb8041d1e593efc2edfdf66db02a94
2011-04-12Change rc undershoot/overshoot semanticsJohn Koleszar
This patch changes the rc_undershoot_pct and rc_overshoot_pct controls to set the "aggressiveness" of rate adaptation, by limiting the amount of difference between the target buffer level and the actual buffer level which is applied to the target frame rate for this frame. This patch was initially provided by arosenberg at logitech.com as an attachment to issue #270. It was modified to separate these controls from the other unrelated modifications in that patch, as well as to use the pre-existing variables rather than introducing new ones. Change-Id: Id542e3f5667dd92d857d5eabf29878f2fd730a62
2011-04-12Merge "Fix encoder range check for frame width and height"John Koleszar