Commit Graph

1050 Commits

Author SHA1 Message Date
Dmitry Kovalev
88340b173b Merge "Combining fb_idx_ref_cnt[] and yv12_fb[] arrays." 2014-01-31 15:55:04 -08:00
Yaowu Xu
6a4e2ddabc Properly merge two different real time modes
--rt --cpu-used=-5 uses the progressive rtc mode
--rt --cpu-used=-6 uses the new super fast rtc mode

Change-Id: Id6469ca996100cdf794a0e42d76430161f22f976
2014-01-31 15:07:51 -08:00
Alex Converse
e78c174e54 Cleanup block_rd_txfm.
* Avoid unnecessary type erasure
* Prune unused/duplicate fields from struct rdcost_block_args
* Make struct rdcost_block_args a local

Change-Id: I4f1fd4837ccd028bbfe727191ee8d69f0463b7e5
2014-01-31 12:13:18 -08:00
Jim Bankoski
da6b18622f remove confusing compressor_speed
use mode instead

Change-Id: I419d7a2dc4b0714ca6ff723c5e824521c150c460
2014-01-31 07:55:19 -08:00
Yaowu Xu
96dc80da61 Merge "create super fast rtc mode" 2014-01-29 16:36:20 -08:00
Dmitry Kovalev
6332063475 Combining fb_idx_ref_cnt[] and yv12_fb[] arrays.
Adding new RefCntBuffer struct which contains reference counter and image
buffer.

Change-Id: I71c1f532faa13442c32c43fc03ec45b6f88fb844
2014-01-29 12:48:01 -08:00
Dmitry Kovalev
b00eb5c464 Finally removing vp9_setup_interp_filters() function.
Change-Id: If446225afbb49f6033c2a4516a37c377de6f70f7
2014-01-29 11:29:34 -08:00
Jim Bankoski
ea8aaf15b5 create super fast rtc mode
This patch only works if the video is a width and height that are both
a multiple of 32..   It sets every partition to 16x16, and does INTRADC
only on the first frame and ZEROMV on every other frame.   It always does
does the largest possible transform, and loop filter level is set to 4.

Was ~20% faster than speed -5 of vp8

Now 20% slower but adds motion search ( every block ), nearest, near
and zeromv

The SVC test was changed because - while this realtime mode produces
bad quality albeit quickly, it isn't obeying all the rules it should
about which frames are available.

Change-Id: I235c0b22573957986d41497dfb84568ec1dec8c7
2014-01-29 08:39:39 -08:00
Jim Bankoski
d9201cb109 Merge "Reintroduce modelling for some speeds" 2014-01-28 15:12:03 -08:00
Jim Bankoski
79af185891 Reintroduce modelling for some speeds
Change-Id: Ia8fa3961eec34545465018281dc022bc6f73869a
2014-01-28 13:51:06 -08:00
Dmitry Kovalev
b098c04290 Merge "Decoupling set_ref_ptrs() and vp9_setup_interp_filters()." 2014-01-28 10:37:58 -08:00
Yaowu Xu
1fecc5bd2e Merge "Added a speed feature" 2014-01-28 10:28:54 -08:00
Dmitry Kovalev
e5b31a1d8c Decoupling set_ref_ptrs() and vp9_setup_interp_filters().
Change-Id: I8d17867a4772554cbba2bd113cc5b4c99d50146d
2014-01-27 16:00:20 -08:00
Dmitry Kovalev
8691565441 Removing subpix_fn_table struct.
We don't use different filter kernels for x and y, it is always one kernel
for both directions.

Change-Id: Iefcbb02ec74bf46ea20d9dca672a3efd5d631517
2014-01-24 17:06:26 -08:00
Dmitry Kovalev
f9f936b82f Merge "Renaming INTERPOLATION_TYPE to INTERP_FILTER." 2014-01-24 16:52:10 -08:00
Yaowu Xu
a0b9b050b8 Added a speed feature
That force the stop of subpel search possibly at full/half/quater pel
stages

Change-Id: Ie50c500417bd78e1a53e6620bd4c2b85f63d9c67
2014-01-24 16:40:36 -08:00
Dmitry Kovalev
4264c93844 Renaming INTERPOLATION_TYPE to INTERP_FILTER.
Corresponding renames:
  subpel_kernel              => interp_kernel
  vp9_get_filter_kernel()    => vp9_get_interp_kernel()
  pred_filter_type           => pred_interp_filter
  adaptive_pred_filter_type  => adaptive_pred_interp_filter
  mcomp_filter_type          => interp_filter
  read_interp_filter_type()  => read_interp_filter()
  write_interp_filter_type() => write_interp_filter()
  fix_mcomp_filter_type()    => fix_interp_filter()

Change-Id: I1fa61fa1dc81ebbf043457c3ee2d8d4515bee6d3
2014-01-24 15:57:28 -08:00
Yaowu Xu
8971338c6b change to avoid IOC
SSE for a 64x64 block with 3 planes can go as high as 3*2^28. So left
shift by 4 may overflow 32 bit int.

Change-Id: I63c84aa56894788bb987299badabbd7cc6fd0be6
2014-01-24 12:49:44 -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
e4755db40b Removing get_scale_ref_frame_idx() function + cleanup.
Change-Id: Ic9472f361f8749a165aa464c2fa859681b66381b
2014-01-22 17:10:37 -08:00
Adrian Grange
e37eb0ade7 Rename set_scale_factors as set_ref_ptrs
New name better describes what the function does.

Change-Id: I33be1366a81f058a9854b804bcde211061187dc7
2014-01-22 13:04:30 -08:00
Adrian Grange
82f6af6009 Tidy up comments & remove commented out code.
Change-Id: I46dd5ce06f36362c6274511cd1531d93926aa9bc
2014-01-22 09:59:01 -08:00
Dmitry Kovalev
ef9f7446be Cleaning up vp9_setup_buffer_inter() function.
Change-Id: Ia63e2d05fa5dca3fb67788b0f1f28e9802ef27dd
2014-01-21 19:46:07 -08:00
Jim Bankoski
3fa1356994 remove complex rd modeling.
The affect on quality was minimal.  Less than .1%, various sets
yt ( +.15%), derf (-.1%), hd ( -.1% ), std hd(-.15%)...

The affect on speed of encode at speed -5 was substantial ( ~3% ).

Change-Id: I8903346fbae0c35f5b9ea20f81fdd239ae81247d
2014-01-21 09:59:49 -08:00
Jingning Han
2f52decd22 Inter-frame non-RD mode decision
This commit setups a test framework for real-time coding. It enables
a light motion search for non-RD mode decision purpose.

Change-Id: I8bec656331539e963c2b685a70e43e0ae32a6e9d
2014-01-16 12:35:04 -08:00
Jim Bankoski
ae5b96d355 Merge "As you go mbmi->skip_coeff" 2014-01-15 12:20:14 -08:00
Dmitry Kovalev
69b684279c Merge "Cleaning up vp9_rdopt.c." 2014-01-15 00:00:33 -08:00
Jim Bankoski
73cd22f8d4 As you go mbmi->skip_coeff
Calculate the skip_coeff as part of the encode process, rather than
checking the eobs after the fact with another pass.

Change-Id: Ib41b139e96a97dee30e4b993b4cc53d86337128d
2014-01-14 17:58:25 -08:00
Dmitry Kovalev
433e5ea0e8 Fixing invalid block width/height calculation.
Change-Id: Ieaeb53902ce0ffd5b1b27a92583e98abfa791433
2014-01-14 17:53:32 -08:00
Dmitry Kovalev
70fe826d26 Cleaning up vp9_rdopt.c.
Change-Id: I5200bf68b43578eaadc4ea47b37f2633fa96d7bd
2014-01-14 17:46:14 -08:00
Dmitry Kovalev
518a934f43 Merge "Converting int_mv to MV." 2014-01-14 14:11:49 -08:00
Dmitry Kovalev
dd31f2e4ae Merge "Adding mv_has_subpel() function." 2014-01-13 12:00:51 -08:00
Dmitry Kovalev
2033ac49b4 Converting int_mv to MV.
Change-Id: Id31c0e100d275bd3650eaf5e4b8fe5ce648dbfaf
2014-01-13 11:21:07 -08:00
Dmitry Kovalev
b02c72b5d9 Adding mv_has_subpel() function.
Change-Id: I50922bb1a689f8515debaa018f850b231c21189f
2014-01-13 10:57:56 -08:00
Jingning Han
29736b889b Merge "Declare setup_buffer_inter in vp9_rdopt.h" 2014-01-10 16:01:07 -08:00
Jingning Han
4f969ccc1b Merge "Enable skipping reference frame check in rd loop" 2014-01-10 16:00:56 -08:00
Jingning Han
db2b350d33 Declare setup_buffer_inter in vp9_rdopt.h
This funtion initializes buffer pointers and first stage motion vector
prediction. It will be needed by both regular rate-distortion
optimization loop and the non-RD mode decision. Hence move its
declaration in vp9_rdopt.h

Change-Id: I64e8b6316c9d05f20756a62721533a2e4d158235
2014-01-10 13:52:40 -08:00
Jingning Han
d66c748635 Enable skipping reference frame check in rd loop
This commit allows encoder to compare the SAD cost associated with
the best motion vector predictor, per frame. If one reference frame
has this cost more than 4 times of the best SAD cost given by other
reference frames, skip NEARESTMV, NEARMV, ZEROMV mode check of this
reference frame.

This setting is turned on in speed 2 and above. Compression quality
change in speed 2:
derf  -0.014%
yt    -0.097%
hd    -0.023%
stdhd  0.046%

It reduces the speed 2 runtime of test sequences:
pedestrian_area_1080p 4000 kbps 310763 ms -> 303595 ms
bluesky_1080p 6000 kbps         259852 ms -> 251920 ms

Change-Id: I7f59cf79503d51836d61d56d50dc5bdf0e502e22
2014-01-09 18:25:53 -08:00
Johann
719dadf3ef Use the correct member for initialization
On Windows this fails with:
error C2440: 'initializing': cannot convert from int_mv to uint32_t

Change-Id: I51630efd0e83a0ce620c91aa7859dd6fc1572e99
2014-01-08 19:31:24 -08:00
Alex Converse
22d83a0ab7 Merge "Replace RD modeling with a fixed point approximation." 2014-01-08 11:06:54 -08:00
Alex Converse
f2ca665f1c Replace RD modeling with a fixed point approximation.
Change-Id: I44eb44eb3f36c05d916ef140ef42cc84f72f99ec
2014-01-08 10:37:24 -08:00
Jingning Han
06e4f825af Fix an issue in motion vector prediction stage
The previous implementation stops motion vector prediction test when
the zero motion vector appears for the second time. This commit fixes
it by simply skipping the second time check on zero mv and continuing
on to next mv candidate.

It slightly improves stdhd in speed 2 by 0.06% on average. Most static
sequences are not affected. A few hard ones, like jet, ped, and riverbed
were improved by 0.1 - 0.2%.

Change-Id: Ia8d4e2ffb7136669e8ad1fb24ea6e8fdd6b9a3c1
2014-01-07 10:18:04 -08:00
Dmitry Kovalev
16f5607dfe Merge "Adding new_mv local variable." 2014-01-07 09:56:41 -08:00
Dmitry Kovalev
7b496783c2 Merge "Adding get_ref_frame_buffer() function." 2014-01-07 09:56:06 -08:00
Dmitry Kovalev
b3af2f87b0 Merge "Removing unused mvp_fill manipulation code." 2014-01-07 09:54:05 -08:00
Jingning Han
656166ea81 Merge "Remove avoid_frame_with_high_error from RD loop" 2014-01-07 09:31:17 -08:00
Dmitry Kovalev
6a7a7341ee Removing unused mvp_fill manipulation code.
The code can be removed because mvp_full will be overridden after that.

Change-Id: I89559b1b6914c86bcd02b7359d37241948ac11d3
2014-01-06 18:07:12 -08:00
Dmitry Kovalev
c015ba5f6e Adding new_mv local variable.
Change-Id: I9631b35810c232c134f39dc0edadb1b3860a45ae
2014-01-06 17:58:01 -08:00
Dmitry Kovalev
abe4940d64 Replacing &cpi->common with cm.
Change-Id: Ic5bf5682ccdb8d2fbad6bba0d7db19a4f47b62a1
2014-01-06 17:29:16 -08:00
Dmitry Kovalev
a224b0dded Merge "Combining ref_frame and second_ref_frame into ref_frames[2]." 2014-01-06 15:02:31 -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
bbb25e6a39 Merge "Adding RefBuffer struct." 2014-01-06 14:19:44 -08:00
Jingning Han
393a8ccef9 Remove avoid_frame_with_high_error from RD loop
The feature undergoes prior assumption that the recursive partition
size search from 4x4 to 64x64, hence utilizing information from small
blocks to determine early termination in large block rate-distortion
optimization search. The current codebase is now going from top down.
The previous function might go with not properly initialized values,
hence removed.

Tested on pedestrian_area_1080p at 4000 kbps running under speed 2.
No visible difference in runtime observed.

Change-Id: I553df415c6191413762db7ae34e8790c71d8118e
2014-01-06 13:34:07 -08:00
Dmitry Kovalev
6b150c2884 Combining ref_frame and second_ref_frame into ref_frames[2].
Change-Id: I007d66a1cb1b44751dcceafbaa64649ed9a34562
2014-01-06 12:24:37 -08:00
Dmitry Kovalev
6e8c103620 Merge "Replacing int_mv with MV." 2014-01-03 17:38:28 -08:00
Dmitry Kovalev
ba41e9d459 Adding RefBuffer struct.
Adding RefBuffer to simplify reference buffer management. The struct has a
pointer to image data and scale factors relative to the current frame.

Change-Id: If38eb1491ff687cc11428aee339f3e052e2c5d9e
2014-01-03 15:21:55 -08:00
Dmitry Kovalev
672c355a26 Replacing int_mv with MV.
Change-Id: Ifd432fa3741ba47102d298e0b348eb00f5a9ce53
2014-01-03 11:48:07 -08:00
Dmitry Kovalev
5b04962cf4 Merging best_ref_mv and second_best_ref_mv into best_ref_mv[2].
Change-Id: If04b57828847cee09a79c94e1098d1aa4990ea0d
2014-01-03 11:31:00 -08:00
Jingning Han
cdc933ca00 Merge "Adaptive motion control on ref and search range" 2013-12-27 15:04:16 -08:00
Jingning Han
a4ce53f14d Adaptive motion control on ref and search range
This commit takes a preliminary attempt to refine the motion search
control. It detects the SAD associated with mv predictor per reference
frame, and based on which to determine whether the encoder wants to
reduce the motion search range (if the predicted mv provides fairly
small SAD), or to skip the current reference frame (if there exists
another ref frame that gives much smaller SAD cost).

This feature is turned on in the settings of speed 1 and above.

In speed 1, compression performance changed
derf  -0.018%
yt    -0.043%
hd    -0.045%
stdhd -0.281%

speed-up
pedestrian_area_1080p at 4000 kbps 100 frames
199651ms -> 188846ms (5.5% speed-up)
blue_sky_1080p at 6000 kbps
443531ms -> 415239ms (6.3% speed-up)

In speed 2, compression performance changed
derf  -0.026%
yt    -0.090%
hd    -0.055%
stdhd -0.210%

speed-up
pedstrian 113949ms -> 108855ms (4.5% speed-up)
blue_sky  271057ms -> 257322ms (5% speed-up)

Change-Id: I1b74ea28278c94fea329d971d706d573983d810d
2013-12-27 12:43:06 -08:00
Dmitry Kovalev
1e8b5bf4ac Merge "Removing vp9_findnearmv.{h, c} files." 2013-12-26 13:38:38 -08:00
Dmitry Kovalev
b3b9f4a4d0 Merge "Using single struct to represent scale factors." 2013-12-20 11:22:02 -08:00
Jingning Han
243327f43c Store the SSE of prediction residuals
Buffer the SSE of prediction residuals in the rate-distortion
optimization loop of a given block. This information would be used
for later encoding control.

Change-Id: If4e63f3462490513c48be9407d3327c8dd438367
2013-12-19 18:45:28 -08:00
Dmitry Kovalev
987810ad95 Removing vp9_findnearmv.{h, c} files.
Moving all code from that files to vp9_mvref_common.{h, c}.

Change-Id: Ibc4afcb8cea6847166ff411130e93611ebe63b20
2013-12-19 17:39:57 -08:00
Dmitry Kovalev
a3fbcc88bb Using single struct to represent scale factors.
Moving back to scale_factors struct. We don't need anymore x_offset_q4 and
y_offset_q4 because both values are calculated locally inside vp9_scale_mv
function.

Change-Id: I78a2122ba253c428a14558bda0e78ece738d2b5b
2013-12-19 16:06:33 -08:00
Dmitry Kovalev
c872d2be65 Call set_scaled_offsets() just before scale_mv() call.
Before mv scaling it is required to calculate x_offset_q4/y_offset_q4
by calling set_scaled_offsets(). Now offset configuration can not be
missed because it happens just before scale_mv().

Change-Id: I7dd1a85b85811a6cc67c46c9b01e6ccbbb06ce3a
2013-12-19 14:55:13 -08:00
Jingning Han
d8557a052c Make rd_pred_filter update consistent in all bsizes
This commit reworks the prediction filter rate-distortion cost update
process consistent for all block sizes.

Change-Id: I5874349ab38df380240f96c2d4ef924072bab68d
2013-12-18 11:54:31 -08:00
Jingning Han
07a28c77e3 Merge "Fix rd_filter_cache update in sub8x8 RD loop" 2013-12-16 17:57:02 -08:00
Jingning Han
ef838c349c Merge "Remove redefinition in handle_inter_mode" 2013-12-16 17:56:41 -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
3755be94ed Merge "Using MV struct instead of int_mv union in encoder (2)." 2013-12-16 16:56:07 -08:00
Jingning Han
75cfadbd1f Fix rd_filter_cache update in sub8x8 RD loop
Properly handle the rd_filter_cache update, when early termination
or skip prediction filter type check is triggered.

Change-Id: Ie7b9a75fed3358f45ffd15817f2b36670c14eb2d
2013-12-16 14:52:20 -08:00
hkuang
fb53409d2a Merge "Remove border extension in intra frame prediction." 2013-12-16 14:48:54 -08:00
hkuang
25e5552630 Remove border extension in intra frame prediction.
Change-Id: Id677df4d3dbbed6fdf7319ca6464f19cf32c8176
2013-12-16 14:05:58 -08:00
Dmitry Kovalev
095b03231c Using MV struct instead of int_mv union in encoder (2).
Change-Id: I068345f722a7116e3119927295ad23a28d3066a0
2013-12-13 17:20:40 -08:00
Dmitry Kovalev
64cf398713 Merge "Using MV struct instead of int_mv union in encoder." 2013-12-13 16:42:54 -08:00
Dmitry Kovalev
f54b515797 Merge "Cleaning up vp9_append_sub8x8_mvs_for_idx()." 2013-12-13 15:38:53 -08:00
Dmitry Kovalev
25da21b14e Using MV struct instead of int_mv union in encoder.
Change-Id: I8b81a3e4b4fa530a654c28d9c136afa0c1d379fd
2013-12-13 15:24:48 -08:00
Jingning Han
84acc988eb Remove redefinition in handle_inter_mode
Change-Id: I44513b9db6d42e2c52723e1a429f06a93d300c8b
2013-12-13 13:38:05 -08:00
James Zern
3aa75bcef6 Merge "vp9 asserts: fix compile warning" 2013-12-13 12:41:31 -08:00
Jingning Han
2f9d118f21 Merge "Remove some dead code" 2013-12-13 11:10:39 -08:00
James Zern
178db94cd6 vp9 asserts: fix compile warning
string literal to int within an assert

Change-Id: I0c889256b67a078e6e2a79577f0b7ae084243258
2013-12-12 19:49:19 -08:00
Jingning Han
3b5a90bd86 Enable adaptive pred filter type for sub8x8
This commit enables an adaptive prediction filter type selection
for sub8x8 block sizes. In speed 1, it re-uses the filter type of
collocated 8x8 block if it is tested in the rate-distortion optimization
loop, for the sub8x8 blocks. Otherwise, it runs the normal test
over all the three filter types. In speed 2, it re-uses the 8x8
block's prediction filter type, if available. Otherwise, force it
to be EIGHTTAP.

Compression and speed performance wise:
speed 1
derf -0.266%
yt   -0.138%

bus at 2000 kbps: 33766ms -> 30451ms (10% speed-up)
football at 600 kbps: 48173ms -> 43786ms (9% speed-up)

speed 2
derf -0.026%
yt   +0.134%

bus at 2000 kbps: 18973ms -> 17698ms (6% speed-up)
football at 600 kbps: 26748ms -> 25096ms (6% speed-up)

Change-Id: I77e097533b969fd3472147225fa79fc98095d342
2013-12-12 17:54:34 -08:00
Jingning Han
9d6e7ce12d Rename clamp_mv_min_max to set_mv_search_range
This function sets the motion search range limit. Rename it to be
more informative.

Change-Id: I2e8e01073dcb99c9bea9c9acd0a61d672d615444
2013-12-11 14:00:08 -08:00
Jingning Han
cf83dfb283 Merge "Enforce motion search range clamp for sub8x8" 2013-12-11 13:51:32 -08:00
Jingning Han
a67e654b6c Enforce motion search range clamp for sub8x8
This commit constrains the maximal motion search range for sub8x8
blocks to be [-1023, 1023], in the unit of full pixel.

Change-Id: I955b60649364ab410f2453cafd46a496f2fcb43e
2013-12-11 10:59:27 -08:00
Dmitry Kovalev
098d13ba10 Cleaning up vp9_append_sub8x8_mvs_for_idx().
Replacing if-else with switch statement, reordering function arguments.

Change-Id: I4825d2ef311ba8999b6d4ceb0eef003587a13434
2013-12-10 17:56:53 -08:00
Dmitry Kovalev
2dd20e468a Cleaning up skip context calculation.
Renames:
  vp9_get_pred_context_mbskip => vp9_get_skip_context
  vp9_get_pred_prob_mbskip    => vp9_get_skip_prob

Change-Id: I2af499848ef73f3f5cd8cdb27852d0bcdfe31d09
2013-12-10 14:11:26 -08:00
Dmitry Kovalev
e18eb7721e Merge "Renaming comp_pred_mode to reference_mode." 2013-12-10 10:52:34 -08:00
Dmitry Kovalev
08c48ddc01 Renaming comp_pred_mode to reference_mode.
Change-Id: I83ffed2b1878a35ac35f07f9ee74309adc9c7b11
2013-12-09 15:13:34 -08:00
Dmitry Kovalev
2c3120274a Removing max_uv_txsize_lookup lookup table.
Adding get_uv_tx_size_impl() with tx size selection logic, rewriting
get_uv_tx_size().

Change-Id: I3ecb108059a41be227a8c89a0710bd174f508951
2013-12-09 14:03:23 -08:00
Dmitry Kovalev
a19d694f09 Merge "Removing BLOCK_TYPES and adding PLANE_TYPES constant instead." 2013-12-07 02:20:41 -08:00
Alex Converse
1c3e04bb94 Remove some dead code
Change-Id: I0953a3b28758811f9d6a85787850e77592bd7670
2013-12-06 21:21:04 -08:00
Dmitry Kovalev
b6e5bb27c9 Merge "Renaming reference mode context calculation function." 2013-12-06 14:22:47 -08:00
Dmitry Kovalev
52618d28e1 Replacing b_width_log2 with num_4x4_blocks_wide_lookup.
Change-Id: I8ab9bbe2595ed1743f35223b6a6ce6d023b9a20e
2013-12-06 12:04:06 -08:00
Dmitry Kovalev
63963f51ef Renaming reference mode context calculation function.
Renames:
  vp9_get_pred_context_comp_inter_inter => vp9_get_reference_mode_context
  vp9_get_pred_prob_comp_inter_inter    => vp9_get_reference_mode_prob

Change-Id: I3bbb69481e6b0c848028667c9269f567f293d3bd
2013-12-06 11:23:01 -08:00
Dmitry Kovalev
d6b159d4a6 Removing BLOCK_TYPES and adding PLANE_TYPES constant instead.
Change-Id: Ic3bb862e93aedf6a489a33ea6f7e5097d96855ee
2013-12-06 10:54:00 -08:00
Dmitry Kovalev
5be34ba80f Merge "vp9_get_pred_context_intra_inter() clean up." 2013-12-06 09:14:36 -08:00
Jingning Han
ee02f3fbed Merge "Remove redundant bsize mapping in motion search" 2013-12-06 08:57:58 -08:00
Dmitry Kovalev
377fa8aff8 Renaming PREV_COEF_CONTEXTS to COEFF_CONTEXTS.
Also adding BAND_COEFF_CONTEXTS macro to simplify for loop logic.

Change-Id: I12a78a49cf1addf81e6b3fe2a3736ec2b79bd79e
2013-12-05 17:08:06 -08:00
Dmitry Kovalev
6fd71e1b09 vp9_get_pred_context_intra_inter() clean up.
Renaming:
 vp9_get_pred_context_intra_inter => vp9_get_intra_inter_context
 vp9_get_pred_prob_intra_inter    => vp9_get_intra_inter_prob

Change-Id: I2c1affea2e84f4e616137c6df82adb11c7845781
2013-12-05 17:01:03 -08:00
Jingning Han
45aa6f15b0 Remove redundant bsize mapping in motion search
Both single frame and compound inter motion search run with luma
component only. Hence removing the block size mapping therein.

Change-Id: I217488e702432ae9fa0e95bf6f516ebb36b5c79b
2013-12-04 17:25:06 -08:00
Dmitry Kovalev
3712b58c2f Merge "Cleaning up vp9_entropy.h file." 2013-12-04 16:46:41 -08:00
Dmitry Kovalev
f00d157c12 Moving eob array to the encoder.
In the decoder we don't need to save eobs, we can pass eob as an argument.
That's why removing eob arrays from VP9Decompressor and TileWorkerData,
and moving eob pointer from macroblockd_plane to macroblock_plane.

Change-Id: I8eb919acc837acfb3abdd8319af63d1bbca8217a
2013-12-03 17:59:32 -08:00
Dmitry Kovalev
8e89e2f2e0 Cleaning up vp9_entropy.h file.
Renaming constants for consistency:
  DCT_VAL_CATEGORY1 => CATEGORY1_TOKEN
  DCT_VAL_CATEGORY2 => CATEGORY2_TOKEN
  DCT_VAL_CATEGORY3 => CATEGORY3_TOKEN
  DCT_VAL_CATEGORY4 => CATEGORY4_TOKEN
  DCT_VAL_CATEGORY5 => CATEGORY5_TOKEN
  DCT_VAL_CATEGORY6 => CATEGORY6_TOKEN
  DCT_EOB_TOKEN     => EOB_TOKEN
  DCT_EOB_MODEL_TOKEN => EOB_MODEL_TOKEN
  MAX_ENTROPY_TOKENS => ENTROPY_TOKENS

Moving constants:
  INTER_MODE_CONTEXTS from vp9_entropy.h to vp9_blockd.h.
  EOSB_TOKEN from vp9_entropy.h to vp9_tokenize.h

Change-Id: I5fcbf081318e1d365792b6d290a930c6cb0f3fc2
2013-12-03 17:23:03 -08:00
Alex Converse
f63c75de84 Merge "Remove plane_block_idx." 2013-12-03 10:51:13 -08:00
Paul Wilkins
8a4310b160 Merge "Fix use_uv_intra_estimate in rd loop" 2013-12-03 04:30:50 -08:00
Alex Converse
2360a5f093 Remove plane_block_idx.
Its last remaining caller can be passed its results directly without any
additional work. Also, it's not non-4:2:0 safe.

Change-Id: Ia5089ba5f7f66c7617270483c619c9271aefd868
2013-12-02 18:33:50 -08:00
Jingning Han
9f81a50c85 Fix use_uv_intra_estimate in rd loop
This commit fixes the use of uv_intra_estimate by properly restoring
the mode_info struct required by rd_pick_intra_sbuv_mode.

Change-Id: I6a156d79533c4e2e60dfd3b8c5bb0a42a8eca280
2013-12-02 17:30:41 -08:00
Dmitry Kovalev
526a774adb Merge "Moving reaster_block_offset{,_int16} from vp9_blockd.h to vp9_rdopt.h." 2013-12-02 10:31:31 -08:00
Yaowu Xu
e237b7dea3 Merge "Simplify super_block_yrd()" 2013-12-02 09:39:42 -08:00
Yaowu Xu
56d9a4fcd5 Merge "Merge tx selection into RD calculation" 2013-12-02 09:39:10 -08:00
Dmitry Kovalev
d83d61d942 Moving reaster_block_offset{,_int16} from vp9_blockd.h to vp9_rdopt.h.
Change-Id: I5a5888d4639cc6b7eb266be47581dd15ba08c91e
2013-11-27 12:57:21 -08:00
Dmitry Kovalev
e2f1d02eb3 Merge "Moving mode encodings from common to encoder + cleanup." 2013-11-27 11:00:54 -08:00
Dmitry Kovalev
d3a2e55af4 Removing qcoeff buffers from the decoder.
We only need qcoeff buffers in the encoder. Reducing TileWorkerData struct
and VP9Decompressor struct sizes by 24K.

Change-Id: Id148868461f7ffa3d3dd634b371503ae9c57e207
2013-11-26 18:52:10 -08:00
Yaowu Xu
971112f965 Simplify super_block_yrd()
Change-Id: Iae16644faeed920e69cd5d1db71e2e1e4bda241c
2013-11-26 17:05:56 -08:00
Dmitry Kovalev
f4bf712fbb Moving mode encodings from common to encoder + cleanup.
Change-Id: I248ccb1532e2cd95314d0b95108f2c2e71cf084f
2013-11-26 14:53:17 -08:00
Yaowu Xu
08d6fa6de4 Merge tx selection into RD calculation
Change-Id: I406021e34b31b899202a99b39d3da4fa06ebee69
2013-11-26 12:37:25 -08:00
Dmitry Kovalev
204ff1c868 Removing vp9_modecosts.{c, h} files.
Renaming vp9_init_mode_costs() to fill_mode_costs() and moving it to
vp9_rdopt.c.

Change-Id: Ib2542d216458f6dced9f4b7ccbdd2cd98176aa5a
2013-11-25 12:44:05 -08:00
Dmitry Kovalev
3e72277272 Merge "Adding select_tx_size() function." 2013-11-25 10:59:56 -08:00
Dmitry Kovalev
e8af3db88a Merge "Renaming COMPPREDMODE_TYPE enum and its members." 2013-11-25 10:59:08 -08:00
Guillaume Martres
87375e257b Rename block_yrd_txfm to block_rd_txfm
This function is also used with the U and V planes.

Change-Id: Ib6beae0438790bfb690b3a2bda9c5c8b0e89a9b8
2013-11-25 01:18:51 +01:00
Dmitry Kovalev
fb9c19c62d Renaming COMPPREDMODE_TYPE enum and its members.
List of renames:
  COMPPREDMODE_TYPE      => REFERENCE_MODE
  SINGLE_PREDICTION_ONLY => SINGLE_REFERENCE
  COMP_PREDICTION_ONLY   => COMPOUND_REFERENCE
  HYBRID_PREDICTION      => REFERENCE_MODE_SELECT (like TX_MODE_SELECT)
  NB_PREDICTION_TYPES    => REFERENCE_MODES

Change-Id: If723dabe9435325d0165dcd028142a2c78b417b4
2013-11-22 16:35:37 -08:00
Dmitry Kovalev
350731e8f9 Organizing all scan tables into lookup table.
Change-Id: Ie829ee58a55157e6972c63cebe69a5d0a3221349
2013-11-22 16:20:45 -08:00
Dmitry Kovalev
ad3333e2cd Merge "Removing plane_block_{width, height} functions." 2013-11-21 16:37:27 -08:00
Dmitry Kovalev
485682c30a Adding select_tx_size() function.
Change-Id: I9d18b31661a2ccdcd4e25956882c7fc2d4b7002e
2013-11-21 15:55:40 -08:00
Dmitry Kovalev
79b5a2b142 Removing plane_block_{width, height} functions.
Change-Id: I29c0dfcf41a1253d5e2a0d2ff740c0c38ebaa5a2
2013-11-20 12:39:29 -08:00
Dmitry Kovalev
1a69eed2c4 Using is_inter_block() and has_second_ref() functions.
Change-Id: Iadd771a33c8874f3b774923bca4da3c8fe5429ee
2013-11-20 12:08:10 -08:00
Jingning Han
82c32fe1b5 Use restore_dst_buf in handle_inter_mode
There are many places in handle_inter_mode that need to restore the
dst buffer pointers, due to buffer pointer swap and early rd search
breakout. This commit wraps these operations into an inline function
for clean-up.

Change-Id: I0462e8c41c8bc3cd8db07395489cac03d8e5be54
2013-11-19 15:33:16 -08:00
Dmitry Kovalev
953b1e9683 Removing raster_block_offset_uint8() function.
There is no need to use that function, it is much clear to pass offset
directly to the buffer.

Change-Id: I9026cb0c5094c46f97df5d7f7daeb952f2843b24
2013-11-18 19:00:49 -08:00
Yaowu Xu
e63aaf9ad1 Fixed a bug in commit a4a5a210
Commit a4a5a210 enabled lossless coding, but the commit incorrectly
disabled the usage of skip in encoder even when skip should be used.
This commit make sure that skip is enabled even in lossless mode.

Change-Id: I276954f952c6ac68f17a316ebc72f09001228a08
2013-11-18 14:51:04 -08:00
Dmitry Kovalev
5380739a87 Removing vp9_encodeintra.{h, c} files.
There was only one function in *.c file, so moving it to vp9_encodemb.c.

Change-Id: I728859d08b3d6c05c33c1c5b21f0ea1d0e0f83af
2013-11-15 12:17:16 -08:00
Jingning Han
b6b9143218 Dual buffer encoding for intra modes
Overall change (using dual buffer scheme for superblocks of both inter
and intra modes) reduces speed 2 runtime:
bluesky_1080p at 6000kbps:   263553ms -> 257441ms
riverbed_1080p at 8000kbps:  233230ms -> 225308ms.

Change-Id: Idf8d70f768a4b0d97b2a8506372c57b7b4022119
2013-11-13 12:57:03 -08:00
Dmitry Kovalev
3f3d14e1d3 Moving q_index from MACROBLOCKD to MACROBLOCK.
Moving because q_index is used only by encoder.

Change-Id: I0b96175614ed4fd3d76ee56a0ba36258e1e896f6
2013-11-12 18:13:19 -08:00
Jingning Han
e69461593d Merge "Enable dual buffer rd search and encoding scheme" 2013-11-12 18:11:41 -08:00
Dmitry Kovalev
73a5cbeba4 Merge "Using max_tx_size instead of bsize when possible." 2013-11-12 16:54:30 -08:00
Dmitry Kovalev
3a2ea76469 Merge "Moving {sb, mb, b, ab}_index from MACROBLOCKD to MACROBLOCK." 2013-11-12 15:59:28 -08:00
Jingning Han
34b6abefa2 Enable dual buffer rd search and encoding scheme
This commit enables the dual buffer rate-distortion optimization
and encoding scheme. It stacks the original transform coefficients,
quantized levels, and reconstructed coefficients, in the rate-
distortion optimization search process, hence eliminates the need
to re-run residual generation, forward transform, and quantization
in the encoding stage.

Change-Id: I011bfad3a59a380a869ee552e91dae0394ec492e
2013-11-11 18:32:55 -08:00
Jingning Han
e5741c56d1 Merge "Allocate dual buffer sets for encoding" 2013-11-11 18:00:57 -08:00
Dmitry Kovalev
4e39d530f0 Merge "Cleaning up joint_motion_search function." 2013-11-11 16:34:39 -08:00
Jingning Han
3b3aea6834 Allocate dual buffer sets for encoding
Allocate memory space of dual buffer sets that store the coeff, qcoeff,
dqcoeff, and eobs. Connect the pointers of macroblock_plane and
macroblockd_plane to the actual buffer in use accordingly.

Change-Id: I2f0b5f482ca879fae39095013eaf8901db20a5a4
2013-11-11 16:24:39 -08:00
Dmitry Kovalev
14f2cf1757 Cleaning up joint_motion_search function.
Change-Id: I70a0878b23bda0ac3ff8733b4c96d5c636bc551c
2013-11-11 16:04:02 -08:00
Dmitry Kovalev
3551e25099 Moving {sb, mb, b, ab}_index from MACROBLOCKD to MACROBLOCK.
We use {sb, mb, b, ab}_index only inside encoder, so moving them into
appropriate data structure.

Change-Id: Ib5c1036716354d9d321e11a60c1634c1cb8f9716
2013-11-11 15:58:57 -08:00
Dmitry Kovalev
c53a9c70fb Merge "Localizing NEARESTMV special cases in the code." 2013-11-11 11:12:06 -08:00
Yaowu Xu
a4a5a210cb Disable zeroblock forcing for lossless coding mode
This to make sure that prediction residue always get coded in lossless
mode.

This commit also fixed lossless unit test

Change-Id: I537726ee55328d4e4cf0a0196393a67e12bfcde1
2013-11-08 10:32:44 -08:00
Dmitry Kovalev
4a96e64dc2 Using max_tx_size instead of bsize when possible.
Change-Id: I246364bc4270ca13aefb4bc3445bcf102b3170dc
2013-11-05 17:36:43 -08:00
Dmitry Kovalev
815189613b Localizing NEARESTMV special cases in the code.
Removing special case handling from vp9_tree_probs_from_distribution(),
tree_merge_probs(), and vp9_tokens_from_tree_offset() functions. Replacing
inter_mode_offset() function with macro INTER_OFFSET which is used now for
vp9_inter_mode_tree definition.

Change-Id: Iff75a1499d460beb949ece543389c8754deaf178
2013-11-05 11:58:57 -08:00
Jingning Han
f3efb9903c Merge "Fix the use case of plane_block_idx in sub8x8 RD" 2013-11-05 09:27:05 -08:00
Jingning Han
4fc8320f4c Merge "Avoid mv cost check for invalid mv values" 2013-11-05 09:01:05 -08:00
Jingning Han
c2217f2238 Avoid mv cost check for invalid mv values
The compound inter prediction could potentially run with initial
motion vectors of invalid value and check the mv_cost, which triggers
overheap read. This commit resolves this issue by forcing a motion
vector value check for compound inter modes of both superblock and
sub8x8 block sizes.

Change-Id: I4f4fc19ce83c8272782bc382f12c82a3f03212fc
2013-11-04 19:01:42 -08:00
Dmitry Kovalev
dde8069e57 Splitting partition_probs array into two arrays.
We only update partition_probs for inter frames but they are constant
for key frames. It is not necessary to have constants inside frame
context and copy them every time. This change reduces FRAME_CONTEXT size
by at least 48 bytes.


Change-Id: If70a53be51043f37fe7d113853217937710932a7
2013-11-04 14:26:16 -08:00
Jingning Han
4efa6a0176 Fix the use case of plane_block_idx in sub8x8 RD
This commit fixes the use case of plane_block_idx, which determines
the plane (Y/U/V) index based on block index. When block idx >= 4 in
sub8x8 block loop, it should be of chroma components.

Change-Id: I072705aa7b35445524ac607089ca8ce54b7ba478
2013-11-03 11:19:33 -08:00
Jingning Han
2de7cbe980 Add second ref frame check back in rdcost hist
Update best_inter_rd and best_inter_ref_frame only in single ref
frame case.

Change-Id: Id56825b231a62d6852bd83811410c05a7569f715
2013-11-03 09:15:41 -08:00
Dmitry Kovalev
0e1756330b Merge "Removing is_intra_mode() function." 2013-10-31 18:06:53 -07:00
Yunqing Wang
d03b3cbdd7 Merge "Fix x_offset_q4/y_offset_q4 calculation" 2013-10-31 09:47:54 -07:00
Jingning Han
a2a5c6f821 Merge "Enable all-zero coeff block index for sub8x8 blk" 2013-10-30 16:00:57 -07:00
Dmitry Kovalev
6761872e49 Replacing (SWITCHABLE_FILTERS + 1) with SWITCHABLE_FILTER_CONTEXTS.
Change-Id: I9781a62bc1a4cd9176554d1271d87dbcafda9cb0
2013-10-30 14:40:34 -07:00
Jingning Han
8c8381d543 Enable all-zero coeff block index for sub8x8 blk
This commit makes zcoeff_blk cache the case where the entire block
is quantized to be zero (without applying zero-forcing) in the rate-
distortion optimization loop, and skip the forward DCT, quantization,
inverse DCT, and reconstruction process in the encode_block stage.

It now works for all the block sizes, including sub8x8 blocks.

Change-Id: I5ae60a9c436ba3637d11666733554bec4580ef98
2013-10-30 14:01:06 -07:00
Yunqing Wang
9ed2d0a577 Fix x_offset_q4/y_offset_q4 calculation
"<< SUBPEL_BITS" needs to be added in the calculation. Call
set_scaled_offsets() to calculate x_offset_q4 and y_offset_q4.

Change-Id: Ied130ea771510e918f51cd1dc3abe57f4c0962b5
2013-10-29 17:46:55 -07:00
Dmitry Kovalev
e6dcf2aeb6 Fixing wrongly initialized tx_type variable.
Wrong value was used in get_tx_type_4x4() function, so making
initialization before that call.

Change-Id: Ief30bb1e0c03b2f23d993bbf9ae18d7150ba9a83
2013-10-29 12:18:53 -07:00
Dmitry Kovalev
aa76cd1e49 Removing is_intra_mode() function.
It is enough to check just block type: intra or inter. Intra block implies
intra prediction mode, and inter block implies inter mode.

Change-Id: I3cf98731a3935f670a3cd8e2b2443483eb944be4
2013-10-28 20:00:55 -07:00
Dmitry Kovalev
8253532c2d Cleaning up vp9_regular_quantize_b_4x4.
Passing scan & iscan as parameters, adding useful local variables.

Change-Id: Ia2a87906941db9557350d273669ce5c3cdb7235d
2013-10-28 14:28:28 -07:00
James Zern
58a0f6dbdd vp9: add TileInfo
replaces use of cur_tile_mi_(row|col)_(start|end) by VP9_COMMON, making
it less stateful and more reusable for parallel tile decoding

Change-Id: I1df09382b4567a0e5f4434825d47c79afe2399be
2013-10-28 20:54:43 +01:00
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
Jingning Han
c8f481fa3d Restore mode skip feature in sub8x8 rd loop
This commit restores the mode skip feature in the sub8x8 rd loop.

Change-Id: I5496ee32053f572b8961b549e9ecd4f1360824de
2013-10-07 14:20:34 -07:00
Dmitry Kovalev
23cc1cd8e6 Removing redundant vp9_pt_energy_class declarations.
Declaring vp9_pt_energy_class in vp9_entropy.h instead of many external
places.

Change-Id: I66e8a3fc119a43f88d130d0dae4133c825a047a3
2013-10-07 14:11:01 -07:00
Dmitry Kovalev
272adbbec4 Using inter_mode_offset_function instead of duplicated code.
Change-Id: I8de865cd1deca07b5c92c225782f0867367e9a11
2013-10-07 13:18:46 -07:00
Jingning Han
1ab60f7bfb Merge "Remove redundant second_ref_frame check in sub8x8" 2013-10-04 09:04:11 -07:00
Paul Wilkins
8abd92f12f Remove mode_skip_start and mask code for sub 8x8
This code serves no purpose in the re-factored sub 8x8 code.

Change-Id: I5364986224d1a28b71bcb046ec8557a3d14aaa47
2013-10-04 14:26:17 +01:00
Dmitry Kovalev
d975804e9a Merge "Replacing duplicated code with get_scan_and_band call." 2013-10-03 18:58:40 -07:00
Dmitry Kovalev
8b34437522 Replacing duplicated code with get_scan_and_band call.
Change-Id: I2cc3684f416a63dc99b9303109f9850f34a470d5
2013-10-03 17:46:28 -07:00
Jingning Han
2952b7d1fb Remove redundant second_ref_frame check in sub8x8
This commit removes the redundant second reference frame check in
the rate-distortion optimization loop for sub8x8 blocks.

Change-Id: I13a57a6f624c4a9bcef02ff2a867fa30d8b44a93
2013-10-03 14:02:12 -07:00
Jingning Han
b9daef91d8 Use vp9_zero in sub8x8 RD optimiazion loop
Change-Id: Ic23a705e48cadaa7151f2bd8536d56636cb973e3
2013-10-03 12:34:25 -07:00
Jingning Han
4093192ec9 Change b_mode_info definition from union to struct
This commit defines b_mode_info as a struct type. This will allow
us to further remove the use of PARTITION_INFO in the encoding process.

Change-Id: I975b0f7d557b5e0f66545a61b472def76b671cce
2013-10-03 12:34:11 -07:00
Jingning Han
793c2d8429 Remove unused variables in inter_mode rd loops
Remove redundant variable definition/use in rate-distortion search
loop for regular and sub8x8 blocks, respectively.

Change-Id: Ic0eb3660bb6851ba2eb8d702ba9fd11595000d01
2013-10-03 12:34:11 -07:00
Jingning Han
a55625873f Merge "Refactor inter mode rate-distortion search" 2013-10-03 12:19:53 -07:00
Jingning Han
11abab356e Refactor inter mode rate-distortion search
This commit separates the rate-distortion optimization loop of
superblocks from that of sub8x8 blocks. This allows better design
rate-distortion optimization search loop for each setting. It also
removes the use of SPLITMV and I4X4_PRED therein.

No performance change in speed 0 settings. For bus@CIF at 2000kbps,
the speed 1 runtime goes from 48009ms to 43894ms (about 10% faster).
The overall compression performance on derf changed by -0.021%.

Speed 2 runtime goes from 27114ms to 28700ms (6% slower), while the
overall coding efficiency goes up by 1.629% for derf, 1.236% for yt.

Change-Id: Ie6bdfa0a370148dd60bd800961077f7e97e67dd4
2013-10-03 11:36:49 -07:00
Dmitry Kovalev
9250d1529c Using vp9_zero instead of vpx_memset.
Change-Id: I9a0d0e9c3459954aa7b9c68f92cc5d56385ebd18
2013-10-03 10:59:36 -07:00
Paul Wilkins
6253cc9279 Speed setting review.
Substantial reworking of the speed vs quality trade offs for
speed 1 and 2.

In this patch I am attempting to freeze the "quality" meaning of
speeds 1 and 2 relative to speed 0 so that in future we can
better evaluate progress.

I am targeting :
Speed 1 quality ~-5% vs speed 0.
Speed 2 quality ~-10% vs speed 0

It is inevitable that quality will still fluctuate a little as we adjust
settings and add new features, but we will attempt to keep as
close as possible to these values. Above speed 2 things will remain
a bit more fluid for now.

In this patch speed 1 is approximately 4-5x as fast as speed 0. This
is similar to before but the quality hit is a lot less. Likewise speed 2
is approximately 2x as fast as speed 1 but is similar in quality to the
previous speed 1 configuration.

Also slight change to behavior of FLAG_EARLY_TERMINATE to insure
all reference frames get at least one rd test. Important for very low
variance regions.

WIP :- Added a new speed level with old speed 4 becoming speed 5.
Speed 3 and 4 tradeoffs still WIP

Change-Id: Ic7a38dd7b5b63ab1501f9352411972f480ac6264
2013-10-03 10:23:28 +01:00
Dmitry Kovalev
b927620231 Merge "Using is_inter_block and has_second_ref functions." 2013-09-29 12:14:41 -07:00
Dmitry Kovalev
29815ca729 Merge "Moving from int_mv* to MV* (3)." 2013-09-29 12:13:16 -07:00
Dmitry Kovalev
7343681675 Merge "Removing vp9_get_coef_neighbors_handle function." 2013-09-29 12:01:36 -07:00
Dmitry Kovalev
209c6cbf8f Removing vp9_get_coef_neighbors_handle function.
Change-Id: I6be72c8b048d1ccc7ef43764cf84c32360098970
2013-09-27 14:11:13 -07:00
Guillaume Martres
2b426969c3 Simplify RDMULT and RDDIV derivation
Don't divide RDMULT and RDDIV by 100 when RDMULT > 1000. This was
probably done to avoid overflow when the rd cost was stored in a 32 bits
integer but this is not the case anymore. This change will make it easier
to support multiple quantizers per frame.

derf compression gain at speed 0: 0.037%

Change-Id: Ibeeb9b7cfa1a132a7af41bc90fc07a3bba0857f6
2013-09-26 13:55:16 -07:00
Dmitry Kovalev
eda4e24c0d Using is_inter_block and has_second_ref functions.
Change-Id: I60dee58a4fd24d3c4f3c101a49d30e217309f43a
2013-09-25 19:03:04 -07:00
Dmitry Kovalev
8266da1cd1 Moving from int_mv* to MV* (3).
Change-Id: I9795d0937bc07793c13d067281995e0750f694d9
2013-09-25 16:44:19 -07:00
Dmitry Kovalev
f9e2140cab Merge "Moving from int_mv* to MV* (2)." 2013-09-25 16:12:13 -07:00
Dmitry Kovalev
2b5670238b Merge "Replacing txfm with tx." 2013-09-25 15:57:56 -07:00
Dmitry Kovalev
d445945a84 Adding vp9_get_entropy_contexts function.
Change-Id: Ife0dd29fb4ad65c7e12ac5f1db8cea4ed81de488
2013-09-24 17:26:05 -07:00
Dmitry Kovalev
d0365c4a2c Replacing txfm with tx.
Renaming txfm_stepdown_count to tx_stepdown_count and max_txfm_size to
max_tx_size.

Change-Id: Ifc173e22c78240e561a57c4c741b64b1b8fc6fef
2013-09-24 17:24:35 -07:00
Dmitry Kovalev
b87696ac37 Moving from int_mv* to MV* (2).
Updating fractional_mv_step_fp and fractional_mv_step_comp_fp function
types.

Change-Id: I601c4378bc39ac3ffd4e295d9cbd8e1f74829d46
2013-09-24 12:48:12 -07:00
Dmitry Kovalev
30888742f4 Merge "Moving from int_mv to MV." 2013-09-24 12:25:56 -07:00
Yaowu Xu
71cfaaa689 Merge "Replace memcpy with vpx_memcpy" 2013-09-24 11:35:03 -07:00
Yaowu Xu
9be0bb19df Replace memcpy with vpx_memcpy
Also removed obselete comment

Change-Id: Iae1664777d76383639c637ee786e0d50fc45819a
2013-09-24 10:56:06 -07:00
Yaowu Xu
ff1ae7f713 Prevent using uninitialized value in RD decision
INT64_MAX may be assigned as RDCOST when RDCSOST computation is skipped
for speed, this commit to prevent INT64_MAX from being used as real
RDCOST in transform size decision.

Change-Id: I89a945134191bbdea1f1431ade70424ac079eaac
2013-09-24 10:53:01 -07:00
Jingning Han
9bcd750565 Merge "Enable per transformed block zero coeffs forcing" 2013-09-24 09:18:17 -07:00
Jingning Han
24ad692572 Merge "Calculate rd cost per transformed block" 2013-09-24 09:18:03 -07:00
Jingning Han
a517343ca3 Enable per transformed block zero coeffs forcing
This commit enables forcing all coefficients zero per transformed
block, when its rate-distortion cost is lower than regular coeff
quantization.

The overall performance improvement (including its parent patch on
calculating rd cost per transformed block) at speed 1:
derf:  0.298%
yt:    0.452%
hd:    0.741%
stdhd: 0.006%

Change-Id: I66005fe0fd7af192c3eba32e02fd6d77952accb5
2013-09-23 10:39:35 -07:00
Jingning Han
78fbb10642 Calculate rd cost per transformed block
This commit makes the rate-distortion optimization loop evaluate
the rd costs of regular quantization and all zero coeffs, per
transformed block. It improves speed 1 compression performance:

derf: 0.245%
yt:   0.515%

For a large partition that consists multiple transformed blocks,
this allows more flexibility to selectively force a portion of
them coded as all zero coeffs, as well be continued in the next
patches.

Change-Id: I211518be4179747b57375696f017d1160cc91851
2013-09-20 12:40:17 -07:00
Dmitry Kovalev
e51e7a0e8d Moving from int_mv to MV.
Converting vp9_mv_bit_cost, mv_err_cost, and mvsad_err_cost
functions for now.

Change-Id: I60e3cc20daef773c2adf9a18e30bc85b1c2eb211
2013-09-20 13:52:43 +04:00
Jingning Han
44b708b4c4 Remove redundant mv_pred use for sub8x8 blocks
The sub8x8 blocks has its own motion vector reference scheme. The
mv_pred is only used blocks of sizes 8x8 and above, to find the
starting point for motion search.

This change does not change any coding behavior. It makes the
encoding process slightly faster. (0.5% speed-up for local test on
speed 1.)

Change-Id: I746ee6ef0eac19aa3621be014afa12be8d82cbb9
2013-09-19 10:32:44 -07:00