Commit Graph

34 Commits

Author SHA1 Message Date
Andrew D'Addesio 9b45bcf713 libavutil: Add saturating subtraction functions
Add av_sat_sub32 and av_sat_dsub32 as the subtraction analogues to
av_sat_add32/av_sat_dadd32.

Also clarify the formulas for dadd32/dsub32.

Signed-off-by: Andrew D'Addesio <modchipv12@gmail.com>
2017-12-04 07:28:45 +00:00
Michael Niedermayer d82d11397f avutil/arm/intmath: return int for uint8 / uint16 clip
The C functions return uint8/16_t but that is effectively int not unsigned int
Fixes fate-filter-tblend

We do not return uint8/16_t as that would require the compiler to truncate the
values, slowing it down.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 17:20:16 +02:00
Michael Niedermayer 1253091d6f Merge commit '76ce9bd8e26dcb3652240a1072840ff4011d7cdc'
* commit '76ce9bd8e26dcb3652240a1072840ff4011d7cdc':
  libavutil: Add ARM av_clip_intp2_arm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 11:15:32 +01:00
Peter Meerwald 76ce9bd8e2 libavutil: Add ARM av_clip_intp2_arm
add ARM code for implementing av_clip_intp2 using the ssat instruction

on Cortex-A8, av_clip_intp2_arm() is faster than av_clip_intp2_c() and
the generic av_clip(), about -19%

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-02-21 00:54:40 +01:00
Michael Niedermayer 89c8eaa321 Merge commit '637606de2d2e0af0a9fa2f23f943765d7d7c5cd5'
* commit '637606de2d2e0af0a9fa2f23f943765d7d7c5cd5':
  configure: arm: make _inline arch ext symbols depend on inline_asm
  arm: use HAVE*_INLINE/EXTERNAL macros for conditional compilation

Conflicts:
	configure
	libavcodec/arm/dca.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-08 14:19:55 +01:00
Mans Rullgard a7831d509f arm: use HAVE*_INLINE/EXTERNAL macros for conditional compilation
These macros reflect the actual capabilities required here.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-12-07 16:54:03 +00:00
Michael Niedermayer e335658370 Merge commit '9734b8ba56d05e970c353dfd5baafa43fdb08024'
* 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>
2012-10-12 14:26:46 +02:00
Diego Biurrun 9734b8ba56 Move avutil tables only used in libavcodec to libavcodec. 2012-10-11 18:29:36 +02:00
Michael Niedermayer 7427d1ca4a Merge remote-tracking branch 'qatar/master'
* 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>
2012-08-14 15:34:39 +02:00
Mans Rullgard 87fa05a0da ARM: intmath: use native-size return types for clipping functions
This avoids having the compiler redundantly mask the values to
the smaller size.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 14:51:52 +01:00
Michael Niedermayer d8c3170c9f Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
  g723.1: do not pass large structs by value
  g723.1: do not bounce intermediate values via memory
  g723.1: declare a variable in the block it is used
  g723.1: avoid saving/restoring excitation
  g723.1: avoid unnecessary memcpy() in residual_interp()
  g723.1: make postfilter write directly to output buffer
  g723.1: drop unnecessary variable buf_ptr in formant_postfilter()
  g723.1: make scale_vector() output to a separate buffer
  g723.1: make autocorr_max() work on an arbitrary buffer
  g723.1: do not needlessly use int64_t
  g723.1: use saturating addition functions
  g723.1: optimise scale_vector()
  g723.1: remove useless uses of MUL64()
  g723.1: remove unnecessary argument 'shift' from dot_product()
  g723.1: deobfuscate "(x << 4) - x" to "15 * x"
  celp: optimise ff_celp_lp_synthesis_filter()
  libavutil: add saturating addition functions
  cllc: Implement ARGB support
  cllc: Add support for QRGB
  cllc: Rename some funcs to represent what they actually do
  ...

Conflicts:
	LICENSE
	libavcodec/g723_1.c
	libavcodec/x86/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-13 14:38:43 +02:00
Mans Rullgard 6c4975eaaf libavutil: add saturating addition functions
Fixed-point audio codecs often use saturating arithmetic, and
special instructions for these operations are common.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-13 01:03:10 +01:00
Michael Niedermayer 18b0c39f99 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  g723.1: fix addition overflow
  g723.1: simplify and fix multiplication overflow
  g723.1: deobfuscate an expression
  g723.1: remove unused #includes
  ARM: add missing "cc" clobber in av_clipl_int32_arm()
  rtmp: Factorize the code by adding handle_invoke_error
  rtmp: Factorize the code by adding handle_invoke_status
  rtmp: Factorize the code by adding handle_invoke_result
  libavutil: remove unused av_abort() macro
  ffmenc: replace if/abort with assert()
  libavutil: drop offsetof() fallback definition
  libavutil: drop fallback definitions of INTxx_MIN/MAX
  configure: Check for a sctp struct instead of just the header
  configure: suncc: Add -xc99 to dependency flags, required on Solaris
  doxygen: Fix function parameter names to match the code
  doc: Drop obsolete shared libs cflags hint to workaround Cygwin gcc bugs
  swf: Move shared table out of the header file
  swf: Move swf_audio_codec_tags table to the only place it is used
  fate: add G.723.1 decoder tests

Conflicts:
	configure
	doc/platform.texi
	libavformat/Makefile
	libavutil/arm/intmath.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-10 16:25:23 +02:00
Mans Rullgard 0d735ca214 ARM: add missing "cc" clobber in av_clipl_int32_arm()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-10 10:51:10 +01:00
Michael Niedermayer 11a1033c9f Merge remote-tracking branch 'qatar/master'
* qatar/master: (23 commits)
  build: cosmetics: Reorder some lists in a more logical fashion
  x86: pngdsp: Fix assembly for OS/2
  fate: add test for RTjpeg in nuv with frameheader
  rtmp: send check_bw as notification
  g723_1: clip argument for 15-bit version of normalize_bits()
  g723_1: use all LPC vectors in formant postfilter
  id3v2: Support v2.2 PIC
  avplay: fix build with lavfi disabled.
  avconv: split configuring filter configuration to a separate file.
  avconv: split option parsing into a separate file.
  mpc8: do not leave padding after last frame in buffer for the next decode call
  mpegaudioenc: list supported channel layouts.
  mpegaudiodec: don't print an error on > 1 frame in a packet.
  api-example: update to new audio encoding API.
  configure: add --enable/disable-random option
  doc: cygwin: Update list of FATE package requirements
  build: Remove all installed headers and header directories on uninstall
  build: change checkheaders to use regular build rules
  rtmp: Add a new option 'rtmp_subscribe'
  rtmp: Add support for subscribing live streams
  ...

Conflicts:
	Makefile
	common.mak
	configure
	doc/examples/decoding_encoding.c
	ffmpeg.c
	libavcodec/g723_1.c
	libavcodec/mpegaudiodec.c
	libavcodec/x86/pngdsp.asm
	libavformat/version.h
	library.mak
	tests/fate/video.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-09 00:51:02 +02:00
Mans Rullgard ec9d2c15c1 ARM: use Q/R inline asm operand modifiers only if supported
Some compilers do not support the Q/R modifiers used to access
the low/high parts of a 64-bit register pair.  Check for this
and disable all uses of it when not supported.

Fixes bug #337.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-07 21:13:30 +01:00
Michael Niedermayer 86e107a7d4 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  cosmetics: Consistently use C-style comments with multiple inclusion guards
  anm: fix a few Doxygen comments
  misc typo and wording fixes
  attributes: add av_noreturn
  attributes: drop pointless define guards
  configure: do not disable av_always_inline with --enable-small
  flvdec: initial stream switch support
  avplay: fix write on freed memory for rawvideo
  snow: remove a VLA used for edge emulation
  x86: lavfi: fix gradfun/yadif build with mmx/sse disabled
  snow: remove the runs[] VLA.
  snow: Check mallocs at init
  flacdec: remove redundant setting of avctx->sample_fmt

Conflicts:
	ffplay.c
	libavcodec/h264.c
	libavcodec/snow.c
	libavcodec/snow.h
	libavcodec/snowdec.c
	libavcodec/snowenc.c
	libavformat/flvdec.c
	libavutil/attributes.h
	tools/patcheck

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-04 00:32:31 +02:00
Michael Niedermayer 2942431a0f arm/intmath: disable av_clip_uintp2_arm with config_small
The code otherwise breaks compilation (gcc 4.5 tested but probably any compiler)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-12 23:05:47 +02:00
Michael Niedermayer 96bc6485bc arm: fix av_clipl_int32() asm
Note, the other arm asm code is likely affected too and should be changed as well.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-11 20:25:55 +02:00
Michael Niedermayer 686959e87e Merge remote-tracking branch 'qatar/master'
* qatar/master:
  doxygen: Consistently use '@' instead of '\' for Doxygen markup.
  Use av_printf_format to check the usage of printf style functions
  Add av_printf_format, for marking printf style format strings and their parameters
  ARM: enable thumb for Cortex-M* CPUs
  nsvdec: Propagate error values instead of returning 0 in nsv_read_header().
  build: remove SRC_PATH_BARE variable
  build: move basic rules and variables to main Makefile
  build: move special targets to end of main Makefile
  lavdev: improve feedback in case of invalid frame rate/size
  vfwcap: prefer "framerate_q" over "fps" in vfw_read_header()
  v4l2: prefer "framerate_q" over "fps" in v4l2_set_parameters()
  fbdev: prefer "framerate_q" over "fps" in device context
  bktr: prefer "framerate" over "fps" for grab_read_header()
  ALSA: implement channel layout for playback.
  alsa: support unsigned variants of already supported signed formats.
  alsa: add support for more formats.
  ARM: allow building in Thumb2 mode

Conflicts:
	common.mak
	doc/APIchanges
	libavcodec/vdpau.h
	libavdevice/alsa-audio-common.c
	libavdevice/fbdev.c
	libavdevice/libdc1394.c
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-24 03:07:04 +02:00
Mans Rullgard 8986fddc2b ARM: allow building in Thumb2 mode
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-23 07:31:54 +01:00
Michael Niedermayer b8a43bc1b5 Merge remote-tracking branch 'qatar/master' into master
* qatar/master: (27 commits)
  ac3enc: fix LOCAL_ALIGNED usage in count_mantissa_bits()
  ac3dsp: do not use the ff_* prefix when referencing ff_ac3_bap_bits.
  ac3dsp: fix loop condition in ac3_update_bap_counts_c()
  ARM: unbreak build
  ac3enc: modify mantissa bit counting to keep bap counts for all values of bap instead of just 0 to 4.
  ac3enc: split mantissa bit counting into a separate function.
  ac3enc: store per-block/channel bap pointers by reference block in a 2D array rather than in the AC3Block struct.
  get_bits: add av_unused tag to cache variable
  sws: replace all long with int.
  ARM: aacdec: fix constraints on inline asm
  ARM: remove unnecessary volatile from inline asm
  ARM: add "cc" clobbers to inline asm where needed
  ARM: improve FASTDIV asm
  ac3enc: use LOCAL_ALIGNED macro
  APIchanges: fill in git hash for av_get_pix_fmt_name (0420bd7).
  lavu: add av_get_pix_fmt_name() convenience function
  cmdutils: remove OPT_FUNC2
  swscale: fix crash in bilinear scaling.
  vpxenc: add VP8E_SET_STATIC_THRESHOLD mapping
  webm: support stereo videos in matroska/webm muxer
  ...

Conflicts:
	Changelog
	cmdutils.c
	cmdutils.h
	doc/APIchanges
	doc/muxers.texi
	ffmpeg.c
	ffplay.c
	libavcodec/ac3enc.c
	libavcodec/ac3enc_float.c
	libavcodec/avcodec.h
	libavcodec/get_bits.h
	libavcodec/libvpxenc.c
	libavcodec/version.h
	libavdevice/libdc1394.c
	libavformat/matroskaenc.c
	libavutil/avutil.h
	libswscale/rgb2rgb.c
	libswscale/swscale.c
	libswscale/swscale_template.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-29 03:34:35 +02:00
Mans Rullgard a84f82560e ARM: improve FASTDIV asm
This uses one register less.  Also add missing "cc" clobber.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-28 15:00:17 +01:00
Michael Niedermayer 027264cb82 Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits)
  ARM: add ARMv6 optimised av_clip_uintp2
  ARM: remove volatile from asm statements in libavutil/intmath
  ARM: fix av_clipl_int32_arm()
  v4l: include avdevice.h
  ffserver: move close_connection() call to avoid a temporary string and copy.
  lavf: initialize demuxer private options.
  AVOptions: set string default values.
  lavdevice: mark v4l for removal on next major bump.
  swscale: fix compile on ppc.
  swscale: fix compile on x86-32.
  build: Remove generated .version file on distclean.
  configure: Add -D_GNU_SOURCE to CPPFLAGS on OS/2.
  doc: Drop hint at --enable-memalign-hack for MinGW, it is now autodetected.
  ffplay: Remove disabled code.
  Mark parameterless function declarations as 'void'.
  swscale: use av_clip_uint8() in yuv2yuv1_c().
  swscale: remove VOF/VOFW.
  swscale: split chroma buffers into separate U/V planes.
  swscale: replace formatConvBuffer[VOF] by allocated array.
  rgb2rgb: remove duplicate mmx/mmx2/3dnow/sse2 functions.
  ...

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-27 02:53:21 +02:00
Mans Rullgard ca7d8256e3 ARM: add ARMv6 optimised av_clip_uintp2
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-26 20:13:00 +01:00
Mans Rullgard 77cd6efc33 ARM: remove volatile from asm statements in libavutil/intmath
The volatile qualifiers are not needed on these statements as
their effects are fully specified by constraints.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-26 20:13:00 +01:00
Mans Rullgard 74cc8c52ed ARM: fix av_clipl_int32_arm()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-26 20:12:59 +01:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Jason Garrett-Glaser 545dc699f8 Force inlining of avutil common routines
On some versions of gcc, these weren't always getting inlined due to hitting
the inline cap limit in some files.  This is generally bad, as most of these
functions are smaller inlined than not.
(cherry picked from commit eb3755a5aa)
2011-02-18 19:52:41 +01:00
Jason Garrett-Glaser eb3755a5aa Force inlining of avutil common routines
On some versions of gcc, these weren't always getting inlined due to hitting
the inline cap limit in some files.  This is generally bad, as most of these
functions are smaller inlined than not.
2011-02-17 15:25:25 -08:00
Måns Rullgård 9077e29ecc ARM: optimised integer clip functions
Originally committed as revision 24089 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-07 17:27:51 +00:00
Måns Rullgård edd7fa82d7 ARM: intmath.h cosmetics
Originally committed as revision 24088 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-07 17:27:48 +00:00
Måns Rullgård 2ed6f39944 Replace many includes of libavutil/common.h with what is actually needed
This reduces the number of false dependencies on header files and
speeds up compilation.

Originally committed as revision 22407 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-09 17:39:19 +00:00
Måns Rullgård 75fb5c24ed Move FASTDIV macro to intmath.h
Originally committed as revision 21335 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-19 23:25:36 +00:00