summaryrefslogtreecommitdiff
path: root/vp8/decoder/threading.c
AgeCommit message (Collapse)Author
2011-09-19Fix necessary for input partitions iface to match the RTP profileStefan Holmer
These changes fixes a glitch between the RTP profile and the input partitions interface. Since there's no way for the user to know the actual number of partitions, the decoder have to read the multi_token_paritition bits also when input partitions mode is enabled. Included are also a couple of fixes for issues with independent partitions and uninitialized memory reads. Change-Id: I6f93b15287d291169ed681898ed3fbcc5dc81837
2011-08-24Removed bmi copy to/from BLOCKDScott LaVarnway
for SPLITMV and B_PRED modes. Modified code to use the bmi found in mode_info_context instead of BLOCKD. On the decode side, the uvmvs are calculated only when required, instead of every macroblock. This is WIP. (bmi should eventually be removed from BLOCKD) Small performance gains noticed for RT encodes and decodes.(VGA) Change-Id: I2ed7f0fd5ca733655df684aa82da575c77a973e7
2011-08-12Disable error concealment until first key frame is decodedStefan Holmer
When error concealment is enabled the first key frame must be successfully received before error concealment is activated. Error concealment will be activated when the delta following delta frame is received. Also fixed a couple of bugs related to error tracking in multi-threading. And avoiding decoding corrupt residual when we have multiple non-resilient partitions. Change-Id: I45c4bb296e2f05f57624aef500a874faf431a60d
2011-07-22fix sharpness bug and clean upJohann
sharpness was not recalculated in vp8cx_pick_filter_level_fast remove last_filter_type. all values are calculated, don't need to update the lfi data when it changes. always use cm->sharpness_level. the extra indirection was annoying. don't track last frame_type or sharpness_level manually. frame type only matters for motion search and sharpness_level is taken care of in frame_init move function declarations to their proper header Change-Id: I7ef037bd4bf8cf5e37d2d36bd03b5e22a2ad91db
2011-07-08New loop filter interfaceAttila Nagy
Separate simple filter with reduced no. of parameters. MB filter level picking based on precalculated table. Level table updated for each frame. Inside and edge limits precalculated and updated just when sharpness changes. HEV threshhold is constant. ARM targets use scalars and others vectors. Change works only with --target=generic-gnu All other targets have to be updated! Change-Id: I6b73aca6b525075b20129a371699b2561bd4d51c
2011-06-27Adding support for error concealment in multi-threaded decodingStefan Holmer
Also includes a couple of error concealment bug fixes: - the segment_id wasn't properly initialized when missing - when interpolating and no neighbors are found, set to zero - clear the qcoef buffer when concealing an MB Change-Id: Id79c876b41d78b559a2241e9cd0fd2cae6198f49
2011-06-15Remove redundant check for KEY_FRAME in multithreaded decoderAttila Nagy
For Intra blocks is enough to check ref_frame == INTRA_FRAME. Change-Id: I3e2d3064c7642658a9e14011a4627de58878e366
2011-06-02Removed B_MODE_INFOScott LaVarnway
Declared the bmi in BLOCKD as a union instead of B_MODE_INFO. Then removed B_MODE_INFO completely. Change-Id: Ieb7469899e265892c66f7aeac87b7f2bf38e7a67
2011-05-24MODE_INFO size reductionScott LaVarnway
Declared the bmi in MODE_INFO as a union instead of B_MODE_INFO. This reduced the memory footprint by 518,400 bytes for 1080 resolutions. The decoder performance improved by ~4% for the clip used and the encoder showed very small improvements. (0.5%) This reduction was first mentioned to me by John K. and in a later discussion by Yaowu. This is WIP. Change-Id: I8e175fdbc46d28c35277302a04bee4540efc8d29
2011-05-09clean up unused variable warningsJohann
Change-Id: I9467d7a50eac32d8e8f3a2f26db818e47c93c94b
2011-05-05Merge "Runtime detection of available processor cores."Yunqing Wang
2011-04-28Consolidated build inter predictorsScott LaVarnway
Code cleanup. Change-Id: Ic8b0167851116c64ddf08e8a3d302fb09ab61146
2011-04-26Merge "Test vector mismatch fix"Scott LaVarnway
2011-04-26Test vector mismatch fixScott LaVarnway
Fixed test vector mismatch that was introduced in the "Removed dc_diff from MB_MODE_INFO" (Ie2b9cdf9e0f4e8b932bbd36e0878c05bffd28931) Change-Id: I98fa509b418e757b5cdc4baa71202f4168dc14ec
2011-04-25remove simpler_lpfJohann
the decision to run the regular or simple loopfilter is made outside the function and managed with pointers stop tracking the option in two places. use filter_type exclusively Change-Id: I39d7b5d1352885efc632c0a94aaf56b72cc2fe15
2011-04-21Removed dc_diff from MB_MODE_INFOScott LaVarnway
The dc_diff flag is used to skip loopfiltering. Instead of setting this flag in the decoder/encoder, we now check for this condition in the loopfilter. Change-Id: Ie2b9cdf9e0f4e8b932bbd36e0878c05bffd28931
2011-04-20Removed redundant checks of the mode_info_context flagsScott LaVarnway
Code cleanup. The build inter predictor functions are redundantly checking the mode_info_context for either INTRA_FRAME or SPLITMV. Change-Id: I4d58c3a5192a4c2cec5c24ab1caf608bf13aebfb
2011-03-31Runtime detection of available processor cores.Attila Nagy
Detect the number of available cores and limit the thread allocation accordingly. On decoder side limit the number of threads to the max number of token partition. Core detetction works on Windows and Posix platforms, which define _SC_NPROCESSORS_ONLN or _SC_NPROC_ONLN. Change-Id: I76cbe37c18d3b8035e508b7a1795577674efc078
2011-03-21Merge "Increase static linkage, remove unused functions"John Koleszar
2011-03-17Increase static linkage, remove unused functionsJohn Koleszar
A large number of functions were defined with external linkage, even though they were only used from within one file. This patch changes their linkage to static and removes the vp8_ prefix from their names, which should make it more obvious to the reader that the function is contained within the current translation unit. Functions that were not referenced were removed. These symbols were identified by: $ nm -A libvpx.a | sort -k3 | uniq -c -f2 | grep ' [A-Z] ' \ | sort | grep '^ *1 ' Change-Id: I59609f58ab65312012c047036ae1e0634f795779
2011-03-16apple: include proper mach primativesJohn Koleszar
Fixes implicit declaration warning for 'mach_task_self'. This change is an update to Change I9991dedd1ccfddc092eca86705ecbc3b764b799d, which fixed this issue for the decoder but not the encoder. Change-Id: I9df033e81f9520c4f975b7a7cf6c643d12e87c96
2011-03-08Fix an unused variable warning.Ralph Giles
Move the update of the loopfilter info to the same block where it is used. GCC 4.5 is not able trace the initialization of the local filter_info across the other calls between the two conditionals on pbi->common and issues an uninitialized variable warning. Change-Id: Ie4487b3714a096b3fb21608f6b0c74e745e3c6fc
2011-02-17Merge "Fix relative include paths"John Koleszar
2011-02-15Remove redundant ptr checks in calls to vpx_freeJames Zern
vpx_free if used contains this check. If replaced, well behaved free will behave similarly. Change-Id: I25483aaa8b39255b9a8cf388d6e5eaa20a908ae1
2011-02-10Fix relative include pathsJohn Koleszar
Allow compiling without adding vp8/{common,encoder,decoder} to the include paths. Change-Id: Ifeb5dac351cdfadcd659736f5158b315a0030b6c
2011-02-09Put more code under #if CONFIG_MULTITHREAD.Gaute Strokkenes
Change-Id: Icf4b692099d7d249fe3553852b1022b027b28e4b
2011-02-03Make vp8_adjust_mb_lf_value return the updated value rather thanGaute Strokkenes
manipulating it in situ via a pointer. Change-Id: If4a87a4eccd84f39577c0e91e171245f4954c5cf
2011-01-28Adds "armvX-none-rvct" targetsTero Rintaluoma
Adds following targets to configure script to support RVCT compilation without operating system support (for Profiler or bare metal images). - armv5te-none-rvct - armv6-none-rvct - armv7-none-rvct To strip OS specific parts from the code "os_support"-config was added to script and CONFIG_OS_SUPPORT flag is used in the code to exclude OS specific parts such as OS specific includes and function calls for timers and threads etc. This was done to enable RVCT compilation for profiling purposes or running the image on bare metal target with Lauterbach. Removed separate AREA directives for READONLY data in armv6 and neon assembly files to fix the RVCT compilation. Otherwise "ldr <reg>, =label" syntax would have been needed to prevent linker errors. This syntax is not supported by older gnu assemblers. Change-Id: I14f4c68529e8c27397502fbc3010a54e505ddb43
2011-01-19Merge "Implement error tracking in the decoder"John Koleszar
2011-01-19Implement error tracking in the decoderHenrik Lundin
A new vpx_codec_control called VP8D_GET_FRAME_CORRUPTED. The output from the function is non-zero if the last decoded frame contains corruption due to packet losses. The decoder is also modified to accept encoded frames of zero length. A zero length frame indicates to the decoder that one or more frames have been completely lost. This will mark the last decoded reference buffer as corrupted. The data pointer can be NULL if the length is zero. Change-Id: Ic5902c785a281c6e05329deea958554b7a6c75ce
2011-01-11Remove unused local variablesHenrik Lundin
Removing unused local variables causing compiler warnings in Visual Studio. Change-Id: I0e2096303be1fdbc01428a6e57cca9796bb32c8a
2010-11-17vp8mt_alloc_temp_buffers: make prototype return voidJohn Koleszar
This function was never called in a context expecting a return value, the return value was always a constant, and the !CONFIG_MULTITHREAD path didn't have a return statement, which caused a compiler warning. This patch changes the function to return void instead. Fixes issue #231 Change-Id: I9ef7f56e54418b7265026c54fc4ed5660c1418d1
2010-10-27Eliminate more warnings.Timothy B. Terriberry
This eliminates a large set of warnings exposed by the Mozilla build system (Use of C++ comments in ISO C90 source, commas at the end of enum lists, a couple incomplete initializers, and signed/unsigned comparisons). It also eliminates many (but not all) of the warnings expose by newer GCC versions and _FORTIFY_SOURCE (e.g., calling fread and fwrite without checking the return values). There are a few spurious warnings left on my system: ../vp8/encoder/encodemb.c:274:9: warning: 'sz' may be used uninitialized in this function gcc seems to be unable to figure out that the value shortcut doesn't change between the two if blocks that test it here. ../vp8/encoder/onyx_if.c:5314:5: warning: comparison of unsigned expression >= 0 is always true ../vp8/encoder/onyx_if.c:5319:5: warning: comparison of unsigned expression >= 0 is always true This is true, so far as it goes, but it's comparing against an enum, and the C standard does not mandate that enums be unsigned, so the checks can't be removed. Change-Id: Iaf689ae3e3d0ddc5ade00faa474debe73b8d3395
2010-10-21Convert [4][4] matrices to [16] arrays.Timothy B. Terriberry
Most of the code that actually uses these matrices indexes them as if they were a single contiguous array, and coverity produces reports about the resulting accesses that overflow the static bounds of the first row. This is perfectly legal in C, but converting them to actual [16] arrays should eliminate the report, and removes a good deal of extraneous indexing and address operators from the code. Change-Id: Ibda479e2232b3e51f9edf3b355b8640520fdbf23
2010-09-23Adjust multi-thread sync ranges according to image sizesYunqing Wang
In multi-threaded decoder, set different sync ranges for different video resolutions. Change-Id: Iea48fd36f51919e0152c8ed3b1f10e1b723c0ca7
2010-09-17Restructure multi-threaded decoderYunqing Wang
On each MB, loopfiltering is done right after MB decoding. This combines two loops in multi-threaded code into one, which reduces number of synchronizations to half. The above-row/left-col data are saved in temp buffers for next-row/next MB decoding. Tests on 4-core gLucid machine showed 10% decoder performance gain with threads=4 (tulip clip). Testing on other platforms isn't done yet. Change-Id: Id18ea7c1e84965dabea65d4c01ca5bc056ddeac9
2010-09-09Use WebM in copyright notice for consistencyJohn Koleszar
Changes 'The VP8 project' to 'The WebM project', for consistency with other webmproject.org repositories. Fixes issue #97. Change-Id: I37c13ed5fbdb9d334ceef71c6350e9febed9bbba
2010-09-03Reduced the size of MB_MODE_INFOScott LaVarnway
Moved partition_bmi and partition_count out of MB_MODE_INFO and placed into MACROBLOCK. Also reduced the size of other members of the MB_MODE_INFO struct. For 1080p, the memory was reduced by 1,209,516 bytes. The decoder performance appeared to improve by 3% for the clip used. Note: The main goal for this change is to improve the decoder performance. The encoder will be revisited at a later date for further structure cleanup. Change-Id: I4733621292ee9cc3fffa4046cb3fd4d99bd14613
2010-09-01Fix rare deadlock before loop filterFrank Galligan
There was an extremely rare deadlock that happened when one thread was waiting to start the loop filter on frame n while the other threads were starting to work on frame n+1. Change-Id: Icc94f728b3b6663405435640d9a2996735ba19ef
2010-08-31Replace sleep(0) calls in multi-threaded decoderYunqing Wang
This is a workaround for gLucid problem. Change-Id: I188a016a07e4c2ea212444c5a6284ff3c48a5caa
2010-08-31Changed above and left context data layoutScott LaVarnway
The main reason for the change was to reduce cycles in the token decoder. (~1.5% gain for 32 bit) This layout should be more cache friendly. As a result of this change, the encoder had to be updated. Change-Id: Id5e804169d8889da0378b3a519ac04dabd28c837 Note: dixie uses a similar layout
2010-08-12Removed unnecessary MB_MODE_INFO copiesScott LaVarnway
These copies occurred for each macroblock in the encoder and decoder. Thetemp MB_MODE_INFO mbmi was removed from MACROBLOCKD. As a result, a large number compile errors had to be fixed. Change-Id: I4cf0ffae3ce244f6db04a4c217d52dd256382cf3
2010-08-11Moved gf_active code to encoder onlyScott LaVarnway
The gf_active code is only used by the encoder, so it was moved from common and decoder. Change-Id: Iada15acd5b2b33ff70c34668ca87d4cfd0d05025
2010-08-10First modification of multi-thread decoderYunqing Wang
This is the first modification of VP8 multi-thread decoder, which uses same threads to decode macroblocks and then do loopfiltering for each frame. Inspired by Rob Clark, synchronization was done on every 8 macroblocks instead of every macroblock to reduce lock contention. Comparing with the original code, this implementation gave about 15%- 20% performance gain while decoding my test clips on a Core2 Quad platform (Linux). The work is not done yet. Test on other platforms are needed. Change-Id: Ice9ddb0b511af1359b9f71e65066143c04fef3b5
2010-07-29apple: include proper mach primativesJohn Koleszar
Fixes implicit declaration warning for 'mach_task_self'. Patch courtesy of timeless at gmail.com Change-Id: I9991dedd1ccfddc092eca86705ecbc3b764b799d
2010-07-23Swap alt/gold/new/last frame buffer ptrs instead of copying.Fritz Koenig
At the end of the decode, frame buffers were being copied. The frames are not updated after the copy, they are just for reference on later frames. This change allows multiple references to the same frame buffer instead of copying it. Changes needed to be made to the encoder to handle this. The encoder is still doing frame buffer copies in similar places where pointer reference could be done. Change-Id: I7c38be4d23979cc49b5f17241ca3a78703803e66
2010-06-30Add loopfilter initialization fix in multithreading codeYunqing Wang
Modified loopfilter initialization to avoid unnecessary operations. Change-Id: I9fd1a5a49edc1cb8116c2a72a6908b1e437459ec
2010-06-15Change bitreader to use a larger window.Timothy B. Terriberry
Change bitreading functions to use a larger window which is refilled less often. This makes it cheap enough to do bounds checking each time the window is refilled, which avoids the need to copy the input into a large circular buffer. This uses less memory and speeds up the total decode time by 1.6% on an ARM11, 2.8% on a Cortex A8, and 2.2% on x86-32, but less than 1% on x86-64. Inlining vp8dx_bool_decoder_fill() has a big penalty on x86-32, as does moving the refill loop to the front of vp8dx_decode_bool(). However, having the refill loop between computation of the split values and the branch in vp8_decode_mb_tokens() is a big win on ARM (presumably due to memory latency and code size: refilling after normalization duplicates the code in the DECODE_AND_BRANCH_IF_ZERO and DECODE_AND_LOOP_IF_ZERO cases. Unfortunately, refilling at the end of vp8dx_bool_decoder_fill() and at the beginning of each decode step in vp8_decode_mb_tokens() means the latter requires an extra refill at the end. Platform-specific versions could avoid the problem, but would require most of detokenize.c to be duplicated. Change-Id: I16c782a63376f2a15b78f8086d899b987204c1c7
2010-06-09Remove secondary mv clamping from decode stageJohn Koleszar
This patch removes the secondary MV clamping from the MV decoder. This behavior was consistent with limits placed on non-split MVs by the reference encoder, but was inconsistent with the MVs generated in the split case. The purpose of this secondary clamping was only to prevent crashes on invalid data. It was not intended to be a behaviour an encoder could or should rely on. Instead of doing additional clamping in a way that changes the entropy context, the secondary clamp is removed and the border handling is made implmentation specific. With respect to the spec, the border is treated as essentially infinite, limited only by the clamping performed on the near/nearest reference and the maximum encodable magnitude of the residual MV. This does not affect any currently produced streams. Change-Id: I68d35a2fbb51570d6569eab4ad233961405230a3
2010-06-04LICENSE: update with latest textJohn Koleszar
Change-Id: Ieebea089095d9073b3a94932791099f614ce120c