Commit Graph

51 Commits

Author SHA1 Message Date
Johann
c5f11912ae Include vpx_dsp_common.h when using VPXMIN/MAX
Change-Id: I2e387a06484a06301f3cd6600c4ba2f4335b61ee
2015-08-31 14:36:35 -07:00
James Zern
5e16d397bd vpx_dsp_common: add VPX prefix to MIN/MAX
prevents redeclaration warnings;
vp8 has its own define which will be resolved in a future commit

Change-Id: Ic941fef3dd4262fcdce48b73075fe6b375f11c9c
2015-08-26 20:11:32 -07:00
Jingning Han
89af744ba6 Change vp9_ prefix function names in vpx_scale to vpx_
Change-Id: Iac85902cbbb3e752801dc85de9a3c778e47304aa
2015-08-14 15:27:43 -07:00
Jingning Han
6ad714fa52 Add static syntax to total_adj_strong_thresh
Change-Id: I34cc7b500d19a79f29c5ad241f602c1bc269446e
2015-08-07 17:26:25 -07:00
Zoe Liu
7186a2dd86 Code refactor on InterpKernel
It in essence refactors the code for both the interpolation
filtering and the convolution. This change includes the moving
of all the files as well as the changing of the code from vp9_
prefix to vpx_ prefix accordingly, for underneath architectures:
(1) x86;
(2) arm/neon; and
(3) mips/msa.
The work on mips/drsp2 will be done in a separate change list.

Change-Id: Ic3ce7fb7f81210db7628b373c73553db68793c46
2015-07-31 10:27:33 -07:00
James Zern
f274c2199b vpx_mem: remove vpx_memcpy
vestigial. replace instances with memcpy() which they already were being
defined to.

Change-Id: Icfd1b0bc5d95b70efab91b9ae777ace1e81d2d7c
2015-04-28 19:59:41 -07:00
Scott LaVarnway
8b17f7f4eb Revert "Remove mi_grid_* structures."
(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-04-21 11:16:45 -07:00
Marco
8f84fbe756 Remove a few unneccessary multiplications in denoiser.
Change-Id: I3edbb7cc67203fbbf32c6fd4a08015ca9d9ed53e
2015-02-20 11:55:11 -08:00
Marco
c0923d4d3a Fix to vp9 denoiser.
Prevent from using wrong mv for denoiser motion compensation.

Change-Id: Ifa0f9daabdbdab0900d3c17304059fe0d15de914
2015-01-28 12:07:27 -08:00
JackyChen
25a19b48ff Fix compile error in Chromium building.
The comparison of address in the condition is not necessary, since
they will constantly be non-null.

Change-Id: Id0b0075283f5af65215d5761a8160a4cb2a15c9b
2015-01-21 12:59:25 -08:00
Jingning Han
dfda5cebc7 Fix frame buffer swap in denoiser
This commit fixes a bug in denoiser reference frame buffer swap,
which disables frame buffer update.

Change-Id: I39a9427180fd18f9692602064ad821f7af4714c0
2015-01-16 12:29:58 -08:00
Jingning Han
a0be730eae Refactor mc reference block fetch in denoiser
This commit refactors the motion compensated reference block fetch
process in denoiser. It skips the stage that generates motion
compensated reference block if denoiser decides to use copy block
mode. For high motion clips, this could speed up the denoising
process by about 10%.

Change-Id: I8ef4fa5fe766a8c4529119b9ec01faefb3d4ef53
2015-01-08 12:43:08 -08:00
Jingning Han
e3f0b19f3f Use lookup table to find pixel numbers in block
This could save one multiplication in each threshold funtion
called by the denoiser per block.

Change-Id: I35f437e09999f0a087180878ef7805f0d86e5819
2015-01-08 12:32:28 -08:00
Jingning Han
e535ad5067 Merge "Refactor denoiser frame buffer update" 2015-01-08 11:16:14 -08:00
Jingning Han
97dc782635 Merge "Initalize zeromv_sse and newmv_sse in vp9_pick_inter_mode" 2015-01-08 10:55:03 -08:00
Jingning Han
ea061a885d Refactor denoiser frame buffer update
Use frame buffer pointer swap instead of memcpy when possible.
These two CLs make the denoiser when running on vidyo1 720p at
speed -6 over 10% faster.

Change-Id: I64fe8a2422cafca6787a50c7f4dfb961191c0a9d
2015-01-07 18:33:13 -08:00
Jingning Han
29a5deb40c Use vp9_convolve_copy in denoiser output
Replace copy_block with vp9_convolve_copy for speed performance
improvement.

Change-Id: I3a08c4d01dff2253b6ee573efd02f65ccdc1b5a5
2015-01-07 18:23:17 -08:00
Jingning Han
e42b3ee765 Initalize zeromv_sse and newmv_sse in vp9_pick_inter_mode
These two parameters are used to control the denoiser cut-off
thresholds. They should be properly initialized when starting
mode search of a given block.

Change-Id: Iba8a25487026a0dbe0d350c347d7e4e4e237b637
2015-01-07 15:32:41 -08:00
Jingning Han
2fb9b635bb Fix denoiser chroma component initialization
Use the correct frame size and stride value for chroma components
when setting the initial values. These control parameters are
assigned when the denoiser buffer was allocated and initialized.

Change-Id: Ia6318194c7738aff540bcbd34f77f0dac46221a1
2015-01-07 08:49:59 -08:00
Jingning Han
27582e573b Skip duplicate denoiser frame buffer allocation
Allocate the frame buffer allocation for denoiser once during the
encoder initialization. This avoids allocating frame buffer
multiple times and overwriting the buffer pointer without proper
releasing.

Change-Id: I9b3baa6283449d86fd164534d344c036bb035700
2015-01-07 08:49:04 -08:00
Frank Galligan
c4f7079ad4 Revert "Revert "Add support for setting byte alignment.""
This reverts commit 91471d6aad.

Fixes the compile issues if post_proc is enabled.

Change-Id: Ib40a15ce2c194f9b5adfa65a17ab01ddf60f5a59
2014-12-15 12:20:37 -08:00
Paul Wilkins
91471d6aad Revert "Add support for setting byte alignment."
Fails to compile. Bad calls to vp9_alloc_frame_buffer
and vp9_realloc_frame_buffer in postproc.c

This reverts commit 399823b6f5.

Change-Id: I29f0e173f8e185d3a303cfdb17813e1eccb51e3a
2014-12-15 11:54:13 +00:00
Frank Galligan
399823b6f5 Add support for setting byte alignment.
Add support for setting byte alignment on the Y, U, and V plane of the
reference buffers. The byte alignment must be a power of 2, from 32 to
1024. A value of 0 sets legacy alignment.

Change-Id: I7c1399622f7aa68e123646369216b32047dda73d
2014-12-12 13:34:36 -08:00
JackyChen
80465dae88 Add SSE2 code and unit test for VP9 denoiser.
This SSE2 is based on VP8 denoiser's SSE2 code. In VP8, there are
only 16x16 blocks in denoiser, while in VP9, there are 13 different
block sizes.

By adding this SSE2 code, the improvement of encoder speed is around
20%(using C code vs using SSE2 code), vary for different clips.

The unit test for VP9 denoiser is to confirm that the SSE2 code is
bit-exact with the C code. The unit test covers all block size.

Change-Id: Ic8d8ac26db4ea40a5f146b5678a065af07eaaa3d
2014-10-06 15:27:40 -07:00
JackyChen
7ba646f7e6 Fix a bug in calculating delta in VP9 denoiser.
When calculating delta in VP8 denoiser, since the block size is fixed to 16x16,
the divisor is 256, which is the number of the pixel.
But in VP9, the block size varies, the divisor should correspond to the block
size.

Change-Id: Ibdc1e5d23ba8c788b0d0dc6d406bcdfc34c1b142
2014-09-29 13:09:18 -07:00
hkuang
c70cea97ac Remove mi_grid_* structures.
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-19 21:27:11 -07:00
JackyChen
47380c3350 Fix the bug which made VP8 denoiser not bit-exact between C code and SSE code.
This issue is found when the denoising mode is set to kDenoiserOnYUVAggressive.
Updated the C code to make it the same with SSE version.

I also changed several lines in VP9 denoiser for the code style.

Change-Id: I640d48cf946fe8c6a400e6e252107501d1e226d3
2014-09-10 16:18:43 -07:00
JackyChen
b1153f34d4 Map motion magnitude in VP9 denoiser.
This is to keep the same with VP8 denoiser.
If motion magnitude is small,
make denoiser more aggressive.

Change-Id: I942a6e2f2ed9aec6f0c4c1f9e5fa47066cadcc0c
2014-09-04 14:53:33 -07:00
JackyChen
d75266f141 Update the condition when COPY_BLOCK is chosen.
The change is just to keep the condition the same with VP8.

Change-Id: I9662b40996126605945dd853c0cbe8916c1ce578
2014-09-04 14:28:12 -07:00
JackyChen
e30f7698f5 Fix a bug in VP9 denoiser.
When the first try of denoising turns out to be too much,
we will use a softer filter by adopting an adjustment to
make the result closer to original pixel (as in VP8 denoiser).
The old code made the adjustment in the wrong direction.

Change-Id: I84e28fa9e01eef47c5a37d5a2e6d3d378a06786b
2014-09-04 11:46:36 -07:00
Deb Mukherjee
5acfafb18e Adds config opt for highbitdepth + misc. vpx
Adds config parameter vp9_highbitdepth, to support highbitdepth profiles.
Also includes most vpx level high bit-depth functions. However
encode/decode in the highbitdepth profiles will not work until
the rest of the code is in place.

Change-Id: I34c53b253c38873611057a6cbc89a1361b8985a6
2014-09-02 14:37:10 -07:00
Jim Bankoski
eec110a25b vp9_denoiser_update_frame_stats: unused parm fixed
Change-Id: Ic39cc0deafb3ed509434d3d9953b99713de7394a
2014-08-22 13:41:16 -07:00
Tim Kopp
c66f612c4b VP9 denoiser fix: ref frames now updated properly
The ALT_REF_FRAME is now updated in the case of a KEY_FRAME in the VP9 denoiser.

Change-Id: Idf9a9772706f50e774fb240afcc01db38841043c
2014-07-18 15:26:19 -07:00
Tim Kopp
03819ed9ab VP9 Denoiser denoises after mode/bsize search
In vp8, statistics are collected about the different modes as they are searched.
This process is more complicated due to the variable block size. Fields were
added to the PICM_MODE_CONTEXT struct to hold this information for each point in
the search. The information is then taken from the appropriate part of the tree
during denoising.

Change-Id: I89261ab77ad637821287ae157dfdf694702b8e77
2014-07-15 08:43:43 -07:00
Tim Kopp
3c86228cd3 Vp9 denoiser MC bugfix
In the previous version, only certain buffers in the macroblockd were saved and
the restored. In this version, all of the buffers are saved and restored. The
code was then rolled into a loop for readability.

Also contains a tiny fix for when the -DOUTPUT_YUV_DENOISED flag is used.

Change-Id: Id925ef8b3fa122ae88acfa1d9a1e4df45df83518
2014-07-08 15:13:13 -07:00
Tim Kopp
03a3ba4a0d VP9 denoiser implemented FILTER_BLOCK case
Renamed updating_running_avg() to filter(). Extended function with the rest of
the filter procedure. Made all of the empirically-determined constants used in
VP8 into functions so they can be tweaked more easily.

Change-Id: I41730c8c92370c76885950a43742347477ca4e7e
2014-07-02 11:23:29 -07:00
Tim Kopp
9c9922df97 VP9 denoising enabled by noise_sensitivity param
As in VP8.

Currently, this parameter is set with the VP8E_SET_NOISE_SENSITIVITY flag.
The flag was not renamed so that we don't break the interface for webrtc. This
should probably be changed at some point in the future.

Change-Id: Ic73fcb0dde9d1d019e9d042050b617333ac65472
2014-07-02 11:20:35 -07:00
Tim Kopp
49741fee9f Replaced loops with vpx_memcpy()
Change-Id: Icbe05657f0e92c3838e6a5a975f4f82d21328a2e
2014-07-02 10:36:25 -07:00
Tim Kopp
1a66dab93a VP9 denoiser used s/int/enum where appropriate
Change-Id: Id52a7869fd1f31bb060de170e3295da7435adb9e
2014-07-01 14:07:40 -07:00
Tim Kopp
2f71de77f0 Denoised output is now grayscale
Grayscale is conditionally compiled.

Change-Id: I482ab237560d0bae8d397fd9999e78d38104f2a1
2014-07-01 14:07:40 -07:00
Tim Kopp
2826c1d259 Implemented motion compensation for VP9 denoiser
Change-Id: Iee21eb0ecc5a1fe2c56fb3df0cee0ead6d139ed1
2014-06-27 08:56:09 -07:00
Tim Kopp
52462bf7a8 VP9 denoiser: implemented update_frame_stats()
Also added reset_frame_stats()

Change-Id: I8e6ca00dbd5fa85cd39485d81c9343c0ff207d6c
2014-06-27 08:56:09 -07:00
Tim Kopp
b79d5b62bd Fixed VP9 denoiser COPY_BLOCK case
Now copies the src to the correct location in the running average buffer.

Change-Id: I9c83c96dc7a97f42c8df16ab4a9f18b733181f34
2014-06-20 07:18:42 -07:00
Tim Kopp
31c03b31fe VP9 denoiser bugfixes
s/stdint.h/vpx\/vpx_int.h

Added missing 'break;'s

Also included other minor changes, mostly cosmetic.

Change-Id: I852bba3e85e794f1d4af854c45c16a23a787e6a3
2014-06-20 07:18:42 -07:00
Tim Kopp
b56f3af7db Fixes in VP9 alloc, free, and COPY_FRAME case
Change-Id: I1216f17e2206ef521fe219b6d72d8e41d1ba1147
2014-06-19 08:41:36 -07:00
Tim Kopp
0fec8f9712 Improved vp9 denoiser running avg update.
Change-Id: Ie0aa41fb7957755544321897b3bb2dd92f392027
2014-06-19 08:41:36 -07:00
Tim Kopp
ff38807165 Implemented COPY_BLOCK case for vp9 denoiser
Change-Id: Ie89ad1e3aebbd474e1a0db69c1961b4d1ddcd33e
2014-06-19 08:41:36 -07:00
Tim Kopp
2614e56c58 Changed buf_2ds in vp9 denoiser to YV12 buffers
Changed alloc, free, and running average code as necessary.

Change-Id: Ifc4d9ccca462164214019963b3768a457791b9c1
2014-06-18 14:18:09 -07:00
Tim Kopp
a4b7a713a4 Update running avg for VP9 denoiser
Change-Id: I9577d648542064052795bf5770428fbd5c276b7b
2014-06-18 14:18:09 -07:00
Tim Kopp
2a72067301 Implemented vp9_denoiser_{alloc,free}()
Change-Id: I79eba79f7c52eec19ef2356278597e06620d5e27
2014-06-18 14:18:09 -07:00