Commit Graph

118 Commits

Author SHA1 Message Date
Marco Paniconi
02b8baf35e Avoid gf/altref boost in pick_q under svc cbr mode.
Change-Id: Ib719a9f74924718715592e0238bc391ae239d026
2014-03-03 19:11:02 -08:00
Dmitry Kovalev
4b7addcc10 Fixing include order in vp9_ratectrl.c.
Change-Id: Id1ec41275cc35565e522a1b2ac252ea3ec05638f
2014-02-27 15:35:38 -08:00
Dmitry Kovalev
8b33c64162 Merge "Using clamp() for active_{best, worst}_quality." 2014-02-26 09:20:14 -08:00
Dmitry Kovalev
8d80c262d1 Using clamp() for active_{best, worst}_quality.
Change-Id: Ia79f975f54829b8ae6b568ca5c05f4f1f541706f
2014-02-25 18:01:49 -08:00
Deb Mukherjee
10bae82510 Adds variance based fixed size partitioning
Adds a method for determining a fixed size partition based on
variance of a 64x64 SB. This method is added to rtc speed 6.
Also fixes a bug in rtc_use_partition() and includes some
refactoring related to partitioning search, and some cosmetics.

Currently compared to speed 5, the coding efficiency of speed 6
is -19% and that of speed 7 is -55%, in cbr mode.

Change-Id: I057e04125a8b765906bb7d4bf7a36d1e575de7c6
2014-02-25 12:20:59 -08:00
Adrian Grange
9b9c33a2b8 Remove comment from calls to vp9_clear_system_state.
Removed the comment "// __asm emms;" from all calls
to vp9_clear_system_state.

Change-Id: Ib4dae69c1cdf3f185b04184a870cd70c4d703f10
2014-02-18 15:43:42 -08:00
Deb Mukherjee
12ae6eaf21 Enforce max-intra-pct in one-pass cbr mode
This was inadvertently left out in a previous refactoring step.

Change-Id: Idf3350e95152f876a1a1a4591dd30c8981856c96
2014-02-14 14:27:02 -08:00
Jim Bankoski
fb4f10a26e vp9_ratectrl - convert buffers to int64 to avoid casting
Change-Id: Ifd6b2d36d91237b5f38853a3a8a529d8be38ba09
2014-02-14 07:36:47 -08:00
Marco Paniconi
e590e087d5 Fix target frame size setting, for 1pass cbr.
Only use layered average size if number_temporal_layers > 1.

Also removed unneeded commented-out line, and change some parameter
setting in vpx_temporal_scalable_patterns.c

Change-Id: Ic86e43e7daf0313e8c5a4aba1497299158111955
2014-02-13 15:21:09 -08:00
Jim Bankoski
7336dfe2ae Merge "static analysis warning in vp9_ratectrl.c" 2014-02-13 06:20:35 -08:00
Jim Bankoski
eb5889f882 static analysis warning in vp9_ratectrl.c
Change-Id: I8aa3dd068d9a7225b3e8b24392a7b4a54b9435dd
2014-02-12 11:54:53 -08:00
Deb Mukherjee
cf479baa03 Merge "Removes active_worst_quality feedback" 2014-02-12 09:20:31 -08:00
Deb Mukherjee
d23e339202 Removes active_worst_quality feedback
Removes certain cases of feedback of active_worst_quality,
and removes it from the RATE_CONTROL structure. Now active
worst quality is expected to be computed locally in the
q picking function during the encode.
Making temporal filter strength depend on avg_frame_qindex
rather than on active_worst_quality actually improves
performance esp. for yt.
derf: +0.038%
yt: +0.359%

Change-Id: I1fe5a343034b55af9322289165321f00ac0827b1
2014-02-11 16:59:56 -08:00
Jingning Han
220e9a932e Merge "Use more meaningful names for speed features" 2014-02-11 08:49:35 -08:00
Jingning Han
734938dc6b Use more meaningful names for speed features
Use frame_parameter_update to precisely describe the functionality.

Change-Id: Ia9a55ba8efef7b987e30d949dd00ac716189bdb9
2014-02-10 15:20:11 -08:00
Deb Mukherjee
15fb5510a8 Further one-pass vbr rate control changes
Some parameter changes and fixes on one-pass rate control.
derfraw300 is now only 10% below 2-pass speed 0 rate control.

Change-Id: I1940eef8a5a035dc18e71b880d5e00cabd1f01b9
2014-02-10 14:27:19 -08:00
Marco Paniconi
812bacc919 Some updates and fixes for layered CBR mode.
-Properly set the average frame size for each layer.

-Allow each layer to update its average/last Q stats after encoding.

-Initialize for some layer context variables.

Change-Id: Iaa37d144fcf4f30ff4283a4e8db8b9ca8bf4c815
2014-02-10 10:21:20 -08:00
Dmitry Kovalev
0865e0d532 Cleaning up vp9_ratectl.c.
Change-Id: I13738ef1f307cc5f563126bc7a92beaa01fde3bd
2014-02-07 15:01:32 -08:00
Deb Mukherjee
b2209c3346 Parameter fixes for one-pass non-cbr mode
Fixes some of the parameters for 1-pass non-cbr mode.
Also includes some cleanups, inlcuding refactoring of the
recode_loop options.

Results on derfraw300 improve by about 5-6%, so that the one-pass
mode is now 13% below the 2-pass mode in speed 0.

Change-Id: I844cc2638694c7574f3be00d41d60b23dc1016f0
2014-02-06 13:49:52 -08:00
Marco Paniconi
4864ab21b0 Layer based rate control for CBR mode.
This patch adds a buffer-based rate control for temporal layers,
under CBR mode.

Added vpx_temporal_scalable_patters.c encoder for testing temporal
layers, for both vp9 and vp8 (replaces the old vp8_scalable_patterns).

Updated datarate unittest with tests for temporal layer rate-targeting.

Change-Id: I8900a854288b9354d9c697cfeb0243a9fd6790b1
2014-02-06 09:24:45 -08:00
Dmitry Kovalev
6432ae4902 Merge "Clamping active_{best, worst}_quality values." 2014-02-05 15:53:00 -08:00
Deb Mukherjee
40e63d4b51 One-pass rate control cleanups/fixes/refactoring
Inlcudes a number cleanups:
1. Moves the one-pass pre-encode parameter setting functions
to vp9_ratectrl.c
2. Deprecates per_frame_bandwidth in RATE_CONTROL structure
3. Removes target_bandwidth in cpi structure since it is not used.
4. Various renaming of functions

There is no bit-stream change in 2-pass, one-pass cbr and one-pass
vbr modes.

Change-Id: Ifd9916bf4d485b7d04c5f52044ffe6703254ccbd
2014-02-05 11:22:15 -08:00
Deb Mukherjee
35ee7f5f4b One-pass rate control fixes and cleanups
Fixes rate control partially in one-pass non-cbr case to achieve a
bitrate close to the one desired. Previous version was way off at
the high bitrate end.

Also includes several one-pass rate control cleanups and refactoring.

On derfraw300, one-pass encoding is now 19% off from two-pass speed
0 encoding, down from 35%.

Change-Id: I6f0dcdb7f8aa85a7e7cd3a3155d4f9d2a4d2f4f4
2014-02-04 10:51:27 -08:00
James Zern
ef951d1919 vp9/encoder: fix function prototypes
silences warnings about declarations not matching prototype

Change-Id: I30b9a24f78ebe3b9cc2bbfcd3a7363ba7c328e4d
2014-01-31 20:45:36 -08:00
Deb Mukherjee
50bf8fd4f5 Enables alt-ref frames in one pass mode
Includes a few fixes and clean-ups that adds the ability
to use alt-ref frames in one-pass mode.
Whether alt-refs are actually used or not is controlled by a
macro USE_ALTREF_FOR_ONE_PASS in vp9_firstpass.c.

This first cut seems to improve derf by 15+% in 1-pass mode.
But further experiments with parameters are underway.

Change-Id: I78254421435478003367c788c7930d2dc4ee2816
2014-01-29 11:04:52 -08:00
Dmitry Kovalev
aaa43ed383 Clamping active_{best, worst}_quality values.
Change-Id: If370f83080b403e417716d1edad58fdaa2b90170
2014-01-27 12:58:31 -08:00
Dmitry Kovalev
4bc1877b71 Cleaning up vp9_ratectl.c file.
Change-Id: I8cfa5d5eb2c1bbacd9b604cc5dc0a2cd2e5cebb8
2014-01-24 11:14:05 -08:00
Dmitry Kovalev
3cdcb2f567 Simplifying target_size_from_buffer_level() function.
Change-Id: I1d556ddf04ab0a98eadf412972a6977c1055446f
2014-01-22 02:24:01 -08:00
Dmitry Kovalev
6031abeb38 Cleaning up vp9_ratectrl.c.
Change-Id: I3a260d3ca68db3a9352ae5409de76e56202976e5
2014-01-17 17:43:04 -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
8f0d213494 Merge "Cleaning up reatectrl.c file." 2014-01-15 16:26:09 -08:00
Yaowu Xu
293532f314 Merge "Add max burst bitrate control." 2014-01-15 14:40:59 -08:00
Deb Mukherjee
1699d6bd53 Minor fix on an assert
Fixes assert that fails occasionally on small values of
max-key frame intervals. Also, adds a small change on
updating frames_to_key for frame drops.

Change-Id: Icc2b33b25e3e4ced7e49f8db73e0a887ef9c99e0
2014-01-14 12:51:13 -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
d2c1e8a5a5 Cleaning up reatectrl.c file.
Adding temp variable for &cpi->rc.

Change-Id: Id9a658659354c12e1940532ff85311ce89071b2f
2014-01-10 17:44:33 -08:00
Dmitry Kovalev
447eece329 Cleaning up vp9_rc_postencode_update() function.
Change-Id: I02e44c10660fdb9201a802ad19ceb64756feeebe
2014-01-10 10:44:20 -08:00
Dmitry Kovalev
ed364b2114 Merge "Adding {get, set}_rate_correction_factor() functions." 2014-01-10 10:30:04 -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
Dmitry Kovalev
c01fe86ccc Adding {get, set}_rate_correction_factor() functions.
Change-Id: Ib3212832953a3445fc5f021af0e1de7886f09b4f
2014-01-08 17:40:35 -08:00
Deb Mukherjee
0d21d79bbc Merge "Further rate control cleanups" 2014-01-08 09:20:29 -08: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
Marco Paniconi
3817c7c732 Code cleanup: remove unneeded lines.
Change-Id: I44a89b822a436299b9dd4ff26ad2e35767c29c58
2014-01-06 16:04:48 -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
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
Marco Paniconi
1b8b8b0d0d Updates for 1-pass CBR rate control.
Adjustments based on buffer level, frame dropper.

Change-Id: Iaa85b570493526a60c4b9fb7ded4c0226b1b3a33
2013-12-18 09:24:24 -08:00
Deb Mukherjee
1e59cbf23b Rate control changes on active_worst_quality
Various cleanups and refactoring.
Removes feedback of active worst qaulity and uses last_q
instead to make the interface cleaner. Active worst quality
is now decided only once for a frame being coded in the
beginning based on last_q and other stats. Also, adds other
cleaups on last_q to store also the last_q for altref frames,
and reduces the altref interval a little.

The output does change a little.
derfraw300: +0.224% (global psnr)
stdhdraw250: +0.442% (global psnr)

Change-Id: Ie634cdc032697044c472dd0fe79c109b3e7f9767
2013-12-16 17:08:16 -08:00
Dmitry Kovalev
8eac2ca840 Merge "Renaming constants." 2013-12-06 09:55:02 -08:00
Deb Mukherjee
52d273674b Further rate control cleanups
Includes various cleanups.
Streamlines the interfaces so that all rate control state
updates happen in the vp9_rc_postencode_update() function.
This will hopefully make it easier to support multiple
rate control schemes.
Removes some unnecessary code, which in rare cases can casue
a difference in the constrained quality mode output, but
other than that there is no bitstream change yet.

Change-Id: I3198cc37249932feea1e3691c0b2650e7b0c22fc
2013-12-05 16:31:04 -08:00
Dmitry Kovalev
0d4b8d7e43 Renaming constants.
NUM_YV12_BUFFERS        => FRAME_BUFFERS
ALLOWED_REFS_PER_FRAME  => REFS_PER_FRAME
NUM_REF_FRAMES_LOG2     => REF_FRAMES_LOG2
NUM_REF_FRAMES          => REF_FRAMES
NUM_FRAME_CONTEXTS_LOG2 => FRAME_CONTEXTS_LOG2
NUM_FRAME_CONTEXTS      => FRAME_CONTEXTS

Change-Id: I4e1ada08f25d8fa30fdf03aebe1b1c9df0f87e63
2013-12-05 16:23:09 -08:00
Deb Mukherjee
e924057d80 Fixing inadvertent change
Fixes an inadvertant change made in a previous patch while doing
some experiments.

Change-Id: I9961f2157c803676491a3d6daf056ff8a37367b3
2013-11-27 14:50:34 -08:00