Commit Graph

56 Commits

Author SHA1 Message Date
Johann
1d7ccd5325 Relocate memory operations for common code
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-05-13 11:41:15 -07:00
James Zern
f58011ada5 vpx_mem: remove vpx_memset
vestigial. replace instances with memset() which they already were being
defined to.

Change-Id: Ie030cfaaa3e890dd92cf1a995fcb1927ba175201
2015-04-28 20:00:59 -07:00
Yunqing Wang
e76eaf05b1 vp9_ethread: add parallel loopfilter
1. Added row-based loopfilter in encoder;
2. Moved common multi-threaded loopfilter functions from decoder
   to common;
3. Merged multi-threaded loopfilter code, and made encoder/
   decoder call same function to reduce code duplication.

Encoder tests showed that 1% - 2% speedup was seen for good-quality
2-pass mode(at speed 3); 1% - 3% speedup using 2 threads and 4% - 6%
speedup using 4 threads were seen for real-time mode(at speed 7).

Change-Id: I8a4ac51c2ad9bab9fa7b864e90743931c53ec1c4
2015-01-16 17:19:27 -08:00
Paul Wilkins
a3c1a9b419 Use 64 bit to accumulate frame sse.
When testing frame sse to choose a loop filter value and
when checking ambient error in kf Q selection, use 64 bit
values for accumulating the sse, to avoid risk of overflow
for large image formats.

Change-Id: I03765d16c843d0ade61a45b0cd46312472697e57
2015-01-07 14:13:16 +00:00
Peter de Rivaz
f610f88be4 Corrected the renaming of CONFIG_VP9_HIGH ro CONFIG_VP9_HIGHBITDEPTH.
Change 71789 renamed CONFIG_VP9_HIGH to CONFIG_VP9_HIGHBITDEPTH.
However, one use of CONFIG_VP9_HIGH was missed.

Change-Id: I0ebb9c71380c6d810a25708d15471abf9533e695
2014-12-04 11:01:46 +00:00
Yunqing Wang
edbd61e136 vp9_ethread: modify VP9_COMP structure
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-24 17:57:38 -08:00
Yunqing Wang
70c9d2983b Revert "vp9_ethread: include a pointer to mb in VP9_COMP"
This reverts commit 6906d218dd.

Another way will be used to handle mb struct.

Change-Id: Ic1111a46b2b1ee00f8f9e3fcd4cf3eb6030b2dc4
2014-11-20 08:31:12 -08:00
Yunqing Wang
6906d218dd vp9_ethread: include a pointer to mb in VP9_COMP
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-14 12:31:06 -08:00
Deb Mukherjee
993d10a217 Adds various high bit-depth encode functions
Change-Id: I6f67b171022bbc8199c6d674190b57f6bab1b62f
2014-09-25 01:50:36 -07:00
Deb Mukherjee
5cd0aab81a Adds high bitdepth quantization functions
Adds various high bitdepth quantization functions.

Change-Id: I36fc0bf75a1bd15128ed271df8723de0ac134b0c
2014-09-16 14:55:37 -07:00
James Zern
49d7abc0ec vp9_picklpf: search_filter_level: remove filt_err
inspect ss_err[] directly, removes an unnecessary assignment

Change-Id: I14db5e8e567e7e541a57fce73389ffe7651d5614
2014-09-11 11:37:56 -07:00
Dmitry Kovalev
91c2f1e45a Moving pass from VP9_COMP to VP9EncoderConfig.
We had a very complicated way to initialize cpi->pass from
cfg->g_pass:
switch (cfg->g_pass) {
  case VPX_RC_ONE_PASS:
    oxcf->mode = ONE_PASS_GOOD;
    break;
  case VPX_RC_FIRST_PASS:
    oxcf->mode = TWO_PASS_FIRST;
    break;
  case VPX_RC_LAST_PASS:
    oxcf->mode = TWO_PASS_SECOND_BEST;
    break;
}

cpi->pass = get_pass(oxcf->mode).

Now pass is moved to VP9EncoderConfig and initialization is simple:
switch (cfg->g_pass) {
  case VPX_RC_ONE_PASS:
    oxcf->pass = 0;
    break;
  case VPX_RC_FIRST_PASS:
    oxcf->pass = 1;
    break;
  case VPX_RC_LAST_PASS:
    oxcf->pass = 2;
    break;
}

Change-Id: I8f582203a4575f5e39b071598484a8ad2b72e0d9
2014-08-08 14:27:54 -07:00
Yaowu Xu
d0cb273e04 Allow encoder to set lpf level to 0
As a way to speed-up rtc encoding at speed 7.

Change-Id: Ie36a010392cf7b741dc130df21a4e733622a75b7
2014-06-27 15:23:41 -07:00
Dmitry Kovalev
ae7d3ef39f Moving loopfilter call to vp9_decode_frame().
Inline loopfilter has been already handled in vp9_decode_frame().
Collecting all similar code in one place now.

Change-Id: I358a0280fc7c2b27cca520bc1e8c16c4eb6491dd
2014-05-12 16:19:19 -07:00
Paul Wilkins
702e25839e Clean up of firstpass.c
Re-factor duplicate code.
Add two pass check for use of section_intra_rating as
it is un-initialised in the 1 pass and rt case.

Change-Id: I93120796f07961b8a21fb26e1a9f0d3d13949994
2014-05-12 12:32:42 +01:00
Dmitry Kovalev
ef003078e8 Renaming "onyx" to "encoder".
Actual renames:
  vp9_onyx_if.c -> vp9_encoder.c
  vp9_onyx_int.h -> vp9_encoder.h

Change-Id: I80532a80b118d0060518e6c6a0d640e3f411783c
2014-04-22 14:57:05 -07:00
Dmitry Kovalev
3766ccd37a Adding consts in vp9_picklpf.c.
Change-Id: I84af62cc52954fc2eaf0b737245be76551fc8005
2014-04-11 15:33:50 -07:00
Dmitry Kovalev
fc28560bbd Rewriting calc_plane_error() function.
Change-Id: I06bb077edd4917b967fefe28bf4891b61b4f79b5
2014-03-27 16:15:04 -07:00
Dmitry Kovalev
355b8baf55 Merge "Convert use_fast_lpf_pick to an enum." 2014-03-21 21:19:31 -07:00
Alex Converse
bbfbbbf672 Convert use_fast_lpf_pick to an enum.
Change-Id: I06e17b489dea74dedea356c73ef72dc5ffad3a30
2014-03-21 14:59:26 -07:00
Dmitry Kovalev
50bbd8a583 Tiny vp9_picklpf.c cleanup.
Change-Id: I1804c3629c3df2b67438e87196ab35fafaddaa24
2014-03-21 12:00:26 -07:00
Yaowu Xu
023d2a21aa vp9_picklpf.c: remove unused functions and params
Change-Id: Ib4d850227cef35694c663feb157765a2cbf84699
2014-03-05 14:07:36 -08:00
Yunqing Wang
11a9366e3b Rename a loopfilter parameter
As pointed out by Dmitry and James, "partial" is a Microsoft-
specific c++ keyword, and it is renamed.

Change-Id: Ia0fc11ceb89e54b3195287f89f7e26edbbe9beb8
2014-01-31 16:30:04 -08:00
Alex Converse
c0214e7155 Cache loop filter errors.
This avoids fitlering a frame multiple times at the same level.

Change-Id: I1fd54dd7ea257d16da8569f48036b8fad3a3ed61
2014-01-24 17:08:25 -08:00
Alex Converse
8c2ae2d5df Refactor loop filter level search.
Factor out the code that tries filtering a frame at a given level.

Change-Id: Ia04507e3ce6b1ad6ae7d05a9d88222fd319f44b7
2014-01-24 17:08:24 -08:00
Alex Converse
ea283a6272 Add some consts to vp9_calc_ss_err().
Also change its wrongly named dest parameter to reference.

Change-Id: Ide142dead31c9ccda1f09a48b221284369783fb7
2014-01-24 14:26:02 -08:00
Alex Converse
4ce8929b9e Add a method to estimate loop filter level from quantizer and frame type.
Use this method with rt at speed -5.

Change-Id: If3bd6fad4c05ddde72131442dad191e4145047e7
2014-01-24 11:44:10 -08:00
Dmitry Kovalev
2f4e6ee55d Cleaning up vp9_picklpf.c file.
Change-Id: Id54f317846f61a320cc5aeef47248e074376ee5d
2014-01-17 16:09:21 -08:00
Dmitry Kovalev
ac40c87f68 Removing unused vp9_yv12_copy_partial_frame() function.
Change-Id: I3149e562fe9500914f67b6f908283edcdc381ac6
2014-01-16 18:16:34 -08:00
Dmitry Kovalev
62a2c2b15b Removing unused calc_partial_ssl_err() function.
Change-Id: Iad8b0208d3a3b0fc3d7fda3933b0fc007d4d2e9e
2014-01-13 11:26:16 -08:00
Dmitry Kovalev
57be81369a Renaming 'Sharpness' to 'sharpness'.
Change-Id: I54513dc3b3321e0c0bb6b15ea5c34085ed80b4a4
2014-01-08 14:19:14 -08:00
Jim Bankoski
cac3e1588e cpplint issues in vp9_picklpf.c
Change-Id: I62e631ca95fefbb1a993479a5e3926dc81359fe7
2013-10-04 17:08:41 -07:00
Dmitry Kovalev
67fe9d17cb Removing redundant code and function arguments.
Change-Id: Ia5cdda0f755befcd1e64397452c42cb7031ca574
2013-08-09 17:24:40 -07:00
Dmitry Kovalev
816d6c989c Moving loopfilter struct to VP9_COMMON.
Loop filter configuration doesn't belong to macroblock, so moving it from
MACROBLOCKD to VP9_COMMON. Also moving the declaration of loopfilter struct
from vp9_blockd.h to vp9_loopfilter.h.

Change-Id: I4b3e34be9623b47cda35f9b1f9951f8c5b1d5d28
2013-08-09 14:41:51 -07:00
Yaowu Xu
6ec2b85bad Added lpf level picking using partial frame
Change-Id: I599ab1bd22b5f3f10d5962c609952abdef8ff67a
2013-08-09 07:37:08 -07:00
Yaowu Xu
6a7a4ba753 renamed vp8_yv12_copy_y to vpx_yv12_copy_y
Becuase the routine is used by both vp8 and vp9

Change-Id: I2d35b287b5bc2394865d931a27da61f4ce7edeeb
2013-08-09 07:37:08 -07:00
Yaowu Xu
c7c9901845 added a speed feature on lpf level picking
Change-Id: Id578f8afdeab3702fc8386969f2d832d8f1b5420
2013-08-09 07:36:32 -07:00
Dmitry Kovalev
ee1771ebaa Moving all loop filter related variables into new struct.
Adding loopfilter struct with fields from MACROBLOCKD and VP9Common.
Eventually it will be moved to vp9_loopfilter.h for better code structure.

Change-Id: Iaf5fb71c33719cdfa1b991f671caf071be9ea035
2013-07-19 16:19:10 -07:00
Dmitry Kovalev
c0eb57406c Renaming TXFM_MODE to TX_MODE (like TX_SIZE, TX_TYPE).
Moving TX_MODE enum to vp9_enums.h. Renaming txfm_mode variables to
tx_mode.

Change-Id: I459d1af6dd928ce7fccdf8ce30b6f1ca057bef92
2013-07-19 11:37:13 -07:00
Paul Wilkins
845bc13ba9 Remove loop dering experiment.
Change-Id: I1a979bf74c286b157c31bab6bdcba0494acb4918
2013-05-25 10:09:23 +01:00
Yaowu Xu
2da90fddc2 Remove obselete code
The strategy to run fast loop filter picking for encoder speed-up
should be revisited at a later stage.

Change-Id: I3b75e06d767cff41be952a42e63b3292f4eab996
2013-04-10 13:45:22 -07:00
John Koleszar
441e2eab1b Add an in-loop deringing experiment
Adds a per-frame, strength adjustable, in loop deringing filter. Uses
the existing vp9_post_proc_down_and_across 5 tap thresholded blur
code, with a brute force search for the threshold.

Results almost strictly positive on the YT HD set, either having no
effect or helping PSNR in the range of 1-3% (overall average 0.8%).
Results more mixed for the CIF set, (-0.5 min, 1.4 max, 0.1 avg).
This has an almost strictly negative impact to SSIM, so examining a
different filter or a more balanced search heuristic is in order.

Other test set results pending.

Change-Id: I5ca6ee8fe292dfa3f2eab7f65332423fa1710b58
2013-03-26 08:23:24 -07:00
John Koleszar
9b7be88883 Fix pulsing issue with scaling
Updates the YV12_BUFFER_CONFIG structure to be crop-aware. The
exiting width/height parameters are left unchanged, storing the
width and height algined to a 16 byte boundary. The cropped
dimensions are added as new fields.

This fixes a nasty visual pulse when switching between scaled and
unscaled frame dimensions due to a mismatch between the scaling
ratio and the 16-byte aligned sizes.

Change-Id: Id4a3f6aea6b9b9ae38bdfa1b87b7eb2cfcdd57b6
2013-03-13 19:10:10 -07:00
John Koleszar
c03d45def9 Avoid allocating memory when resizing frames
As long as the new frame is smaller than the size that was originally
allocated, we don't need to free and reallocate the memory allocated.
Instead, do the allocation on the size of the first frame. We could
make this passed in from the application instead, if we wanted to
support external upscaling.

Change-Id: I204d17a130728bbd91155bb4bd863a99bb99b038
2013-02-08 12:20:30 -08:00
John Koleszar
879cb7d962 Merge vp9-preview changes into experimental branch
Incorportate vp9-preview changes by merging master branch into experimental.

Conflicts:
	test/test.mk
	vp9/common/vp9_filter.c
	vp9/common/vp9_idctllm.c
	vp9/common/vp9_invtrans.h
	vp9/common/vp9_mbpitch.c
	vp9/common/vp9_rtcd_defs.sh
	vp9/common/vp9_systemdependent.h
	vp9/common/vp9_type_aliases.h
	vp9/common/x86/vp9_asm_stubs.c
	vp9/common/x86/vp9_subpixel_mmx.asm
	vp9/decoder/vp9_decodframe.c
	vp9/decoder/vp9_dequantize.c
	vp9/decoder/vp9_dequantize.h
	vp9/decoder/vp9_onyxd_int.h
	vp9/encoder/vp9_bitstream.c
	vp9/encoder/vp9_encodeframe.c
	vp9/encoder/vp9_rdopt.c

Change-Id: I17f51c3666d1b59cf1a699f87607cbc5d30a87c5
2013-01-08 10:19:59 -08:00
Yaowu Xu
d278d01836 minor loop filter refactoring and cleanup
This commit did a couple of minor cleanup/refactoring to prepare for
futher loop filter experiments. It merged y_only version of loop filter
function into the regular one, which makes sure that same logic is used
for functions for picking level and for actual loop filtering.

Change-Id: Id10c94dccd45f58e5310bacfdf6ee63cbb60b86f
2013-01-07 16:23:58 -08:00
John Koleszar
5ebe94f9f1 Build fixes to merge vp9-preview into master
Various fixups to resolve issues when building vp9-preview under the more stringent
checks placed on the experimental branch.

Change-Id: I21749de83552e1e75c799003f849e6a0f1a35b07
2012-12-26 11:21:09 -08:00
Ronald S. Bultje
4cca47b538 Use standard integer types for pixel values and coefficients.
For coefficients, use int16_t (instead of short); for pixel values in
16-bit intermediates, use uint16_t (instead of unsigned short); for all
others, use uint8_t (instead of unsigned char).

Change-Id: I3619cd9abf106c3742eccc2e2f5e89a62774f7da
2012-12-18 15:31:19 -08:00
Johann
1009f76566 Use 'vpx_scale' consistently
Change-Id: I178352813d2b8702d081caf405de9dbad9af2cc3
2012-12-05 16:05:44 -08:00
Johann
52d350febf Begin to refactor vpx_scale usage in VP9
Only declare the functions in vpx_scale RTCD and include the relevant
header.

Remove unused files and functions in vpx_scale to avoid wasting time
renaming. vpx_scale/win32/scaleopt.c contains functions which have not
been called in a long time but are potentially optimized.

The 'vp8' functions have not been renamed yet. That is for after the
cleanup.

Change-Id: I2c325a101d60fa9d27e7dfcd5b52a864b4a1e09c
2012-12-05 08:59:40 -08:00