Commit Graph

5615 Commits

Author SHA1 Message Date
Geza Lore
0134764fa6 Optimization of 8bit block error for high bitdepth
If high bit depth configuration is enabled, but encoding in profile 0,
the code now falls back on optimized SSE2 assembler to compute the
block errors, similar to when high bit depth is not enabled.

Change-Id: I471d1494e541de61a4008f852dbc0d548856484f
2015-10-08 14:05:25 -07:00
jackychen
b0a2ba2ffa VP9_denoiser: pass address in copy_frame to make it faster.
Change-Id: I65269ddb3ea5f911d5be38614b93c97be7e1ba76
2015-10-07 13:22:37 -07:00
Marco Paniconi
780ada18aa Merge "VP9 denoiser bug-fix: artifact caused by false buffer swap." 2015-10-07 19:08:07 +00:00
Alex Converse
061103dc82 Merge "vp9: simplify extrabits encoding" 2015-10-07 18:45:02 +00:00
jackychen
7231c62c9f VP9 denoiser bug-fix: artifact caused by false buffer swap.
The artifact occurs periodically when VP9 denoiser is on and
refresh_golden_frame happen. When refresh_golden_frame happen,
we should copy the frame buffer instead of swapping the pointers.

Change-Id: Ib3204c4b04db28ecf439c6d9e61f3d146f04196d
2015-10-07 11:16:15 -07:00
Marco
bc137ff67b Move setting of refresh threshold outside loop.
Small code cleanup. consec_zeromv refresh threshold
does not need to be computed for every super-block.

No change in behavior.

Change-Id: I8c4b1b28072f42b01d917fff6d1f62722f1e1554
2015-10-06 17:51:30 -07:00
Alex Converse
2f7f482c77 vp9: simplify extrabits encoding
Change-Id: I5a2abd35cb303d8f6354b3119ab95acf90405116
2015-10-06 16:26:08 -07:00
Marco
7266bedc04 Add first_spatial_layer_to_encode to SVC.
Use the existing VP9_SET_SVC control to set the
first spatial layer to encode.

Since we loop over all spatial layers inside the encoder, the
setting of spatial_layer_id via VP9_SET_SVC has no relevance.
Use it instead to set the first_spatial_layer_to_encode,
which allows an application to skip encoding lower layer(s).

Change only affects the 1 pass CBR SVC.

Change-Id: I5d63ab713c3e250fdf42c637f38d5ec8f60cd1fb
2015-10-06 08:56:15 -07:00
jackychen
de53e6de49 Add the check of resolution in VP9 dynamic resizing.
The resolution check fixs the issue which resets resize_pending
unnecessarily and causes not-bitexact with previous one-step version.

Change-Id: I4e7660b3c8f34f59781e2e61ca30d61080c322de
2015-10-05 15:39:32 -07:00
Marco Paniconi
7777e7a8d5 Merge "Fix to denoiser with dynamic resize." 2015-10-05 14:14:35 +00:00
Marco Paniconi
3da6564f90 Merge "Stabilize the encoder buffer from going too negative." 2015-10-05 14:11:43 +00:00
JackyChen
87b2495f95 Turn on two-steps scaling in VP9 encoder dynamic resizing.
First do a 3/4 scaling and then go down to 1/2 when necessary.

Change-Id: I5689c5228ca7e1606baea7f960eb24d0dab04d4d
2015-10-02 15:27:37 -07:00
Marco
86ede50943 Fix to denoiser with dynamic resize.
Temporary fix to denoiser when dynamic resizing is on.
 -Reallocate denoiser buffers on resized frame.
 -Force golden update on resized frame.
 -Don't denoise resized frame, and copy source into denoised buffers.

Change-Id: Ife7638173b76a1c49eac7da4f2a30c9c1f4e2000
2015-10-02 11:50:57 -07:00
Marco
37293583cd Stabilize the encoder buffer from going too negative.
For screen-content mode, with frame dropper off, put a limit
on how low encoder buffer can go.

Under hard slide changes, the buffer level can go too low and then
take long time to come back up (in particular when frame-dropping
is not used), which will affect the active_worst and target frame size.

Change-Id: Ie9fca097e05cd71141f978ec687f852daf9de332
2015-10-02 11:07:59 -07:00
jackychen
ba06be3844 Two-steps scaling in VP9 encoder dynamic resizing.
Dynamic resizing now support two-steps scaling: first go down to
3/4 and then 1/2. This feature is under a flag which controls the
switch between two-steps scaling and one-step scaling (1/2 only).

Change-Id: I3a6c1d3d5668cf8e016a0a02aeca737565604a0f
2015-10-01 18:18:49 -07:00
Scott LaVarnway
2f8625d824 VP9: remove plane_type from macroblockd_plane
Change-Id: Ia5072a3a92212d8565f33359f6c146469bdfbbec
2015-09-30 15:15:11 -07:00
Scott LaVarnway
66de2b710f Merge "VP9: move loopfilter build masks to decode loop" 2015-09-29 21:40:48 +00:00
Marco
c05c58f8ff aq-mode for SVC: Add consec_zero_mv to layer context.
Change-Id: I63fadf1c7240d4b2893384f75c519311e9659d47
2015-09-29 10:01:53 -07:00
Scott LaVarnway
7718117104 VP9: move loopfilter build masks to decode loop
The loopfilter masks are now built in the decode loop.
This is done so we can eventually reduce the number of
MODE_INFO structs required by the decoder.

The encoder builds the masks for the entire frame prior
to calling the loopfilter.

Change-Id: Ia2146b07e0acb8c50203e586dfae0c4c5b316f11
2015-09-29 05:20:49 -07:00
Ronald S. Bultje
cc5dd3ec10 Merge "vp9/10: improve support for render_width/height." 2015-09-28 16:25:28 +00:00
Ronald S. Bultje
3db5721e21 Merge "Rename display_{size,width,height} to render_*." 2015-09-28 16:25:20 +00:00
Ronald S. Bultje
812945a8f1 vp9/10: improve support for render_width/height.
In the decoder, map this to the output variable vpx_image_t.r_w/h.
This is intended as an improved version of VP9D_GET_DISPLAY_SIZE,
which doesn't work with parallel frame decoding. In the encoder,
map this to a codec control func (VP9E_SET_RENDER_SIZE) that takes
a w/h pair argument in a int[2] (identical to VP9D_GET_DISPLAY_SIZE).

Also add render_size to the encoder_param_get_to_decoder unit test.

See issue 1030.

Change-Id: I12124c13602d832bf4c44090db08c1009c94c7e8
2015-09-25 22:18:22 -04:00
James Zern
db2056f341 Merge "vp9/10 encoder: prevent NULL access on failure" 2015-09-26 01:52:52 +00:00
Ronald S. Bultje
36ffe64498 Rename display_{size,width,height} to render_*.
The name "display_*" (or "d_*") is used for non-compatible information
(that is, the cropped frame dimensions in pixels, as opposed to the
intended screen rendering surface size). Therefore, continuing to use
display_* would be confusing to end users. Instead, rename the field
to render_*, so that struct vpx_image can include it.

Change-Id: Iab8d2eae96492b71c4ea60c4bce8121cb2a1fe2d
2015-09-25 21:34:29 -04:00
Marco
3f7656cc23 Limit cyclic refresh on steady background blocks.
Use the existing QP condition on limiting cyclic refresh, and add
addiitonal condition that block has been encoded with zero/small motion
x frames in row (where x is at least several times the refresh period).
Additional condition only affect non-screen content mode.

This helps to improve visual stability for noisy input, where on steady
background areas the application of delta_qp may lead to encoding the noise.

Also added a change to use the true skip (after encoding) to update the
last QP.

Change-Id: I234a1128d017d284cf767fdb58ef6c59d809f679
2015-09-25 10:40:35 -07:00
Jacky Chen
ee72b6915e Merge "Change size on first frame and change config cause crash." 2015-09-25 01:04:07 +00:00
James Zern
cf8f6559ce vp9/10 encoder: prevent NULL access on failure
Change-Id: I1fc8e0b3d48675cd5428b7b36f7cc28ab32cbf71
2015-09-23 17:55:51 -07:00
Marco Paniconi
30bd74cf74 Merge "Non-rd mode: Limit transform size for intra to 16x16." 2015-09-24 00:12:02 +00:00
Hui Su
d5683faab9 Merge "Adjust rd calculation in choose_tx_size_from_rd" 2015-09-23 21:39:43 +00:00
Marco
9b51b3a9ca Adjust rate-boost threshold in cyclic refresh for seg#2.
Small gain in metrics (average ~0.2dB), small
reduction in rate fluctuation.

Change-Id: Id75bd89c168486f075308fb474ebd26e3bdfb85b
2015-09-23 11:52:55 -07:00
Marco
01860f6fe4 Non-rd mode: Limit transform size for intra to 16x16.
Limit transform size for intra to 16x16, for non-screen content mode.
Little/no change in speed or metrics.
32x32 intra block is rarley selected in RTC (non-screen content) case,
but some visual improvement can be seen in some example,
e.g., captured_video_dark_whd.yuv.

Change-Id: I68e2db87875343b3fb9bb407a7709f0088f84072
2015-09-23 10:59:24 -07:00
hui su
38cc168822 Adjust rd calculation in choose_tx_size_from_rd
Coding gain:
derflr 0.142%
hevclr 0.153%
hevcmr 0.124%

Change-Id: I63b56ae3a9002c3a266e10e2964135ed43b0ba53
2015-09-23 10:54:28 -07:00
jackychen
55f092db09 Change size on first frame and change config cause crash.
Reallocation of mi buffer fails if change size on the first frame and
change config in subsequent frames. Add a condition for resolution
check to avoid assertion failure.

BUG=1074

Change-Id: Ie26ed816a57fa871ba27a72db9805baaaeaba9f3
2015-09-21 10:57:05 -07:00
Marco
38ad2dcea6 Non-rd pickmode: Don't skip checking zeromv-last mode.
Reference frame masking logic may skip checking zeromv-last mode.
Fix to avoid this and make sure zero-last is always checked.

No noticeable change in speed, and PSNR/SSIM metrics on RTC set overall
neutral (very small gain ~0.02).
Small visual improvement on few RTC clips.

Change-Id: I26eacdc449126424001a4a64e5ac31949f064417
2015-09-21 10:32:23 -07:00
Marco Paniconi
e12ec3615c Merge "Add SVC codec control to set frame flags and buffer indices." 2015-09-17 22:29:07 +00:00
James Zern
9d8decc162 Merge changes from topic 'tile-thread-cleanup'
* changes:
  vp9/decode_tiles_mt: move frame count accum from loop
  VP9Decoder: remove duplicate tile_worker_info
  vp9/decode_tiles_mt: move some inits from inner loop
  vp9_accumulate_frame_counts: pass counts directly
2015-09-17 22:00:23 +00:00
Marco
730cdefd3e Add SVC codec control to set frame flags and buffer indices.
Add SVC codec control to set the frame flags and buffer indices
for each spatial layer of the current (super)frame to be encoded.
This allows the application to set (and change on the fly) the
reference frame configuration for spatial layers.

Added an example layer pattern (spatial and temporal layers)
in vp9_spatial_svc_encoder for the bypass_mode using new control.

Change-Id: I05f941897cae13fb9275b939d11f93941cb73bee
2015-09-17 09:37:15 -07:00
Ronald S. Bultje
eeb5ef0a24 Add support for color-range.
In decoder, export (eventually) into vpx_image_t.range field. In
encoder, use oxcf->color_range to set it (same way as for
color_space).

See issue 1059.

Change-Id: Ieabbb2a785fa58cc4044bd54eee66f328f3906ce
2015-09-16 06:41:46 -04:00
James Zern
c667593e1e Merge changes from topic 'fix-vp9-bitstream-test'
* changes:
  vp9_encoder_parms_get_to_decoder: cosmetics
  vp9...parms_get_to_decoder: remove unneeded func
  vp9...parms_get_to_decoder: fix EXPECT param order
  vp9_encoder_parms_get_to_decoder: delete dead code
  fix BitstreamParms test
  vp9_encoder_parms_get_to_decoder: remove vp10
  yuvconfig2image(): add explicit cast to avoid conv warning
  vp9/10 decoder_init: add missing alloc cast
  vp9/10: set color_space on preview frame
  vp10: add extern "C" to headers
  vp9: add extern "C" to headers
2015-09-15 23:14:34 +00:00
Marco Paniconi
f6097ef243 Merge "SVC fix to set worst/best_quality per layer." 2015-09-15 22:06:13 +00:00
Marco
15c43d9ac7 SVC fix to set worst/best_quality per layer.
Allow the worst/best_quality to be set per layer via the
VP9E_SET_SVC_PARAMETERS control.

Change-Id: Icba5ec8ac757152f3bb7860d6010d9174a7bd578
2015-09-15 14:16:07 -07:00
Marco
eb53c69ece Add cyclic refresh parameters to svc-layer context.
For 1 pass CBR spatial-SVC:
Add cyclic refresh parameters to the svc-layer context.

This allows cyclic refresh (aq-mode=3) to be applied to
the whole super-frame (all spatial layers).
This gives a performance improvement for spatial layer encoding.

Addd the aq_mode mode on/off setting as command line option.

Change-Id: Ib9c3b5ba3cb7851bfb8c37d4f911664bef38e165
2015-09-15 10:06:36 -07:00
Debargha Mukherjee
0e1b4fb941 Fix two pass svc encoding
Fixes temporal scalability. Updates were inadvertently turned
off for two pass svc causing crashes due to gf_group.index
growing unchecked.

Change-Id: Iff759946bf61bbde70630347cc8fa4d51a8c2d2f
2015-09-15 06:11:24 -07:00
jackychen
419456617e Change parameters for VP9 dynamic resizing.
Use a smaller window in dynamic resizing and wait a shorter
time after key frame.

Change-Id: I086f840cdec3c6bdaa9acfe11346d919e445973d
2015-09-14 16:17:52 -07:00
Alex Converse
0b762e0c0c Merge "CR: Don't attempt to read qindex_delta for segments CR is unaware of." 2015-09-14 22:59:24 +00:00
Alex Converse
575e81f7c9 CR: Don't attempt to read qindex_delta for segments CR is unaware of.
Found by the remoting VideoEncoderVpxTest.Vp9LossyUnchangedFrame unit
test under asan.

Change-Id: Icac63051bf37c7355e661837b57c257d58c764fc
2015-09-14 13:55:30 -07:00
Marco
4d1424faf9 For 1 pass: always use the normative filter in vp9_scale_if_required()
The normative (convolve8) filter is optimized/faster than
the nonnormative one. Pass usage of scaler (normative/nonomorative)
to vp9_scale_if_required(), and always use normative one for 1 pass.

Change-Id: I2b71d9ff18b3c7499b058d1325a9554de993dd52
2015-09-14 13:13:32 -07:00
Marco
e8a4a3e2b1 Avoid scaling last_source, unless needed.
Save some encoding time, for the case of spatial layers
or under dynamic resizing mode.

Change-Id: If4a8eb6f0376c3d2dde8465fde6bfd86ab704920
2015-09-11 11:53:25 -07:00
Marco
6ddbc845cc Remove unneeded/incorrect comment.
Change-Id: I5c923223c284ad4fda0c45572a66bebc8528dd1d
2015-09-11 08:49:13 -07:00
Alex Converse
3d6b8a667f Prevent CR in screen mode from refreshing flat inter blocks forever.
Take the minimum last_codec_q_map on inter skip.

Change-Id: Ibb308526dd19793bb359f51ebd7b48d8692903fd
2015-09-10 15:03:13 -07:00