Граф коммитов

1540 Коммитов

Автор SHA1 Сообщение Дата
James Zern 01483677e5 add vp9_loop_filter_data_reset
Change-Id: I8a9c9019242ec10fa499a78db322221bf96a0275
2014-10-23 19:43:48 +02:00
Yunqing Wang 330a6b2756 Merge "vp9_ethread: allocate frame contexts outside VP9_COMMON struct" 2014-10-22 17:10:39 -07:00
Yunqing Wang 7c7e4d4eb8 vp9_ethread: allocate frame contexts outside VP9_COMMON struct
This patch allocated frame contexts outside VP9_COMMON. This allows
multiple threads to share the same copy of frame contexts, and
reduces the overhead. It also guarantees the correct update of
these contexts during bitstream packing. This patch doesn't change
encoding result.

Change-Id: Ic181a2460b891d1d587278a6d02d8057b9dbd353
2014-10-22 15:03:12 -07:00
Hangyu Kuang 9ce3a7d76c Implement frame parallel decode for VP9.
Using 4 threads, frame parallel decode is ~3x faster than single thread
decode and around 30% faster than tile parallel decode for frame parallel
encoded video on both Android and desktop with 4 threads. Decode speed is
scalable to threads too which means decode could be even faster with more threads.

Change-Id: Ia0a549aaa3e83b5a17b31d8299aa496ea4f21e3e
2014-10-22 10:50:58 -07:00
hkuang e3bf55dedb Correct the logic of ready_for_new_data.
This should be set right after decoder really start to decode frame
instead setting at the end.

Even decoder does not have a displayable frame to show and return NULL
to application, this should be set too.

Change-Id: If0313a834bc64e3b0f05a84f4459d444d9eab0d8
2014-10-17 10:09:56 -07:00
James Zern e9b8810b4d move LFWorkerData allocation to VP9LfSync
this removes an assumption that worker->data1 would be pointing to a
TileWorkerData allocation.
additionally, within the multi-threaded loopfilter pass VP9LfSync as a
parameter to the worker hook, removing the need for a shadow pointer in
LFWorkerData.

Change-Id: Ic7b2faa34e3eb59dbcb8a7c67f333448fa047c88
2014-10-16 18:55:46 +02:00
James Zern 175c870efa vp9_loop_filter_frame_mt: remove pbi dependency
Change-Id: I44d42a5098305a2d050ce8ff3c76baf7798c48af
2014-10-16 18:55:44 +02:00
James Zern 69f11d2b9d vp9_loop_filter_frame_mt: pass planes directly
one less dependency on pbi

Change-Id: I3f3a392416d3523f4aea6682c3965885baf85197
2014-10-16 18:54:10 +02:00
James Zern eb3fdfba09 vp9_loop_filter_frame_mt: pass VP9LfSync directly
a step towards removing the pbi dependency

Change-Id: I10747b325e81c172f5e67031ea5159159fc26e91
2014-10-16 17:27:57 +02:00
James Zern ff3ae42d8c vp9: store TileWorkerData allocations separately
move them from VP9Worker::data[12] to allow the structure to be reused a
bit more naturally by the multi-threaded loopfilter.

Change-Id: I31b49c9e93ca744fd7f6d6ed8696671188fb2c1d
2014-10-16 17:27:57 +02:00
hkuang cf608110fc Merge "Correct the format." 2014-10-14 13:45:11 -07:00
hkuang c1b0d0da0b Correct the format.
Change-Id: I59a53b419adda3a609d50b2a82f5a4a54849752e
2014-10-14 11:35:26 -07:00
hkuang 8fff2db51e Merge "Remove unnecessary local variable." 2014-10-14 11:05:51 -07:00
hkuang c38a8edf16 Merge "Remove extra line." 2014-10-14 11:05:01 -07:00
hkuang c7f9c717de Remove unnecessary local variable.
Change-Id: I7b19b6061cec369825a0a0b7a485ca490dbc12ee
2014-10-13 14:05:42 -07:00
hkuang dbe91de6d4 Remove extra line.
Change-Id: I5e79c276d8953ae17cd35b2846e6e40660c037c3
2014-10-10 14:59:04 -07:00
hkuang 3304d4e6ca Optimize the code to set the refernce frame right after reading the header.
Change-Id: I495cf4a366e06e3220ed132500b1ba1c8448f708
2014-10-09 16:32:36 -07:00
hkuang ca27459c1a Merge "Remove unnecessary code." 2014-10-09 15:44:08 -07:00
hkuang 336e255236 Merge "Remove unnecessary scale check in set_ref." 2014-10-09 15:43:31 -07:00
hkuang 0e06c8ff36 Remove unnecessary code.
Function will jump to error handler when ref buffer is corrupted.
So "xd->corrupted |= ref_buffer->buf->corrupted;" is useless.

Change-Id: I35353a0637ad0dbb682454e040ef69fa68280bfa
2014-10-09 15:12:12 -07:00
Deb Mukherjee 1929c9b391 Rename highbitdepth functions to use highbd prefix
Uses highbd_ prefix convention consistently.

Change-Id: I58f7f799a7ff8e32701bcd71c955bcf1cdd4581e
2014-10-09 14:40:40 -07:00
hkuang 15a3e5f742 Remove unnecessary scale check in set_ref.
Scale check has been done in read_inter_block_mode_info.

Change-Id: I6c86f93bd579109ed30ff13a04a30e35f5ae6fc5
2014-10-09 12:19:55 -07:00
Jingning Han 27c9577f8e Merge "Take out repeated block width/height lookup functions" 2014-10-07 15:33:45 -07:00
Yaowu Xu 29062db37f Merge "Add range checking for decoded coefficients." 2014-10-07 12:36:56 -07:00
Jingning Han b66f7016c1 Take out repeated block width/height lookup functions
The functions b_width_log2 and b_height_log2 only do direct
table fetch. This commit unifies such use cases by using the
table directly and removes these functions.

Change-Id: I3103fc6ba959c1182886a2799d21b8b77c8a7b6b
2014-10-07 12:33:07 -07:00
Yaowu Xu 9751aa1264 Add range checking for decoded coefficients.
The coefficient range checking is enabled when configured with
--enable-debug --enable-coefficient-range-checking
for vpxdec to detect ill-formed input stream. This addresses the
problem raised by issue #792.

Change-Id: I3f9ea541de4dc742dd64389d6c5f543fb1c4f052
2014-10-07 11:30:13 -07:00
Deb Mukherjee fced63ed30 Resolves some static analysis / undefined warnings
Also fixes a case of distortion becoming negative and messing
up the RDCOST computation.

Change-Id: Id345af9e8dfff31ade622be5756e51f2cdface53
2014-10-07 11:20:56 -07:00
Yaowu Xu f809475c73 Merge "Make iscan and scan neighbor arrays static const." 2014-10-02 15:15:58 -07:00
Yaowu Xu 9712bc691d Make iscan and scan neighbor arrays static const.
This commit changes the tables to be read only, which fixes
issue #866

Change-Id: I85bbe03f9d344f50570f8c1c61699bdc5cee248f
2014-10-02 14:08:14 -07:00
Alex Converse a0befb93e7 Fix subsampling check for images 1 pixel wide/tall
Change-Id: I0e262ede7eb4a4ae0c86181922d744e542e93350
2014-10-02 11:02:57 -07:00
Deb Mukherjee 9ed23de13f Miscellaneous decoder changes for high bitdepth
Also includes yv12 config changes.

Change-Id: Iacf40d8bf486815b54c32a127ce3cd4516b7e44f
2014-09-29 11:27:45 -07:00
Deb Mukherjee 993d10a217 Adds various high bit-depth encode functions
Change-Id: I6f67b171022bbc8199c6d674190b57f6bab1b62f
2014-09-25 01:50:36 -07:00
hkuang c70cea97ac Remove mi_grid_* structures.
mi_grid_* are arrays of pointer to pointer. They save the pointers that point
to the MIs in cm->mi. But they are unnecessary and complicated. The original
goal was to remove MODE_INFO_t copy. But with an extra MODE_INFO_t pointer
inside MODE_INFO_t, same goal could be achieved.

This commit totally removes the mi_grid_* structures. But there are still
many dummy MODE_INFO_t inside cm->mi which are a waste of memory. Next commit
will do on-demand MODE_INFO_t allocation in order to save these memories.

Change-Id: I3a05cf1610679fed26e0b2eadd315a9ae91afdd6
2014-09-19 21:27:11 -07:00
Deb Mukherjee 822b51609b High bit-depth coefficient coding functions
Tokenization and Detokenization enhancements for 10/12 bit

Change-Id: I3c269ec30f8eb160ee024905638a193975237559
2014-09-19 15:21:24 -07:00
Deb Mukherjee 0d3c3d3ce7 Adds high bitdepth convolve, interpred & scaling
Change-Id: Ie51c352a6b250547207cbc1ebba833a01ed053e3
2014-09-18 07:26:17 -07:00
Dmitry Kovalev 4f506358c4 Merge "Speeding up decode_coeffs()." 2014-09-16 15:13:14 -07:00
Deb Mukherjee 5cd0aab81a Adds high bitdepth quantization functions
Adds various high bitdepth quantization functions.

Change-Id: I36fc0bf75a1bd15128ed271df8723de0ac134b0c
2014-09-16 14:55:37 -07:00
Dmitry Kovalev adaec4d0fb Speeding up decode_coeffs().
1080p decoding speedup -- 1.25%, 4K decoding speedup -- 2.5%.

Change-Id: I5f02f521cbf7758d4d1886a93bc5b074abdff03d
2014-09-16 12:04:09 -07:00
Deb Mukherjee 10783d4f3a Adds high bitdepth transform functions and tests
Adds various high bitdepth transform functions and tests.
Much of the changes are related to using typedefs tran_low_t
and tran_high_t for the final transform cofficients and intermediate
stages of the transform computation respectively rather than fixed
types int16_t/int. When vp9_highbitdepth configure flag is off,
these map tp int16_t/int32_t, but when the flag is on, they map
to int32_t/int64_t to make space for needed extra precision.

Change-Id: I3c56de79e15b904d6f655b62ffae170729befdd8
2014-09-11 19:56:33 -07:00
James Zern 7ee073e61d vp9: wait for key/intra-only frame after corruption
don't bother decoding any further after receiving an earlier decode
error until a key/intra-only frame is encountered.

Change-Id: I381917b70d7a9e6f8d6de42e3d181bb113a4cec4
2014-09-09 19:36:11 -07:00
James Zern 2215d2f135 Merge changes If8887e1d,I36bfc9c8,I3d1e6c42
* changes:
  vp9_dthread: simplify loop_filter_row_worker signature
  simplify vp9_loop_filter_worker signature
  vp9_decodeframe: simplify tile_work_hook signature
2014-09-09 16:50:28 -07:00
James Zern 6d65cb1552 Merge changes I660c1b7f,Id3cdf6b6
* changes:
  vp9_loop_filter_frame_mt: defer allocations
  vp9_loop_filter_alloc: reorder parameters
2014-09-09 16:48:43 -07:00
James Zern a46ca6ec00 vp9_loop_filter_frame_mt: defer allocations
the code currently checks whether the allocation has been done instead
of allocating on the first frame.
since:
4f27202 vp9: fix crash in mt loopfilter w/corrupt file

this change defers the allocation until the loop filter is used.

Change-Id: I660c1b7f34e713a8dd9884483f01d23b9847366e
2014-09-08 20:13:39 -07:00
James Zern 958a15f006 vp9_loop_filter_alloc: reorder parameters
VP9LfSync lf_sync is being operated on, make it the first parameter as
in dealloc

Change-Id: Id3cdf6b6a48157627780ae0d5d4b7dfa94a78078
2014-09-08 20:13:39 -07:00
James Zern a5da7dea39 vp9_dthread: simplify loop_filter_row_worker signature
use the type names directly in the function declaration rather than
(void *arg1, void *arg2)

Change-Id: If8887e1dbcdf84842783a92f91668bef6223c9e5
2014-09-08 19:53:46 -07:00
James Zern f853117b87 vp9_decodeframe: simplify tile_work_hook signature
use the type names directly in the function declaration rather than
(void *arg1, void *arg2)

Change-Id: I3d1e6c42d384d8e628d7f2075fa561c2c5e20749
2014-09-08 19:53:46 -07:00
Alex Converse b932c6c5dd BITSTREAM CLARIFICATION: Forbid referencing across color spaces.
Check image format of reference frames.

Change-Id: I7d8d7f097ba547839ff9cec3880bd15a4948ee06
2014-09-08 11:12:09 -07:00
Dmitry Kovalev 54bec0971f Merge "Initializing intra modes without vpx_once()." 2014-09-05 12:03:36 -07:00
James Zern 46faaeeffb Merge changes I7b9f40dc,I76e74f2e
* changes:
  vp9: correct context buffer resize check
  vp9: fail decode if block/frame refs are corrupt
2014-09-05 12:01:59 -07:00
James Zern 2886b91790 Merge "vp9: skip loopfilter when the frame is corrupt" 2014-09-05 11:58:09 -07:00
James Zern bb4950dfdf vp9: correct context buffer resize check
allocations within vp9_alloc_context_buffers() rely on mi_rows/mi_cols
individually, use those to determine whether to realloc rather than
stride and stride * rows. this fixes a crash with some fuzzed files for
invalid accesses into last_frame_seg_map and above_context.

Change-Id: I7b9f40dcf170d443890f3bd2acd285507943c7d4
2014-09-04 19:14:21 -07:00
James Zern 440f5097c7 vp9: fail decode if block/frame refs are corrupt
proceeding using a corrupt (incompletely decoded) frame reference may
lead to incorrect assumptions about allocation sizes leading to a crash.

Change-Id: I76e74f2e1be127c2e2c7e1174bb3307497dfd23d
2014-09-04 19:14:00 -07:00
Dmitry Kovalev bf778e7d8e Initializing intra modes without vpx_once().
Change-Id: I0a9d52432f2500f1bd8f43f229e70e38bb9a0343
2014-09-03 11:39:02 -07:00
Deb Mukherjee 5acfafb18e Adds config opt for highbitdepth + misc. vpx
Adds config parameter vp9_highbitdepth, to support highbitdepth profiles.
Also includes most vpx level high bit-depth functions. However
encode/decode in the highbitdepth profiles will not work until
the rest of the code is in place.

Change-Id: I34c53b253c38873611057a6cbc89a1361b8985a6
2014-09-02 14:37:10 -07:00
James Zern 0e361fb895 Merge "vp9: sync workers at the start of decode_tiles_mt()" 2014-08-29 14:07:37 -07:00
James Zern fec40f9269 vp9: fix m/t loop filter invalid free
store the number of allocated rows in VP9LfSync, the calculated values
can not be relied on when dealing with corrupt material.

Change-Id: I13b8bcec9738c299a71df726772ab7ac05511e5b
2014-08-29 11:04:45 -07:00
James Zern dbdff12b81 vp9: sync workers at the start of decode_tiles_mt()
prevents any problems resuming decode after decoding a corrupt frame

Change-Id: Ib7eb1b5c062aebe71074fef1ece32a32822c16be
2014-08-28 17:50:38 -07:00
James Zern db8b1b7bf1 vp9: skip loopfilter when the frame is corrupt
this change is proactive: the loop filter expects valid input and may
produce undefined results / crash in other cases.

Change-Id: I6cc1e966062a91cbc6db981c87cd03d9129fc8fe
2014-08-27 17:04:48 -07:00
James Zern cde790c36d vp9: fix crash in inline loopfilter w/corrupt file
attempting to decode a frame after the previous frame failed has the
potential of interrupting an earlier loop filter task

Change-Id: I6f2b1ddcdf5b89c3e2ee8caf5289dada2a087d66
2014-08-27 16:55:31 -07:00
James Zern 4f27202df7 vp9: fix crash in mt loopfilter w/corrupt file
if the first frame was corrupt and loop filter not called, the next call
would assume the necessary allocations had been done and segfault when
accessing a NULL pointer

Change-Id: Ib6ef505e5c594e6f0fe65ab0700172bcf06b92a6
2014-08-27 14:21:14 -07:00
Adrian Grange 7b2177ce9c Fix bug 837 (Part 2): Handle increase in frame width
The case where frame width increases but the overall memory
size required to hold the mi arrays does not was not
handled.

Change-Id: I72e70b912a7d1766687ad682979f1c9ee124449b
2014-08-21 08:15:23 -07:00
Minghai Shang 229f2aa5b8 Merge "[spatial svc]Add a few different encode frame tests." 2014-08-19 17:45:01 -07:00
Minghai Shang e1b5d24837 [spatial svc]Add a few different encode frame tests.
1. Clean the code for encode frame tests
2. Add encode w/ and w/o alt reference frame test
3. Add encode SNR layers test
4. Add encode multiple layers but decode partial layers test

Change-Id: Ibd2c9bc02525db584a6f931a98405f2d851b3cd6
2014-08-18 11:18:21 -07:00
James Zern 1043474665 Merge "vp9_copy_reference_dec: check ref frame index before use" 2014-08-14 18:53:39 -07:00
James Zern a07d09ff34 vp9_copy_reference_dec: check ref frame index before use
use get_ref_frame() to ensure a valid frame is retrieved if one exists

Change-Id: I4b116d928e643ee62a991babd4b974037b6b3830
2014-08-14 14:57:54 -07:00
Adrian Grange 54f8cb78c6 Merge "Fix bug 837: realloc mode info buffers on resize" 2014-08-14 14:53:33 -07:00
Adrian Grange 4e30565a9f Fix bug 837: realloc mode info buffers on resize
The test to determine if the mode info buffers need
to be resized when the frame size changes was
incorrect, as per bug 837.

By storing the size of the allocated data structure,
a simple test determines whether to allocate more
memory when the frame size changes.

Change-Id: I1544698f2882cf958fc672485614f2f46e9719bd
2014-08-14 08:59:15 -07:00
James Zern a6b7bd6a1c Merge "fixes several -Wunused-function warnings" 2014-08-12 20:15:14 -07:00
Jim Bankoski f452961765 fixes several -Wunused-function warnings
Change-Id: I4dc2cb255f4fe30998b6ee61184895dee9f5da8e
2014-08-12 16:51:07 -07:00
Adrian Grange 1ebf52df2c Common encode/decode function to get reference frame
Replaced encoder and decoder functions to get a pointer
to a reference frame with a common function, vp9_get_ref_frame,
and simplified it.

Change-Id: Icb206fcce8caace3bfd1db3dbfa318dde79043ee
2014-08-08 11:37:11 -07:00
Adrian Grange 75b42a4977 Remove coding_use_prev_mi member from VP9_COMMON
This was shadowing the use of error_resilient_mode, but with
the opposite sense.

Change-Id: Ie4d30263a304fe4b3e94f0c7741db6888cc6afd8
2014-08-08 09:40:38 -07:00
Deb Mukherjee 09bf1d61ca Changes hdr for profiles > 1 for intraonly frames
Specifies the bit-depth, color sampling and colorspace
for intra only frames for profiles > 0

Also adds checks to ensure that profile 1 and 3 are
exclusively used for non 420 streams.

Change-Id: Icfb15fa1acccbce8f757c78fa8a2f60591360745
2014-08-07 09:47:14 -07:00
hkuang 44395a21da Move vp9_dec_build_inter_predictors_* to decoder folder.
Change-Id: Ibe9fa28440cc79ba9f3504d78c7dca7bb01a23e1
2014-07-28 11:09:11 -07:00
hkuang 7eca086707 Add segmentation map array for current and last frame segmentation.
The original implementation only allocates one segmentation map and this
works fine for serial decode. But for frame parallel decode,  each thread
need to have its own segmentation map and the last frame segmentation map
should be provided from last frame decoding thread.

After finishing decoding a frame, thread need to serve the old segmentation
map that associate with the previous decoded frame. The thread also need to
use another segmentation map for decoding the current frame.

Change-Id: I442ddff36b5de9cb8a7eb59e225744c78f4492d8
2014-07-28 10:44:02 -07:00
Jim Bankoski 899585ebe9 Fix reference frame size restrictions.
The issue was introduced by commit g9f37d14 with adding explicit
restrictions on reference-frame scale factors. The restriction
is checked against aligned-by-8 frame dimensions, not against
original ones. So, for example, frame of 35×35 actually can refer
to frame of 70×70, but the new check won't allow this. It will
compare 35 vs 72 (not 70), so 2x downscale limit will be exceeded.

Change-Id: Ic663693034440f64ac8312cbff9e1e773a921060
2014-07-28 08:37:25 -07:00
Yaowu Xu b43b4fe3a2 Merge "Fix allocation of context buffers on frame resize" 2014-07-25 08:49:39 -07:00
Yaowu Xu 9261e1aa6e Changed validation of reference frame size
A previous change, https://gerrit.chromium.org/gerrit/#/c/70632,
introduced a size validation for reference frames to insuare the
input stream is a valid VP9 stream. However, the logic requiring
all reference frames have valid size turned out to be too strict.

In this commit, we modify the validation to require one of the
reference frame has valid dimension. In addition, the decoder
reports error whenever it detects the use of reference frame
with invalid scalig ratio.

Change-Id: If8efc312244087556cfe00f1fcbdff811268ebad
2014-07-24 14:58:01 -07:00
Adrian Grange 423e8a9727 Fix allocation of context buffers on frame resize
The patch:
https://gerrit.chromium.org/gerrit/#/c/70814/
changed the test that determined whether the context
frame buffers needed to be reallocated or not.

The code checked for a change in total frame area
to signal the need to reallocate context buffers.
However, the above_context buffer needs to be
resized i:xf only the width of the frame has increased.

Change-Id: Ib89d75651af252908144cf662578d84f16cf30e6
2014-07-24 14:07:45 -07:00
Alex Converse 5926e7c0e8 Remove unfinished VP9 alpha channel.
Change-Id: Ic5d3a3a0dac10b49495771886a31e793bb78b5ca
2014-07-21 15:55:50 -07:00
Yunqing Wang 765485cab2 Add -DNDEBUG when config option debug is disabled
For gcc, when libvpx config option debug is disabled, added the
flag -DNDEBUG to disable the assertions in libvpx for some speedup.

Change-Id: Ifcb7b9e8ef5cbe5d07a24407b53b9a2923f596ee
2014-07-21 09:20:03 -07:00
Adrian Grange 18a7f69dae Re-introduce frame size check inadvertantly deleted
This patch adds back in code that checks that the frame
size lies within defined bounds was inadvertantly removed
by a previous patch:
https://gerrit.chromium.org/gerrit/#/c/70814/

Change-Id: If526570ba559260c4b7e98098bc75f7700ae7f97
2014-07-18 15:44:10 -07:00
Deb Mukherjee 727f384085 Merge "Separates profile 2 into 2 profiles 2 and 3" 2014-07-18 03:23:51 -07:00
Deb Mukherjee c447a50aea Separates profile 2 into 2 profiles 2 and 3
Separates HBD profile int two profiles (2 and 3) consistent with the
highbitdepth branch. This patch is ported from the original highbitdepth
branch patch: https://gerrit.chromium.org/gerrit/#/c/70460/

Two of the invalid file tests needed to be updated.

Change-Id: I6a4acd2f7a60b1fb4cbcc8e0dad4eab4248431e3
2014-07-17 20:51:59 -07:00
Adrian Grange f68aaa38d6 Modified frame buffer handling
This patch is the first step toward simplifying the
frame buffer handling.

The final goal is to have a common frame buffer handling
framework for both encoder and decoder that incorporates
the existing ability to use externally allocated memory.

Change-Id: I2c378a4f54a39908915f46c4260e17a080db7ff1
2014-07-17 11:06:35 -07:00
Jim Bankoski 943e43273b allow config options to limit max size of decode
This is a practical concern to allow us to fail in a decoder instance
if the size of a file is bigger than we can reasonably handle.

Change-Id: I0446b5502b1f8a48408107648ff2a8d187dca393
2014-07-17 07:07:48 -07:00
Adrian Grange 7be99c4a26 Merge "Fix show_existing_frame not decreasing frame buffer ref counter." 2014-07-15 12:01:16 -07:00
Alexander Voronov 0aa2af55b5 Fix show_existing_frame not decreasing frame buffer ref counter.
The issue was introduced by commit g7c43fb6. If current frame
is repeated from existing-ref pool, frame buffer ref counter
is not decreased, so buffer isn't released. Decoder fails being
unable to allocate new frame buffer at some point.

Added a test vector to verify that the condition will not
recur later. Test vector was generated by the code in this patch:
https://gerrit.chromium.org/gerrit/#/c/70862/

Change-Id: I8af96eb5b9670176e01a281d2e18bd458712cf78
2014-07-15 11:06:15 -07:00
Deb Mukherjee 1f6aaeddc5 Merge "Some extra bit probability cleanups" 2014-07-14 17:26:54 -07:00
hkuang 3cffa0c74e Move vp9_thread.* to common.
Prepare for frame parallel decoding, the reference count buffers
need to be protected by mutex. Move vp9_thread.* to common
folder so that those buffers could use cross-platform mutex
from vp9_thread.*.

(cherry picked from commit 337e8015c9)

Change-Id: I0587a08447925f4554d7788686a31483c2ae3f37
2014-07-11 15:24:31 -07:00
hkuang c147cf3d3b Add unit test to test tile decoding error handling.
Also fix bugs related with corrupted frame handling.
Return VPX_CODEC_CORRUPT_FRAME when getting corrupted
block.

Change-Id: I7207ccc7c68c4df2b40b561315d16e49ccf7ff41
2014-07-11 13:50:05 -07:00
Deb Mukherjee 6957e7a077 Some extra bit probability cleanups
Refactoring to remove some duplication of probability
tables between tokenization and detokenization.

Change-Id: I2fc6a6497f9c0410021a9b41f828bc58a864e466
2014-07-11 11:39:18 -07:00
James Zern 61c3338516 call vp[89]_clear_system_state after longjmp
restore the environment post encode/decode failure

Change-Id: I3c72e2260a616432eaf1f9545d4fb4d8e45cc7b0
2014-07-10 12:36:28 -07:00
James Zern 2d8339eeab Merge "vp9_decoder_remove: destroy common after thread shutdown" 2014-07-09 17:46:42 -07:00
James Zern 2e0588bc46 vp9_decoder_remove: destroy common after thread shutdown
in a failure case the threads may still be running and share a reference
to VP9_COMMON

Change-Id: I867034b4b55f133663b8cbf6ca06e72acf952849
2014-07-09 11:08:06 -07:00
hkuang b84ee5a3d0 Merge "Move vp9_thread.* to common." 2014-07-09 10:16:13 -07:00
Adrian Grange 7c43fb67ae Fix decoder handling of intra-only frames
This patch fixes bug 633:
https://code.google.com/p/webm/issues/detail?id=633

The first decoded frame does not have to be a keyframe,
it could be an inter-frame that is coded intra-only.

This patch fixes the handling of intra-only frames.

A test vector has also been added that encodes 3
intra-only frames at the start of the clip. The
test vector was generated using the code in the
following patch:
https://gerrit.chromium.org/gerrit/#/c/70680/

Change-Id: Ib40b1dbf91aae2bc047e23c626eaef09d1860147
2014-07-08 16:24:03 -07:00
hkuang 337e8015c9 Move vp9_thread.* to common.
Prepare for frame parallel decoding, the reference count buffers
need to be protected by mutex. Move vp9_thread.* to common
folder so that those buffers could use cross-platform mutex
from vp9_thread.*.

Change-Id: I541277cf15eefed6641555944f67f4a0bcdc8154
2014-07-07 14:52:19 -07:00
hkuang 28a794f680 Seperate the frame buffers from VP9 encoder/decoder structure.
Prepare for frame parallel decoding, the frame buffers must be
separated from the encoder and decoder structure, while the encoder
and decoder will hold the pointer of the BufferPool.

Change-Id: I172c78f876e41fb5aea11be5f632adadf2a6f466
2014-07-02 15:34:20 -07:00
hkuang bf58d1725c Revert "Revert "Revert "Revert 3 patches from Hangyu to get Chrome to build:"""
This reverts commit 749e0c7b28.

Change-Id: I0c63a152baf94d38496dd925a40040366153bf4f
2014-07-02 14:57:39 -07:00
James Zern 8aafd34050 Merge changes I875ac5a7,I2b13369d,I9ceb47a9
* changes:
  update vp9_thread.[hc]
  vp9_thread_test: remove unnecessary c_str()'s
  vp9_thread_test: factorize decode loop
2014-07-01 20:46:53 -07:00
Jim Bankoski abf0df08f1 validate uv block size when reading partition
Change-Id: I74fc5f1a7bab3128cdd49441b83ec3a25aee65ca
2014-07-01 10:26:26 -07:00
James Zern e656f44c24 update vp9_thread.[hc]
pull the latest from WebP, which adds a worker interface abstraction
allowing an application to override init/reset/sync/launch/execute/end

this has the side effect of removing a harmless, but annoying, TSan
warning.

Original source:
 http://git.chromium.org/webm/libwebp.git
  100644 blob 08ad4e1fecba302bf1247645e84a7d2779956bc3 src/utils/thread.c
  100644 blob 7bd451b124ae3b81596abfbcc823e3cb129d3a38 src/utils/thread.h

Local modifications:
 - s/WebP/VP9/g
 - camelcase functions -> lower with _'s
 - associate '*' with the variable, not the type

Change-Id: I875ac5a74ed873cbcb19a3a100b5e0ca6fcd9aed
2014-07-01 00:39:10 -07:00
hkuang 1480ba6f0a Revert "Fix a bug in VP9Worker which leads to unit test hang."
The caller should reset the state instead of letting worker
to reset.

This reverts commit 34b2ce15f9.

Change-Id: Idb546ea6386cffc44e98dee772900d21ab79710f
2014-06-30 17:02:26 -07:00
hkuang 34b2ce15f9 Fix a bug in VP9Worker which leads to unit test hang.
This fixes the hang in VP9/InvalidFileTest.ReturnCode/3
due to worker->had_error has not been reset after getting
error.

Change-Id: Ia3608225094758a2bd88f6ae4dd9dfd93bbaad27
2014-06-30 10:45:50 -07:00
Jim Bankoski 7a8829f61a initialize bit buffer structure to avoid warning error
Change-Id: I38bb2801ad3f059d5e2eb6513eec92397c67abcd
2014-06-30 08:05:15 -07:00
Jim Bankoski 9aa4fad73c silence unused parm warning for worker thread in loop filter
Change-Id: Id51468f99f8970b8795ce2d254344f4b8d7817d0
2014-06-29 09:30:59 -07:00
James Zern 749e0c7b28 Revert "Revert "Revert 3 patches from Hangyu to get Chrome to build:""
This reverts commit b336356198.

This causes a hang in:
VP9/InvalidFileTest.ReturnCode/3

the change to test/user_priv_test.cc remains with a minor update

Change-Id: I4a8a272ca37ea329b0f413f0b1cd827a238bd9fd
2014-06-27 19:46:27 -07:00
Jim Bankoski 52b63c238e Merge "Better validation of invalid files" 2014-06-27 11:05:21 -07:00
Jim Bankoski 9f37d149c1 Better validation of invalid files
This patch checks that a decoder never tries to reference frame that's
outside the range of 2x to 1/16th the size of this frame.  Any attempt
to do so causes a failure.

Change-Id: I5c98fa7bb95ac4f29146f29dd92b62fe96164e4c
2014-06-27 10:03:15 -07:00
hkuang 36eeb1799d Merge "Revert "Revert 3 patches from Hangyu to get Chrome to build:"" 2014-06-25 11:42:08 -07:00
hkuang b336356198 Revert "Revert 3 patches from Hangyu to get Chrome to build:"
This patch reverts the previous revert from Jim and also add a
variable user_priv in the FrameWorker to save the user_priv
passed from the application. In the decoder_get_frame function,
the user_priv will be binded with the img. This change is needed
or it will fail the unit test added here:
https://gerrit.chromium.org/gerrit/#/c/70610/

This reverts commit 9be46e4565.

Change-Id: I376d9a12ee196faffdf3c792b59e6137c56132c1
2014-06-25 11:21:37 -07:00
James Zern b2b07755e0 vp9: check tile column count
the max is 6. there are assumptions throughout the decode regarding
this; fixes a crash with a fuzzed bitstream

$ zzuf -s 5861 -r 0.01:0.05 -b 6- \
  < vp90-2-00-quantizer-00.webm.ivf \
  | dd of=invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf \
    bs=1 count=81883

Change-Id: I6af41bb34252e88bc156a4c27c80d505d45f5642
2014-06-24 19:26:11 -07:00
Jingning Han 961bafc366 Merge "Remove unused vp9_init_quant_tables function" 2014-06-23 09:37:30 -07:00
Jim Bankoski 9be46e4565 Revert 3 patches from Hangyu to get Chrome to build:
Avoids failures:
MSE_ClearKey/EncryptedMediaTest.Playback_VP9Video_WebM/0
MSE_ClearKey_Prefixed/EncryptedMediaTest.Playback_VP9Video_WebM/0
MSE_ExternalClearKey_Prefixed/EncryptedMediaTest.Playback_VP9Video_WebM/0
MSE_ExternalClearKey/EncryptedMediaTest.Playback_VP9Video_WebM/0
MSE_ExternalClearKeyDecryptOnly/EncryptedMediaTest.Playback_VP9Video_WebM/0
MSE_ExternalClearKeyDecryptOnly_Prefixed/EncryptedMediaTest.Playback_VP9Video_WebM/0
SRC_ExternalClearKey/EncryptedMediaTest.Playback_VP9Video_WebM/0
SRC_ExternalClearKey_Prefixed/EncryptedMediaTest.Playback_VP9Video_WebM/0
SRC_ClearKey_Prefixed/EncryptedMediaTest.Playback_VP9Video_WebM/0

Patches are
This reverts commit 9bc040859b
This reverts commit 6f5aba069a
This reverts commit 9bc040859b

I1f250441	Revert "Refactor the vp9_get_frame code for frame parallel."
Ibfdddce5	Revert "Delay decreasing reference count in frame-parallel decoding."
I00ce6771	Revert "Introduce FrameWorker for decoding."

Need better testing in libvpx for these commits

Change-Id: Ifa1f279b0cabf4b47c051ec26018f9301c1e130e
2014-06-21 11:36:51 -07:00
Jim Bankoski 3431f575ed Merge "Fix bug in error handling that causes segfault" 2014-06-20 16:46:31 -07:00
hkuang 9bc040859b Introduce FrameWorker for decoding.
When decoding in serial mode, there will be only
one FrameWorker doing decoding. When decoding in
parallel mode, there will be several FrameWorkers
doing decoding in parallel.

Change-Id: If53fc5c49c7a0bf5e773f1ce7008b8a62fdae257
2014-06-20 14:46:45 -07:00
Jim Bankoski 88ba08818e Fix bug in error handling that causes segfault
See: https://code.google.com/p/chromium/issues/detail?id=362697

The code properly catches an invalid stream but seg faults instead of
returning an error due to a buffer not having been initialized. This
code fixes that.

Change-Id: I695595e742cb08807e1dfb2f00bc097b3eae3a9b
2014-06-20 14:44:50 -07:00
Jingning Han 3b9c19aaa7 Remove unused vp9_init_quant_tables function
This function is not effectively used, hence removed.

Change-Id: I2e8e48fa07c7518931690f3b04bae920cb360e49
2014-06-18 11:51:41 -07:00
Adrian Grange dbd1184a5a Improve vp9_rb_bytes_read
Change-Id: I69eba120eb3d8ec43b5552451c8a9bd009390795
2014-06-18 08:31:45 -07:00
hkuang e4c5f7e2b6 Delay decreasing reference count in frame-parallel decoding.
The current decoding scheme will decrease the reference count
of the output frame when finish decoding. Then the application
could copy the frame from the decoder buffer to application buffer.
In frame-parallel decoding, a decoded frame will not be outputted
until several frames later which depends on thread numbers. So
the decoded frame's reference count should be decreased only
after application finish copying the frame out. But due to the
limitation of vpx_codec_get_frame, decoder could not know when
application finish decoding. So use a index last_show_frame to
release the last output frame's reference count.

Change-Id: I403ee0d01148ac1182e5a2d87cf7dcc302b51e63
2014-06-13 10:53:33 -07:00
hkuang 537cb06036 Initially add frame_parallel_decode flag.
Stub flag temporarily set to 0 until frame parallel
decoding implementations are finished.

Change-Id: I8ab768138e8f8f8eb809875703b2502ea0fe7cea
2014-06-11 17:29:29 -07:00
Dmitry Kovalev f5628853d7 Fixing failed ARM build.
Change-Id: I3f74418f07c2dfdd7725a5b4a8ef5c5f4aca6289
2014-06-02 11:14:12 -07:00
Dmitry Kovalev e14f900ae3 Merge "Moving itxm_add pointer from MACROBLOCKD to MACROBLOCK." 2014-05-29 11:16:39 -07:00
Dmitry Kovalev e7135a9344 Removing decoded_key_frame flag.
Change-Id: I79576920efb7f3f6f197d386727409759d8bda8d
2014-05-21 15:51:40 -07:00
hkuang 0958bbd185 Merge "Fix the memory alignment issue due to patch: https://gerrit.chromium.org/gerrit/#/c/70162/" 2014-05-21 12:12:21 -07:00
Dmitry Kovalev 35a83677a5 Moving itxm_add pointer from MACROBLOCKD to MACROBLOCK.
The final goal is eventually to get rid of both itxm_add and fwd_txm4x4.
This patch does it in the decoder.

Change-Id: Ibb3db57efbcbb1ac387c6742538a9fcf2c6f24a5
2014-05-21 11:09:44 -07:00
Dmitry Kovalev 66ce10c13d Merge "Deadline is not supported in VP9 decoder, removing it completely." 2014-05-21 10:37:39 -07:00
hkuang b9e1e994e1 Fix the memory alignment issue due to patch:
https://gerrit.chromium.org/gerrit/#/c/70162/

Change-Id: I797be6a4b21460de6d791125fc20d2be3a35364f
2014-05-21 10:08:06 -07:00
hkuang 20c1edf612 Refactor decode_tiles and loopfilter code.
The current decode_tiles decodes the frame one tile by one tile
and then loopfilter the whole frame or use another worker thread to
do loopfiltering.

|------|------|------|------|
|Tile1-|Tile2-|Tile3-|Tile4-|
|------|------|------|------|

For example, if a tile video has one row and four cols, decode_tiles
will decode the Tile1, then Tile2, then Tile3, then Tile4.
And during decode each tile, decode_tile will decode row by row in
each tile.

For frame parallel decoding, decode_tiles will decode video in row order
across the tiles. So the order will be:
"Decode 1st row of Tile1" -> "Decode 1st row of Tile2"
-> "Decode 1st row of Tile3" -> "Decode 1st row of Tile4"
-> "Decode 2nd row of Tile1" -> "Decode 2nd row of Tile2"
-> "Decode 2nd row of Tile3" -> "Decode 2nd row of Tile4"-> "loopfilter 1st row"

Change-Id: I2211f9adc6d142fbf411d491031203cb8a6dbf6b
2014-05-20 14:47:45 -07:00
Dmitry Kovalev 5ac6d9778f Merge "Making vp9_initialize_dec() static." 2014-05-19 10:27:07 -07:00
Dmitry Kovalev 79ba41903f Removing MACROBLOCKD dependency from loop filter.
Change-Id: I9ef40f3d95ab8f94f69e92ea25678a40956bc1ce
2014-05-16 09:48:26 -07:00
Yaowu Xu 04c40d3d93 cleanup -wextra warnings:
vp9_decoder.c
  vp9_dthread.c

Change-Id: Iaafe941545db98e9e3559096a955894646084ac2
2014-05-15 15:59:25 -07:00
hkuang 1fe6496b17 Merge "Refactor calling loopfilter code." 2014-05-15 10:51:10 -07:00
hkuang bf8c58be5a Refactor calling loopfilter code.
This change is mainly for a follow CL that will refactor the
decode_tiles.

Change-Id: I52de6f8dbada75a64d9a94ebb5975136ed0960b4
2014-05-15 10:21:18 -07:00
Dmitry Kovalev 39015ea200 Making vp9_initialize_dec() static.
Change-Id: I831fe91dfadf4e89f5bbba6ab7a9917d8dd2ed55
2014-05-14 16:33:00 -07:00
Yaowu Xu ed09580777 vp9_decodeframe.c: cleanup -wextra warnings
Change-Id: I0315cea6a5e58182bc2556e9825ec2ef0b1480c3
2014-05-14 09:46:11 -07:00
Dmitry Kovalev d31b836193 Deadline is not supported in VP9 decoder, removing it completely.
Change-Id: I7675f23150404913f4b457add69fb846f6921997
2014-05-13 17:35:46 -07:00
Dmitry Kovalev eecc750b33 Merge "Moving loopfilter call to vp9_decode_frame()." 2014-05-13 17:20:26 -07:00
Dmitry Kovalev ae7d3ef39f Moving loopfilter call to vp9_decode_frame().
Inline loopfilter has been already handled in vp9_decode_frame().
Collecting all similar code in one place now.

Change-Id: I358a0280fc7c2b27cca520bc1e8c16c4eb6491dd
2014-05-12 16:19:19 -07:00
Dmitry Kovalev ccfb4b920a Adding get_tile_buffers() function.
Change-Id: I910c437b80af90c50831e1fbff75842d4276a027
2014-05-12 12:49:29 -07:00
Adrian Grange 3305909bc2 Merge "Fix check of debug counts for corrupt frame" 2014-05-11 09:13:55 -07:00
Adrian Grange 99892e85d5 Fix check of debug counts for corrupt frame
Fixes the idecoder in the case where:
  cm->error_resilient_mode == 0, and
  cm->frame_parallel_decoding_mode == 0, but
  new_fb->corrupted == 1.

The assert in debug_check_frame_counts fails to
take into account the case of a corrupt frame.

Change-Id: Idf318a68458cc88d65d6f3f408a10d8ffe87e43f
2014-05-09 10:12:23 -07:00
Dmitry Kovalev 0dacecaf20 Removing VP9DecoderConfig.
We only used two members from that struct: max_threads and inv_tile_order.
Moving them directly to VP9Decoder struct.

Change-Id: If696a4e5b5b41868a55f3cc971e1d7c1dd9d5f69
2014-05-08 16:24:36 -07:00
Dmitry Kovalev 25110038f7 Merge "Using crop_{width, height} instead of {width, height}." 2014-04-30 15:01:26 -07:00
Jim Bankoski 29af017fc0 corrupted frames shouldn't affect stats
Don't update the stats if we have a corrupted frame.

Change-Id: I65a13adc50e0389b4201d3b671f0225195dfaff4
TODO: Test case that shows this problem.
2014-04-30 10:13:29 -07:00
Dmitry Kovalev 49d8bdc29b Using crop_{width, height} instead of {width, height}.
Change-Id: I6dc9741cdcd700f5c4a387f58da7feb58dd4bbda
2014-04-29 16:12:44 -07:00
Dmitry Kovalev 571c70e554 Removing WRITE_RECON_BUFFER related code.
That code is not used, we could easily return it back using vpx_img_write()
function.

Change-Id: Id107875c6feab6ad245a518f6b437b6ed4b1246d
2014-04-25 16:43:58 -07:00
Joey Parrish 18c08607e0 Add VPXD_SET_DECRYPTOR support to the VP9 decoder.
Change-Id: I88f86c8ff9af34e0b6531028b691921b54c2fc48
2014-04-23 16:11:54 -07:00
Dmitry Kovalev e608418899 Renaming MB_PREDICTION_MODE to PREDICTION_MODE.
Actually, it would be great to have two separate enums INTRA_MODES and
INTER_MODES in future.

Change-Id: I6c4147cf0002853da9c1e03fe9514eab876f01c8
2014-04-22 17:48:31 -07:00
Yaowu Xu bae205fd6a Remove an unused function
Change-Id: I0f2592ecfc5197dfb94975260cb2f862315e7895
2014-04-20 14:50:35 -07:00
Dmitry Kovalev ab3d8e6fc5 Renaming VP9D_CONFIG to VP9DecoderConfig.
Change-Id: I9677aab1c7bb0ca9e989cb21348a3a2c926d8f5a
2014-04-11 14:50:11 -07:00
Dmitry Kovalev 59fd74229e Merge "Removing unused initial_{width, height} from VP9Decoder." 2014-04-11 10:23:35 -07:00
Dmitry Kovalev b5bf64668e Merge "Cleaning up vp9_dthread.{c, h}." 2014-04-10 21:44:33 -07:00
Dmitry Kovalev 69c6671ead Cleaning up vp9_dthread.{c, h}.
Change-Id: If33087462293605f79d9281af133091fff33a876
2014-04-10 16:17:49 -07:00
Dmitry Kovalev 65e650e0c0 Merge "Revert "Converting set_prev_mi() to get_prev_mi()."" 2014-04-09 20:44:30 -07:00
Dmitry Kovalev 46a20d67cb Removing unused initial_{width, height} from VP9Decoder.
Change-Id: I039474b34863bc3db9c6cda82485c32826a1b5d1
2014-04-09 16:18:29 -07:00
Dmitry Kovalev 60def47f21 Revert "Converting set_prev_mi() to get_prev_mi()."
This reverts commit 22a3e30790

Change-Id: I460d905edf5fb2006da58c18fbe02c04d0c631bb
2014-04-09 15:23:16 -07:00
James Zern db8af0b0b3 Merge "Fix TODO typo" 2014-04-09 11:29:44 -07:00
Dmitry Kovalev 5ed83c3220 Merge "Converting set_prev_mi() to get_prev_mi()." 2014-04-09 10:27:05 -07:00
Frank Galligan bbf8971a28 Fix TODO typo
Change-Id: I7a5230852cb24ce22bfe85ea2608cdb4619b5200
2014-04-09 08:48:44 -07:00
Deb Mukherjee 0cca5dd8d7 Merge "High-level hooks for Profile 2 (10/12 bit)" 2014-04-08 22:19:38 -07:00
Frank Galligan 9893fb9859 Merge "Fix decoder resolution change with tiles" 2014-04-08 17:13:33 -07:00
Deb Mukherjee d35df2d8ea High-level hooks for Profile 2 (10/12 bit)
Adds some high-level hooks for profile 2 before further
progress on the implementation.

According to the definitiion in this patch:
1. Profile 2 only supports 10 or 12 bit color but not 8
2. Profile 2 supports all color sampling modes: 444, 422 and 420,
and alpha plane.
3. Profile 3 is currently undefined.

Please consider the definition carefully and suggest modifications
to the definition as needed.

Change-Id: I5b284fc679e54ac5aee171af72fa7994cfd28995
2014-04-08 16:18:34 -07:00
Frank Galligan 6ae58931d6 Fix decoder resolution change with tiles
There was a bug with the decoder that if you started the decoder
with more threads than the first frame had tile columns. Afterwards
tried to decode a frame with more tile columns than the first frame,
the decoder would hang. E.g. run vpxdec --threads=4. The first frame
had two tile columns, then the next key frame had 4 tile columns, the
decoder would hang. If you started with 4 tiles and switched to 2
tiles the decoder would be fine. The issue is that the worker the thread
loop is using is stale.

I added a test vector "vp90-2-14-resize-848x480-1280x720.webm" that
exhibited the bug.

Change-Id: I7bdd47241a52ac0fe1c693a609bc779257e94229
2014-04-08 15:16:11 -07:00
Dmitry Kovalev 56c2f41ccb Renaming VP9D_COMP & VP9Decompressor to VP9Decoder.
Change-Id: Ieb9b455b8aaef9884391021b7f640ef24c554687
2014-04-08 11:41:12 -07:00
Dmitry Kovalev 22a3e30790 Converting set_prev_mi() to get_prev_mi().
Change-Id: Iad4002d7aecaae0e25d88e286bacde7e6cd7264f
2014-04-07 16:01:34 -07:00
Dmitry Kovalev b5e12dda52 Cleaning up vp9_{cx, dx}_iface.c files.
Change-Id: Ib4e31ba74c4b882bd93942ef743f4a189892738d
2014-04-07 10:38:51 -07:00
hkuang 0678104164 Merge "Code clean up." 2014-04-04 15:32:14 -07:00
hkuang 272e030f70 Code clean up.
No need to check pbi->common.frame_to_show again.

Change-Id: I572ea4afd0d8b6000c0bb7575b7023d75cad5a4e
2014-04-03 16:20:26 -07:00
Dmitry Kovalev a9f324fa7f Removing interp_kernel from MACROBLOCKD.
Now interp_kernel is obtained when it is really required (based on
mbmi->interp_filter value).

Change-Id: I4c7a93c179d1045eba16e7526c293d02c9b8b47e
2014-04-03 15:28:42 -07:00
Dmitry Kovalev 5f8dd6c9ec Adding return value to set_offsets() function.
Change-Id: I88e018442c527cf21eac791f0768e805dda244f1
2014-04-01 20:06:47 -07:00
Dmitry Kovalev 86f44a91f4 Renaming two members in MACROBLOCKD struct.
Renames:
  mi_8x8 -> mi
  mode_info_stride -> mi_stride

Change-Id: I66f3e5fd1e7b7f46f108af5bb711c5fd9493c1be
2014-04-01 17:46:40 -07:00
Dmitry Kovalev d42976c515 Common configuration for MACROBLOCKD struct.
Change-Id: Ie2ea9dd8bd338cc9fe12ca9033df64f7644c68b3
2014-04-01 10:57:59 -07:00
Dmitry Kovalev 03349d2ba2 Moving dqcoeff array to MACROBLOCKD in decoder.
Change-Id: I3e20c0cdb9d2437bddf21afb255855f2dead8e02
2014-03-28 10:36:16 -07:00
Dmitry Kovalev 63f86c149a Removing prev_mi_8x8 from MACROBLOCKD.
Change-Id: I32beb5f18c10b5771146c55933b5555487f53633
2014-03-26 10:50:34 -07:00
Dmitry Kovalev 6f139773a2 Merge "Removing redundant references to VP9D_COMP struct." 2014-03-25 16:56:33 -07:00
Dmitry Kovalev 9366624cc4 Removing redundant references to VP9D_COMP struct.
Change-Id: I4c4772c0e6aca2c7d7085a72412ac8dba8874a3d
2014-03-25 14:21:26 -07:00
Dmitry Kovalev 72d431b69f Removing redundant vpx_free() call.
above_seg_context is alreaded freed during vp9_remove_common() call.

Change-Id: I16b72c710e71d2f143df2d47e876d220c8d374e0
2014-03-25 14:07:49 -07:00
Dmitry Kovalev ed39c40a2e Moving above_context to VP9_COMMON.
Change-Id: I713af99d1e17e05a20eab20df51d74ebfd1a68d2
2014-03-25 10:40:08 -07:00
Yaowu Xu ebb4a26202 Merge "Align threading LFWorkerData to 32 bytes." 2014-03-24 17:19:48 -07:00
Dmitry Kovalev 0e84fb08e9 Merge "Making c++ compiler happier." 2014-03-24 17:17:57 -07:00
Dmitry Kovalev 79c51573c1 Merge "Initialization code cleanup." 2014-03-24 16:12:42 -07:00
Dmitry Kovalev a5d51fbdf3 Merge "General cleanup in vp9_decoder.{h, c}." 2014-03-24 15:56:25 -07:00
Yaowu Xu bc2761d3cb Align threading LFWorkerData to 32 bytes.
This is to silent a number misalignment warning reported by valgrind.

Change-Id: Ia47a06010b28d7a88dde21f3e4ccb9308fc6f8cf
2014-03-24 12:48:27 -07:00
Dmitry Kovalev 5b8c834c1a Initialization code cleanup.
Change-Id: I47a8b4bf9a6cc0063d1a6785eaaad641d0659e24
2014-03-24 12:21:22 -07:00
Dmitry Kovalev c9a8c32bce Merge "Removing unused members from VP9D_CONFIG struct." 2014-03-24 09:27:06 -07:00
Dmitry Kovalev 9347e55f12 Making c++ compiler happier.
Change-Id: Ie224e968589bdb0774dc112e6f6df56cc0447465
2014-03-21 14:37:01 -07:00
Dmitry Kovalev b09cbae0dd General cleanup in vp9_decoder.{h, c}.
Change-Id: I68819558a9c5ac6ea85fe62260712af6f4cc46b7
2014-03-21 14:20:13 -07:00
Dmitry Kovalev 89ec46e6b8 Removing unused members from VP9D_CONFIG struct.
Change-Id: I83a201ab4dcf2f00131f2030f382c6dbfcb39d7e
2014-03-21 14:08:19 -07:00
Dmitry Kovalev 4cb37bff96 Removing redundant {above, left}_seg_context manipulation code.
Change-Id: Ib3c1746e61220c629cbd971b2458aa686b5c9e36
2014-03-21 12:12:55 -07:00
Dmitry Kovalev a57de9da03 Merge "Reusing {above, left}_seg_context vars in both encoder and decoder." 2014-03-21 12:02:42 -07:00
Dmitry Kovalev d82766155c Merge "Removing source & source_sz from VP9Decompressor struct." 2014-03-21 12:01:25 -07:00
Yaowu Xu 46c71e5eba Merge "Remove duplicate declaration" 2014-03-21 08:44:04 -07:00
Dmitry Kovalev 7ad40117f1 Reusing {above, left}_seg_context vars in both encoder and decoder.
Change-Id: Id1fa36c92cb007b73a450cc8552e810cedad38b9
2014-03-20 16:15:57 -07:00
Dmitry Kovalev 88a10abe7c Removing source & source_sz from VP9Decompressor struct.
Change-Id: If4c1a48c60e8b27dd021a83170289ccc5467c6de
2014-03-20 15:01:37 -07:00
Yaowu Xu 7ef16efca1 Remove duplicate declaration
Change-Id: Ic8e52a89e0df816c38cd8ff1b7c53862b9a6dff2
2014-03-19 12:23:32 -07:00
Dmitry Kovalev 8ccfcb765f Removing mi_stream.
Change-Id: If674140e30c223c88894b983fd22a583efb99dcf
2014-03-19 10:47:32 -07:00
Dmitry Kovalev b8bc2d337a Fixing warnings/errors from c++ compiler.
Change-Id: Ia561dda53f2dd10e3a10a2df2adb8027ab19397a
2014-03-18 10:47:51 -07:00
Dmitry Kovalev e65c564c78 Adding vp9_swap_mi_and_prev_mi() function.
Change-Id: I18b3939f0b51085cdd25c9182c3a9c7536ca7e3e
2014-03-13 13:55:33 -07:00
Dmitry Kovalev aa7ec14c9a Merge "Speeding up reading of intra block modes." 2014-03-13 13:45:32 -07:00
Dmitry Kovalev 90fed85ce0 Renaming decode_modes_{b, sb}.
decode_modes_b => decode_block
decode_modes_sb => decode_partition

Change-Id: I2a208f5f7bcaa1105f6a2244e37c53b8958c5d76
2014-03-12 15:11:07 -07:00
Dmitry Kovalev ba54a886c3 Speeding up reading of intra block modes.
Reimplementing sub8x8-reading of intra block modes in
read_intra_frame_mode_info() and read_intra_block_mode_info(). Code looks
more readable as well.

Change-Id: Ia42fc7d0dad708bc0c7a8bff1f8b37809b843f40
2014-03-12 12:32:09 -07:00
Dmitry Kovalev c909b43e3c Merge "Moving mi_streams from VP9Decompressor to VP9Common." 2014-03-12 12:20:18 -07:00
Dmitry Kovalev dff81e6c7a Moving mi_streams from VP9Decompressor to VP9Common.
Change-Id: I7ad79c061ad4efbc4914ac49723b48183fdbdd47
2014-03-10 16:12:45 -07:00
Dmitry Kovalev ff935ff781 Removing last_mi from MACROBLOCKD struct.
Change-Id: Ied12b39c55667b26fd3bf90eb331e601c53a10f6
2014-03-10 16:02:03 -07:00
Dmitry Kovalev 32866fd80a Merge "Renaming vp9_onyxd.h and vp9_onyxd_if.c to vp9_decoder.{h, c}." 2014-03-10 12:11:09 -07:00
Dmitry Kovalev f8f8c6d44c Adding reusable get_y_mode_prob() function.
Change-Id: Iebd182d7aeebc0f8964b6fd35057449bb25b00c1
2014-03-10 10:50:16 -07:00
Jim Bankoski 04e7607bd0 Merge "vp9_read_bit_buffer.h convert header statics to global functions" 2014-03-10 07:36:24 -07:00
Jim Bankoski 622f06eb59 Merge "vp9_reconinter.h static functions in header converted to global" 2014-03-10 07:36:05 -07:00
Dmitry Kovalev 5233e10a84 Renaming vp9_onyxd.h and vp9_onyxd_if.c to vp9_decoder.{h, c}.
Change-Id: Ibd0892be1ddadd93b8a22fa2c2e2053001f2948f
2014-03-06 12:08:20 -08:00
Dmitry Kovalev 8c2d3c6ee7 Merge "Removing vp9_onyxd_int.h file." 2014-03-05 21:40:31 -08:00
Dmitry Kovalev ea88da7492 Removing vp9_onyxd_int.h file.
Moving VP9Decompressor struct from vp9_onyxd_int.h to vp9_onyxd.h.

Change-Id: Ic86c15e44130541a7f692db43ef9109293f99ae8
2014-03-05 10:39:29 -08:00
Dmitry Kovalev d31fc628a7 Renaming NMV_UPDATE_PROB to MV_UPDATE_PROB.
Change-Id: I7f3bcca103f0b1f6b3c064b61472543de9a8288a
2014-03-05 10:37:52 -08:00
Jim Bankoski a1fbe1e15f vp9_read_bit_buffer.h convert header statics to global functions
Change-Id: Ibea71b22de898832320d9e49a711a0cb0092901b
2014-03-03 15:21:22 -08:00
Jim Bankoski e5e9b05d68 vp9_reconinter.h static functions in header converted to global
Change-Id: I916944950deb22f4c2301d83a803b732bf3ecd77
2014-03-03 14:58:43 -08:00
Dmitry Kovalev 46af01d719 Adding get_tx_type() instead of get_tx_type_{8x8, 16x16}.
Change-Id: I4a54b12e5229705222c5a101258b9d1f81e2948d
2014-03-03 12:20:51 -08:00
Dmitry Kovalev cf123f40ee Merge "Removing VP9D_PTR." 2014-03-03 09:18:28 -08:00
Yaowu Xu 501fce7270 vp9_decodeframe.c: remove unused params
Change-Id: Ie83e18802234199491dbb6e90886739814558f96
2014-03-02 14:34:50 -08:00
Yaowu Xu 2f4eb5f096 Remove vp9_create_common()
The function has evolved over time, now only calls vp9_rtcd(), so this
commit removes the function and changes to call vp9_rtcd() directly.

Change-Id: I8cfa6190daa4b28f6f3d1e11bb3a07f9c95322bf
2014-03-01 10:59:24 -08:00
Yaowu Xu 0fa4d89042 Fix unused parameters in vp9_extend_frame_borders
Change-Id: I7255b3bc47d760333f58ac4878becbcc8ad30967
2014-02-28 15:50:32 -08:00
Dmitry Kovalev e4159100bc Merge "Adding get_y_mode() function." 2014-02-28 11:12:22 -08:00
Dmitry Kovalev af62e09684 Removing VP9D_PTR.
Change-Id: I17276e25db4592ffeff0961dd9eeaabe4bde110c
2014-02-27 19:08:10 -08:00
Dmitry Kovalev bb65be98bb Reusing existing mem_{get, put}_be32() functions.
Change-Id: Iba128039534e16a6e0a8cfe7e58306c4655e9f0d
2014-02-27 17:40:30 -08:00
Dmitry Kovalev 1ae91f7784 Adding get_y_mode() function.
Change-Id: Iaac57b24f79cd205a8c62bc1177412d22f5787a8
2014-02-27 16:05:50 -08:00
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