summaryrefslogtreecommitdiff
path: root/vp8/encoder
AgeCommit message (Collapse)Author
2012-10-09Merge "multi-res: add parent_ref_valid flag"John Koleszar
2012-10-09multi-res: add parent_ref_valid flagJohn Koleszar
Rather than overloading the parent_ref_frame value to shut off the search in some cases, add a new validity flag. This cleans up some of the duplicated mr_encoder_id && mr_low_res_mv_avail checks as well, for readability. Change-Id: Iddad93a27066c3d85ff2f25a361ac113b288ab7b
2012-10-09Merge "post-proc: deblock filter optimization"Yunqing Wang
2012-10-08post-proc: deblock filter optimizationYunqing Wang
1. Algorithm modification: Instead of having same filter threshold for a whole frame, now we allow the thresholds to be adjusted for each macroblock. In current implementation, to avoid excessive blur on background as reported in issue480(http://code.google.com/p/webm/issues/detail?id=480), we reduce the thresholds for skipped macroblocks. 2. SSE2 optimization: As started in issue479(http://code.google.com/p/webm/issues/detail?id=479), the filter calculation was adjusted for better performance. The c code was also modified accordingly. This made the deblock filter 2x faster, and the decoder was 1.2x faster overall. Next, the demacroblock filter will be modified similarly. Change-Id: I05e54c3f580ccd427487d085096b3174f2ab7e86
2012-10-08multi-res: work around reference mismatchJohn Koleszar
In some situations, believed to be an interaction between temporal scalability and dropped frames, the references available to an encoder may not be the same references available to its parent. Previously, the code tried to force the reference frame chosen by the parent to be used on this frame, even if it was disabled. This was preventing the pick mode loop from running even once, which led to a crash. Attempts to reproduce this bug locally were unsuccessful, so it is still undetermined what the underlying cause of this issue is. In the specific case that was failing, the application did not set any flags which influenced the reference selection on that frame. ref_frame_flags indicated that the golden frame was disabled, believed to be because the last frame updated the last and golden frames, so golden was shut off by default. It's not clear why this wouldn't have also been true in the lower res encoder, ie, why the lower res encoder decided to use and/or was allowed to use the golden frame. We weren't able to debug into the non-crashing lower res encoder as the crash couldn't be reproduced locally. Change-Id: Ifb265253d26963ac2afde0e20cf6792788be6af7
2012-10-03fix uninitialized value in multi-res encodingJohn Koleszar
If a parent mb is available but is intra coded, then parent_ref_mv is invalid. Check that the parent is inter coded before trying to access the parent_ref_mv. Previously the parent_ref_mv was being read from an uninitialized stack allocation, causing potential OOB reads and other undefined behavior. Change-Id: I0c93cd412a19c3a184bcf6decaa145b3a036a6c0
2012-10-01Disable keyframe in real time that's placed one frame after a cut.Jim Bankoski
The codec as it stood placed a keyframe one frame after a real cut scene - and ignored datarate and other considerations. TODO: Its possible that we should detect a keyframe and recode the frame ( in certain circumstances) to improve quality. Change-Id: Ia1fd6d90103f4da4d21ca5ab62897d22e0b888a8
2012-09-27Resetting of the cyclic_refresh_mode_index:Marco Paniconi
Reset the cyclie refresh mode index in alloc_compressor_data(). This is needed to handle both cases of internal and external spatial resizing. Change-Id: I2697e12d45135eae2e8f0d45161811f24722312a
2012-09-26Reset the cyclic_refresh_mode_index to 0 on resize.Marco Paniconi
On an internal spatial resize, this mode index was not reset to 0, and therefore could exceed dimensions of seg_map or cyclic_refresh_map. Change-Id: I6fe85dbd2765eb0207a9d9f71fda8d8b8c34f075
2012-09-25Merge "disable segmentation on enhancement layers"Jim Bankoski
2012-09-24disable segmentation on enhancement layersJim Bankoski
This should avoid problems with blocks gettings high quality improvement despite having recently moved: Change-Id: Ic0af0de2d6577807fa3c553f47b55d547ef36359
2012-09-23Update to cyclic refresh:Marco Paniconi
Set the seg map to 0 for key frame. In previous commit on cyclic refresh, the seg map for key frame was not reset, and instead used the seg map from last frame. Change-Id: I848eb2face420dfcd2f7daca6f070b9127ca938b
2012-09-21Update to cyclic refresh.Marco Paniconi
-Increase the amount of mbs to be refreshed. -Replace the delta qp with a fixed and reduced delta. -Change to the mb update loop to try to always update same amount of mbs. Change-Id: I93ac88002fd8dc677d2337f77998ff93f64e4ff9
2012-09-13Removed pre_mvcScott LaVarnway
Not used. Change-Id: Ifbd97c9ad537d5184f7e305fa8acf6f027978b6b
2012-08-31Encoder denoiser performance improvementYunqing Wang
The denoiser function was modified to reduce the computational complexity. 1. The denoiser c function modification: The original implementation calculated pixel's filter_coefficient based on the pixel value difference between current raw frame and last denoised raw frame, and stored them in lookup tables. For each pixel c, find its coefficient using filter_coefficient[c] = LUT[abs_diff[c]]; and then apply filtering operation for the pixel. The denoising filter costed about 12% of encoding time when it was turned on, and half of the time was spent on finding coefficients in lookup tables. In order to simplify the process, a short cut was taken. The pixel adjustments vs. pixel diff value were calculated ahead of time. adjustment = filtered_value - current_raw = (filter_coefficient * diff + 128) >> 8 The adjustment vs. diff curve becomes flat very quick when diff increases. This allowed us to use only several levels to get a close approximation of the curve. Following the denoiser algorithm, the adjustments are further modified according to how big the motion magnitude is. 2. The sse2 function was rewritten. This change made denoiser filter function 3x faster, and improved the encoder performance by 7% ~ 10% with the denoiser on. Change-Id: I93a4308963b8e80c7307f96ffa8b8c667425bf50
2012-08-23Merge "Added error checking to vp8cx_create_encoder_threads()"Scott LaVarnway
2012-08-21Merge "Add biasing to ZEROMV for videos with static background"Jim Bankoski
2012-08-21Merge "Removed last_kf_gf_q"Scott LaVarnway
2012-08-21Add biasing to ZEROMV for videos with static backgroundYunqing Wang
For videos with big static background(such as video conferencing clips), the mode decision was biased to ZEROMV in order to obtain a stable background. The percentage of ZEROMV on last frame was used to predict if there is static area in current frame, and checking already-encoded neighboring macroblocks' motion vectors to make sure the local area has low motion. Change-Id: I05b3241d3a56a0bda88b6681e5646c1c8baf2e57
2012-08-20Fix inter_zz_count calculation bugYunqing Wang
The current way of counting inter_zz_count doesn't work correctly in multi-threaded encoding. Calculating it after the frame is encoded fixed the problem. Change-Id: Ifcb1972cde950b8cc194f75c6d7b6af09e8b0e65
2012-08-20Merge "realtime turndown loopfilter for 00"Yaowu Xu
2012-08-20Merge "static threshold fix for realtime"Yaowu Xu
2012-08-20realtime turndown loopfilter for 00Jim Bankoski
Loop filter producing wierd artifacts when repeatedly applied in noisy video. This mitigates the effect. Change-Id: If4b1a8543912d186a486f84e11d8b01f7436fa5f
2012-08-20static threshold fix for realtimeJim Bankoski
This code allows us to skip encoding if the sse is less than the error we could possibly encode. Change-Id: Iefb590dc0ee30b660495218398c7969f7d5fd19f
2012-08-20silent compiling warnings for VC9 buildYaowu Xu
Change-Id: Iaa947e640f27e6f6eaf7d845f243536bca2df513
2012-08-14Added error checking to vp8cx_create_encoder_threads()Scott LaVarnway
Added checks for pthread_create() errors. Change-Id: Ie198ef5c14314fe252d2e02f7fe5bfacc7e16377
2012-08-02Merge "Fix encoder mem allocation when picture size is changed"Attila Nagy
2012-08-02Merge "Fix potential encoder dead-lock after picture resize"Attila Nagy
2012-08-02Pass B_PREDICTION_MODE to intra4x4_predictJohann
Use the correct type when calling and inside the function. Change-Id: Idbaf1bf58b9574f0cba73d78780e9aedd8889dfd
2012-08-02Removed last_kf_gf_qScott LaVarnway
Not used. Change-Id: I7595cb21db73bd56ee4d9280ecb7ab9b1240f4e2
2012-08-01Rename vp8_intra4x4_predict_dJohann
predict_d has become canonical. Remove previous helper function. Disable ARM assembly pending update. Change-Id: Idd84ac8a28f9b0221ea97904a77de1e705d06a7d
2012-08-01Use intra4x4_predict_d parameter namesJohann
Rename the local variables for consistency. Change-Id: Ic202ff54551332f706d97da9b67b2e0959ee7f61
2012-08-01Change vp8_intra4x4_predict call sitesJohann
Use the _d variant from the decoder. It moves the pointer calculations to the caller. Change-Id: Iae2a793433ef082980a3ffa0a1cabf0264a6a24d
2012-08-01Fix potential encoder dead-lock after picture resizeAttila Nagy
The sync interval for the multithreaded encoder was considered as not changing during the encoding. This is not true if picture size is changed. The encoder could dead-lock because the main thread and the other threads were using different sync interval. Change-Id: I75232bbdbc6c02d77f830d870fd8b4e96697c64e
2012-08-01Fix encoder mem allocation when picture size is changedAttila Nagy
After the picture size was changed to a bigger one, the internal memory was corrupted and multithreaded encoder was deadlocking. Memory for last frame's MVs, segmentation map and active map were allocated when the compressor was created (vp8_create_compressor). Buffers need to be reallocated when picture size is changed, so, the allocation was moved to vp8_alloc_compressor_data, which is called every time the picture is resized. Change-Id: I7ce16b8e69bbf0386d7997df57add155aada2240
2012-07-31Merge "Be consistent with SAD values"Johann
2012-07-27Merge "Remove the resetting of qp params for temporal layers."Jim Bankoski
2012-07-27Remove the resetting of qp params for temporal layers.Marco Paniconi
The ambient qp and active worse/best qp were reset for every frame when temporal layers is on. This change removes this reset. As this affects the target size for forced key frames (it will actually lower the size somewhat), we increased the inital boost factor to compensate. Change-Id: Ie38d95f5c99ab3d447469c49e2177bc3fcc4ad28
2012-07-27Be consistent with SAD valuesJohann
SAD returns unsigned values. Make all the declarations the same. Remove bestsad initialization and check. It is always set to the result of a SAD call so it will never remain UINT_MAX Use ja instead of jg to test unsigned comparison instead of signed. Update test. Change-Id: I46336ab45f4e60fc37caf20bd36bc5782079c7a5
2012-07-27Merge "SAD cosmetic cleanup"Johann
2012-07-27Optimizes updates of encoder block ptrsAttila Nagy
Precalculated block ptrs do not need updates during encoding. Set these at init stage. Moved the allocation of 'mt_current_mb_col' (last encoded MB on each row) to vp8_alloc_compressor_data(), so that it is correctly reallocated when frame size is changing. Change-Id: Idcdaa2d0cf3a7f782b7d888626b7cf22a4ffb5c1
2012-07-26SAD cosmetic cleanupJohann
Change-Id: Iae915f2988081697cca6b65943afaca1d8de8df3
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-10Merge "Remove goldfreq in VP8_COMP"Yunqing Wang
2012-07-02Fix subpixel_predict initializationYunqing Wang
xd->subpixel_predict16x16 is called in first pass, but isn't initialized in first pass, which causes segfault. This patch fixed that problem. Change-Id: Ibd2cad4e2d32ea589fc3e0876d60d3079ae836e7
2012-06-29Merge "Fix decimation_count in drop_frame"Yunqing Wang
2012-06-20Merge "Fix segmentation updates with vp8_set_roimap()"Paul Wilkins
2012-06-20Fix compilation with -werrorJohn Koleszar
Fix a last few warnings with multithread, arm, 32 bit Change-Id: Ic7c67616c370d0ff87562a232fb1e5df0702dc86
2012-06-20Fix segmentation updates with vp8_set_roimap()Paul Wilkins
Changes relating to Issue 411 Removed code that was clearing down the segmentation data each frame. Added range/parameter checking in vp8_set_roimap(); Return error if called when cyclic_refresh is enabled. Correct setup_features() so that it sets or clears the segment update flags as appropriate. Change-Id: Ib31ac53006640ddf1ba7b9ec8f8b952e3eff860a
2012-06-12Remove goldfreq in VP8_COMPYunqing Wang
goldfreq can be replaced by DEFAULT_GF_INTERVAL. Change-Id: I3659a9e7b9a6be9cb1952a1838e02c20d656e369