Commit Graph

187 Commits

Author SHA1 Message Date
Dmitry Kovalev
b93fcec3b7 Adding get_bsize() function to vp9_firstpass.c.
Change-Id: I31373ad860eb554eb3b03e877e8fba580dc3de07
2014-01-24 18:10:02 -08:00
Yaowu Xu
e5034f65e5 Fixed integer overflow for large input video
The sum of squared mv components can go beyond int range for large
 input resolution. This commit changed the type to int64 to avoid
overflow.

Change-Id: Ib21ea2817845cea1435f893064e6417c79c5bc64
2014-01-24 11:34:41 -08:00
Dmitry Kovalev
9c0fbd573f Merge "Setup pre[0] buffer before calls to {first_pass, zz}_motion_search." 2014-01-24 11:15:01 -08:00
Adrian Grange
8b0537f631 Merge changes I24ad1f0f,I33be1366
* changes:
  Reorder functions to avoid forward declaration
  Rename set_scale_factors as set_ref_ptrs
2014-01-24 08:38:52 -08:00
Dmitry Kovalev
520496ba95 Cleaning up vp9_firstpass.c file.
Change-Id: Ic352b0429d5784f9d78872a478fe6275ee7a56a0
2014-01-23 12:36:19 -08:00
Dmitry Kovalev
7450275755 Setup pre[0] buffer before calls to {first_pass, zz}_motion_search.
Change-Id: I9b94e741201eacb1982014724a532bdaae31f130
2014-01-23 12:14:57 -08:00
Adrian Grange
e54e4b03db Reorder functions to avoid forward declaration
Change-Id: I24ad1f0f1cb0e991c476ea174db8ac1584929b02
2014-01-22 16:20:39 -08:00
Dmitry Kovalev
ed6bb10f0f Fixing simple_weight() function + cleanup.
We used y_width/y_height instead of y_crop_width/y_crop_height.

Change-Id: Ia796494956f16d7a4085e043d58bdfe6de19abe7
2014-01-22 08:57:13 -08:00
Dmitry Kovalev
2b6e0fe010 Merge "Cleaning up first_pass_motion_search() function." 2014-01-22 01:51:08 -08:00
Dmitry Kovalev
209a3ae4f4 Merge "Replacing cpi->twopass with twopass." 2014-01-21 23:01:27 -08:00
Yaowu Xu
dbae98082c Enforce key frame placement
Change-Id: I2f85c6b058638571d68a7209779de8ca8168934f
2014-01-21 14:08:43 -08:00
Alex Converse
2b3891d9da Fix key frames for one pass.
Set this_key_frame_forced flag and don't use kf_boost when not set.

Change-Id: Ibe66a82fa9219e60db358ddeb43d6471816c8b50
2014-01-16 13:04:51 -08:00
Dmitry Kovalev
a86a5b17e5 Replacing cpi->twopass with twopass.
Change-Id: I733a84ec178439ead66e031395d9a8e49e8f4d1a
2014-01-15 16:21:38 -08:00
Dmitry Kovalev
c37d54a93e Merge "Replacing cpi->rc with rc." 2014-01-15 16:04:05 -08:00
Yaowu Xu
293532f314 Merge "Add max burst bitrate control." 2014-01-15 14:40:59 -08:00
Dmitry Kovalev
b7465b3efb Replacing cpi->rc with rc.
Change-Id: I0fbb7615545861e26ebffe72bd44f3a0e8616df7
2014-01-15 12:46:18 -08:00
Dmitry Kovalev
efdbd29928 calculate_modified_err() cleanup.
Change-Id: Ia24c9b1ff2d51dd9cb133722a041a615e1b8419f
2014-01-15 12:23:16 -08:00
Dmitry Kovalev
0f008fbd2e Cleaning up first_pass_motion_search() function.
Change-Id: I4826a71c7f99db09e5362b16703d024939587f25
2014-01-14 18:07:23 -08:00
Dmitry Kovalev
382470db42 Merge "Removing unnecessary casts + cleanup." 2014-01-14 14:47:48 -08:00
Dmitry Kovalev
970e945795 Merge changes I8eda5762,Ia2ffca07
* changes:
  Removing unused switchable_interp_count[] field from VP9_COMP.
  Using clamp() function instead of the same raw code.
2014-01-14 14:46:07 -08:00
Dmitry Kovalev
518a934f43 Merge "Converting int_mv to MV." 2014-01-14 14:11:49 -08:00
Paul Wilkins
5c808ba13a Add max burst bitrate control.
Applies an upper limit on burst bitrate for any
frame. This is to insure that typical encodes for YT
do not produce frames that are so large that they
risk stalling HW implementations. Such frames
could also cause playback problems in SW.

For now the limit is set at 250 bits per MB for 1080P
and larger (with the 1080P limit used for smaller frames).

Setting maxQ, constant quality mode or targeting a
very high bandwidth will have precedence over this limit.

Change-Id: Ie6f776c38b06ac7cec043d034085f4b79ee46a38
2014-01-14 09:52:49 +00:00
Dmitry Kovalev
46a951c846 Using clamp() function instead of the same raw code.
Change-Id: Ia2ffca072f5391b277ce1a0c4e5b4ece9ffc6831
2014-01-13 16:27:50 -08:00
Dmitry Kovalev
887984479c Removing unnecessary casts + cleanup.
Change-Id: I7298087426977e36b61ecf493949e9412842254c
2014-01-13 13:04:05 -08:00
Dmitry Kovalev
2033ac49b4 Converting int_mv to MV.
Change-Id: Id31c0e100d275bd3650eaf5e4b8fe5ce648dbfaf
2014-01-13 11:21:07 -08:00
Yaowu Xu
31d3f43e18 fix a div by zero issue
Change-Id: I091dfaa0ed5b9672eedd46d6097469d0802e24ef
2014-01-13 10:44:32 -08:00
Paul Wilkins
a00dad39bd No arf right before real scene cut.
To reduce pulsing we now allow an arf just before forced key frames
and at the end of a clip or section (which may be stitched to
another clip or section). However, this does not make sense for
key frames arising from real scene cuts.

Change from original patch reflects other recent changes in regard
to alignment of gf/arf and kf groups.

Change-Id: I074a91d1207e9b3e28085af982f6718aa599775f
2014-01-13 11:35:02 +00:00
Paul Wilkins
603075fa04 Further rate control tweaks and fixes.
Further fixes regarding min and max rate.
Bug fixes re kf group bits and last kf group.

Change-Id: Iaafd719d30a489e135a3c55851ce8c632091a436
2014-01-13 11:34:34 +00:00
Marco Paniconi
21a0c1f38f Merge "Don't use gf_update by default for 1-pass CBR." 2014-01-10 11:43:20 -08:00
Marco Paniconi
c46538d45e Don't use gf_update by default for 1-pass CBR.
Change-Id: I5df6abceb0a2a69706feadeb820b593cae88f573
2014-01-10 10:40:12 -08:00
Deb Mukherjee
36c8daed58 Merge "Cleanups on refresh flags" 2014-01-09 17:38:45 -08:00
Deb Mukherjee
412e4954c1 Cleanups on refresh flags
Cleanups on frame refresh flags and external overrides.

Change-Id: Ia6a56fe1bde906b1dc3fcbf4ef1c7b207cd2df2d
2014-01-09 17:00:23 -08:00
Paul Wilkins
11569060f4 Merge "Fix rate allocation bug." 2014-01-09 03:00:15 -08:00
Dmitry Kovalev
feab7e1146 Merge "Using struct twopass_rc* instead of VP9_COMP*." 2014-01-08 14:14:05 -08:00
Deb Mukherjee
0d21d79bbc Merge "Further rate control cleanups" 2014-01-08 09:20:29 -08:00
Paul Wilkins
d7b49b28e6 Fix rate allocation bug.
Fix miss alignment of the frames contributing to the
error score and bit allocation for gf/arf groups.

Initial results slightly +.

Change-Id: Ie508bdcfdac52e592d48e1f13e01b3551b523deb
2014-01-08 15:30:13 +00:00
Deb Mukherjee
730ade414d Further rate control cleanups
Some cleanups on frames_to_key, frames_since_key.
Also removes the unused fixed_q parameters in vp9.

Change-Id: If8743a32c71de30a8d17136477b53d607a7acda8
2014-01-07 13:51:50 -08:00
Dmitry Kovalev
7b496783c2 Merge "Adding get_ref_frame_buffer() function." 2014-01-07 09:56:06 -08:00
Paul Wilkins
e4e58ac400 Merge "Clean up: unused function and variables" 2014-01-07 02:27:20 -08:00
Dmitry Kovalev
7919bf6afd Adding get_ref_frame_buffer() function.
Encapsulating direct references to lst_fb_idx, gld_fb_idx, alt_fb_idx.

Change-Id: I7e65ba3f131286e433e6651970c5647311fa4687
2014-01-06 14:50:54 -08:00
Dmitry Kovalev
b57b82b5d6 Using struct twopass_rc* instead of VP9_COMP*.
Change-Id: Id9ff7772aa3a3fb5d6cf94aff7dc9489bd964340
2014-01-06 12:46:23 -08:00
Deb Mukherjee
cf3d2c8d5a Corerctly sets frame type in the 2 pass case
This patch sets frame types correctly in the new
vp9_get_second_pass_params() function called prior
to encode_frame_to_data_rate() function, so that the
latter function can just work with what is passed to
it. This will allow multiple vp9_get_second_pass_params()
to be created for various encode strategies without
messing with the core encode function.

There is no difference in derf and yt. stdhd/hd are pending.

Change-Id: I70dfb97e9f497e9cee04052e0e8e0c2892eab0c3
2014-01-06 10:49:25 -08:00
Paul Wilkins
d7663edeba Clean up: unused function and variables
Remove adjust_maxq_qrange() and related variables.

Change-Id: I50d065f4619c499283e2680e31d0d99c22439dec
2014-01-06 11:26:02 +00:00
Paul Wilkins
bc27812c8b Merge "Modified Handling of min and max vbr rates." 2014-01-06 02:04:55 -08:00
Dmitry Kovalev
84520829ed Cleaning up get_prediction_decay_rate() function.
Change-Id: Ie8fcee21f41f91f94b4fa02f2a55691dea1734e3
2014-01-03 12:11:36 -08:00
Paul Wilkins
65ede3da45 Modified Handling of min and max vbr rates.
In two pass encodes bits are allocated to each frame
according to a modified error score for the frame as a
fraction of the modified error score for the clip or section.

Previously a minimum rate per frame was reserved and
subtracted from the bits allocatable by the two pass code.
The vbr max section rate was enforced by clipping the
actual number of bits allocated.

In this patch the min and max vbr rates are enforced
instead by clipping the modified error scores for each frame
rather than the number of bits allocated.

Small gains for all test sets (psnr and SSIM) ranging from
~ +0.05 for YT psnr up to ~ +0.25 for Std-hd SSIM.

Change-Id: Iae27d70bdd3944e3f0cceaf225bad2e8802833de
2014-01-03 14:56:08 +00:00
Paul Wilkins
17b2d63196 Merge "Adjust gf_group_error_left for arf groups." 2013-12-20 04:21:56 -08:00
Dmitry Kovalev
5bfd475104 Merge "Adding get_block_variance_fn() function." 2013-12-19 14:47:59 -08:00
Dmitry Kovalev
66ef9d1c20 Adding get_block_variance_fn() function.
Change-Id: I67d934b6af899ffd4bcad2d913a650685fa64abd
2013-12-19 14:07:03 -08:00
Deb Mukherjee
4dbad63a71 Begin refactor of frame schedule in rate control
Various cleanups and streamlining of interfaces as precursor
to further advancements in rate control.
Pre-encode parameter setting for different use cases:
One-pass, first of 2-pass, second of 2-pass, and Svc
are separated out.

There is no change in output with this change.

Change-Id: Ied8ca7d84d610993776aa30ef263fe20452e0e3e
2013-12-19 10:55:38 -08:00