summaryrefslogtreecommitdiff
path: root/vp8/encoder
AgeCommit message (Collapse)Author
2010-11-15Remove stack shadowing for x86-x64 for SAD functions.Fritz Koenig
x86-64 passes arguments in registers. There is no need to push them to the stack before using them. This fixes 15acc84f10cefd98b2f8dbd2eac2cc92c5a3f851 where ebx was not getting preserved on x86. Change-Id: I1214b5f818a0201f75ab6ad7d5c6f448e09b16c2
2010-11-15Merge "Bad cost tables used in ARNR filtering."Paul Wilkins
2010-11-15Bad cost tables used in ARNR filtering.Paul Wilkins
The use of incorrect mv costing tables in the ARNR sub-pel filtering code led to corruption of the altref buffer in some cases, particularly at low data rates. The average gain from this fix is about 0.3% but there are a few extreme cases where nasty and visible artifacts manifested and for these few data points the improvement is > 10%. PGW and AWG Change-Id: I95cc02b196a433e71d0d2bd2b933fe68ed31e796
2010-11-15Merge "make rdmult adaptive for intra in quantizer RDO"Yaowu Xu
2010-11-11make rdmult adaptive for intra in quantizer RDOYaowu Xu
This intends to correct the tendency that VP8 aggressively favors rate on intra coded frames. Experiments tested different numbers in [0, 1] and found 9/16 overall provided about 2-4% gains for all-intra coded clips based on vpx-ssim metric. The impact on regular encoded clips is much smaller but positive overall. Overall impact on psnr is also positive even though very small. Change-Id: If808553aaaa87fdd44691f9787820ac9856d9f8a
2010-11-11quantizer: fix assertion in fast quantizer pathJohn Koleszar
The fast quantizer assembly code has not been updated to match the new exact quantizer, which was made the default in commit 6adbe09. Specifically, they are not aware of the potential for the coefficient to be scaled, which results in the quantized result exceeding the range of the DCT. This patch restores the previous behavior of using the non-shifted coefficients when in the fast quantizer code path, but unfortunately requires rebuilding the tables when switching between the two. Change-Id: I0a33f5b3850335011a06906f49fafed54dda9546
2010-11-11Revert "Remove stack shadowing for x86-64"Fritz Koenig
This reverts commit 15acc84f10cefd98b2f8dbd2eac2cc92c5a3f851. Change-Id: Ia640be8cbc134432914849c1750f62575ea084e6
2010-11-11Merge "Relax rate control for last few frames"Paul Wilkins
2010-11-10Merge "Remove stack shadowing for x86-64"Fritz Koenig
2010-11-10FDCT optimizations.Fritz Koenig
Fixed up the fdct for mmx and 8x4 sse2 to match them most recent changes. Change-Id: Ibee2d6c536fe14dcf75cd6eb1c73f4848a56d719
2010-11-10postproc : Re-work posproc calling to allow more flags.Fritz Koenig
Debugging in postproc needs more flags to allow for specific block types to be turned on or off in the visualizations. Must be enabled with --enable-postproc-visualizer during configuration time. Change-Id: Ia74f357ddc3ad4fb8082afd3a64f62384e4fcb2d
2010-11-10Relax rate control for last few framesPaul Wilkins
VBR rate control can become very noisy for the last few frames. If there are a few bits to spare or a small overshoot then the target rate and hence quantizer may start to fluctuate wildly. This patch prevents further adjustment of the active Q limits for the last few frames. Patch also removes some redundant variables and makes one small bug fix. Change-Id: Ic167831bec79acc9f0d7e4698bcc4bb188840c45
2010-11-10Tuning for the more exact quantizer.Paul Wilkins
Small changes to the default zero bin and rounding tables. Though the tables are currently the same for the Y1 and Y2 cases I have left them as separate tables in case we want to tune this later. There is now some adjustment of the zbin based on the prediction mode. Previously this was restricted to an adjustment for gf/arf 0,0 MV. The exact quantizer now marginal outperforms and is the default. The overall average gain is about 0.5% Change-Id: I5e4353f3d5326dde4e86823684b236a1e9ea7f47
2010-11-05improve average framerate calculationJohn Koleszar
Change Ice204e86 identified a problem with bitrate undershoot due to low precision in the timestamps passed to the library. This patch takes a different approach by calculating the duration of this frame and passing it to the library, rather than using a fixed duration and letting the library average it out with higher precision timestamps. This part of the fix only applies to vpxenc. This patch also attempts to fix the problem for generic applications that may have made the same mistake vpxenc did. Instead of calculating this frame's duration by the difference of this frame's and the last frame's start time, we use the end times instead. This allows the framerate calculation to scavenge "unclaimed" time from the last frame. For instance: start | end | calculated duration ======+=======+==================== 0ms 33ms 33ms 33ms 66ms 33ms 66ms 99ms 33ms 100ms 133ms 34ms Change-Id: I92be4b3518e0bd530e97f90e69e75330a4c413fc
2010-11-01SSSE3 version of fast quantizerScott LaVarnway
(test clip: tulip) For good quality mode with speed=1, this gave the encoder a small (2 - 3%) performance boost. Change-Id: I8a1d4269465944ac0819986c2f0be4b0a2ee0b35
2010-10-29Finding first labelScott LaVarnway
Using tables for the label count and label offset. Change-Id: Iac3d5b292c37341a881be0af282f5cac3b3e01eb
2010-10-28Save XMM registers in asm functionsYunqing Wang
XMM6/7 are used in these functions, and need to be saved. Change-Id: I3dfaddaf2a69cd4bf8e8735c7064b17bac5a14e5
2010-10-28Merge "Fix full-search SAD function crash in Visual Studio"Yunqing Wang
2010-10-28Fix full-search SAD function crash in Visual StudioYunqing Wang
Unlike GCC, Visual Studio compiler doesn't allocate SAD output array 16-byte aligned, which causes crash in visual studio. Change-Id: Ia755cf5a807f12929bda8db94032bb3c9d0c2362
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-27Full search SAD function optimization in SSE4.1Yunqing Wang
Use mpsadbw, and calculate 8 sad at once. Function list: vp8_sad16x16x8_sse4 vp8_sad16x8x8_sse4 vp8_sad8x16x8_sse4 vp8_sad8x8x8_sse4 vp8_sad4x4x8_sse4 (test clip: tulip) For best quality mode, this gave encoder a 5% performance boost. For good quality mode with speed=1, this gave encoder a 3% performance boost. Change-Id: I083b5a39d39144f88dcbccbef95da6498e490134
2010-10-27Fix half-pixel variance RTCD functionsJohn Koleszar
This patch fixes the system dependent entries for the half-pixel variance functions in both the RTCD and non-RTCD cases: - The generic C versions of these functions are now correct. Before all three cases called the hv code. - Wire up the ARM functions in RTCD mode - Created stubs for x86 to call the optimized subpixel functions with the correct parameters, rather than falling back to C code. Change-Id: I1d937d074d929e0eb93aacb1232cc5e0ad1c6184
2010-10-26Merge "Add half-pixel variance RTCD functions"John Koleszar
2010-10-26Merge "make vp8_recon16x16mb{,y} RTCD functions"John Koleszar
2010-10-26Merge "make arm hex search the generic implementation"John Koleszar
2010-10-26Merge "arm: remove duplicate functions"John Koleszar
2010-10-26Add half-pixel variance RTCD functionsJohn Koleszar
NEON has optimized 16x16 half-pixel variance functions, but they were not part of the RTCD framework. Add these functions to RTCD, so that other platforms can make use of this optimization in the future and special-case ARM code can be removed. A number of functions were taking two variance functions as parameters. These functions were changed to take a single parameter, a pointer to a struct containing all the variance functions for that block size. This provides additional flexibility for calling additional variance functions (the half-pixel special case, for example) and by initializing the table for all block sizes, we don't have to construct this function pointer table for each macroblock. Change-Id: I78289ff36b2715f9a7aa04d5f6fbe3d23acdc29c
2010-10-26make vp8_recon16x16mb{,y} RTCD functionsJohn Koleszar
ARM NEON has a platform specific version of vp8_recon16x16mb, though it's just a stub to extract the various parameters from the MACROBLOCKD struct and pass them to vp8_recon16x16mb_neon(). Using that function's prototype directly will be a better long term solution, but it's quite an invasive change. Change-Id: I04273149e2ade34749e2d09e7edb0c396e1dd620
2010-10-26make arm hex search the generic implementationJohn Koleszar
The ARM version of vp8_hex_search() is a faster implementation of the same algorithm. Since it doesn't use any ARM specific code, it can be made the default implementation. This removes a linking error. Change-Id: I77d10f2c16b2515bff4522c350004e03b7659934
2010-10-26Merge "add missing GET_GOT/RESTORE_GOT pairs"John Koleszar
2010-10-26arm: remove duplicate functionsJohn Koleszar
These functions were true duplicates of functions present in the generic code. This fixes some of the link errors when building with --enable-shared --enable-pic. Change-Id: Idff26599d510d954e439207883607ad6b74df20c
2010-10-26Merge commit 'refs/changes/09/809/1' of https://review.webmproject.org/p/libvpxJim Bankoski
2010-10-25add missing GET_GOT/RESTORE_GOT pairsJohn Koleszar
These functions made global references but did not set up the GOT, causing compilation failures in PIC mode. Change-Id: Iac473bf46733f87eb2e001cd736af4acf73fa51d
2010-10-25Merge "quiet compiler"Johann
2010-10-25Fix leaked file descriptor with ENTROPY_STATSMartin Ettl
cppcheck found a leaked file descriptor in the debugging code enabled by defining ENTROPY_STATS. Fixes issue #60. Change-Id: I0c1d0669cb94d44fed77860f97b82763be06b7cb
2010-10-25quiet compilerJohann
clean up compiler warnings, man in the yellow hat warnings, and start to remove unused #includes Change-Id: I6267e98d9b3024b6fb1ef2732b29067a33cb96f6
2010-10-25Add runtime CPU detection support for ARM.Timothy B. Terriberry
The primary goal is to allow a binary to be built which supports NEON, but can fall back to non-NEON routines, since some Android devices do not have NEON, even if they are otherwise ARMv7 (e.g., Tegra). The configure-generated flags HAVE_ARMV7, etc., are used to decide which versions of each function to build, and when CONFIG_RUNTIME_CPU_DETECT is enabled, the correct version is chosen at run time. In order for this to work, the CFLAGS must be set to something appropriate (e.g., without -mfpu=neon for ARMv7, and with appropriate -march and -mcpu for even earlier configurations), or the native C code will not be able to run. The ASFLAGS must remain set for the most advanced instruction set required at build time, since the ARM assembler will refuse to emit them otherwise. I have not attempted to make any changes to configure to do this automatically. Doing so will probably require the addition of new configure options. Many of the hooks for RTCD on ARM were already there, but a lot of the code had bit-rotted, and a good deal of the ARM-specific code is not integrated into the RTCD structs at all. I did not try to resolve the latter, merely to add the minimal amount of protection around them to allow RTCD to work. Those functions that were called based on an ifdef at the calling site were expanded to check the RTCD flags at that site, but they should be added to an RTCD struct somewhere in the future. The functions invoked with global function pointers still are, but these should be moved into an RTCD struct for thread safety (I believe every platform currently supported has atomic pointer stores, but this is not guaranteed). The encoder's boolhuff functions did not even have _c and armv7 suffixes, and the correct version was resolved at link time. The token packing functions did have appropriate suffixes, but the version was selected with a define, with no associated RTCD struct. However, for both of these, the only armv7 instruction they actually used was rbit, and this was completely superfluous, so I reworked them to avoid it. The only non-ARMv4 instruction remaining in them is clz, which is ARMv5 (not even ARMv5TE is required). Considering that there are no ARM-specific configs which are not at least ARMv5TE, I did not try to detect these at runtime, and simply enable them for ARMv5 and above. Finally, the NEON register saving code was completely non-reentrant, since it saved the registers to a global, static variable. I moved the storage for this onto the stack. A single binary built with this code was tested on an ARM11 (ARMv6) and a Cortex A8 (ARMv7 w/NEON), for both the encoder and decoder, and produced identical output, while using the correct accelerated functions on each. I did not test on any earlier processors. Change-Id: I45cbd63a614f4554c3b325c45d46c0806f009eaa
2010-10-25isolate new temporal filtering codeJohann
onyx_if is getting pretty big. split out the temporal code to make it easier to look at. Change-Id: I207c3a94c90e91b32e3ea5e1836a53b7a990fabd
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-21Merge "Move firstpass motion map to stats packet"John Koleszar
2010-10-21Move firstpass motion map to stats packetJohn Koleszar
The first implementation of the firstpass motion map for motion compensated temporal filtering created a file, fpmotionmap.stt, in the current working directory. This was not safe for multiple encoder instances. This patch merges this data into the first pass stats packet interface, so that it is handled like the other (numerical) firstpass stats. The new stats packet is defined as follows: Numerical Stats (16 doubles) -- 128 bytes Motion Map -- 1 byte / Macroblock Padding -- to align packet to 8 bytes The fpmotionmap.stt file can still be generated for debugging purposes in the same way that the textual version of the stats are available (defining OUTPUT_FPF in firstpass.c) Change-Id: I083ffbfd95e7d6a42bb4039ba0e81f678c8183ca
2010-10-21Add MMWORD PTR/XMMWORD PTR in subtract_sse2.asmYunqing Wang
Change-Id: Ia649b500ef020225d8bbf611799d0f47658dc2ac
2010-10-21Merge "Rewrite vp8_short_walsh4x4_sse2()"Yunqing Wang
2010-10-21Merge "Add SSE2 subtract functions"Yunqing Wang
2010-10-21Remove stack shadowing for x86-64Fritz Koenig
x86-64 passes most arguments in registers. There is no need to push them to the stack before using them. Change-Id: I13c683f1358782682ecafaf1df3fb0af23b978ea
2010-10-21Rewrite vp8_short_walsh4x4_sse2()Yunqing Wang
This rewriting reflects changes made in commit "Improve the accuracy of forward walsh-hadamard transform". Since this function is not called much, only a small encoder performance gain (~0.5% ) is seen. Change-Id: Ie9df58a43028a11fd5b115c4bbe3141f7596578b
2010-10-19Merge "change to make use of more trellis quantization"Yaowu Xu
2010-10-18Add SSE2 subtract functionsYunqing Wang
Instead of doing 8-bit data unpack and 16-bit subtraction, use psubb to do 16 8-bit subtractions and pcmpgtb to preserve the sign information. This does not bring noticable gain since these functions are not called frequently. Change-Id: I90a0dfaa3db9d422e4ada324076596ffb178548e
2010-10-18copy compiler warning fixesJohann
generic version got fixed, but not the arm version. fixes: vp8/encoder/arm/mcomp_arm.c: In function 'vp8_full_search_sadx3': vp8/encoder/arm/mcomp_arm.c:1208: warning: pointer targets in passing argument 5 of 'fn_ptr->sdx3f' differ in signedness vp8/encoder/arm/mcomp_arm.c:1208: note: expected 'unsigned int *' but argument is of type 'int *' and another unsigned change to keep the files similar Change-Id: I1b6255dc3a03b90394a791ee0d15d8167d9454db
2010-10-15remove dead codeJohann
vp8_diamond_search_sadx4 isn't used in arm because there is no corrosponding sdx4df as in x86. rather than keep it in sync with ../mcomp.c, delete it vp8_hex_search had the original, more readable/understandable code if`d out. it's also available in ../mcomp.c, so remove the dead copy Change-Id: Ia42aa6e23b3a2e88040f467280befec091ec080e