summaryrefslogtreecommitdiff
path: root/vp8/encoder/rdopt.c
AgeCommit message (Collapse)Author
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-11Fix bad mergeJohn Koleszar
Change-Id: I45849dde0ee9b7e87fa32adb65ade8486bb66556
2012-06-11Merge "Reset Q for key frame when spatial resizing occurs."John Koleszar
2012-05-30fix denoiser for temporal patterns and rdJim Bankoski
This extends the denoiser to work for temporally scalable coding. I believe this also fixes a very rare but really bad bug in the original implementation. Change-Id: I8b3593a8c54b86eb76f785af1970935f7d56262a
2012-05-24fix denoiser for temporal patterns and rdJim Bankoski
This extends the denoiser to work for temporally scalable coding. I believe this also fixes a very rare but really bad bug in the original implementation. Change-Id: I8b3593a8c54b86eb76f785af1970935f7d56262a
2012-05-11fix warnings for building on win32Scott Graham
Change-Id: If6e11ba3d681e831d7d98662c0abdd2ac16b3811
2012-04-23Shares one set of RD costs tables between all encoding threadsAttila Nagy
RD costs were local to MACROBLOCK data and had to be copied all the time to each thread's MACROBLOCK data. Tables moved to a common place and only pointers are setup for each encoding thread. vp8_cost_tokens() generates 'int' costs so changed all types to be int (i.e. removed unsigned). NOTE: Could do some more cleaning in vp8cx_init_mbrthread_data(). Change-Id: Ifa4de4c6286dffaca7ed3082041fe5af1345ddc0
2012-03-26Removed duplicate vp8_build_intra_predictors_mb y/uvScott LaVarnway
Added y/uv stride as a parameter and remove the duplicate code. Change-Id: I019117a9dd9659a09d3d4e845d4814d3f33341b5
2012-03-21remove __inline for compiler compatibilityJames Berry
__inline removed for broader compiler compatibility Change-Id: I6f2b218dfc808b73212bbb90c69e2b6cc1fa90ce
2012-03-14Merge "fix potential use of uninitialized rate_y"John Koleszar
2012-03-14fix potential use of uninitialized rate_yJohn Koleszar
This issue likely doesn't appear in the unmodified encoder, but sufficient hacking on the mode selection loop can expose it. Change-Id: I8a35831e8f08b549806d0c2c6900d42af883f78f
2012-03-13Merge "Adds a motion compensated temporal denoiser to the encoder."Jim Bankoski
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-03-12Merge "Move SAD and variance functions to common"Johann
2012-03-06vp8e - RDLambda fixJim Bankoski
Last commit went the wrong way. Change-Id: I5e47ee6c25b0893dfa84318229b93c57dfeec24e
2012-03-05Move SAD and variance functions to commonJohann
The MFQE function of the postprocessor depends on these Change-Id: I256a37c6de079fe92ce744b1f11e16526d06b50a
2012-03-05vp8e - fix coefficient costingJim Bankoski
Coefficient costing failed to take account of the first branch being skipped ( 0 vs eob) if the previous token is 0. Fixed rd to account for slightly increased token cost & cleaned up warning message Change-Id: I56140635d9f48a28dded5a816964e973a53975ef
2012-02-29vp8e - attempt to lessen blockinessJim Bankoski
applies a penalty to intra blocks in order to cut down on blockiness in easy sections. Change-Id: Ia9e5df16328b0bf01bf0f2e6e61abcb687316c12
2012-02-28Merge changes Ifb450710,I61c4a132Scott LaVarnway
* changes: Eliminated reconintra_mt.c Eliminated vp8mt_build_intra_predictors_mbuv_s
2012-02-28Eliminated reconintra_mt.cScott LaVarnway
Reworked the code to use vp8_build_intra_predictors_mby_s, vp8_intra_prediction_down_copy, and vp8_intra4x4_predict_d_c functions instead. vp8_intra4x4_predict_d_c is a decoder-only version of vp8_intra4x4_predict. Future commits will fix this code duplication. Change-Id: Ifb4507103b7c83f8b94a872345191c49240154f5
2012-02-28Merge "Only do uv intra-mode evaluation when intra mode is checked"Yunqing Wang
2012-02-28Only do uv intra-mode evaluation when intra mode is checkedYunqing Wang
When we encode slide-show clips, for the majority of the time, only ZEROMV mode is checked, and all other modes are skipped. This change delayed uv intra-mode evaluation until intra mode is actually checked. This gave big performance gain for slide-show video encoding (2nd pass gain: 18% to 28%). But, this change doesn't help other types of videos. Also, zbin_mode_boost is adjusted in mode-checking loop, which causes bitstream mismatch before/after this change when --best or --good with --cpu-used=0 are used. Change-Id: I582b3e69fd384039994360e870e6e059c36a64cc
2012-02-27Fix skippable evaluation in mode decisionYunqing Wang
Yaowu fixed the skippable evaluation by correcting 2nd order block's eob. Change-Id: Id47930cbc74a90a046c0c0e324efb03477639ee0
2012-02-17Fix incorrect use of uv eobs in intra modesYunqing Wang
In vp8_rd_pick_inter_mode(), if total of eobs is zero, rate needs to be adjusted since there are no non-zero coefficients for transmission. The uv intra eobs calculated in rd_pick_intra_mbuv_mode() need to be saved before they are overwritten by inter-mode eobs. Change-Id: I41dd04fba912e8122ef95793d4d98a251bc60e58
2012-02-02Moved ref_frame_cost from MACROBLOCKD to MACROBLOCKScott LaVarnway
Change-Id: I05788522e9cde4322cfb12032483bdbf184bdf0b
2012-01-31BLOCKD structure cleanupScott LaVarnway
Removed redundancies. All of the information can be found in the MACROBLOCKD structure. Change-Id: I7556392c6f67b43bef2a5e9932180a737466ef93
2012-01-30RTCD: add arnr functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. It removes the last of the VP8_ENCODER_RTCD struct references. Change-Id: I2a44f52d7cccf5177e1ca98a028ead570d045395
2012-01-30RTCD: add block subtraction functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. Change-Id: Id8a287fdd4bd050ea4452e1582ad85520f3081be
2012-01-30RTCD: add FDCT functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. Change-Id: I3f9c07db65eb206f6363d21bdb80e871570da767
2012-01-30RTCD: add variance functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. Change-Id: Ie5c1aa480637e98dc3918fb562ff45c37a66c538
2012-01-30RTCD: add recon functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. Change-Id: I9bfcf9bef65c3d4ba0fb9a3e1532bad1463a10d6
2012-01-30RTCD: add remaining IDCT functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. Change-Id: I03c4dbf30dfd3558b0e256ff9d3ff4c012aadc80
2012-01-26Correct clamping in use of vp8_find_near_mvs()John Koleszar
Commit e06c242ba introduced a change to call vp8_find_near_mvs() only once instead of once per reference frame by observing that the only effect that the frame had was on the bias applied to the motion vector. By keeping track of the sign_bias value, the mv to use could be flip-flopped by multiplying its components by -1. This behavior was subtley wrong in the case when clamping was applied to the motion vectors found by vp8_find_near_mvs(). A motion vector could be in-bounds with one sign bias, but out of bounds after inverting the sign, or vice versa. The clamping must match that done by the decoder. This change modifies vp8_find_near_mvs() to remove the clamping from that function. The vp8_pick_inter_mode() and vp8_rd_pick_inter_mode() functions instead track the correctly clamped values for both bias values, switching between them by simple assignment. The common clamping and inversion code is in vp8_find_near_mvs_bias() Change-Id: I17e1a348d1643497eca0be232e2fbe2acf8478e1
2012-01-18Merge changes I1ebe76aa,Ia079b52bJohn Koleszar
* changes: rdopt/pickinter: factor out some common setup rdopt: remove unused frame_lf_or_gf
2012-01-11rdopt/pickinter: factor out some common setupJohn Koleszar
Add new get_predictor_pointers() and get_reference_search_order() functions for code shared between the two implementations. Change-Id: I1ebe76aa8f168b1f5cfabc00d05d8f19a0d4d207
2012-01-11rdopt: remove unused frame_lf_or_gfJohn Koleszar
This flag was set but unused. Change-Id: Ia079b52b88ffbe3b16fdbde4b84e2b87304eaa13
2012-01-03Merge "Remove useless g_common.h"Scott LaVarnway
2011-12-22Remove unnecessary ternary constructsJohn Koleszar
The code had a number of constructs like (condition)?1:0, which is redundant with C's semantics. In the cases where a boolean operator was used in the condition, simply remove the ternary part. Otherwise adjust the surrounding expression to remove the condition (eg, for rounding up. See pickinter.c and rdopt.c) Change-Id: Icb2372defa3783cf31857d90b2630d06b2c7e1be
2011-12-21Remove useless g_common.hJohn Koleszar
This file declared a bunch of nonexistent, unreferenced global function pointers. Change-Id: Ic26bb8c7712deba754c49fc01f383b53afc9e728
2011-12-15Moved dequant idct into commonScott LaVarnway
These functions are now used by the encoder. This is WIP with the goal of creating a common idct/add for the encoder and decoder. A boost of 1.8% was seen for the HD rt test clip used. [Tero] Added needed changes to ARM side. Change-Id: Ibbb8000be09034203d7adffc457d3c3f8b06a5bf
2011-12-15Only call vp8_find_near_mvs() once for each macroblockYunqing Wang
While doing motion search on a macroblock, we usually call vp8_find_near_mvs once per reference frame. Actually, for different reference frames, the only difference in calculating these near_mvs is they may have different sign_bias, which causes a sign change in resulting near_mvs. In this change, we only do find_near_mvs for the first reference frame. For other reference frames, only need to adjust the near_mvs according to that reference frame's sign_bias value. Change-Id: I661394b49c6ad79fed7d0f2eb2be239b9c56f149
2011-12-09vp8e - entropy stats per frame typeJim Bankoski
Change-Id: I4168eb6ea22ae541471738a7a3453e7d52059275
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-18Speed selection support for disabled reference framesJohn Koleszar
There was an implicit reference frame test order (typically LAST, GOLD, ARF) in the mode selection logic, but this doesn't provide the expected results when some reference frames are disabled. For instance, in real-time mode, the speed selection logic often disables the ARF modes. So if the user disables the LAST and GOLD frames, the encoder was always choosing INTRA, when in reality searching the ARF in this case has the same speed penalty as searching LAST would have had. Instead, introduce the notion of a reference frame search order. This patch preserves the former priorities, so if a frame is disabled, the other frames bump up a slot to take its place. This patch lays the groundwork for doing something smarter in the frame test order, for example considering temporal distance or looking at the frames used by nearby blocks. Change-Id: I1199149f8662a408537c653d2c021c7f1d29a700
2011-11-17Merge "Added predictor stride argument(s) to subtract functions"Scott LaVarnway
2011-11-15Added predictor stride argument(s) to subtract functionsScott LaVarnway
Patch set 2: 64 bit build fix Patch set 3: 64 bit crash fix [Tero] Patch set 4: Updated ARMv6 and NEON assembly. Added also minor NEON optimizations to subtract functions. Patch set 5: x86 stride bug fix Change-Id: I1fcca93e90c89b89ddc204e1c18f208682675c15
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-11-09Merge "ARMv6 optimized Intra4x4 prediction"Johann
2011-11-09ARMv6 optimized Intra4x4 predictionTero Rintaluoma
Added ARM optimized intra 4x4 prediction - 2x faster on Profiler compared to C-code compiled with -O3 - Function interface changed a little to improve BLOCKD structure access Change-Id: I9bc2b723155943fe0cf03dd9ca5f1760f7a81f54
2011-11-08Fix checks in MB quantizer initializationYunqing Wang
vp8cx_mb_init_quantizer() needs to be called at least once to get all values calculated. This change added one check to decide if we could skip initialization or not. Change-Id: I3f65eb548be57580a61444328336bc18c25c085b