Commit Graph

1216 Commits

Author SHA1 Message Date
Dmitry Kovalev
8fc8583a4c Merge "Consistent names for reference_mode functions." 2014-02-25 11:04:37 -08:00
Adrian Grange
709fecac83 Trap request to display non-existant frame
If show_existing_frame indicates that the decoder should
display an existing (previously decoded) frame, add a
check to make sure that the signaled buffer does contain
a valid decoded frame.

Change-Id: Iac8c686b321827414d69a3f2d0467566911bcba2
2014-02-24 10:19:31 -08:00
Dmitry Kovalev
69fd030dc8 Consistent names for reference_mode functions.
Change-Id: I48c9e5e4ca21e11740c750ca2eabf7e8a51c52d2
2014-02-19 15:33:59 +01:00
Dmitry Kovalev
9b75f381cf Adding is_mv_valid() function.
Change-Id: I9d036244b558765b252d8c6681b22721cb2e51bb
2014-02-19 13:57:18 +01:00
Yaowu Xu
8d646becb6 Merge "Removed the reset of mode_info from previous frame" 2014-02-13 17:03:50 -08:00
Yaowu Xu
896d79a57e Removed the reset of mode_info from previous frame
Prior to this commit, both encoder and decoder reset mode/mv info from
previous frame in error resilient mode to ensure bitstreams are able to
decode when there is loss of frame in decoder side. However, this is
not necessary. This commit changed to remove the reset, so encoder can
continue to use mode/mv/partition information from previously encoded
frame without affecting decodeablilty under loss of frame.

Change-Id: I0279f862900dc647fb471ae3389770bb1b9f454f
2014-02-13 12:48:08 -08:00
Dmitry Kovalev
004c8c636e Renaming skip_coeff to skip for consistency.
Change-Id: I036e815ca63d00cba71202ae09ba0f6ef745dcb8
2014-02-12 17:44:12 -08:00
Frank Galligan
1604ad2149 Fix frames that have no references to them.
BasicRateTargeting3TemporalLayers found an error with
the get/release frame buffer management.

Change-Id: Iccff25cba1d2f276f2a0d0fb7b20cf99b4405549
2014-02-11 18:34:21 -08:00
Frank Galligan
d51ca0db00 Merge "Add get release decoder frame buffer functions." 2014-02-11 08:19:37 -08:00
Frank Galligan
e8e152799b Add get release decoder frame buffer functions.
This CL changes libvpx to call a function when a frame buffer
is needed for decode. Libvpx will call a release callback when
no other frames reference the frame buffer. This CL adds a
default implementation of the frame buffer callbacks. Currently
only VP9 is supported. A future CL will add support for
applications to supply their own frame buffer callbacks.

Change-Id: I1405a320118f1cdd95f80c670d52b085a62cb10d
2014-02-10 14:08:11 -08:00
James Zern
4e44457b4d vp9_dthread: interleave mutex/cond alloc+init
this ensures both are properly initialized when calling _dealloc().
+ check the arrays before access

Change-Id: I789af39b41c271b5cb3c029526581b4d9903b895
2014-02-06 12:39:24 -08:00
Alex Converse
41d3c989fd Propgate constants through subexp routines.
This avoids calls to get_unsigned_bits() with constants and
replaces hard to trace loops with simpler structures.

Change-Id: Ic1afc5a17d7df5bcfc85b76efda316b0bf118467
2014-02-03 11:55:46 -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
Yunqing Wang
11a9366e3b Rename a loopfilter parameter
As pointed out by Dmitry and James, "partial" is a Microsoft-
specific c++ keyword, and it is renamed.

Change-Id: Ia0fc11ceb89e54b3195287f89f7e26edbbe9beb8
2014-01-31 16:30:04 -08:00
Dmitry Kovalev
88340b173b Merge "Combining fb_idx_ref_cnt[] and yv12_fb[] arrays." 2014-01-31 15:55:04 -08:00
Dmitry Kovalev
a8a2f22958 Merge "Renaming "mbskip" to "skip"." 2014-01-31 15:52:35 -08:00
Yunqing Wang
903801f1ef vp9 decoder: row-based multi-threaded loopfilter
Implemented parallel loopfiltering, which uses existing tile-
decoding threads. Each thread works on one row, and when that row
is loopfiltered, it moves to next unattended row. To ensure the
correct filtering order, threads are synchronized and one
superblock is filtered only if the superblocks it depends on are
filtered already.

To reduce synchronization overhead and speed up the decoder, we use
nsync > 1 for high resolution.

Performance tests:
1. on desktop:
8-tile 4k video using 8 threads, speedup: 70% - 80%
4-tile HD video using 4 threads, speedup: ~35%
2. on mobile device(Nexus 7):
4-tile 1080p video using 4 threads, speedup: 18% - 25%
4-tile 1080p video using 2 threads, speedup: 10% - 15%

Change-Id: If54b4a11960dd706c22d5ad145ad94156031f36a
2014-01-31 14:44:53 -08:00
Adrian Grange
64e2597465 Disable update of last_show_frame for existing frame
When showing a previously decoded frame, i.e. when
show_existing_frame=1, the update of the
last_show_frame flag must be disabled.

This is to ensure that the last_show_frame flag
reflects the state of the flag for the immediately
previously decoded frame rather then the value that
was forced to ensure that a previously decoded frame
would be displayed.

This patch also adds a test vector to verify that the
display_existing_frame flag works as expected. Code
for generating the test vector can be found in this
patch:
https://gerrit.chromium.org/gerrit/#/c/68581/

(Bug originally reported by Alexander Voronov
<ru.xalba@gmail.com>).

Change-Id: I731d288fba02088959f7fcc87707137fffc6acf5
2014-01-31 08:55:01 -08:00
Dmitry Kovalev
b107f2c470 Renaming "mbskip" to "skip".
Change-Id: I27a30b43eae026a77f92958e2238d02d9cdf7832
2014-01-29 14:48:42 -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
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
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
Frank Galligan
c6d537155c Merge "Revert external frame buffer code." 2014-01-24 11:31:23 -08:00
James Zern
26c88ec14e Merge changes I826655a7,I5164df72,Iba9b198c,Ide9a6846,I4f51ce85,I0e6aa00f,Ic334da9a,I252f5f8a,I7865db2d,I13b434b1
* changes:
  test/: remove unnecessary extern "C"s
  top-level: add extern "C" to headers
  vpx_ports: add extern "C" to headers
  vpx: add extern "C" to headers
  vp9/encoder: add extern "C" to headers
  vp9/decoder: add extern "C" to headers
  vp9/common: add extern "C" to headers
  vp8/encoder: add extern "C" to headers
  vp8/decoder: add extern "C" to headers
  vp8/common: add extern "C" to headers
2014-01-24 10:47:00 -08:00
Frank Galligan
b1c72b633e Revert external frame buffer code.
A future CL will add external frame buffers
differently.

Squash commit of four revert commits:
Revert "Increase required number of external frame buffers"

This reverts commit 9e41d569d7.

Revert "Add external constants."

This reverts commit bbf53047b0.

Revert "Add frame buffer lru cache."

This reverts commit fbada948fa.

Conflicts:
	vpxdec.c

Change-Id: I76fe42419923a6ea6c75d9997cbbf941d73d3005

Revert "Add support to pass in external frame buffers."

This reverts commit 10f891696b.

Conflicts:
	test/external_frame_buffer_test.cc
	vp9/common/vp9_alloccommon.c
	vp9/common/vp9_reconinter.c
	vp9/decoder/vp9_decodeframe.c
	vp9/encoder/vp9_onyx_if.c
	vp9/vp9_dx_iface.c
	vpx/vpx_decoder.h
	vpx/vpx_external_frame_buffer.h
	vpx_scale/generic/yv12config.c
	vpxdec.c

Change-Id: I7434cf590f1c852b38569980e4247fad0d939c2e
2014-01-24 10:10:20 -08:00
James Zern
40aa910c19 vp9/decoder: add extern "C" to headers
Change-Id: I0e6aa00f220280e22d30d098545265835d0c1079
2014-01-23 16:21:24 -08:00
Yaowu Xu
10b0813a9c Changed to prevent decoder crash
The change prevent a decoder crash for invalid stream with negative
size.

Change-Id: I7411765f3524c783058fa3d436549be4e75d8969
2014-01-23 15:43:08 -08:00
hkuang
7f30a6f877 Merge "Seperate the border size for encoder and decoder." 2014-01-22 10:59:31 -08:00
Adrian Grange
c77c5413e0 Merge "Force show_frame=1 when show_existing_frame=1" 2014-01-22 08:34:48 -08:00
hkuang
437004c710 Seperate the border size for encoder and decoder.
Encoder's boarder is still 160, while decoder's boarder will be 32.
With on demand and separate boarder buffer for boarder extension.
The decoder's boarder does not need to to 160 anymore.

Change-Id: I93d5aaff15a33a2213e9761eaa37c5f2870747db
2014-01-21 15:28:41 -08:00
Adrian Grange
3246692ebc Force show_frame=1 when show_existing_frame=1
When showing a previously decoded frame, we need to
explicitly set the show_frame flag.

For the current frame being decoded this flag is
explicitly set in the frame header.

This should fix WebM Issue 696:
http://code.google.com/p/webm/issues/detail?id=696

Change-Id: I5751a809813f88d2ca6f62c47c3878475ff9ba8d
2014-01-21 10:39:39 -08:00
Jingning Han
318e177f4a Deprecate the use of best_mv in decoding process
This commit removes the use of best_mv in the decoding process. This
variable can be replaced with nearest_mv. It saves a few cycles on
assigning the values for best_mv.

Change-Id: Ic183f9c1fb615c54efd7e6ccfedcf09d493435e4
2014-01-16 18:04:58 -08:00
Dmitry Kovalev
bbb25e6a39 Merge "Adding RefBuffer struct." 2014-01-06 14:19:44 -08:00
Dmitry Kovalev
5771276fda Moving get_scan() call out of decode_coeffs() function.
Change-Id: I5db2e5a6c36e6c503dea2e07d9d2e0daf4ac9d89
2014-01-03 18:18:39 -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
Yaowu Xu
8458c8c450 Merge "Fix show existing frame" 2014-01-02 09:27:28 -08:00
Dmitry Kovalev
1e8b5bf4ac Merge "Removing vp9_findnearmv.{h, c} files." 2013-12-26 13:38:38 -08:00
Dmitry Kovalev
f69b5609ff Renaming vp9_dboolhuff.{h, c} to vp9_reader.{h, c}.
Change-Id: I50c009ff8108bda1c57427f23d63a79c04f7e776
2013-12-20 12:53:03 -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
c67ee5ea24 Merge "Converting vp9_treecoder.h to vp9_prob.{h, c}" 2013-12-19 11:03:30 -08:00
Johann
dc2c62eba8 Cast away Windows warning
Subtracting the pointers promoted to a signed type.

Change-Id: Ied0e822a1756ed7b2f514efafcb6dce4efb9b9d6
2013-12-18 15:52:51 -08:00
Johann
85770264ac Fix incorrect size reading
Guard against incorrect size values moving *data past data_end.

Check read length against the difference of the buffers.

Change-Id: Ie0b54e2db517fd41a0f3ceb23402ee44839a4739
2013-12-17 18:48:55 -08:00
Johann
83baed0b6b Merge "Add const to match declaration" 2013-12-16 19:17:43 -08:00
Johann
5894e7ef50 Add const to match declaration
The definition fell out of sync in
I7d2fda72de5fc27e86c6589543b41fa044681dbf

Change-Id: I3ce3f6ba96bb121f51efaa08f64a69ad9f731a9e
2013-12-16 15:46:11 -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
b5c9261832 Converting vp9_treecoder.h to vp9_prob.{h, c}
Moving vp9_norm probability table from vp9_entropy.c to vp9_prob.c

Change-Id: Ie757b73860c6f43130790c332b292e2a1a81b788
2013-12-16 12:53:09 -08:00
Frank Galligan
d0ee1fd797 Merge "Add support to pass in external frame buffers." 2013-12-15 19:18:25 -08:00
Frank Galligan
10f891696b Add support to pass in external frame buffers.
VP9 decoder can now use frame buffers passed in by the application.

Change-Id: I599527ec85c577f3f5552831d79a693884fafb73
2013-12-15 18:45:46 -08:00
Dmitry Kovalev
f54b515797 Merge "Cleaning up vp9_append_sub8x8_mvs_for_idx()." 2013-12-13 15:38:53 -08:00
James Zern
3aa75bcef6 Merge "vp9 asserts: fix compile warning" 2013-12-13 12:41:31 -08:00
Dmitry Kovalev
e121bf4c1d Moving mi configuration loop from vp9_read_mode_info to set_offsets.
set_offsets() is a right place to configure all mi-related pointers.

Change-Id: I7d2fda72de5fc27e86c6589543b41fa044681dbf
2013-12-12 19:56:30 -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
James Zern
345fbfef06 vp9 mt decode: reorder tile decode
reorder the tiles based on size and their presumed complexity. this
minimizes the cases where the main thread is waiting on a worker to
complete.

Change-Id: Ie80642c6a1d64ece884f41683d23a3708ab38e0c
2013-12-10 18:33: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
1048a7e314 Merge "Cleaning up skip context calculation." 2013-12-10 15:00:22 -08:00
Dmitry Kovalev
bcee73f7ae Merge "Cleaning up read_inter_block_mode_info() function." 2013-12-10 14:59:36 -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
hkuang
d70a8c09c6 Merge "Implenment on demand border extension. In place extend the border now. Next commit will totally remove the border." 2013-12-09 17:16:31 -08:00
hkuang
ff2c96be1f Implenment on demand border extension. In place extend
the border now. Next commit will totally remove the border.

Change-Id: Ic1e1ca9cc34f81c688715b3948689b47df63a151
2013-12-09 16:44:08 -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
347df4ce55 Merge "Renaming vp9_get_pred_context_tx_size() function." 2013-12-09 15:10:49 -08:00
Dmitry Kovalev
7293ef7ac0 Cleaning up read_inter_block_mode_info() function.
Change-Id: Ib4e215a80f00e342d857a54a4ca1b2dc82b6db1d
2013-12-09 14:45:17 -08:00
Dmitry Kovalev
a19d694f09 Merge "Removing BLOCK_TYPES and adding PLANE_TYPES constant instead." 2013-12-07 02:20:41 -08:00
Dmitry Kovalev
cb92f4f042 Renaming vp9_get_pred_context_tx_size() function.
Change-Id: Ia6d6f4dfb1fd1ec0f8ba53796b59a802e9d7881d
2013-12-06 15:31: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
8eac2ca840 Merge "Renaming constants." 2013-12-06 09:55:02 -08:00
Dmitry Kovalev
5be34ba80f Merge "vp9_get_pred_context_intra_inter() clean up." 2013-12-06 09:14:36 -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
Dmitry Kovalev
da519166e9 Merge "Cleaning up vp9_detokenize.c file." 2013-12-05 16:45:10 -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
Tero Rintaluoma
047b0b01bb Fix show existing frame
- Disable mode info update in case where current frame is coded
  as "show existing frame".
- Should fix issue 676.

Change-Id: Ibee681850eb307f982da6528d3e31cb94f881c08
2013-12-05 12:10:10 +02:00
Frank Galligan
8363349b84 Merge "Fix the initial references to frame buffers." 2013-12-04 19:26:40 -08:00
Dmitry Kovalev
934e10d0f1 Cleaning up vp9_detokenize.c file.
Using consistent names (block_idx => block, dqcoeff_ptr => dqcoeff,
pt => ctx), inlining get_tx_eob() call.

Change-Id: I05208e57df81bbb8f25b8274684a48192e9de464
2013-12-04 17:24:18 -08:00
Frank Galligan
9ed616a56c Fix the initial references to frame buffers.
The old code would start in a mixed state, where all the reference
frames were pointing to frame buffer 0, but the reference counts
were 0. This is why we needed special code for the first frame.

Change-Id: I734961012917654ff8c0c8b317aac00ab75ded1a
2013-12-04 16:53:18 -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
Dmitry Kovalev
fd16baae25 Merge "Making names consistent with REFERENCE_MODE enum name." 2013-12-03 12:48:34 -08:00
Dmitry Kovalev
4585b9dbac Merge "Removing token_to_counttoken array." 2013-12-03 12:29:56 -08:00
Dmitry Kovalev
54b5deff77 Removing token_to_counttoken array.
Change-Id: I02050bcca4c9fd68a00abdea5aba0c3f8993d9a9
2013-12-02 18:41:53 -08:00
Dmitry Kovalev
5ab920d2ae Using local variable for token_cache.
The difference with the old code is that originally the whole token_cache
was initialized with zeros at the beginning of decode_coefs() function.
Now we set several zero values explicitly with "token_cache[scan[c]] = 0".

Change-Id: I88cc5031f01d13012d1a4491739c36cb44f9401e
2013-12-02 15:44:26 -08:00
Dmitry Kovalev
9144111296 Cleaning up decode_coefs() function.
Removing goto and using while loop instead, renaming seg_eob to max_eob,
moving eob token counter increment.

Change-Id: Idcc4b3a45e4f313596a71776aef56691a6647e5f
2013-12-02 14:36:06 -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
Dmitry Kovalev
c5bdc9dfd2 Making names consistent with REFERENCE_MODE enum name.
Change-Id: I17268af3e0cbf7e5788c3154466e404947c944b3
2013-11-26 16:46:13 -08:00
Dmitry Kovalev
d7efe068d2 Deleting vp9_treereader.h file.
Renaming treed_read() to consistent vp9_read_tree() and moving it from
deleted vp9_treereader.h to vp9_dboolhuff.h file.

Change-Id: Iedd8655acbe25e4fcf62b79e5a13bdea69b6b004
2013-11-26 12:38:58 -08:00
Dmitry Kovalev
e8af3db88a Merge "Renaming COMPPREDMODE_TYPE enum and its members." 2013-11-25 10:59:08 -08:00
Jingning Han
ba8b5e8d6d Use separate inter predictors for enc/dec
The decoder will construct inter predictor using lazy border extension,
while the encoder, going with multiple runs of motion search in the rate-
distortion optimization loop for each block, does border extension at
frame level. This commit makes separate the inter predictors for encoder
and decoder, respectively.

Change-Id: Ieca2fecba3a7201a6d64ef9f219e5d91e50559c3
2013-11-25 09:43:34 -08:00
Jingning Han
12e5ec6aa8 Merge "Separate setup_scale_factor/extend_frame_borders" 2013-11-25 09:14:46 -08:00
Dmitry Kovalev
52b43a2876 Inlining and removing vp9_set_pred_flag_seg_id() function.
Change-Id: I0fd76937e847f78378a7ab3fa0af00a7c2c52b42
2013-11-22 17:32:11 -08: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
Jingning Han
86d2a9b978 Separate setup_scale_factor/extend_frame_borders
This commit takes out vp9_extend_frame_borders from
vp9_setup_scale_factors.

The refactoring is for the preparation of the use of lazy border
extension at decoder. This makes it necessary to handle border
extension separately at encoder/decoder. The use of
vp9_extend_frame_borders will be removed, when lazy border extension
is ready.

Change-Id: Ia3baba3d179d5f11eee1634f19b3b319d2a59186
2013-11-22 12:02:08 -08:00
Dmitry Kovalev
e0ec61187e Merge "Removing txfrm_block_to_raster_xy() call from extend_for_intra()." 2013-11-22 10:51:38 -08:00
Jim Bankoski
a64a192c90 Merge changes Id1698a35,Idcabd0b9
* changes:
  detokenization speedups
  Don't write 0's to token_cache
2013-11-22 08:16:17 -08:00
Dmitry Kovalev
7c8cac3c21 Removing txfrm_block_to_raster_xy() call from extend_for_intra().
Change-Id: I6a48d1f35ed5fe7a2c7499675b339994c9c3bdf2
2013-11-21 19:30:58 -08:00
Jim Bankoski
70ffd5d055 detokenization speedups
removed unnecessary ifs and branches ..

Change-Id: Id1698a35292659388f48926791024d1400f2cea9
2013-11-21 16:55:22 -08:00
Jim Bankoski
b38e42fe9d Don't write 0's to token_cache
This code only updates the token_cache if the result is non0.

Change-Id: Idcabd0b993a926fea9c29dbec134b9c5c4859b40
2013-11-21 12:52:15 -08:00
Dmitry Kovalev
4956fcd31b Adding MV_FP_SIZE constant.
Change-Id: I98d750ee92ff51fb714980418ea28be3b1d0f3c6
2013-11-20 12:07:57 -08:00
Jim Bankoski
7a8a68e2bd Merge "scan order table lookup same for encoder and decoder" 2013-11-19 16:22:48 -08:00
Jim Bankoski
d6667dd54f scan order table lookup same for encoder and decoder
Change-Id: I473947b5ca70b7a81151926284bff86f8555492a
2013-11-19 15:31:43 -08:00
Dmitry Kovalev
86b629efb6 Merge "Calculating dst pointer only once per transform block." 2013-11-19 15:05:46 -08:00
Jim Bankoski
8cf352abac entropy code speedup
Change-Id: Ic316d3374ff9a2b43897272260947d56765a0fdd
2013-11-19 14:31:38 -08:00
Jim Bankoski
ff4f1c4b76 scan order / neighbors converted to lookup
Change-Id: I64b189dfeee1cf3e90134a1a93497072f3361e5e
2013-11-19 12:55:44 -08:00
Dmitry Kovalev
b5c4520101 Calculating dst pointer only once per transform block.
Change-Id: I23fea0a2e85be8373600e3e2dae98d36acde389c
2013-11-18 18:37:53 -08:00
Yaowu Xu
1c61e1960d Move vp9_extend.{h,c} from common to encoder
Since they used in encoder only. This commit also re-order includes
for the files that include vp9_extend.h

Change-Id: I929fc113f2135d3198cd1fc6a17434e5a2f8a459
2013-11-18 12:43:36 -08:00
Yaowu Xu
49cbe4580d Renamed two files
from vp9_decodframe.{c,h} to vp9_decodeframe.{c,h}

Change-Id: I21ac4b14fc90246e3f16bd90c52c12d126d791f8
2013-11-15 12:48:43 -08:00
Adrian Grange
38144ed8b2 fix scalling bug by buffer auto-reallocation
Change-Id: Ib748eb287520c794631697204da6ebe19523ce95
2013-11-14 15:53:09 -08:00
Dmitry Kovalev
e6b72d0119 Removing unused coefband_trans_8x8plus array from VP9Decompressor.
Change-Id: Ic1367d767705377402ebfec0705f9f553a834400
2013-11-14 13:37:18 -08:00
Deb Mukherjee
cfcd5c4f61 Simplifies band-getting with a static array
Simplifies the code by implementing band mapping with static arrays.
A lot of the code complexity introduced in a previous patch
disappears.

Change-Id: Ia3fac36e594fb5ad2d55ae141c58bba4c55c2d28
2013-11-13 22:15:16 -08:00
Dmitry Kovalev
11631fec16 Cleaning up decode_coefs() function.
Removing vp9_read_and_apply_sign macro which was used only once.

Change-Id: I6a1625b720d89fc1291c99deccd6638b705f9b06
2013-11-13 16:46:21 -08:00
Dmitry Kovalev
919eeef5c8 Merge "Calculating transform block offsets (x and y) only once." 2013-11-12 16:57:30 -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
ed5a993a97 Calculating transform block offsets (x and y) only once.
Change-Id: I4b5106bdc08fd4551339b968c13428a8f43122e2
2013-11-12 13:55:13 -08:00
Deb Mukherjee
5ade423774 Removes conditional statements from band getting
Implements scan order to band map with arrays in both the encoder
and decoder to remove conditional statements.

Encoding seems to be about 1% faster at speed 0, tested on football.
Decoding seems to be about 0.5-1% faster on a set of 25 videos.

Change-Id: Idb233ca0b9e0efd790e30880642e8717e1c5c8dd
2013-11-12 10:13:27 -08:00
Dmitry Kovalev
42b1f62085 Removing redundant assignment.
xd->mi_8x8 is assigned inside set_offsets() for each prediction block.

Change-Id: I20e5974a9eaf105e5a04fc7f99b7a93bd50e3d0a
2013-11-11 17:39:43 -08:00
Jingning Han
d8b4c79270 Decouple macroblockd_plane buffer usage
Make the macroblockd_plane contain dynamic buffer pointers instead
static pointers to the memory space allocated therein. The decoder
uses the buffer allocated in pbi, while encoder will use a dual
buffer approach for rate-distortion optimization search.

Change-Id: Ie6f24be2dcda35df7c15b4014e5ccf236fb3f76c
2013-11-11 15:26:10 -08:00
Dmitry Kovalev
ec8128e27f Merge "Replacing (raster_block >> tx_size) with (block >> (tx_size << 1))." 2013-11-11 12:27:42 -08:00
Dmitry Kovalev
c53a9c70fb Merge "Localizing NEARESTMV special cases in the code." 2013-11-11 11:12:06 -08:00
Dmitry Kovalev
3aa4b42a35 Merge "Cleaning up read_mv_probs() function." 2013-11-11 11:01:35 -08:00
Dmitry Kovalev
974a27131e Merge "Adding read_reference_mode() function." 2013-11-11 11:00:51 -08:00
Yaowu Xu
cae7e0741a [BITSTREAM]Fix row tile mode_info pointer setup
This commit fixes the assignment of mode_info pointer per tile. It
makes recognition of tiles in both row and column formats and properly
arrange the use of mode_info.

The bug was first introduced in
I6226456dd11f275fa991e4a7a930549da6675915
https://gerrit.chromium.org/gerrit/#/c/67492/

Change-Id: Ie12cd209f53241513728c461ee3d7b9599ddb860
2013-11-08 22:06:53 -08:00
Yaowu Xu
a596975eb6 Correct a couple of typos
Change-Id: Ic470c6c9ce27b615c9645b9cb0d67526417bc374
2013-11-08 12:43:51 -08:00
Dmitry Kovalev
614effc0f6 Merge "Unifying tile decoding for both direct and inverse tile order." 2013-11-08 10:59:02 -08:00
Dmitry Kovalev
d28f30ef4e Replacing (raster_block >> tx_size) with (block >> (tx_size << 1)).
The new expression is much more logical than previous one. Surprisingly
both expressions give exactly the same set of dependent values
-- have_top, have_left, have_right -- in vp9_predict_intra_block.

Change-Id: I63eb1b592b8c37883b3a0dbb1f3daa271e446109
2013-11-07 15:26:57 -08:00
Deb Mukherjee
6cf3b98ac2 Merge "Miscelleneous changes in detokenize for speed" 2013-11-07 09:40:07 -08:00
Dmitry Kovalev
672ba3ddf5 Unifying tile decoding for both direct and inverse tile order.
Now tile decoding consists of two stages:
1. Find tile buffer start and its size, put this info into tile_buffers.
2. Decode each tile based on information from tile_buffers.

It seems that stage 1 can also be reused by multithreaded tile decoder.

Change-Id: If0cdaefdd6d10bb41c63561346c9ae4cfac081dd
2013-11-06 18:15:33 -08:00
Dmitry Kovalev
af36c1f2e7 Merge "Using pd->dqcoeff instead of pd->qcoeff in the decoder." 2013-11-06 16:59:57 -08:00
Dmitry Kovalev
a1dc97beb1 Using pd->dqcoeff instead of pd->qcoeff in the decoder.
It is more logical to use dqcoeff buffer to put there *dequantized*
transform coefficients (inside inverse_transform_block and
decode_coefs functions). Dequantization happens inside WRITE_COEF_CONTINUE
macro.

qcoeff buffer should be only used in the encoder for *quantized*
transform coefficients.

Change-Id: Ifd54bef272bbf5311ced6669c4f1079f998af5d7
2013-11-06 16:14:45 -08:00
Dmitry Kovalev
7b011c5467 Replacing mi_{width,height}_log2 with num_8x8_blocks_{wide,high}_lookup.
Change-Id: I04c55daef89bca2b85cb7db0850f9b052abc5a7c
2013-11-06 13:34:23 -08:00
Yaowu Xu
103c4603d2 Merge "optimize decode_bool operation" 2013-11-06 10:25:52 -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
Yaowu Xu
278856319b Simply a macro
Change-Id: I1c0c1b92aab33b1e4321b8e584a934fe58e0b324
2013-11-05 17:13:00 -08:00
Dmitry Kovalev
6c217d97df Adding read_reference_mode() function.
Change-Id: I517ad7e1a48910f0d2e95feacd23f143d28b42d6
2013-11-05 14:57:05 -08:00
Dmitry Kovalev
d172201403 Cleaning up read_mv_probs() function.
Change-Id: I7a1e88b5977076e22736c0d6af1d4dcc19d39a6a
2013-11-05 14:43:35 -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
Deb Mukherjee
551829d8f3 Miscelleneous changes in detokenize for speed
Changes to reduce branching in detokenization  in order
to improve decode speed.

Change-Id: I23a74d072cc14d99f6fc054c1e6a72021e777903
2013-11-05 10:27:36 -08:00
Deb Mukherjee
3a833ea38f token_cache changes in decoder
Removes stack-alocation of token_cache in decode_coefs function

Seems to achieve about 1% decode speed improvement as tested on
25 480p videos.

Change-Id: I8e7eb3361fa09d9654dfad0677a6d606701fdc6e
2013-11-05 09:32:58 -08:00
Yaowu Xu
9f37d89037 optimize decode_bool operation
Change-Id: I7fe44633d29046ddd38c88c00e8520d27ac748bf
2013-11-04 17:10:18 -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
Dmitry Kovalev
5113d9c3c9 Merge "Cleaning up read_skip_coeff() function." 2013-11-01 10:56:55 -07:00
Yaowu Xu
a272530bf0 Two optimizations:
1. Reduced the size memset based on eob for 32x32 transform. The reset
of non-zero coefficient should probably go into where they are read in
inverse transform functions. (TODO)
2. Removed a redundant level of indirection.
vp9_iht4x4_add() checks transform type and call vp9_iht4x4_16_add()
for tranforms other than DCT_DCT. In this case, the DCT_DCT case
has been already handled here.

Change-Id: Iacbc77da761f0b308df5acea0f20c9add9f33d20
2013-11-01 07:24:07 -07:00
Yaowu Xu
a49e77af50 simplify read_coef_prob()
Change-Id: I529c634db4f81ba5386092c126f53312b1e51b2b
2013-10-31 16:39:08 -07:00
Dmitry Kovalev
970eb39bdc Cleaning up read_skip_coeff() function.
Making code easier to read and avoiding calculation of skip context twice.

Change-Id: I42c376b1a1811bc842bf6420bf81d2de7a1bf980
2013-10-31 14:53:18 -07:00
Dmitry Kovalev
47b6030dda Reducing the number of foreach_transformed_block() calls.
The change doesn't affect the bitstream. It changes the order or function
calls and affects how we reconstruct intra- and inter-blocks. Speed up is
about 1...1.5%.

For intra-blocks:
  Before:
    for each transform block read tokens
    for each transform block do prediction
    for each transform block do inverse transform
  Now:
    for each transform block
      read tokens
      do prediction
      do inverse transform

For inter-blocks:
  Before:
    for each transform block read tokens
    for each transform block do inverse transform
  Now:
    for each transform block
      read tokens
      do inverse transform

Change-Id: I12a79bf1aa5a18c351b8010369bd3ff1deae1570
2013-10-31 13:52:08 -07:00
Dmitry Kovalev
ca39a00822 Merge "Reducing the number of recursive calls." 2013-10-30 15:14:18 -07:00