summaryrefslogtreecommitdiffstats
path: root/libavcodec/mathops.h
Commit message (Collapse)AuthorAgeFilesLines
* AAC encoder: Extensive improvementsClaudio Freire2015-10-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This finalizes merging of the work in the patches in ticket #2686. Improvements to twoloop and RC logic are extensive. The non-exhaustive list of twoloop improvments includes: - Tweaks to distortion limits on the RD optimization phase of twoloop - Deeper search in twoloop - PNS information marking to let twoloop decide when to use it (turned out having the decision made separately wasn't working) - Tonal band detection and priorization - Better band energy conservation rules - Strict hole avoidance For rate control: - Use psymodel's bit allocation to allow proper use of the bit reservoir. Don't work against the bit reservoir by moving lambda in the opposite direction when psymodel decides to allocate more/less bits to a frame. - Retry the encode if the effective rate lies outside a reasonable margin of psymodel's allocation or the selected ABR. - Log average lambda at the end. Useful info for everyone, but especially for tuning of the various encoder constants that relate to lambda feedback. Psy: - Do not apply lowpass with a FIR filter, instead just let the coder zero bands above the cutoff. The FIR filter induces group delay, and while zeroing bands causes ripple, it's lost in the quantization noise. - Experimental VBR bit allocation code - Tweak automatic lowpass filter threshold to maximize audio bandwidth at all bitrates while still providing acceptable, stable quality. I/S: - Phase decision fixes. Unrelated to #2686, but the bugs only surfaced when the merge was finalized. Measure I/S band energy accounting for phase, and prevent I/S and M/S from being applied both. PNS: - Avoid marking short bands with PNS when they're part of a window group in which there's a large variation of energy from one window to the next. PNS can't preserve those and the effect is extremely noticeable. M/S: - Implement BMLD protection similar to the specified in ISO-IEC/13818:7-2003, Appendix C Section 6.1. Since M/S decision doesn't conform to section 6.1, a different method had to be implemented, but should provide equivalent protection. - Move the decision logic closer to the method specified in ISO-IEC/13818:7-2003, Appendix C Section 6.1. Specifically, make sure M/S needs less bits than dual stereo. - Don't apply M/S in bands that are using I/S Now, this of course needed adjustments in the compare targets and fuzz factors of the AAC encoder's fate tests, but if wondering why the targets go up (more distortion), consider the previous coder was using too many bits on LF content (far more than required by psy), and thus those signals will now be more distorted, not less. The extra distortion isn't audible though, I carried extensive ABX testing to make sure. A very similar patch was also extensively tested by Kamendo2 in the context of #2686.
* avutil: add ff_reverse as av_reverse replacementAndreas Cadhalpun2015-08-121-1/+0
| | | | | | | The table is used in libavutil/eval.c. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avcodec: optimize mathops for Loongson-3 v1ZhouXiaoyong2015-04-271-0/+3
| | | | | | | | | HAVE_LOONGSON is replaced by HAVE_LOONGSON3. Even Loongson-2E and 2F support Loongson SIMD instructs but have low performance for decoding. We plan to focus on optimizing Loongson-3A1000, 3B1500 and 3A1500, and modify the configure file to support Loongson-2 series later by adding HAVE_LOONGSON2. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/vc1_mc: move median4() to mathops.hzhaoxiu.zeng2015-02-161-0/+14
| | | | | | Needed for architecture specific optimizations Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Fix compile error on bfin.Bernd Kuhls2014-08-051-2/+0
| | | | | | | | | | | | | | | | | | After the removal of all Blackfin architecture optimizations in http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b55d3bbeed375f7b74442c4dd274d116a3e3d2e1 some includes were left behind leading to a compile error: CC libavformat/adtsenc.o In file included from ./libavcodec/get_bits.h:35, from ./libavcodec/ac3_parser.h:27, from libavformat/ac3dec.c:23: ./libavcodec/mathops.h:43:29: error: bfin/mathops.h: No such file or directory This compile error was found by buildroot autobuild system: http://autobuild.buildroot.net/results/ae0/ae056f267e907091d09d2a1546d6f1ae02fa23b9/ Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit 'f9279ee74936b4990fc46287c27816ef828cc06c'Michael Niedermayer2014-03-221-0/+4
|\ | | | | | | | | | | | | | | | | | | * commit 'f9279ee74936b4990fc46287c27816ef828cc06c': dsputil: Move ff_zigzag_direct and ff_crop_tab declarations to mathops.h Conflicts: libavcodec/imgconvert.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: Move ff_zigzag_direct and ff_crop_tab declarations to mathops.hDiego Biurrun2014-03-221-0/+4
| |
* | Merge commit '5397386effba2e53e4ff82852a86f6be4d59e9c1'Michael Niedermayer2014-03-041-9/+0
|\ \ | |/ | | | | | | | | | | * commit '5397386effba2e53e4ff82852a86f6be4d59e9c1': mathops: move macro to the only place it is used Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mathops: move macro to the only place it is usedVittorio Giovara2014-03-041-9/+0
| | | | | | | | This helps in disentangling lavf and lavc too.
* | Merge commit '9ae53c5860e17d087642d27b00dade071970a2e7'Michael Niedermayer2013-09-191-0/+10
|\ \ | |/ | | | | | | | | | | * commit '9ae53c5860e17d087642d27b00dade071970a2e7': lavc: add ff_u8_to_s8() for safe type punning of uint8_t to int8_t Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: add ff_u8_to_s8() for safe type punning of uint8_t to int8_tJustin Ruggles2013-09-181-0/+10
| |
* | Merge commit 'a22ae9f0c579793f411e2bd7a8db557091a3a4ae'Michael Niedermayer2013-08-061-0/+9
|\ \ | |/ | | | | | | | | | | * commit 'a22ae9f0c579793f411e2bd7a8db557091a3a4ae': mpegts: Remove one 64-bit integer modulus operation per packet Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegts: Remove one 64-bit integer modulus operation per packetBen Avison2013-08-051-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The common case of the pointer having increased by one packet (which results in no change to the modulus) can be detected with a 64-bit subtraction, which is far cheaper than a division on many platforms. Before After Mean StdDev Mean StdDev Change Divisions 248.3 8.8 51.5 7.4 +381.7% Overall 2773.2 25.6 2372.5 43.1 +16.9% Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'd5c62122a7b26704bf867a1262df358623bf5edf'Michael Niedermayer2012-10-131-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * commit 'd5c62122a7b26704bf867a1262df358623bf5edf': Move av_reverse table to libavcodec Conflicts: libavcodec/asvenc.c libavcodec/vble.c libavutil/common.h libavutil/mathematics.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Move av_reverse table to libavcodecDiego Biurrun2012-10-121-0/+1
| | | | | | | | It is only used in that library.
* | Merge commit '9734b8ba56d05e970c353dfd5baafa43fdb08024'Michael Niedermayer2012-10-121-0/+29
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit '9734b8ba56d05e970c353dfd5baafa43fdb08024': Move avutil tables only used in libavcodec to libavcodec. Conflicts: libavcodec/mathtables.c libavutil/intmath.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Move avutil tables only used in libavcodec to libavcodec.Diego Biurrun2012-10-111-0/+29
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-091-0/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * Move MASK_ABS macro to libavcodec/mathops.hMans Rullgard2012-08-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This macro is only used in two places, both in libavcodec, so this is a more sensible place for it. Two small tweaks to the macro are made: - removing the trailing semicolon - dropping unnecessary 'volatile' from the x86 asm Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-291-1/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: aacenc: Fix LONG_START windowing. aacenc: Fix a bug where deinterleaved samples were stored in the wrong place. avplay: use the correct array size for stride. lavc: extend doxy for avcodec_alloc_context3(). APIchanges: mention avcodec_alloc_context()/2/3 avcodec_align_dimensions2: set only 4 linesizes, not AV_NUM_DATA_POINTERS. aacsbr: ARM NEON optimised sbrdsp functions aacsbr: align some arrays aacsbr: move some simdable loops to function pointers cosmetics: Remove extra newlines at EOF Conflicts: libavcodec/utils.c libavfilter/formats.c libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Remove extra newlines at EOFAlex Converse2012-01-271-1/+0
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-10-141-1/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (22 commits) prores: add FATE tests id3v2: reduce the scope of some non-globally-used symbols/structures id3v2: cosmetics: move some declarations before the places they are used shorten: remove the flush function. shn: do not allow seeking in the raw shn demuxer. avformat: add AVInputFormat flag AVFMT_NO_BYTE_SEEK. avformat: update AVInputFormat allowed flags avformat: don't unconditionally call ff_read_frame_flush() when trying to seek. truespeech: use sizeof() instead of hardcoded sizes truespeech: remove unneeded variable, 'consumed' truespeech: simplify truespeech_read_frame() by using get_bits() truespeech: decode directly to output buffer instead of a temp buffer truespeech: check to make sure channels == 1 truespeech: check for large enough output buffer rather than truncating output truespeech: remove unneeded zero-size packet check. mlpdec: return meaningful error codes instead of -1 mlpdec: remove unnecessary wrapper function mlpdec: only calculate output size once mlpdec: validate that the reported channel count matches the actual output channel count pcm: reduce pointer type casting ... Conflicts: libavformat/avformat.h libavformat/id3v2.c libavformat/id3v2.h libavformat/utils.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mathops: remove undefined behaviour from sign_extend()Mans Rullgard2011-10-131-1/+3
| | | | | | | | | | | | | | | | This function intentionally overflows the signed range on the left shift. Using this type-punning avoids errors from the overflow checker without disabling this test globally. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-06-051-6/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: ARM: remove MULL inline asm mathops: use MUL64 macro where it forms part of other ops tty: factorise returning error codes. rawdec: add framerate private option. x11grab: add framerate private option. fbdev,v4l2: remove some forgotten uses of AVFormatParameters.time_base. bktr: don't error when AVFormatParameters.time_base isn't set. cmdutils: add missing const qualifier Skip headers not designed to work standalone during 'make checkheaders'. Add missing #includes to make headers self-contained. musepack: remove unnecessary #include from mpcdata.h musepack: remove extraneous mpcdata.h inclusions Fix error check in av_file_map() Conflicts: cmdutils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mathops: use MUL64 macro where it forms part of other opsMans Rullgard2011-06-041-6/+6
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Add missing #includes to make headers self-contained.Diego Biurrun2011-06-041-0/+1
| | | | | | | | This fixes 'make checkheaders'.
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-05-171-3/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 12 files changed, 36 insertions(+), 81 deletions(-) yes thats 36 new lines in 14 commits * qatar/master: ffmpeg: fix -aspect cli option Restructure video filter implementation in ffmpeg.c. ffplay: remove audio_write_get_buf_size() forward declaration lavfi: print key-frame and picture type information in ff_dlog_ref() mathops: remove ancient confusing comment cws2fws: Improve error message wording. tools: Check the return value of write(). mpegaudio: move OUT_FMT macro to mpegaudiodec.c mpegaudio: remove OUT_MIN/MAX macros Add missing #includes to mp3_header_(de)compress bsf dct: fix indentation dct: bypass table allocation for DCT_II of size 32 h264dsp_mmx: Add #ifdefs around some mmxext functions on x86_64. Remove unused header mpegaudio3.h. Conflicts: ffmpeg.c libavcodec/mpegaudio.h libavcodec/mpegaudio3.h libavfilter/avfilter.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mathops: remove ancient confusing commentMans Rullgard2011-05-161-3/+0
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Add more int packing macros, name them consistentlyMåns Rullgård2010-06-301-5/+29
| | | | Originally committed as revision 23916 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Rename PACK4x8() to PACK4UINT8().Ronald S. Bultje2010-06-221-2/+2
| | | | Originally committed as revision 23721 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add a macro to pack 4 bytes into native byte-order so they can be writtenRonald S. Bultje2010-06-221-0/+8
| | | | | | at once using a single 32-bit store. Originally committed as revision 23715 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use standard C for implementing sign_extend() and zero_extend().Michael Niedermayer2010-05-131-2/+2
| | | | | | This fixes compilation of probetest Originally committed as revision 23116 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add zero_extend() functionMåns Rullgård2010-02-211-0/+7
| | | | Originally committed as revision 21947 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move NEG_[US]SR32 macros to mathops.hMåns Rullgård2010-02-171-0/+8
| | | | Originally committed as revision 21873 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add UMULH()Måns Rullgård2010-01-261-0/+6
| | | | | | | This function/macro returns the high half of the unsigned 64-bit product of two unsigned 32-bit operands. Originally committed as revision 21463 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move COPY3_IF_LT to lavc/mathops.hMåns Rullgård2010-01-201-0/+9
| | | | | | | | This obscure macro is only used in motion_est.c so having it in lavc makes more sense. See discussion here: http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-November/056561.html Originally committed as revision 21346 to svn://svn.ffmpeg.org/ffmpeg/trunk
* AVR32: optimised mathops.hMåns Rullgård2009-08-171-0/+2
| | | | | | 44% faster MP3 decoding Originally committed as revision 19667 to svn://svn.ffmpeg.org/ffmpeg/trunk
* MIPS: add MIPS64 and Loongson asm for MAC64/MLS64Måns Rullgård2009-05-281-0/+2
| | | | Originally committed as revision 18979 to svn://svn.ffmpeg.org/ffmpeg/trunk
* mathops: sort arch-specific #include linesMåns Rullgård2009-05-201-5/+5
| | | | Originally committed as revision 18886 to svn://svn.ffmpeg.org/ffmpeg/trunk
* mathops: whitespace cosmeticsMåns Rullgård2009-05-201-12/+4
| | | | Originally committed as revision 18885 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add sign_extend() function to mathops.hMåns Rullgård2009-03-031-0/+7
| | | | Originally committed as revision 17738 to svn://svn.ffmpeg.org/ffmpeg/trunk
* re-enable mid_pred asm on x86_64. (broke in r16681)Loren Merritt2009-02-081-1/+1
| | | | Originally committed as revision 17058 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: Remove pointless period after copyright statement non-sentences.Diego Biurrun2009-01-191-1/+1
| | | | Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
* moves mid_pred() into mathops.h (with arch specific code split by directory)Aurelien Jacobs2009-01-181-0/+30
| | | | Originally committed as revision 16681 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change semantic of CONFIG_*, HAVE_* and ARCH_*.Aurelien Jacobs2009-01-131-4/+4
| | | | | | They are now always defined to either 0 or 1. Originally committed as revision 16590 to svn://svn.ffmpeg.org/ffmpeg/trunk
* consistency cosmetics: Rename POWERPC identifiers to PPC.Diego Biurrun2008-12-271-1/+1
| | | | Originally committed as revision 16359 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Rename libavcodec/i386/ --> libavcodec/x86/.Diego Biurrun2008-12-221-1/+1
| | | | | | | It contains optimizations that are not specific to i386 and libavutil uses this naming scheme already. Originally committed as revision 16270 to svn://svn.ffmpeg.org/ffmpeg/trunk
* ARM: replace "armv4l" with "arm"Måns Rullgård2008-12-171-2/+2
| | | | Originally committed as revision 16179 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add shift argument to MULL() macroMåns Rullgård2008-11-241-1/+1
| | | | | | | | This replaces use of FRAC_BITS in the MULL() definition with a third argument specifying the shift amount. All uses of this macro are updated to pass FRAC_BITS as third argument. Originally committed as revision 15921 to svn://svn.ffmpeg.org/ffmpeg/trunk
OpenPOWER on IntegriCloud