summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encodeframe.c
AgeCommit message (Collapse)Author
2016-10-25Change 2 motion search counts to be tile dataYunqing Wang
This patch modified the motion search counts used in: https://chromium-review.googlesource.com/#/c/305640/ These 2 counts were originally added as thread data, and used to make decisions in motion search. The tile encoding order can be inconsistent while using different number of threads, which can cause bitstream mismatch. Here moved them to tile data to solve the issue. BUG=webm:1322 Change-Id: Iedc4477aef1746aa0a4f84d88a1156296fd3ba87
2016-10-21vp9: Nonrd variance partition: increase threshold for using 4x4 avg.Marco
In variance partition low resolutions may use varianace based on 4x4 average for better partitioning. Increase the threshold for doing this at speed = 8. Improves speed by ~5%, with little loss, < 1%, on RTC_derf set. Change-Id: Ib5ec420832ccff887a06cb5e1d2c73199b093941
2016-10-17vp9: Non-rd variance partition: add condition for 64x64 split.Marco
Add stronger condition for splitting 64x64, for low noise content. This reduces dragging artifact near moving head. Little/no change in metrics on RTC set. Change-Id: I39b38cfd20f2ece53ff49c2aaf76ba9f82761be1
2016-10-111 pass vbr: Allow for lookahead alt-ref in real-time mode.Marco
For 1 pass vbr real-time mode: Allow for the usage of alt-ref frame when non-zero lag-in-frames is used. Use non-filtered alt-ref, and select usage based on fast scene/content analysis/detection within the lag of frames. Positive gains on ytlive set: overall avgPSNR ~3-4%. Several clips are up between 5-14%, a few clips are neutral/small change. Current speed decrease is about ~5-10%. Use the flag USE_ALTREF_FOR_ONE_PASS to enable this feature (off by default for now). Change-Id: I802d2bf3d44f9cf01f6d15c76be9c90192314769
2016-09-19Zero the whole rd_counts struct rather than the each memberAlex Converse
Change-Id: I495aa9cec2b2b8f1ae69bdab8b3feeca76358472
2016-09-15apply clang-formatclang-format
Change-Id: I501597b7c1e0f0c7ae2aea3ee8073f0a641b3487
2016-09-01Casts to remove some warnings.paulwilkins
Added casts to remove warnings: BUG=webm:1274 In regards to the safety of these casts they are of two types:- - Normalized bits per (16x16) MB stored in a 32 bit int (This is safe as bits per MB even with << 9 normalization cant overflow 32 bits. Even raw 12 bits hdr source even would only be 29 bits :- (4+4+12+9) and the encoder imposes much stricter limits than this on max bit rate. - Cast as part of variance calculations. There is an internal cast up to 64 bit for the Sum X Sum calculation, but after normalization dividing by the number of points the result will always be <= the SSE value. Change-Id: I4e700236ed83d6b2b1955e92e84c3b1978b9eaa0
2016-08-30Merge "Adjust coefficient optimization and tx_domain rd speed features."Paul Wilkins
2016-08-25Create interface for the ALT_REF_AQ classYury Gitman
Current commit is just an API template for the rest of the code, and I will add inner logic later. Altref frames generate a lot of bitrate and at the same time other frames refer to them a lot, so it makes sense to apply special compensation-based adaptive quantization scheme for altref frames. E.g., for blocks that are good predictors for the future apply rate-control chosen quantizer while for bad predictors apply worse one. Change-Id: Iba3f8ec349470673b7249f6a125f6859336a47c8
2016-08-25Adjust coefficient optimization and tx_domain rd speed features.paulwilkins
Previously Tx domain rd was used in all cases above speed 0. Coefficient optimization was only enabled for best and speed 0. This patch selectively sets these features at other speed settings based on block complexity. For the Netflix and HD sets in particular the quality gains are large compared to the speed hit. At speed 1 the average psnr gain in the NF set is > 2.5% with one clip coming in at 18% and some points almost 30%. Average gains for the lower resolution test sets are around 1%. The gains are biggest at low Q so some further optimization may be possible. Change-Id: I340376c7b2a78e5389a34b7ebdc41072808d0576
2016-08-23vp9: Refactor set_low_temp_var_flag.jackychen
No need to pass in force_split, since we should use sb_type in the condition. Change-Id: Ide27243ef46e017bbb98d676347fc566a6c828f7
2016-08-09Merge "Refactor mv limits."Alex Converse
2016-08-08Add cpi parameter for forcing segmentation updateYury Gitman
Change-Id: I1b0bcb1ffe7604117bfaa0b9989d0e25ff04d28c
2016-08-08Refactor mv limits.Alex Converse
Change-Id: Ifebdc9ef37850508eb4b8e572fd0f6026ab04987
2016-08-03Fix msvc compiler warningsYaowu Xu
MSVC 2013 complained about using 32 shift where 64 bit shift should be used. Change-Id: I7a2b165d1a92d3c0a91dd4511b27aba7709b5e55
2016-08-02vp9/encoder: apply clang-formatclang-format
Change-Id: I45d9fb4013f50766b24363a86365e8063e8954c2
2016-07-25Merge "Minor skip segment simplification."Alex Converse
2016-07-22Minor skip segment simplification.Alex Converse
Change-Id: I34863fce1abe94f9539e9a5a6149ae1efb6501bd
2016-07-21VP9: get_pred_context_switchable_interp() -- encoder sideScott LaVarnway
Change-Id: I7217c90d5cf38c51b76759a2dc4f10070f3a40ac
2016-07-18cosmetics: Correct grammar/spelling in commentsYury Gitman
Change-Id: I1954f9d6e33abff9081fe7a5cf59d5497768e0df
2016-07-11Merge "vp9_rd_pick_intra_mode_sb(): set interp_filter to"Scott LaVarnway
2016-07-09vp9_rd_pick_intra_mode_sb(): set interp_filter toScott LaVarnway
SWITCHABLE_FILTERS. This is a partial fix for the build issues with Change 357240. Change-Id: I4e507c196175bae729a4f1397878ec8776b0146c
2016-06-28Merge "vp9: Increase thr_var for 32x32 blocks in var-based partitioning."Jacky Chen
2016-06-28vp9: Move chroma sensitivity check out from choose_partitioning.jackychen
Change-Id: Ie78185a30cac4d1841be3708bd23e6505d3733b6
2016-06-27vp9: Increase thr_var for 32x32 blocks in var-based partitioning.jackychen
For real-time mode, increase variance threshold for 32x32 blocks in var-based partitioning for resolution >= 720p, so that it is more likely to stay at 32x32 for high resolution which accelerates the encoding speed with little/no PSNR drop. PSNR effect on different speed settings: speed 8 rtc: 0.02 overall PSNR drop, 0.285% SSIM drop speed 7 rtc: 0.196% overall PSNR increase, 0.066% SSIM increase speed 5 rtc_derf: no effect. Speed up: gips_motion_WHD, 1mbps: 2.5% faster on speed 7, 2.6% faster on speed8 gips_stat_WHD, 1mbps: 4.6% faster on speed 7, 5.6% faster on speed8 Change-Id: Ie7c33c4d2dd7d09294917e031357fc5476c3a4bb
2016-06-24Merge "vp9: Code clean, move low temp var logic out of choose_partitioning."Jacky Chen
2016-06-24Merge "cosmetics: Beautify whitespaces and line wrapping"James Zern
2016-06-24Merge "cosmetics: Make few conditions clearer"James Zern
2016-06-24vp9: Code clean, move low temp var logic out of choose_partitioning.jackychen
Change-Id: I7093e74131e0964471c9993c1e972b4617c4731d
2016-06-24cosmetics: Beautify whitespaces and line wrappingYury Gitman
Change-Id: I9afa02cae671bd3527cf344695e53d0cc767f549
2016-06-24cosmetics: Make few conditions clearerYury Gitman
Change-Id: Ib024b3e42efc7ce1af56824a4644fdefcd45b215
2016-06-22set interp_filter to SWITCHABLE_FILTER for intra blockAngie Chiang
In vp9_pick_inter_mode(), instead of using vp9_get_pred_context_switchable_interp(xd) to assign filter_ref, we use a less strict condition on assigning filter_ref. This is to reduce the probabily of entering the flow of not assigning filter_ref and then skipping filter search. Overall PSNR gain 0.074% for rtc dataset Details: Low Mid High 0.185% -0.008% -0.082% Change-Id: Id5c5ab38d3766c213d5681e17b4d1afd1529e676
2016-06-21Add a hardware compatibility featurehui su
This commit adds an encoder workaround to support better compatibility with a non-compliant hardware vp9 profile 2 decoder. The known issue with this decoder is: The decoder assumes a wrong value, 127 instead of the correct value of 511 and 2047, for any assumed top-left corner pixel in UV planes for 10 and 12 bit, respectively. Such assumed top-left corner pixel is used for INTRA prediction when a real decoded/reconstructed pixel is not avalable, e.g. when it is located inside the row above the top row or inside the column left to the leftest column of a video image. Change-Id: Ic15a938a3107e1b85e96cb7903a5c4220986b99d
2016-06-17Fix ubsan warning: vp9/encoder/vp9_encodeframe.cYaowu Xu
BUG=webm:1219 Change-Id: I29b896c7f61abf871d7853b1d8200aa5a9f6a95c
2016-06-15vp9: Add bias to last frame in choose_partitioning.JackyChen
This change is only for real-time mode if short_circuit_low_temp_var is on. Add bias to last frame in choosing ref frame for partitioning, when y_sad and y_sad_g are close. It speeds up real-time encoding by 0.5% on some clips with less than 0.1% overall PSNR drop on rtc test set. Change-Id: I2a2110fe36455f3d8f0fc404aef2228f512e8df8
2016-06-14vp9: Code clean up for short circuit feature in low temp variance.JackyChen
Change-Id: I7573a5cf0ab79abed8d124019c0ed6d9531277f9
2016-06-13vp9: Encoding cycle reduction for speed 8.JackyChen
1. Skip golden non-zeromv and newmv-last for bsize >= 16x16 if the temporal variance obtained from choose_partitioning is very low. 2. Skip horz and vert INTRA mode for speed 8. This change works best on the clips with little noise and with some motion (e.g. gips_motion which has > 5% speed up). PSNR drop is 1.78% on rtc test set, no obvious visual quality regression found. Change-Id: Ib43b5b20e67809d03c5a6890818ddff59e1fc94a
2016-06-08vp9: Use nonrd_pick_partition on scene-cut, for speed 5 vbr mode.Marco
On scene-cut detected frames (i.e., high_source_sad = 1), use nonrd_pick_partition (over choose_part + select_part), as the nonrd_pick partitioning is generally better. Small positive increase in metrics on ytlive set (~0.5 - 1%). Negligle overall speed decrease, as its only used on scene-cut frames. Only affects 1 pass vbr mode, speed = 5. Change-Id: I07c89cbdc75f5bb16eb8e0e2773ead0980d2de5c
2016-06-02vp9: Fix valgrind failure for short circuit on low temporal vaiance block.JackyChen
Add check for actual split before using the variance of the split. Change-Id: If0f93248be0b16d17738675d16c90516054dad2b
2016-06-01vp9: Skip some modes when variance is low for big blocks, for 1 pass real-time.jackychen
Skip intra-mode and some inter-modes (newmv, nearmv, nearestmv) for golden frame if the variance got from choose_partitioning is very low. Only for 1 pass real-time CBR mode and bsize >= 32x32, it has ~2.5% speed up with less than 0.1% PSNR drop for rtc test set. Don't see visual regression. Change-Id: I70efbc95a1007231ae36f02c5b2fbf6cd35077ad
2016-05-10Add VP9 encoder API for level specification.hui su
Add control API VP9E_SET_TARGET_LEVEL that allows the encoder to control the output bitstream level and/or keep level related statistics. Usage: 255 do not care about level (default) 0 keep level related stats only 10 target for level 1 11 target for level 1.1 . . . 62 target for level 6.2 Usage for vpxenc: --target-level=0/255/10/11... Change-Id: I31d1aeca19358b893e7577b4e63748c8e614034a
2016-05-02vp9: Refactor choose_partitioning.JackyChen
Move skin superblock force split out of this function as well as some minor code refactors. Checked bitexact for different speed settings and different resolutions. Change-Id: I6078cbe88dd9ce6c0b69470a8a0a8f8d2274161b
2016-04-26Merge "VP9: enable trellis quantization optimization for intra blocks"Hui Su
2016-04-26Merge "vp9: Fix condition to update consec_zero_mv."Marco Paniconi
2016-04-26VP9: enable trellis quantization optimization for intra blockshui su
Coding gain: lowres 0.18% midres 0.23% hdres 0.36% Change-Id: I044c8afbc481fc55b23d440352941071355b0afb
2016-04-25vp9: Fix condition to update consec_zero_mv.Marco
Fix will reset the consec_zero_mv map on non-skipped blocks with non-zero mv. Adjust thresholds on consec_zero_mv in noise estimation and skin detection, as more possible reset on map means lower thresholds should be used. Change-Id: Ibe8520057472b3609585260b51b6f95a38fb777d
2016-04-25Experiment to adapt for net AQ offset.paulwilkins
In Aq mode 1 the segment and AQ delta for each block is based on spatial variance. There may be a net imbalance between blocks that have lower Q than the baseline value and those that have higher Q. This patch monitors that imbalance and extends the allowed baseline Q range for the frame to accommodate adjustment of that baseline value to compensate. Change-Id: Iae8a48c7c01fe2af94a141e149d03acf467237ca
2016-04-22vp9: Move consec_zero_mv from cyclic refresh to cpi struct.Marco
So it can be used even with aq-mode=3 not enabled. Also cleans up some code in the places where its used. No change in behavior. Change-Id: Ib6b265308dbd483f691200da9a0be4da4b380dbc
2016-04-15VP9: inline vp9_get_intra_inter_context()Scott LaVarnway
Change-Id: I71366140799b9b39474b9b459082cdb250bd1905
2016-04-08Remove obsolete segment skip checks from tokenization.Alex Converse
Change-Id: Iac7bc0d0eba459a04688aae224d34ae9b59742db