summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_quantize.c
AgeCommit message (Collapse)Author
2019-04-01Allow macroblock_plane to have its own rounding bufferJingning Han
Add 8 bytes buffer to macroblock_plane to support rounding factor. Change-Id: I3751689e4449c0caea28d3acf6cd17d7f39508ed
2018-08-14Make Sharpness parameter affect visual sharpnessJim Bankoski
1: Lower rdmult used in trellis optimization 2: Shut off the end of block optimization that tries end of block at every sub position if any of the coefficients are > 1. 3: Change the rounding and zbin factor according to sharpness. 4: Disable the skip block check that calculates RD using SSE from predictor. Change-Id: I247b61a26fa22f12f8b684e7cd6d4e368de7c3e4
2018-05-01Clean switch cases in vp9 encoderLinfeng Zhang
To save a branch. Change-Id: Ifa2be7583e95c6991784731c654bbd4cce31e993
2017-08-22quantize: capture skip block earlyJohann
This should probably be handled before vp9_regular_quantize_b_4x4 even gets called. Fixes an assert resulting from removing skip_block from the quantize functions. BUG=webm:1459 Change-Id: I7f52b53f959b4654b3d4517ebda31a678f4d0fde
2017-08-21Remove skip_block from quantizeJohann
This condition is handled before this code is reached. The ssse3 version of the function has always crashed when attempting to handle the skip_block condition. Add assert() and comments regarding the usage of skip_block. Removing the parameter is a fairly involved process so leave it be for the moment. Change-Id: Ib299f6fc6589d7ee102262cc74a7aeb60110bc5a
2017-08-17quantize: normalize intermediate typesJohann
Despite abs_coeff being a positive value, all the other implementations treat it as signed which simplifies restoring the sign. HBD builds cast qcoeff to avoid a visual studio warning. Match vp9_quantize.c style of casting the entire expression. Change-Id: I62b539b8df05364df3d7644311e325288da7c5b5
2017-06-21highbd_quantize_fp_32x32: normalize abs_qcoeff typeJames Zern
use an int to quiet an unsigned rollover warning similar to: 25110f283 Fix an ubsan warning: vp9_quantizer.c Change-Id: Iedecb79a17249bc18f10c0920f88cf704920f12b
2017-02-16Drop zbin_ptr and quant_shift_ptrJohann
vp9[_highbd]_quantize]_fp[_32x32] and vp9_fdct8x8_quant do not make use of these parameters. scan is used for C code and iscan is used for SIMD implementations. Change-Id: I908a0ff7d3febac33da97e0596e040ec7bc18ca5
2016-08-02vp9/encoder: apply clang-formatclang-format
Change-Id: I45d9fb4013f50766b24363a86365e8063e8954c2
2016-06-16Fix an ubsan warning: vp9_quantizer.cYaowu Xu
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1219 Change-Id: Ie1bfda4d51c1567f551515f0ed113eec1bc1d98c
2016-04-27Avoid an unsigned overflow in invert_quantAlex Converse
Change-Id: I16a570b2af66b6580d1cd6f8345a25f079009bf4
2016-02-09Restore previous motion search bit-error scale.Alex Converse
The bit to error transformation got doubled as a result of going from 8-bit to 9-bit costs (change d13385c). Use defines to derive the scale numbers and comment some of the fields. derf: -0.023 BDRATE hevcmr: +0.067 BDRATE stdhd: +0.098 BDRATE (These are substantially smaller than than the original gains from 8 to 9 bit costing.) Change-Id: I6a2b3b029b2f1415e4f90a05709b2333ec0eea9b
2016-01-19VP9: Eliminate MB_MODE_INFOScott LaVarnway
Change-Id: Ifa607dd2bb366ce09fa16dfcad3cc45a2440c185
2015-08-04Change vp9_quantize to vpx_quantizeJingning Han
This commit clears all the vp9_ prefix use case in vpx_dsp. It gets the vp9 folder ready to branch out vp10. Change-Id: I2906eec179ee792b4af8c9b4161313653050e931
2015-07-17Migrate quantization functions from vp9/ to vpx_dsp/Yunqing Wang
The following quantization functions were moved: vp9_quantize_b vp9_quantize_b_32x32 vp9_highbd_quantize_b vp9_highbd_quantize_b_32x32 vp9_quantize_dc vp9_quantize_dc_32x32 vp9_highbd_quantize_dc vp9_highbd_quantize_dc_32x32 The purpose of doing that was to allow these functions to be shared by multiple codecs. Change-Id: Id8ab939f283353cdd07bd930d47db3d932a5d87f
2015-07-08Remove clamp operations.Yaowu Xu
The clamp calls with INT32_MIN and INT32_MAX have no effect at all on int values passed in, therefore this commit removes those effectless clamps and also adds more const intermediate results to make the code more readable. Change-Id: I66d8811f58bb74ec31cbec9a6c441983a662352e
2015-06-11inline vp9_segfeature_active()Scott LaVarnway
and changed name. Change-Id: Ie023ca66cc2c823032f58d4faeb53fd1863c94f3
2015-05-13Relocate memory operations for common codeJohann
With the sad functions, and hopefully the variance functions soon, moving to the vpx_dsp location, place the defines used in the reference C code in a common location. Change-Id: I4c8ce7778eb38a0a3ee674d2f1c488eda01cfeca
2015-04-28vpx_mem: remove vpx_memsetJames Zern
vestigial. replace instances with memset() which they already were being defined to. Change-Id: Ie030cfaaa3e890dd92cf1a995fcb1927ba175201
2015-04-21Revert "Remove mi_grid_* structures."Scott LaVarnway
(see I3a05cf1610679fed26e0b2eadd315a9ae91afdd6) For the test clip used, the decoder performance improved by ~2%. This is also an intermediate step towards adding back the mode_info streams. Change-Id: Idddc4a3f46e4180fbebddc156c4bbf177d5c2e0d
2015-03-06vp9_ethread: fix me consts initialization to support aq_mode=3 encodingYunqing Wang
While turning on "--aq_mode=3", the quantizers are updated by each thread. Fixed the me consts initialization function to make sure that the correct thread data are updated. Change-Id: Ied27bb7bae76fc3fa2cda4f8c35ac0b46271bef4
2015-03-03dc quantizer fix for 32x32 transformsDeb Mukherjee
The rounding factor needs to be scaled down by a factor of 2. Also, the quantized and dequantized coefficients are memset to 0 when dc quantizer is used. Change-Id: Ifa68bab02addbf1b83d249c5b4cbd5cda796b1cf
2015-02-20Move dequant table from VP9_COMMON to VP9_COMP as decoderHangyu Kuang
does not need it any more. This reduces VP9_COMMON size from 25776 bytes to 17584 bytes(~31%). Change-Id: Ic5daea732ccefb6d512b048af7983f0efe08589b
2014-12-22Revert "Revert "Removal of legacy zbin_extra / zbin_oq_value.""Jingning Han
This reverts commit 9946ee23e0a4c158e26a505b162a072f81b8a3be. Fix the ssse3 asm function. Change-Id: I07f77a63aa98087626e45c4e87aa5dcafc0b0b07
2014-12-19Revert "Removal of legacy zbin_extra / zbin_oq_value."Paul Wilkins
This reverts commit e9b586e21bb899e247346e82bccf5afb42604910. Change-Id: I5b36e6727da6c05278d97e2c37b80c109f79bed4
2014-12-18Removal of legacy zbin_extra / zbin_oq_value.Paul Wilkins
zbin extra / zbin_oq_value was widely passed around, hence removal touches a lot of code. Change-Id: Idc94359735b60c38a160e4385ae09d5ca8b6b8e5
2014-12-18Remove mode dependent zbin boost.Paul Wilkins
Initial patch to remove get_zbin_mode_boost() and cpi->zbin_mode_boost. For now sets a dummy value of 0 for zbin extra pending a further clean up patch. Change-Id: I64a1e1eca2d39baa8ffb0871b515a0be05c9a6af
2014-11-24vp9_ethread: modify VP9_COMP structureYunqing Wang
This patch modified struct VP9_COMP. Created a struct ThreadData to include data that need to be copied for each thread. In multiple thread case, one thread processes one tile. all threads share one copy of VP9_COMP, (refer to VP9_COMP *cpi in the code) but each thread has its own copy of ThreadData, (refer to ThreadData *td in the code). Therefore, within the scope of encode_tiles(), both cpi and td need to be passed as function parameters. In single thread case, the FRAME_COUNTS pointer in ThreadData points to "counts" in VP9_COMMON. Change-Id: Ib37908b2d8e2c0f4f9c18f38017df5ce60e8b13e
2014-11-20Revert "vp9_ethread: include a pointer to mb in VP9_COMP"Yunqing Wang
This reverts commit 6906d218ddd1af97228a797f4558e402231d94f1. Another way will be used to handle mb struct. Change-Id: Ic1111a46b2b1ee00f8f9e3fcd4cf3eb6030b2dc4
2014-11-14vp9_ethread: include a pointer to mb in VP9_COMPYunqing Wang
Modified VP9_COMP struct to include MACROBLOCK *mb. This change makes it feasible in multi-thread case to allocate a mb for each thread. Change-Id: I624d6d1aa9c132362200753e5d90b581b1738d6e
2014-11-05Fix visual studio 2013 compiler warningsYaowu Xu
For configured with --enable-vp9-highbitdepth Change-Id: I2b181519d7192f8d7a241ad5760c3578255f24e6
2014-10-09Rename highbitdepth functions to use highbd prefixDeb Mukherjee
Uses highbd_ prefix convention consistently. Change-Id: I58f7f799a7ff8e32701bcd71c955bcf1cdd4581e
2014-10-01Modify block transform skipping checkYunqing Wang
Block transform skipping was implemented based on DCT's energy conservation property. Modified the thresholds using zero bin parameters. AC and DC coefficients were checked separately to allow better identifying of skippable blocks. Borg test at speed 3 showed: stdhd set: psnr gain: 0.153%, ssim gain: 0.051%; derf set: psnr gain: 0.023%, ssim gain: 0.036% For most test clips, the encoding speedup is 1% - 2%. parkrun(720p): 7.5% speedup, park_joy(1080p): 3.5% speedup. Change-Id: If28eb81113a077414f5ca7b021c14f9069b373bb
2014-09-19Remove mi_grid_* structures.hkuang
mi_grid_* are arrays of pointer to pointer. They save the pointers that point to the MIs in cm->mi. But they are unnecessary and complicated. The original goal was to remove MODE_INFO_t copy. But with an extra MODE_INFO_t pointer inside MODE_INFO_t, same goal could be achieved. This commit totally removes the mi_grid_* structures. But there are still many dummy MODE_INFO_t inside cm->mi which are a waste of memory. Next commit will do on-demand MODE_INFO_t allocation in order to save these memories. Change-Id: I3a05cf1610679fed26e0b2eadd315a9ae91afdd6
2014-09-16Adds high bitdepth quantization functionsDeb Mukherjee
Adds various high bitdepth quantization functions. Change-Id: I36fc0bf75a1bd15128ed271df8723de0ac134b0c
2014-09-11Adds high bitdepth transform functions and testsDeb Mukherjee
Adds various high bitdepth transform functions and tests. Much of the changes are related to using typedefs tran_low_t and tran_high_t for the final transform cofficients and intermediate stages of the transform computation respectively rather than fixed types int16_t/int. When vp9_highbitdepth configure flag is off, these map tp int16_t/int32_t, but when the flag is on, they map to int32_t/int64_t to make space for needed extra precision. Change-Id: I3c56de79e15b904d6f655b62ffae170729befdd8
2014-08-08Enable fast forward txfm and quant for rate-distortion searchJingning Han
This commit enables encoder to select fast forward transform and quantization path according to the prediction residual sse/variance, in the rate-distortion optimization scheme. Change-Id: Ief9fc3844fd4107166d401970e800c6e5ce2b5fe
2014-07-21Remove unfinished VP9 alpha channel.Alex Converse
Change-Id: Ic5d3a3a0dac10b49495771886a31e793bb78b5ca
2014-07-08Re-design quantization process for 32x32 transform blockJingning Han
This commit enables a new quantization process for 32x32 2D-DCT transform coefficient blocks. It improves the compression performance of speed 5 by 1.4%. The overall compression gains of speed 5 due to the new quantization scheme is 4.7%. It also includes the SSSE3 implementation of the 32x32 quantization process. Change-Id: I0855b124fd6462418683f783f5bcb44255c9993b
2014-07-02Split vp9_rdopt into vp9_rdopt and vp9_rd.Alex Converse
vp9_rdopt is for making rd optimal mode decisions. vp9_rd is for all other rd related routines. Anything used outside of making an rd optimal decision belongs in rd. Change-Id: I772a3073f7588bdf139f551fb9810b6864d8e64b
2014-07-01Re-design quantization processJingning Han
This commit re-designs the quantization process for transform coefficient blocks of size 4x4 to 16x16. It improves compression performance for speed 7 by 3.85%. The SSSE3 version for the new quantization process is included. The average runtime of the 8x8 block quantization is reduced from 285 cycles -> 255 cycles, i.e., over 10% faster. Change-Id: I61278aa02efc70599b962d3314671db5b0446a50
2014-06-12Fast computation path for forward transform and quantizationJingning Han
This commit enables a fast path computational flow for forward transformation. It checks the sse and variance of prediction residuals and decides if the quantized coefficients are all zero, dc only, or more. It then selects the corresponding coding path in the forward transformation and quantization stage. It is currently enabled in rtc coding mode. Will do it for rd coding mode next. In speed -6, the runtime for pedestrian_area 1080p at 1000 kbps goes down from 14234 ms to 13704 ms, i.e., about 4% speed-up. Overall coding performance for rtc set is changed by -0.18%. Change-Id: I0452da1786d59bc8bcbe0a35fdae9f623d1d44e1
2014-05-14vp9_quantizer.c: cleanup -wextra warningsYaowu Xu
Change-Id: If5a3c48a8c554018a5d63c1541a2900f15767a00
2014-04-22Renaming "onyx" to "encoder".Dmitry Kovalev
Actual renames: vp9_onyx_if.c -> vp9_encoder.c vp9_onyx_int.h -> vp9_encoder.h Change-Id: I80532a80b118d0060518e6c6a0d640e3f411783c
2014-04-22Fix the CONFIG_ALPHA build.Alex Converse
Change-Id: Ib89fe34812c17cd6294ce3c38f87d43a79abb16f
2014-04-16Remove old activity masking code.Paul Wilkins
Delete code relating to the old VP8_TUNE_SSIM flag as this code does not currently work and is largely made redundant in VP9 by the various AQ modes. Change-Id: I71f28e1f680573d296422254489000678552b17b
2014-04-09Moving q_trans[] table to vp9_quantize.{c, h}.Dmitry Kovalev
Change-Id: I1324c339815a47004ddccdaf651d24c60382b92f
2014-04-01Renaming two members in MACROBLOCKD struct.Dmitry Kovalev
Renames: mi_8x8 -> mi mode_info_stride -> mi_stride Change-Id: I66f3e5fd1e7b7f46f108af5bb711c5fd9493c1be
2014-03-28Moving encoder quantization parameters into separate struct.Dmitry Kovalev
Change-Id: I2a169535489aeda3943fb5a46ab53e7a12abaa36
2014-02-28Fixing include order in vp9_quantize.cDmitry Kovalev
Change-Id: Ic32eb103d0d7f98c0a16c4e7bdec117faf05df02