summaryrefslogtreecommitdiff
path: root/libavcodec/x86/cabac.h
Commit message (Collapse)AuthorAge
* avcodec/x86/cabac: workaround llvm 4.2.1 bugMichael Niedermayer2013-01-22
| | | | | | | x86_64 is affected by this too Fixes Ticket2156 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* get_cabac_inline_x86: workaround clang bug with disabled optimizationsMichael Niedermayer2012-09-18
| | | | | | gcc produces binary identical output relative to before this change Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: g723.1: simplify scale_vector() g723.1: simplify normalize_bits() vda: cosmetics: fix Doxygen comment formatting vda: better frame allocation vda: Merge implementation into one file vda: support synchronous decoding vda: Reuse the bitstream buffer and reallocate it only if needed build: Factor out mpegvideo encoding dependencies to CONFIG_MPEGVIDEOENC avprobe: Include libm.h for the log2 fallback proresenc: use the edge emulation buffer rtmp: handle bytes read reports configure: Fix typo in mpeg2video/svq1 decoder dependency declaration Use log2(x) instead of log(x) / log(2) x86: swscale: fix fragile memory accesses x86: swscale: remove disabled code x86: yadif: fix asm with suncc x86: cabac: allow building with suncc x86: mlpdsp: avoid taking address of void ARM: intmath: use native-size return types for clipping functions Conflicts: configure ffprobe.c libavcodec/Makefile libavcodec/g723_1.c libavcodec/v210dec.h libavcodec/vda.h libavcodec/vda_h264.c libavcodec/x86/cabac.h libavfilter/x86/yadif_template.c libswscale/x86/rgb2rgb_template.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * x86: cabac: allow building with sunccMans Rullgard2012-08-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two issues preventing suncc from building this code. The undocumented 'a' operand modifier, causing gcc to omit a $ in front of immediate operands (as required in addresses), is not supported by suncc. Luckily, the also undocumented 'c' modifer has the same effect and is supported. On some asm statements with a large number of operands, suncc for no obvious reason fails to correctly substitute some of the operands. Fortunately, some of the operands in these statements are plain numbers which can be inserted directly into the code block instead of passed as operands. With these changes, the code builds correctly with both gcc and suncc. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-09
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mpegvideo: reduce excessive inlining of mpeg_motion() mpegvideo: convert mpegvideo_common.h to a .c file build: factor out mpegvideo.o dependencies to CONFIG_MPEGVIDEO Move MASK_ABS macro to libavcodec/mathops.h x86: move MANGLE() and related macros to libavutil/x86/asm.h x86: rename libavutil/x86_cpu.h to libavutil/x86/asm.h aacdec: Don't fall back to the old output configuration when no old configuration is present. rtmp: Add message tracking rtsp: Support mpegts in raw udp packets rtsp: Support receiving plain data over UDP without any RTP encapsulation rtpdec: Remove an unused include rtpenc: Remove an av_abort() that depends on user-supplied data vsrc_movie: discourage its use with avconv. avconv: allow no input files. avconv: prevent invalid reads in transcode_init() avconv: rename OutputStream.is_past_recording_time to finished. Conflicts: configure doc/filters.texi ffmpeg.c ffmpeg.h libavcodec/Makefile libavcodec/aacdec.c libavcodec/mpegvideo.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * x86: rename libavutil/x86_cpu.h to libavutil/x86/asm.hMans Rullgard2012-08-09
| | | | | | | | | | | | | | This puts x86-specific things in the x86/ subdirectory where they belong. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-25
|\| | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: wtv: Check the return value from gmtime x86: fft: convert sse inline asm to yasm x86: place some inline asm under #if HAVE_INLINE_ASM Conflicts: libavcodec/x86/fft_sse.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * x86: place some inline asm under #if HAVE_INLINE_ASMRonald S. Bultje2012-06-25
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * h264: new assembly version of get_cabac for x86_64 with PICRoland Scheidegger2012-04-28
| | | | | | | | | | | | | | | | | | | | This adds a hand-optimized assembly version for get_cabac much like the existing one, but it works if the table offsets are RIP-relative. Compared to the non-RIP-relative version this adds 2 lea instructions and it needs one extra register. get_cabac() gets about 40% faster, for an overall speedup of about 5%. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
| * h264: use one table instead of several for cabac functionsRoland Scheidegger2012-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | The reason is this is easier for PIC code (in particular on darwin...). Keep the old names as pointers (static in cabac_functions.h so gcc knows these are just immediate offsets) so the c code can nicely stay the same (alternatively could use offsets directly in the functions needing the tables). This should produce the same code as before with non-pic and better code (confirmed) with pic. The assembly uses the new table but still won't work for PIC case. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
| * h264: (trivial) remove unneeded macro argument in x86/cabac.hRoland Scheidegger2012-04-28
| | | | | | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | h264: new assembly version of get_cabac for x86_64 with PICRoland Scheidegger2012-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a hand-optimized assembly version for get_cabac much like the existing one, but it works if the table offsets are RIP-relative. Compared to the non-RIP-relative version this adds 2 lea instructions and it needs one extra register. There is a surprisingly large performance improvement over the c version (more so than the generated assembly seems to suggest) just in get_cabac, I measured roughly 40% faster for get_cabac on a K8. However, overall the difference is not that big, I measured roughly 5% on a test clip on a K8 and a Core2. Hopefully it still compiles on x86 32bit... Now that only one table is used, there's some chance even darwin as compiles this (apparently the label arithmetic used previously doesn't work if it involves symbols defined in a different file, thanks to Ronald S. Bultje for helping me with this). Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | h264: use one table instead of several for cabac functionsRoland Scheidegger2012-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | The reason is this is easier for PIC code (in particular on darwin...). Keep the old names as pointers (static in cabac_functions.h so gcc knows these are just immediate offsets) so the c code can nicely stay the same (alternatively could use offsets directly in the functions needing the tables). This should produce the same code as before with non-pic and better code (confirmed) with pic. The assembly uses the new table but still won't work for PIC case. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | h264: (trivial) remove unneeded macro argument in x86/cabac.hRoland Scheidegger2012-04-28
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Revert "h264: assembly version of get_cabac for x86_64 with PIC (v4)"Michael Niedermayer2012-04-21
| | | | | | | | | | | | This broke compilation on darwin, revert until a better solution is found. This reverts commit a812b599b504b39a8021827da89d5e23fb361cc9.
* | h264: assembly version of get_cabac for x86_64 with PIC (v4)Roland Scheidegger2012-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a hand-optimized assembly version for get_cabac much like the existing one, but it works if the table offsets are RIP-relative. Compared to the non-RIP-relative version this adds 2 lea instructions and it needs one extra register. There is a surprisingly large performance improvement over the c version (more so than the generated assembly seems to suggest) just in get_cabac, I measured roughly 40% faster for get_cabac on a K8. However, overall the difference is not that big, I measured roughly 5% on a test clip on a K8 and a Core2. Hopefully it still compiles on x86 32bit... v2: incorporated feedback from Loren Merritt to avoid rip-relative movs for every table, and got rid of unnecessary @GOTPCREL. v3: apply similar fixes to the the decode_significance functions, and use same macro arguments for non-pic case. v4: prettify inline asm arguments, add a non-fast-cmov version (as I expect the c code to be faster otherwise since both cmov and sbb suck hard on a Prescott, even can't construct the mask with a 64bit shift as that's just as terrible - it's quite difficult to find usable instructions on that chip...). This is tested to work but not on a P4, in theory it _should_ be fast there. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: asf: only set index_read if the index contained entries. cabac: add overread protection to BRANCHLESS_GET_CABAC(). cabac: increment jump locations by one in callers of BRANCHLESS_GET_CABAC(). cabac: remove unused argument from BRANCHLESS_GET_CABAC_UPDATE(). cabac: use struct+offset instead of memory operand in BRANCHLESS_GET_CABAC(). h264: add overread protection to get_cabac_bypass_sign_x86(). h264: reindent get_cabac_bypass_sign_x86(). h264: use struct offsets in get_cabac_bypass_sign_x86(). h264: fix overreads in cabac reader. wmall: fix seeking. lagarith: fix buffer overreads. dvdec: drop unnecessary dv_tablegen.h #include build: fix doc generation errors in parallel builds Replace memset(0) by zero initializations. faandct: Remove FAAN_POSTSCALE define and related code. dvenc: print allowed profiles if the video doesn't conform to any of them. avcodec_encode_{audio,video}: only reallocate output packet when it has non-zero size. FATE: add a test for vp8 with changing frame size. fate: add kgv1 fate test. oggdec: calculate correct timestamps in Ogg/FLAC Conflicts: libavcodec/4xm.c libavcodec/cook.c libavcodec/dvdata.c libavcodec/dvdsubdec.c libavcodec/lagarith.c libavcodec/lagarithrac.c libavcodec/utils.c tests/fate/video.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cabac: add overread protection to BRANCHLESS_GET_CABAC().Ronald S. Bultje2012-03-28
| | | | | | | | Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
| * cabac: remove unused argument from BRANCHLESS_GET_CABAC_UPDATE().Ronald S. Bultje2012-03-28
| |
| * cabac: use struct+offset instead of memory operand in BRANCHLESS_GET_CABAC().Ronald S. Bultje2012-03-28
| |
| * h264: add overread protection to get_cabac_bypass_sign_x86().Ronald S. Bultje2012-03-28
| |
| * h264: reindent get_cabac_bypass_sign_x86().Ronald S. Bultje2012-03-28
| |
| * h264: use struct offsets in get_cabac_bypass_sign_x86().Ronald S. Bultje2012-03-28
| |
| * x86: Require 7 registers for the cabac asmMartin Storsjö2011-12-12
| | | | | | | | | | | | | | The change in 599b4c6ef didn't turn out to work properly on i386 on OS X, where it broke building with PIC enabled. Signed-off-by: Martin Storsjö <martin@martin.st>
* | cabac: Try to disable problematic ASM for gcc-llvm 4.2.1Michael Niedermayer2012-01-11
| | | | | | | | | | | | This should fix compilation with gcc-llvm (see darwin fate box) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | cabac: 3rd try at working around a compiler bug in clang.Michael Niedermayer2012-01-09
| | | | | | | | | | | | Switch to a broader detection of versions. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | cabac: Disable get_cabac_inline_x86() for clang 2.9 on x86_32Michael Niedermayer2012-01-09
| | | | | | | | | | | | This should finally fix the compilation issue on darwin Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Revert "Revert commit 599b4c6efddaed33b1667c386b34b07729ba732b"Michael Niedermayer2012-01-09
| | | | | | | | | | This reverts commit c4f237a98175438e76da64c51cc6fe613f8d767e. This didnt fix compilation on darwin with current clang.
* | Revert commit 599b4c6efddaed33b1667c386b34b07729ba732bMichael Niedermayer2012-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Author: Mans Rullgard <mans@mansr.com> Date: Sun Dec 11 21:41:59 2011 +0000 x86: cabac: replace explicit memory references with "m" operands This replaces the explicit offset(reg) memory references with "m" operands for the same locations. As a result, one fewer register operand is needed for these inline asm statements. This change appears to have broken compilation on darwin, and subsequent fixes by martin (which did not fix compilation) removed the register advantage, thus this change seems not a good idea to keep. See: http://fate.ffmpeg.org/log.cgi?time=20120103122446&log=compile&slot=i386-darwin-llvm-gcc-4.2.1 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | x86: Require 7 registers for the cabac asmMartin Storsjö2011-12-12
|/ | | | | | | | | | The change in 599b4c6ef didn't turn out to work properly on i386 on OS X, where it broke building with PIC enabled. Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit f1dba9e4988e78738ad9065e4639b82b8355774a) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* x86: cabac: replace explicit memory references with "m" operandsMans Rullgard2011-12-11
| | | | | | | | This replaces the explicit offset(reg) memory references with "m" operands for the same locations. As a result, one fewer register operand is needed for these inline asm statements. Signed-off-by: Mans Rullgard <mans@mansr.com>
* x86: drop pointless ARCH_X86 #ifdef from files in x86 subdirectoryDiego Biurrun2011-11-08
|
* x86: cabac: add operand size suffixes missing from 6c32576Mans Rullgard2011-07-28
| | | | | | This fixes build with clang. Signed-off-by: Mans Rullgard <mans@mansr.com>
* x86: cabac: don't load/store context values in asmMans Rullgard2011-07-28
| | | | | | | | | | | Inspection of compiled code shows gcc handles these fine on its own. Benchmarking also shows no measurable speed difference. Removing the remaining cases in get_cabac_bypass_sign_x86() does cause more substantial changes to the compiled code with uncertain impact. Signed-off-by: Mans Rullgard <mans@mansr.com>
* H.264: optimize CABAC x86 asm for AtomJason Garrett-Glaser2011-07-28
|
* x86: cabac: fix register constraints for 32-bit modeMans Rullgard2011-06-20
| | | | | | | | Some operands need to be accessed in byte mode, which restricts the available registers in 32-bit mode. Using the 'q' constraint selects a suitable register. Signed-off-by: Mans Rullgard <mans@mansr.com>
* cabac: move x86 asm to libavcodec/x86/cabac.hMans Rullgard2011-06-20
Signed-off-by: Mans Rullgard <mans@mansr.com>