summaryrefslogtreecommitdiff
path: root/vp8/common/blockd.h
AgeCommit message (Collapse)Author
2016-07-15vp8: apply clang-formatclang-format
Change-Id: I7605b6678014a5426ceb45c27b54885e0c4e06ed
2014-12-03Various updates to vp8.Marco
Change-Id: Icc7a816491897107764e4c936288e9000e6319b8
2014-01-23vp8/common: add extern "C" to headersJames Zern
Change-Id: I13b434b1e6621e31962b08831c3587c039368c83
2013-12-16vp8/common: normalize include guardsJames Zern
Change-Id: Ia8789a8f864e0edc0bf94f00f6430846f86911c3
2012-08-02Added row based loopfilterScott LaVarnway
Interleaved loopfiltering with decode. For 1080p clips, up to 1% performance gain. For 4k clips, up to 10% seen. This patch is required for better "frame-based" multithreading. Change-Id: Ic834cf32297cc04f27e8205652fb9f70cbe290db
2012-07-26multi-res: add drop_frame supportYunqing Wang
Added drop_frame support in multi-resolution encoder. If one frame is dropped at a lower-resolution level, the next upper-resolution level encoder needs to encode that frame independently without any lower-resolution level motion information. Another issue is that if one frame is dropped at some but not all resolution levels, a frame after that one may use different set of reference frames at different resolution levels. This reference frame asynchronization could degrade motion search precision in upper-resolution level encoding, which uses lower-resolution level motion result. This change compares the lower-resolution and upper- resolution level's reference frames. If they are not the same, the upper-resolution level encoder can not use lower-resolution level motion result. Change-Id: I61afa4f313630e75b7cbdd5742e230e8724a988a
2012-06-11Fix pedantic compiler warningsJohn Koleszar
Allows building the library with the gcc -pedantic option, for improved portabilty. In particular, this commit removes usage of C99/C++ style single-line comments and dynamic struct initializers. This is a continuation of the work done in commit 97b766a46, which removed most of these warnings for decode only builds. Change-Id: Id453d9c1d9f44cc0381b10c3869fabb0184d5966
2012-05-24fix denoiser for temporal patterns and rdJim Bankoski
This extends the denoiser to work for temporally scalable coding. I believe this also fixes a very rare but really bad bug in the original implementation. Change-Id: I8b3593a8c54b86eb76f785af1970935f7d56262a
2012-05-16multi-res: force Key frame sychronizationYunqing Wang
In multi-resolution encoding, frame_type decision for each frame is made by the lowest-resolution encoder. For all other higher- resolution encoders, kf_mode is always set to VPX_KF_DISABLED, and they are forced to use the same frame_type picked by the lowest-resolution encoder. Change-Id: Ic4d52ec65bbc012ca9c2d236210e28a295591eaf
2012-03-29MB_MODE_INFO size reductionScott LaVarnway
Reduced the size of the struct by 8 bytes, which would be a memory savings of 64800 bytes for 1080 resolutions. Had an extra byte, so created an is_4x4 for B_PRED or SPLITMV modes. This simplified the mode checks in vp8_reset_mb_tokens_context and vp8_decode_mb_tokens. Change-Id: Ibec27784139abdc34d4d01f73c09f43e9e10e0f5
2012-03-13Adds a motion compensated temporal denoiser to the encoder.Stefan Holmer
Some refactoring in rdopt.c and pickinter.c. Change-Id: I4f50020eb3313c37f4d441d708fedcaf219d3038
2012-03-08threading.c refactoringScott LaVarnway
Added recon above/left to MACROBLOCKD Reworked decode_macroblock Change-Id: I9c26870af75797134f410acbd02942065b3495c1
2012-02-02Moved ref_frame_cost from MACROBLOCKD to MACROBLOCKScott LaVarnway
Change-Id: I05788522e9cde4322cfb12032483bdbf184bdf0b
2012-02-02Removed frames_till_alt_ref_frame from MACROBLOCKDScott LaVarnway
Change-Id: Ieb05270ac332a4cc38ec4b7b995fc0150e0fffdf
2012-02-02Removed frames_since_golden from MACROBLOCKDScott LaVarnway
Change-Id: I10efa441d663fceb6bc97a3bfad518cd3d9a5128
2012-01-31BLOCKD structure cleanupScott LaVarnway
Removed redundancies. All of the information can be found in the MACROBLOCKD structure. Change-Id: I7556392c6f67b43bef2a5e9932180a737466ef93
2012-01-30RTCD: add arnr functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. It removes the last of the VP8_ENCODER_RTCD struct references. Change-Id: I2a44f52d7cccf5177e1ca98a028ead570d045395
2012-01-30RTCD: add subpixel functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. Change-Id: I6c519ab61e4f4e0ebcc796f2df061f945c48cefe
2012-01-30RTCD: add recon functionsJohn Koleszar
This commit continues the process of converting to the new RTCD system. Change-Id: I9bfcf9bef65c3d4ba0fb9a3e1532bad1463a10d6
2012-01-30New RTCD implementationJohn Koleszar
This is a proof of concept RTCD implementation to replace the current system of nested includes, prototypes, INVOKE macros, etc. Currently only the decoder specific functions are implemented in the new system. Additional functions will be added in subsequent commits. Overview: RTCD "functions" are implemented as either a global function pointer or a macro (when only one eligible specialization available). Functions which have RTCD specializations are listed using a simple DSL identifying the function's base name, its prototype, and the architecture extensions that specializations are available for. Advantages over the old system: - No INVOKE macros. A call to an RTCD function looks like an ordinary function call. - No need to pass vtables around. - If there is only one eligible function to call, the function is called directly, rather than indirecting through a function pointer. - Supports the notion of "required" extensions, so in combination with the above, on x86_64 if the best function available is sse2 or lower it will be called directly, since all x86_64 platforms implement sse2. - Elides all references to functions which will never be called, which could reduce binary size. For example if sse2 is required and there are both mmx and sse2 implementations of a certain function, the code will have no link time references to the mmx code. - Significantly easier to add a new function, just one file to edit. Disadvantages: - Requires global writable data (though this is not a new requirement) - 1 new generated source file. Change-Id: Iae6edab65315f79c168485c96872641c5aa09d55
2012-01-06Merge "Reduced the size of Y1Dequant and friends to [128][2]"John Koleszar
2012-01-06Reduced the size of Y1Dequant and friends to [128][2]Scott LaVarnway
This patch removes the local copies of the dequantize constants and implements John's idea as described in "Make a local copy of the dequantized data" commit. Change-Id: Ic6b7d681f00bf63263f71ff1e39ab2f80729e8b2
2012-01-05Merge "Removed unused diff buffer"Scott LaVarnway
2011-12-22Remove legacy integer typesJohn Koleszar
Remove BOOL, INTn, UINTn, etc, in favor of C99-style fixed width types. Change-Id: I396636212fb5edd6b347d43cc940186d8cd1e7b5
2011-12-12Removed unused diff bufferScott LaVarnway
Change-Id: I9211358cca89b1c4f84b53a202a63ecf9e79ae4c
2011-12-05Multiple-resolution encoderYunqing Wang
The example encoder down-samples the input video frames a number of times with a down-sampling factor, and then encodes and outputs bitstreams with different resolutions. Support arbitrary down-sampling factor, and down-sampling factor can be different for each encoding level. For example, the encoder can be tested as follows. 1. Configure with multi-resolution encoding enabled: ../libvpx/configure --target=x86-linux-gcc --disable-codecs --enable-vp8 --enable-runtime_cpu_detect --enable-debug --disable-install-docs --enable-error-concealment --enable-multi-res-encoding 2. Run make 3. Encode: If input video is 1280x720, run: ./vp8_multi_resolution_encoder 1280 720 input.yuv 1.ivf 2.ivf 3.ivf 1 (output: 1.ivf(1280x720); 2.ivf(640x360); 3.ivf(320x180). The last parameter is set to 1/0 to show/not show PSNR.) 4. Decode: ./simple_decoder 1.ivf 1.yuv ./simple_decoder 2.ivf 2.yuv ./simple_decoder 3.ivf 3.yuv 5. View video: mplayer 1.yuv -demuxer rawvideo -rawvideo w=1280:h=720 -loop 0 -fps 30 mplayer 2.yuv -demuxer rawvideo -rawvideo w=640:h=360 -loop 0 -fps 30 mplayer 3.yuv -demuxer rawvideo -rawvideo w=320:h=180 -loop 0 -fps 30 The encoding parameters can be modified in vp8_multi_resolution_encoder.c, for example, target bitrate, frame rate... Modified API. John helped a lot with that. Thanks! Change-Id: I03be9a51167eddf94399f92d269599fb3f3d54f5
2011-11-03Change use of eob in the encoderTero Rintaluoma
Changed 'int eob' to 'char *eob' in BLOCKD so that both encoder and decoder will use eobs[25] array from MACROBLOCKD structure. In future, this will enable use of the decoder side IDCT in the encoder. Change-Id: I6e1c011628cb8864fd4a0b80f0279ce16a5ca978
2011-09-30Improved tokenizeScott LaVarnway
For a realtime HD encodings, up to 1.6% gains seen. Change-Id: If45028e23db95124da63f9d38ffe06e05596cc6e
2011-09-22Replace vpx_ports/config.h with vpx_config.hAttila Nagy
Just a clean-up. Change-Id: Iea5b6dc925dcfa7db548bc1ab1a13d26ed5a2c9a
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-07-22Merge "fix sharpness bug and clean up"Johann
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-22Preload reference area to an intermediate buffer in sub-pixel motion searchYunqing Wang
In sub-pixel motion search, the search range is small(+/- 3 pixels). Preload whole search area from reference buffer into a 32-byte aligned buffer. Then in search, load reference data from this buffer instead. This keeps data in cache, and reduces the crossing cache- line penalty. For tulip clip, tests on Intel Core2 Quad machine(linux) showed encoder speed improvement: 3.4% at --rt --cpu-used =-4 2.8% at --rt --cpu-used =-3 2.3% at --rt --cpu-used =-2 2.2% at --rt --cpu-used =-1 Test on Atom notebook showed only 1.1% speed improvement(speed=-4). Test on Xeon machine also showed less improvement, since unaligned data access latency is greatly reduced in newer cores. Next, I will apply similar idea to other 2 sub-pixel search functions for encoding speed > 4. Make this change exclusively for x86 platforms. Change-Id: Ia7bb9f56169eac0f01009fe2b2f2ab5b61d2eb2f
2011-06-13Calc ref_frame_cost once per frameScott LaVarnway
instead of every macro block. Change-Id: I2604e94c6b89e3a8457777e21c8c38406d55b165
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-26Broken EC after MODE_INFO size reductionScott LaVarnway
This patch fixes the compiler errors and the seg fault when running decode_with_partial_drops. Change-Id: I7c75369e2fef81d53b790d5dabc327218216838b
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-12Using int_mv instead of MVScott LaVarnway
The compiler produces better assembly when using int_mv for assignments. The compiler shifts and ors the two 16bit values when assigning MV. Change-Id: I52ce4bc2bfbfaf3f1151204b2f21e1e0654f960f
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 force_no_skipScott LaVarnway
force_no_skip is always set to zero. Change-Id: I89b61c5e0bee34627a9c07c05f3517e1db76af77
2011-02-24Removed vp8_block2typeScott LaVarnway
and used defines instead. Change-Id: Idb56e0295d004793f406dfd2d8d8c546aad62e03
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
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-10-14Fix one gcc compiler warningYunqing Wang
../libvpx/vp8/encoder/bitstream.c: In function ‘pack_inter_mode_mvs’: ../libvpx/vp8/encoder/bitstream.c:1026: warning: array subscript has type ‘char’ Change-Id: Ic77491e0a172fa1821e5b3e914d0dc41fe87c00f
2010-09-29Fix loopfilter delta zero transitionsJohn Koleszar
Loopfilter deltas are initialized to zero on keyframes in the decoder. The values then persist from the previous frame unless an update bit is set in the bitstream. This data is not included in the entropy data saved by the 'refresh entropy' bit in the bitstream, so it is effectively an additional contextual element beyond the 3 ref-frames and the entropy data. The encoder was treating this delta update bit as update-if-nonzero, meaning that the value would be refreshed even if it hadn't changed, and more significantly, if the correct value for the delta changed to zero, the update wouldn't be sent, and the decoder would preserve the last (presumably non-zero) value. This patch updates the encoder to send an update only if the value has changed from the previously transmitted value. It also forces the value to be transmitted in error resilient mode, to account for lost context in the event of lost frames. Change-Id: I56671d5b42965d0166ac226765dbfce3e5301868
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-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-23Rework idct calling structure.Fritz Koenig
Moving the eob structure allows for a non-struct based function to handle decoding an entire mb of idct/dequant/recon data. This allows for SIMD functions to idct/dequant/recon multiple blocks at once. SSE2 implementation gives 3% gain on Atom. Change-Id: I8a8f3efd546ea4e0535f517d94f347cfb737c9c2