Commit Graph

202 Commits

Author SHA1 Message Date
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
Dmitry Kovalev
dce41c013b Cleaning up vp9_firstpass.c.
Change-Id: I111d6d1ea5ee641780abc096341369a37627aaae
2014-02-05 15:11:12 -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
Dmitry Kovalev
8d7cd8e75c Merge "Removing unused estimate_cq() function." 2014-02-04 16:57:57 -08:00
Dmitry Kovalev
e829487371 Removing unused estimate_cq() function.
Change-Id: If3a1af1a54f3a3c0d9c966fdc0721981070c7f28
2014-02-04 13:11:25 -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
Jim Bankoski
37e5325b9f Merge "static function convert to inline or global vp9_blockd.h" 2014-01-31 20:16:37 -08:00
Adrian Grange
61142301ac Merge "Typo & comment corrections" 2014-01-31 19:51:44 -08:00
Jim Bankoski
9dec7712ab static function convert to inline or global vp9_blockd.h
Change-Id: Ifdd951f24932839f06d1c700371662511dde6ebe
2014-01-31 19:50:40 -08:00
Dmitry Kovalev
1ee4916794 Cleaning up vp9_get_second_pass_params() function.
Change-Id: Ie7b295190d8def447408e575ea0f3fa3c7eb7dd2
2014-01-31 16:49:33 -08:00
Adrian Grange
908482cb3a Typo & comment corrections
Change-Id: I64569afe61a2679afdd263d3e226a89b9f73cc61
2014-01-31 16:02:48 -08:00
Adrian Grange
284e793d5a Add constant to represent minimum KF boost
Added a constant to represent the minimum KF boost
rather than using the magic number 2000 in the code.

Change-Id: I9428b61f47d26312caff81c6f9ae8587df004791
2014-01-31 07:52:09 -08:00
Deb Mukherjee
56200336d1 Merge "Enables alt-ref frames in one pass mode" 2014-01-29 13:37:30 -08:00
Dmitry Kovalev
b496d141af Cleaning up vp9_firstpass.c.
Change-Id: Ic2ff6405f01fd43d07c5ee3b5e374909401115cc
2014-01-29 11:26:09 -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
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