Commit Graph

687 Commits

Author SHA1 Message Date
Dmitry Kovalev
710ca1fe36 Merge changes I1868fb75,I9ff504c6
* changes:
  Renaming INTERPOLATIONFILTERTYPE to INTERPOLATION_TYPE.
  Adding VP9_FRAME_MARKER constant.
2013-10-24 10:08:19 -07:00
Yunqing Wang
93ec31dff6 Merge "Improve scale_factors struct" 2013-10-24 09:13:41 -07:00
Dmitry Kovalev
ad867fe237 Renaming INTERPOLATIONFILTERTYPE to INTERPOLATION_TYPE.
Change-Id: I1868fb75ed88bfa65c1c2ca24677d65f2894d713
2013-10-23 17:45:52 -07:00
Jingning Han
ae0e747d6a Merge "Use inter mode flag in super_block_yrd" 2013-10-23 13:52:05 -07:00
Jingning Han
f3b31380fa Use inter mode flag in super_block_yrd
Use a flag variable to determine if coded in inter mode, thus avoiding
multiple inter mode checks in super_block_yrd.

Change-Id: I0ef998b2811c38e185a2e0583f0f636cee45d2cf
2013-10-23 11:18:23 -07:00
Yunqing Wang
175c313a12 Improve scale_factors struct
The ref's scale_factors are set at frame level, and then copied for
each partition block. Since the struct members are mostly constant,
this patch separated the constant and non-constant members, and
reduced struct copying. This gave 0.5% ~ 1.4% decoder speed gain.

Change-Id: I94043bf5a6995c8042da52e5c661818dfa6f6d4c
2013-10-22 13:10:22 -07:00
Dmitry Kovalev
ec414372e8 Removing quantize_b_4x4 function pointer.
The pointer was asigned only once with vp9_regular_quantize_b_4x4, calling
this function directly now. Also removing unused declarations:
  prototype_quantize_block
  prototype_quantize_block_pair
  prototype_quantize_mb
  vp9_regular_quantize_b_4x4_pair
  vp9_regular_quantize_b_8x8

Change-Id: I14325bc2f082336820671eafbc06126651b79f73
2013-10-22 13:09:36 -07:00
Dmitry Kovalev
9f09618bd4 Merge "Using stride (# of elements) instead of pitch (bytes) in fdct4x4." 2013-10-22 13:05:24 -07:00
Dmitry Kovalev
fa57135b2c Merge "Removing NUM_ prefix from constant names." 2013-10-22 11:34:28 -07:00
Jingning Han
c807949408 Prevent left_block_mode stepping into left tile
This commit uses left_available flag to decide if the left mode_info
struct is available for left_block_mode. As discussed with James
Zern (jzern@), this prevents the codec from fetching mode_info from
blocks in the left tile, which although effectively not used might
present concerns for multi-threaded tile decoding.

This is NOT a bit-stream change.

Change-Id: I1dc8cf1bcbf056688eee27c7bc5706ac4b4e0125
2013-10-22 09:02:41 -07:00
Dmitry Kovalev
190c2b4591 Using stride (# of elements) instead of pitch (bytes) in fdct4x4.
Just making fdct consistent with iht/idct/fht functions which all use
stride (# of elements) as input argument.

Change-Id: I0ba3c52513a5fdd194f1e7e2901092671398985b
2013-10-21 15:27:35 -07:00
Dmitry Kovalev
1e05c9a7e6 Merge "Cleanup: using cm variable instead of cpi->common." 2013-10-21 14:30:01 -07:00
Jingning Han
deb10ac6f9 Merge "Make memory alloc in pick_mode_context bsize aware" 2013-10-21 11:45:59 -07:00
Dmitry Kovalev
a698e52926 Cleanup: using cm variable instead of cpi->common.
Change-Id: Iab334b5fd51dfa7e7f29963f8bdc62fd7355e56d
2013-10-21 11:10:11 -07:00
Dmitry Kovalev
d1b65c6bda Moving allow_high_precision_mv from MACROBLOCKD to VP9_COMMON.
This value is a global frame-level flag, not a macroblock-level.

Change-Id: Ie8c5790a931150741c2167c00c3e3dd2cf26744d
2013-10-21 10:12:14 -07:00
Dmitry Kovalev
6d2a0da7a7 Removing NUM_ prefix from constant names.
Renames for consistency with other constants:
  NUM_FRAME_TYPES -> FRAME_TYPES
  NUM_PARTITION_CONTEXTS -> PARTITION_CONTEXTS

Change-Id: I3db30acb2868eb0a424237c831087b2e264ec47f
2013-10-18 17:44:19 -07:00
Yaowu Xu
db1045f2c0 Merge "Use lookup table to simplify logic" 2013-10-18 12:55:24 -07:00
Jingning Han
72033fcff8 Make memory alloc in pick_mode_context bsize aware
This commit makes the buffer allocation of zcoeff_blk array in
pick_mode_context block size aware. It calculates the number of
4x4 blocks in the partition and assigns the memory space accordingly.
This process (and the uninitialization) is done once for each encoding
pass. It allows memory copy of smaller buffer when possible.

For football at 600kbps, the runtimes improve by about 1%:
speed 1, 45961ms -> 45472ms
speed 2, 23863ms -> 23598ms

Change-Id: Id2ca24906fa89f46fa5fe742ec4b8efc2a61f877
2013-10-18 12:42:44 -07:00
Yaowu Xu
30d1ec38a7 Use lookup table to simplify logic
In deciding the transform size for a given block in a given TX_MODE.

Change-Id: I1467da09853e69cd320695a24c04e19a2f3d04fb
2013-10-17 14:54:16 -07:00
Dmitry Kovalev
2726f383cd Adding allow_hp as an argument to mv search functions.
Making this change in order to move allow_high_precision_mv field
from MACROBLOCKD structure to VP9_COMMON (because it is a frame level
flag).

Change-Id: I1d006ba36d938e0caf4d40fa051e2e38df9c1108
2013-10-17 14:02:04 -07:00
Guillaume Martres
7fd2561d64 Merge changes I6226456d,I97925178,I766c4b74
* changes:
  Use a separate MODE_INFO stream for each tile column
  Get rid of "this_mi", use "mi_8x8[0]" everywhere instead
  Make the static_segmentation feature work again
2013-10-16 17:05:39 -07:00
Guillaume Martres
acf0d56f0b Get rid of "this_mi", use "mi_8x8[0]" everywhere instead
The only case where they were intentionally pointing to different
structures was in mbgraph, and this didn't have the expected behavior
because both of these pointers are used interchangeably through the code

Change-Id: I979251782f90885fe962305bcc845bc05907f80c
2013-10-16 16:24:03 -07:00
Dmitry Kovalev
9deb614a57 Adding get_band_translate() function.
Moving code that gets band_translate array from get_scan_and_band()
function to get_band_translate() function. Renaming get_scan_and_band() to
get_scan().

Change-Id: I43047c205a1ca2a6e24be44db39dc04b7a385008
2013-10-16 15:11:42 -07:00
Guillaume Martres
e55f60240a Implement variance-based adaptive quantization
This should be similar to what x264 does with --aq-mode 1.
It works well with clips like parkjoy and touhou
(http://x264.nl/developers/Dark_Shikari/LosslessTouhou.mkv).
At low bitrates, the segmentation signaling overhead may negate the
benefits of this feature.

(PGW) Default changed to feature OFF to allow provisional merge.
Change-Id: I938abf9bb487e1d4ad3b0264ea03d9826275c70b
2013-10-16 11:55:13 +01:00
Alexander Voronov
d6a59fb12c Updated encoder to handle intra-only frames
Updated the encoder to handle frames that are coded
intra-only. Intra-only frames must be non-showable,
that is, the "show frame" flag must be set to 0 in
the frame header.

Tested by forcing the ARF frames to be coded intra-
only.

Note: The rate control code will need to be modified
to account for intra-only frames better than they
are currently handled.

Change-Id: I6a9dd5337deddcecc599d3a44a7431909ed21079
2013-10-15 16:44:02 -07:00
Jingning Han
3f52cfa130 Merge "Re-design all-zero-coeff block index buffer use" 2013-10-15 16:23:38 -07:00
Jingning Han
8e3ce1a9e3 Re-design all-zero-coeff block index buffer use
Use the zcoeff_blk buffer of PICK_MODE_CONTEXT to store the indexes
of all-zero-coeff block of the current best mode. Remove the temporary
buffer best_zcoeff_blk defined in the rate-distortion optimization
loop. This improves the speed performance by about 0.5% in all speed
settings.

Change-Id: Ie3e15988ddfa581eafa2e19a8228d3fe4a46095c
2013-10-15 10:54:06 -07:00
Jingning Han
a0d8ec7b76 Merge "Move token_cache from cost_coeffs to MACROBLOCK" 2013-10-14 13:05:32 -07:00
Jingning Han
f60a3910c4 Move token_cache from cost_coeffs to MACROBLOCK
This commit moves token_cache buffer into macroblock struct, instead
of defining as a local variable in cost_coeffs. This avoids repeatedly
re-allocating memory space in the rate-distortion optimization loop.

The runtime at speed 0 reduces:
bus 2000kbps, 161692ms to 159951ms
football 600kbps, 229505ms to 225821ms

Change-Id: If7da6b0b6d8c5138a16271a33c4548fba33d8840
2013-10-14 10:45:56 -07:00
Dmitry Kovalev
107897cf05 Merge "Consistent names for inverse hybrid transforms (1 of 2)." 2013-10-11 15:33:00 -07:00
Deb Mukherjee
c222b96bfd Merge "Change in rddiv parameter to make it a power of 2" 2013-10-11 13:53:59 -07:00
Dmitry Kovalev
7ef573914d Consistent names for inverse hybrid transforms (1 of 2).
Renames:
  vp9_short_iht4x4_add     -> vp9_iht4x4_16_add
  vp9_short_iht8x8_add     -> vp9_iht8x8_64_add
  vp9_short_iht16x16_add_c -> vp9_iht16x16_256_add

Change-Id: Ibca7a188fd062b196787ac5efc1ea545e7f166c0
2013-10-11 13:31:32 -07:00
Deb Mukherjee
d9655e42b8 Change in rddiv parameter to make it a power of 2
Converts the constant rddiv parameter to 128 (from 100) and
implements RDCOST with bit-shift rather than multiplication.
Other parameters are also adjusted to roughly keep the same
balance between Rate and Distortion.

There is a slight speed-up of about 0.5-1% (at speed 0) as
testted on football_cif.

There is a slight change in performance due to small change
in the parameters.
derfraw300: +0.033%
stdhdraw250; +0.102%

Change-Id: I70ac69f58fa71c83108f68fe41796cd19d1fc760
2013-10-11 10:43:02 -07:00
Yaowu Xu
8b175679be Masking intra mode choice adaptively
The commit changes to mask available intra prediction modes for test
based on prediction block size.

With this patch, encoding time of CpuUsed 2 reduces from 10% to 20% for
HD clips with a compression drop of 0.2%

Change-Id: I65f320f1237c0f5ae3a355bf7caf447f55625455
2013-10-11 10:29:53 -07:00
Jingning Han
54e702b5d7 Merge "Restore mode skip feature in sub8x8 rd loop" 2013-10-11 09:21:06 -07:00
Yaowu Xu
e2d6e37a54 Merge "change to avoid out-of-range computation" 2013-10-10 13:38:16 -07:00
Jingning Han
09aca3089f Merge "Re-design rate-distortion cost tracking buffers" 2013-10-10 12:57:31 -07:00
Jingning Han
fc19243ced Re-design rate-distortion cost tracking buffers
This commit re-designs the per transformed block rate-distortion
costs tracking buffers. It removes redundant buffer usage, makes
the needed context memory allocation per VP9_COMP instance and
reuses the same buffer sets inside the rate-distortion optimization
search loop, thereby avoiding repeatedly requiring memory space.

It reduces speed 0 runtime:

bus at 2000 kbps from 166763ms to 158967ms,
football at 600 kbps from 246614ms to 234257ms.

Both about 5% speed-up. Local tests suggest about 2% to 5% speed-up
for speed 1 and 2 settings. This does not change compression
performance.

Change-Id: I363514c5276b5cf9a38c7251088ffc6ab7f9a4c3
2013-10-10 11:03:44 -07:00
Yaowu Xu
b47cef056e change to avoid out-of-range computation
Change-Id: Id5e31833a0ef40de9f64c2f5674af7083233bf14
2013-10-10 11:01:50 -07:00
Dmitry Kovalev
1e8fc24af8 Merge "Removing inv_txm4x4_1_add and inv_txm4x4_add function pointers." 2013-10-10 10:49:27 -07:00
Deb Mukherjee
2b055dfe3f Merge "Adjustment to mv cost parameters" 2013-10-10 09:08:58 -07:00
Jingning Han
be6ae20510 Merge "Fix intra dist model of skip_encode feature" 2013-10-10 09:00:20 -07:00
Deb Mukherjee
e4b0fce41c Adjustment to mv cost parameters
Increases these parameters.
There is a small efficiency gain.

Change-Id: Ie5f0ddb39c907d335e0dafa5eb112365a81f4542
derfraw300: +0.091%
stdhdraw250: +0.238%
2013-10-09 23:14:25 -07:00
Jingning Han
013db649fa Fix intra dist model of skip_encode feature
The intra mode distortion adjustment for skip_encode feature was
broken in the refactoring cc91851. This commit fixes it and tunes
the distortion models used therein.

Change-Id: I0d676e82f8e855536a90cf9b3e3fdefafcd886c6
2013-10-09 16:05:50 -07:00
Deb Mukherjee
d6aae4d456 Merge "Clean-ups in rdopt.c" 2013-10-09 12:10:20 -07:00
Deb Mukherjee
eb8b1cd764 Clean-ups in rdopt.c
Some minor cleanups in preparation for experimentation with
some encode parameters and thresholds

Change-Id: I449d66da97eae0a7acdf4aae374e2f9111342056
2013-10-09 11:32:03 -07:00
Jingning Han
03fe08ca30 Deprecate the use of PARTITION_INFO from encoder
Use b_mode_info to store the inter prediction mode of sub8x8 block,
in replacement of the use of partition_info. Remove redundant buffer
update for partition_info. For bus_cif at 2000 kbps, this seem to make
speed 0 about 1% faster.

Change-Id: Id1b3be45e75a24fb4b42335ac480c23e440978f6
2013-10-09 09:23:52 -07:00
Dmitry Kovalev
c983c966cb Removing inv_txm4x4_1_add and inv_txm4x4_add function pointers.
We already have itxm_add member in MACROBLOCKD structure. Both
inv_txm4x4_1_add and inv_txm4x4_add are just its special cases for
different eob values. But eob logic is already implemented in
vp9_iwht4x4_add and vp9_idct4x4_add (that's why also removing
inverse_transform_b_4x4_add).

Change-Id: I80bec9b6f7d40c5e5033c613faca5c819c3e6326
2013-10-08 11:27:56 -07:00
Dmitry Kovalev
8d3ef287a2 Merge "Removing redundant vp9_pt_energy_class declarations." 2013-10-08 10:54:48 -07:00
Jim Bankoski
08feefbe7b easy to fix cpplint issue in rdopt.c
Change-Id: Id093816146de0d100f0c6ae2542aaa427dbab2d8
2013-10-07 17:03:29 -07:00