summaryrefslogtreecommitdiff
path: root/vp8/encoder
AgeCommit message (Collapse)Author
2011-07-21Merge "Increase chrow row alignment to 16 bytes."John Koleszar
2011-07-21Merge "Add improvements made in good-quality mode to real-time mode"Yunqing Wang
2011-07-20Increase chrow row alignment to 16 bytes.Timothy B. Terriberry
This is done by expanding luma row to 32-byte alignment, since there is currently a bunch of code that assumes that uv_stride == y_stride/2 (see, for example, vp8/common/postproc.c, common/reconinter.c, common/arm/neon/recon16x16mb_neon.asm, encoder/temporal_filter.c, and possibly others; I haven't done a full audit). It also uses replaces the hardcoded border of 16 in a number of encoder buffers with VP8BORDERINPIXELS (currently 32), as the chroma rows start at an offset of border/2. Together, these two changes have the nice advantage that simply dumping the frame memory as a contiguous blob produces a valid, if padded, image. Change-Id: Iaf5ea722ae5c82d5daa50f6e2dade9de753f1003
2011-07-19Moved vp8_encode_bool into boolhuff.hScott LaVarnway
allowing the compiler to inline this function. For real-time encodes, this gave a boost of 1% to 2.5%, depending on the speed setting. Change-Id: I3929d176cca086b4261267b848419d5bcff21c02
2011-07-18Improved 1-pass CBR rate controlJohn Koleszar
This patch attempts to improve the handling of CBR streams with respect to the short term buffering requirements. The "buffer level" is changed to be an average over the rc buffer, rather than a long running average. Overshoot is also tracked over the same interval and the golden frame targets suppressed accordingly to correct for overly aggressive boosting. Testing shows that this is fairly consistently positive in one metric or another -- some clips that show significant decreases in quality have better buffering characteristics, others show improvenents in both. Change-Id: I924c89aa9bdb210271f2e03311e63de3f1f8f920
2011-07-15Merge "Tokenize MB optimized"Scott LaVarnway
2011-07-15Tokenize MB optimizedTero Rintaluoma
Optimized C-code of the following functions: - vp8_tokenize_mb - tokenize1st_order_b - tokenize2nd_order_b Gives ~1-5% speed-up for RT encoding on Cortex-A8/A9 depending on encoding parameters. Change-Id: I6be86104a589a06dcbc9ed3318e8bf264ef4176c
2011-07-14Remove unused speed featuresJohn Koleszar
min_fs_radius, max_fs_radius, full_freq were set but never read. Change-Id: I82657f4e7f2ba2acc3cbc3faa5ec0de5b9c6ec74
2011-07-13Add improvements made in good-quality mode to real-time modeYunqing Wang
Several improvements we made in good-quality mode can be added into real-time mode to speed up encoding in speed 1, 2, and 3 with small quality loss. Tests using tulip clip showed: --rt --cpu-used=-1 (before change) PSNR: 38.028 time: 1m33.195s (after change) PSNR: 38.014 time: 1m20.851s --rt --cpu-used=-2 (before change) PSNR: 37.773 time: 0m57.650s (after change) PSNR: 37.759 time: 0m54.594s --rt --cpu-used=-3 (before change) PSNR: 37.392 time: 0m42.865s (after change) PSNR: 37.375 time: 0m41.949s Change-Id: I76ab2a38d72bc5efc91f6fe20d332c472f6510c9
2011-07-13Merge "Reduce motion vector search on alt-ref frame."Fritz Koenig
2011-07-13Merge "New loop filter interface"Johann
2011-07-11Reduce motion vector search on alt-ref frame.Fritz Koenig
Clamp mv search to accomodate subpixel filtering of UV mv. Change-Id: Iab3ed405993ef6bf779ad7cf60863153068fb7d1
2011-07-08Minor change in pick_inter_mode()Yunqing Wang
Scott suggested to move vp8_mv_pred() under "case NEWMV" to save extra checks. Change-Id: I09e69892f34a08dd425a4d81cfcc83674e344a20
2011-07-08Merge "Adjust full-pixel clamping and motion vector limit calculation"Yunqing Wang
2011-07-08Adjust full-pixel clamping and motion vector limit calculationYunqing Wang
Do mvp clamping in full-pixel precision instead of 1/8-pixel precision to avoid error caused by right shifting operation. Also, further fixed the motion vector limit calculation in change: b7480454706a6b15bf091e659cd6227ab373c1a6 Change-Id: Ied88a4f7ddfb0476eb9f7afc6ceeddbf209fffd7
2011-07-08Merge "clean up warnings when building arm with rtcd"Johann
2011-07-08New loop filter interfaceAttila Nagy
Separate simple filter with reduced no. of parameters. MB filter level picking based on precalculated table. Level table updated for each frame. Inside and edge limits precalculated and updated just when sharpness changes. HEV threshhold is constant. ARM targets use scalars and others vectors. Change works only with --target=generic-gnu All other targets have to be updated! Change-Id: I6b73aca6b525075b20129a371699b2561bd4d51c
2011-07-07Merge "Set VPX_FRAME_IS_DROPPABLE"John Koleszar
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-30Merge "Copy macroblock data to a buffer before encoding it"Yunqing Wang
2011-06-30Merge "Bug fix in motion vector limit calculation"Yunqing Wang
2011-06-30Bug fix in motion vector limit calculationYunqing Wang
Motion vector limits are calculated using right shifts, which could give wrong results for negative numbers. James Berry's test on one clip showed encoder produced some artifacts. This change fixed that. Change-Id: I035fc02280b10455b7f6eb388f7c2e33b796b018
2011-06-30Merge "remove incorrect initialization"Johann
2011-06-29Merge "Change to arf boost calculation."Paul Wilkins
2011-06-29Change to arf boost calculation.Paul Wilkins
In this commit I have added an experimental function that tests prediction quality either side of a central position to calculate a suggested boost number for an ARF frame. The function is passed an offset from the current position and a number of frames to search forwards and backwards. It returns a forward, backward and compound boost number. The new code can be deactivated using #define NEW_BOOST 0 In its current default state the code searches forwards and backwards from the proposed position of the next alt ref. The the old code used a boost number calculated by scanning forward from the previous GF up to the proposed alt ref frame position. I have also added some code to try and prevent placement of a gf/arf where there is a brief flash. Change-Id: I98af789a5181148659f10dd5dd2ff2d4250cd51c
2011-06-29remove incorrect initializationJohann
Values were set, then reset. Only set them once. Change-Id: Iaf43c8467129f2f261f04fa9188b603aa46216b5
2011-06-29clean up warnings when building arm with rtcdJohann
Change-Id: I3683cb87e9cb7c36fc22c1d70f0799c7c46a21df
2011-06-28Use MAX_ENTROPY_TOKENS and ENTROPY_NODES more consistentlyJohn Koleszar
There were many instances in the code of vp8_coef_tokens and vp8_coef_tokens-1, which was a preprocessor macro despite the naming convention. Replace these with MAX_ENTROPY_TOKENS and ENTROPY_NODES, respectively. Change-Id: I72c4f6c7634c94e1fa066cd511471e5592c748da
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-06-28Adding support for independent partitionsStefan Holmer
Adding support in the encoder for generating independent residual partitions by forcing equal probabilities over the prev coef entropy contexts. Change-Id: I402f5c353255f3ca20eae2620af739f6a498cd21
2011-06-23Copy macroblock data to a buffer before encoding itYunqing Wang
I got this idea from Pascal (Thanks). Before encoding a macroblock, copy it to a 16x16 buffer, and then read source data from there instead. This will help keep the source data in cache, and help with the performance. Change-Id: Id05f4cb601299150511d59dcba0ae62c49b5b757
2011-06-23Revert "Reduce overshoot in 1 pass rate control"John Koleszar
This reverts commit 212f6183739d448ad5fa2ccf1b4edd30829b2806. Further testing shows that the overshoot accumulation/damping is too aggressive on some clips. Allowing the accumulated overshoot to decay and limiting to damping to golden frames shows some promise. But some clips show significant overshoot in the buffer window, so I think this still needs work. Change-Id: Ic02a9ca34f55229f9cc04786f4fab54cdc1a3ef5
2011-06-21Merge "adjusting the calculation of errorperbit"Yaowu Xu
2011-06-21Merge "Remove unnecessary bounds checking in motion search"Yunqing Wang
2011-06-20adjusting the calculation of errorperbitYaowu Xu
RDMULT/RDDIV defines a bit worth of distortion in term of sum squared difference. This has also been used as errorperbit in subpixel motion search, where the distortions computed as variance of the difference. The variance of differences is different from sum squared differences by amount of DC squared. Typically, for inter predicted MBs, this difference averages around 10% between the two distortion, so this patch introduces a 110% constant in deriving errorperbit from RDMULT/RDDIV. Test on CIF set shows small but positive gain on overall PSNR (.03%) and SSIM (.07%), overall impact on average PSNR is 0. Change-Id: I95425f922d037b4d96083064a10c7cdd4948ee62
2011-06-17Remove unnecessary bounds checking in motion searchYunqing Wang
The starting points are always within the limits, and bounds checking on these points is not needed. For speed < 5, the encoded result changes a little because different treatment is taken while starting point equals the bounds. Change-Id: I09a402d310f51e305a3519f1601b1d17b05c6152
2011-06-17Merge "Use SSE as BPRED distortion metric consistently"John Koleszar
2011-06-16Assign boost to GF bit allocation if past frame had no ARF.Ronald S. Bultje
Modify the second-pass code to provide a full golden-frame (GF) bit allocation boost if the past GF group (GFG) had no alt-ref frame (ARF), even if the current GFG does contain and ARF. This mostly has no effect on clips, since switching ARFs on/off between GFGs is not very common. Has a positive effect on e.g. cheer (+0.45 SSIM at 600kbps) and football (+0.25 SSIM at 600kbps), particularly at high bitrates. Has a negative effect (-0.04 SSIM at 300kbps) at pamphlet, which appears only marginally related to this patch, and crew (-0.1 SSIM at 700kbps). Change-Id: I2e32899638b59f857e26efeac18a82e0c0b77089
2011-06-16Merge "Disable specialcase for last frames if the sequence contains ARFs."John Koleszar
2011-06-15Use SSE as BPRED distortion metric consistentlyJohn Koleszar
The BPRED mode selection uses SSE as a distortion metric, but the early breakout threshold being used was a variance value. Change-Id: I42d4602fb9b548bf681a36445701fada5e73aff1
2011-06-15Merge "fix --disable-runtime-cpu-detect on x86"John Koleszar
2011-06-15Disable specialcase for last frames if the sequence contains ARFs.Ronald S. Bultje
firstpass.c contains some rate adjustment code that assures that the last few frames in a sequence abide by rate limits. If the second-to- last group of frames contains an alt-ref frame (ARF), the last golden frame (GF) is zero bytes, and we will thus spend a ridiculously high number of bits on regular P-frames trying to hit the target rate. This does slightly enhance the quality of these last few frames, but has no perceptual value (other than hitting the target rate). Disabling this code means we consistently (slightly) undershoot the target rate and consequently do worse on the last few frames of a clip, which is particularly noticeable for small clips. The quality- per-bitrate is generally better, ~0.2% better overall on derf-set, especially on clips such as garden, tennis, foreman at low bitrates. Has a negative effect on hallmonitor at high bitrates. Change-Id: I1d63452fef5fee4a0ad2fb2e9af4c9f2e0d86d23
2011-06-14Merge "Populate bmi for B_PRED only"Scott LaVarnway
2011-06-14fix --disable-runtime-cpu-detect on x86Johann
Change-Id: Ib8e429152c9a8b6032be22b5faac802aa8224caa
2011-06-14Fix RT only buildTero Rintaluoma
Moved encode_intra function from firstpass.c to encodeintra.c to prevent linking problem in real-time only build. Also changed name of the function to vp8_encode_intra because it is not a static. Change-Id: Ibf3c6c1de3152567347e5fbef47d1d39564620a5
2011-06-13Populate bmi for B_PRED onlyScott LaVarnway
Small decode performance gain (~1%) on keyframes. No noticeable gains on encode. Also changed pick_intra4x4mby_modes() to read the above and left block modes for keyframes only. Change-Id: I1f4885252f5b3e9caf04d4e01e643960f910aba5
2011-06-13Calc ref_frame_cost once per frameScott LaVarnway
instead of every macro block. Change-Id: I2604e94c6b89e3a8457777e21c8c38406d55b165
2011-06-09Merge "bug fix mode_info_context not initialized for error-resilient"John Koleszar
2011-06-09remove one set of 16x16 variance funcationsYaowu Xu
call to this set of functions are replaced by var16x16. Change-Id: I5ff1effc6c1358ea06cda1517b88ec28ef551b0d
2011-06-09bug fix mode_info_context not initialized for error-resilientJames Berry
uninitialized xd->mode_info_context would crash vpxenc for --error-resilient=1. Change-Id: I31849e40281e3d65ab63257cfec5e93398997f0b