Commit Graph

1119 Commits

Author SHA1 Message Date
Michael Niedermayer 62101030c4 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: fix byte overreads in SSE-optimized hscale().
  matroskadec: fix typo.
  matroskadec: bail on parsing of incorrect seek index segments

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-15 23:10:26 +02:00
Ronald S. Bultje ea540401d6 swscale: fix byte overreads in SSE-optimized hscale().
SSE-optimized hScale() scales up to 4 pixels at once, so we need to
allocate up to 3 padding pixels to prevent overreads. This fixes
valgrind errors in various swscale-tests on fate.
2011-09-15 07:30:46 -07:00
Michael Niedermayer d06c5b44cc swscale: drop redundant code.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-14 00:32:18 +02:00
Michael Niedermayer 1eb8014b49 swscale: add 14bit support to the "MMX/SSE2/SSSE3/SSE4 versions for horizontal scaling"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-14 00:19:03 +02:00
Michael Niedermayer 7700846cf6 swscale: remove unused and forgotten file.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-14 00:05:19 +02:00
Michael Niedermayer cac9877ed5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  sws: implement MMX/SSE2/SSSE3/SSE4 versions for horizontal scaling.
  include stdint.h in adpcm_data.h
  mpeg12: reorder functions to avoid ugly forward declarations
  Fixed off by one packet size allocation in the smacker demuxer.
  Check for invalid packet size in the smacker demuxer.
  ape demuxer: fix segfault on memory allocation failure.
  xan: Add some buffer checks
  xan: Remove extra trailing newline
  Fixed size given to init_get_bits() in xan decoder.

Conflicts:
	libavcodec/mpeg12.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-13 23:44:12 +02:00
Ronald S. Bultje e0c3e07387 sws: implement MMX/SSE2/SSSE3/SSE4 versions for horizontal scaling.
Speed: from 3.9x to 9.6x speed improvement over C, and some small
(up to 15%) speed improvements over existing MMX code (particularly
for bigger filters).
2011-09-13 09:53:42 -07:00
Michael Niedermayer 27bf599350 swscale: Fix unused asm and enable it
Author of the fix is ronald, the enabling & commit message are mine.

This fixes
	commit 4e3e333a79
	Author: Ronald S. Bultje <rsbultje@gmail.com>
	Date:   Tue Jul 5 12:49:11 2011 -0700

	    swscale: error dithering for 16/9/10-bit to 8-bit.

	    Based on a somewhat similar idea in FFmpeg's swscale copy.

The Fix was originally commited in: (and i missed it due to the commit message)
	commit 5c391a161a
	Author: Ronald S. Bultje <rsbultje@gmail.com>
	Date:   Fri Jul 8 14:39:04 2011 -0700

	    swscale: rename uv_off/uv_off2 to uv_off_px/byte.
2011-09-05 18:42:44 +02:00
Michael Niedermayer 1889c6724a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  AVOptions: fix av_set_string3() doxy to match reality.
  cmdutils: get rid of dummy contexts for examining AVOptions.
  lavf,lavc,sws: add {avcodec,avformat,sws}_get_class() functions.
  AVOptions: add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find().
  cpu detection: avoid a signed overflow

Conflicts:
	avconv.c
	cmdutils.c
	doc/APIchanges
	ffmpeg.c
	libavcodec/options.c
	libavcodec/version.h
	libavformat/version.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-04 04:11:53 +02:00
Anton Khirnov fb4ca26bdb lavf,lavc,sws: add {avcodec,avformat,sws}_get_class() functions. 2011-09-03 20:53:35 +02:00
Reimar Döffinger 746f1f14de Remove unused variables.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-09-01 22:55:51 +02:00
Clément Bœsch 7c14c24250 sws: fix a huge amount of incompatible pointer type arguments warnings. 2011-09-01 20:23:40 +02:00
Michael Niedermayer abe0b8e9f3 sws: use shift for chroma sample up convertion
sws: use shifts for non full range luma sample upconvertion

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-25 14:49:29 +02:00
Michael Niedermayer edae3dbf1d Merge remote-tracking branch 'qatar/master'
* qatar/master: (23 commits)
  h264: hide reference frame errors unless requested
  swscale: split hScale() function pointer into h[cy]Scale().
  Move clipd macros to x86util.asm.
  avconv: reindent.
  avconv: rescue poor abused start_time global.
  avconv: rescue poor abused recording_time global.
  avconv: merge two loops in output_packet().
  avconv: fix broken indentation.
  avconv: get rid of the arbitrary MAX_FILES limit.
  avconv: get rid of the output_streams_for_file vs. ost_table schizophrenia
  avconv: add a wrapper for output AVFormatContexts and merge output_opts into it
  avconv: make itsscale syntax consistent with other options.
  avconv: factor out adding input streams.
  avconv: Factorize combining auto vsync with format.
  avconv: Factorize video resampling.
  avconv: Don't unnecessarily convert ipts to a double.
  ffmpeg: remove unsed variable nopts
  RV3/4 parser: remove unused variable 'off'
  add XMV demuxer
  rmdec: parse FPS in RealMedia properly
  ...

Conflicts:
	avconv.c
	libavformat/version.h
	libswscale/swscale.c
	tests/ref/fate/lmlm4-demux

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-18 10:56:08 +02:00
Ronald S. Bultje 3f04ab4fcd swscale: split hScale() function pointer into h[cy]Scale().
This allows using more specific implementations for chroma/luma, e.g.
we can make assumptions on filterSize being constant, thus avoiding
that test at runtime.
2011-08-17 20:56:06 -07:00
Michael Niedermayer d9c9a0c767 sws: remove hScale16NX_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-14 19:34:48 +02:00
Michael Niedermayer 66bb5cd592 sws: remove hScale16N() and use ronalds reformated version of it.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-14 19:34:48 +02:00
Michael Niedermayer 3652409f5b sws: remove unneeded code from last merge
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-14 19:34:48 +02:00
Michael Niedermayer ca1dfea127 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: add dithering to yuv2yuvX_altivec_real
  rv34: free+allocate buffer instead of reallocating it to preserve alignment
  h264: add missing brackets.
  swscale: use 15-bit intermediates for 9/10-bit scaling.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-13 22:24:47 +02:00
Luca Barbato 3304a1e69a swscale: add dithering to yuv2yuvX_altivec_real
It just does that part in scalar form, I doubt using a vector store
over 2 array would speed it up particularly.

The function should be written to not use a scratch buffer.
2011-08-13 00:06:04 +02:00
Ronald S. Bultje 28c1115a91 swscale: use 15-bit intermediates for 9/10-bit scaling. 2011-08-12 11:54:25 -07:00
Michael Niedermayer 3e32bf3dbd Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lsws: remove optimization debug logs in sws_init_context()
  lsws: use array for storing the supported in/out information

Conflicts:
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-05 21:47:21 +02:00
Stefano Sabatini 6a92551234 lsws: remove optimization debug logs in sws_init_context()
The logged information is possibly false, and it tends to be outdated
after each change since the logging code needs to be manually updated.

Simplify and prevent confusing wrong debug messages.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-08-05 00:45:06 +02:00
Stefano Sabatini 347167ecf5 lsws: use array for storing the supported in/out information
Also remove the unnecessary isSupportedIn/Out macros.

Make the code more compact/readable, and simplify the access to
lsws-specific pixel format information.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-08-05 00:44:11 +02:00
Stefano Sabatini 4ce0a94656 lsws: remove deprecated and unused stuff after the 0->1 major bump 2011-08-04 00:23:00 +02:00
Ronald S. Bultje 62ee0e6a97 Revert "swscale: use 15-bit intermediates for 9/10-bit scaling."
This reverts commit ac0fb59348. It
causes valgrind errors which I'll want to investigate before
resubmitting this.
2011-08-02 12:27:43 -07:00
Ronald S. Bultje ac0fb59348 swscale: use 15-bit intermediates for 9/10-bit scaling. 2011-08-02 10:34:02 -07:00
Michael Niedermayer 335bbe424f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavc: Deprecate unused FF_ER_VERY_AGGRESSIVE
  x11grab: add show_region AVOption.
  x11grab: add follow_mouse AVOption.
  Do not convert RGB buffer at once when stride does not fit exact samples.

Conflicts:
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-01 00:35:57 +02:00
Kostya Shishkov 42ba12888b Do not convert RGB buffer at once when stride does not fit exact samples.
When converting RGB format to RGB format with the same bits per sample,
unscaled path performs conversion on the whole buffer at once. For
non-multiple-of-16 BGR24 to RGB24 conversion it means that padding at the
end of line will be converted too. Since it may be of arbitrary length
(e.g. 8 bytes), operating on the whole buffer produces obviously wrong
results.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-07-30 09:51:23 -07:00
Stefano Sabatini 25a53c54d1 lsws: apply logging factorization in sws_scale_init() 2011-07-28 10:27:51 +02:00
Stefano Sabatini 07f49ca1d1 lsws: remove redundant macros isSupportedIn/Out
Directly call sws_isSupportedInput/Output.
2011-07-27 01:52:09 +02:00
Stefano Sabatini 64bb656326 lsws: factorize some logging code in sws_init_context() 2011-07-27 01:28:05 +02:00
Stefano Sabatini e8794f1d5e lsws: fix weird indent 2011-07-25 13:02:53 +02:00
Stefano Sabatini c899bedbca lsws: use array for storing the supported in/out information 2011-07-25 11:11:49 +02:00
Michael Niedermayer f93f6963ba Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rv30: return AVERROR(EINVAL) instead of EINVAL
  build: add -L flags before existing LDFLAGS
  simple_idct: whitespace cosmetics
  simple_idct: make repeated code a macro
  dsputil: remove huge #if 0 block
  simple_idct: change 10-bit add/put stride from pixels to bytes
  dsputil: allow 9/10-bit functions for non-h264 codecs
  dnxhd: rename some data tables
  dnxhdenc: remove inline from function only called through pointer
  dnxhdenc: whitespace cosmetics
  swscale: mark YUV422P10(LE,BE) as supported for output
  configure: add -xc99 to LDFLAGS for Sun CC
  Remove unused and non-compiling vestigial g729 decoder
  Remove unused code under G729_BITEXACT #ifdef.
  mpegvideo: fix invalid picture unreferencing.
  dsputil: Remove extra blank line at end.
  dsputil: Replace a LONG_MAX check with HAVE_FAST_64BIT.
  simple_idct: add 10-bit version

Conflicts:
	Makefile
	libavcodec/g729data.h
	libavcodec/g729dec.c
	libavcodec/rv30.c
	tests/ref/lavfi/pixdesc
	tests/ref/lavfi/pixfmts_copy
	tests/ref/lavfi/pixfmts_null
	tests/ref/lavfi/pixfmts_scale
	tests/ref/lavfi/pixfmts_vflip

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-21 16:28:53 +02:00
Joseph Artsimovich eedb1f2034 swscale: mark YUV422P10(LE,BE) as supported for output
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-21 02:10:31 +01:00
Michael Niedermayer 042f9d62ca Merge remote-tracking branch 'qatar/master'
* qatar/master:
  configure: Automatically add more flags required on symbian
  mem.h: switch doxygen parameter order to match function prototype
  doxygen: replace @sa tag by the more readable but equivalent @see
  doxygen: use Doxygen markup for authors and web links where appropriate
  doxygen: do not include license boilerplate in Doxygen documentation
  ac3enc: Mark AVClasses const
  ffserver: Replace two loops with one loop.
  ffmpeg: Fix the check for experimental codecs
  swscale: extend mmx padding.
  swscale: clip unscaled colorspace conversion path.
  doxygen: misc consistency cosmetics
  doc: remove file name from @file directive in Doxygen usage example
  doxygen: consistently place brief description
  doxygen: place empty line between brief description and detailed description
  avformat_open_input(): Add braces to shut up gcc warning.

Conflicts:
	libavcodec/8svx.c
	libavcodec/tiff.c
	libavcodec/tiff.h
	libavcodec/vaapi_h264.c
	libavcodec/vorbis.c
	libavcodec/vorbisdec.c
	libavcodec/vp6.c
	libswscale/swscale_unscaled.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-15 17:51:09 +02:00
Ronald S. Bultje baba2eedac swscale: extend mmx padding.
Fixes a crash when forcing libc to strictly adhere to malloc sizes.
2011-07-14 13:27:06 -07:00
Ronald S. Bultje 55eda370cb swscale: clip unscaled colorspace conversion path.
Prevents overflows on very bright scenes when adding dither,
which may lead to black dots.
2011-07-14 13:27:06 -07:00
Michael Niedermayer 5dc6bd86f0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  APIchanges: fill in missing hashes and dates.
  Add an APIChanges entry and bump minor versions for recent changes.
  ffmpeg: print the low bitrate warning after the codec is openend.
  doxygen: Move function documentation into the macro generating the function.
  doxygen: Make sure parameter names match between .c and .h files.
  h264: move fill_decode_neighbors()/fill_decode_caches() to h264_mvpred.h
  H.264: Add more x86 assembly for 10-bit H.264 predict functions
  lavf: fix invalid reads in avformat_find_stream_info()
  cmdutils: replace opt_default with opt_default2() and remove set_context_opts
  ffmpeg: use new avcodec_open2 and avformat_find_stream_info API.
  ffplay: use new avcodec_open2 and avformat_find_stream_info API.
  cmdutils: store all codec options in one dict instead of video/audio/sub
  ffmpeg: check experimental flag after codec is opened.
  ffmpeg: do not set GLOBAL_HEADER flag in the options context

Conflicts:
	cmdutils.c
	doc/APIchanges
	ffmpeg.c
	ffplay.c
	libavcodec/version.h
	libavformat/version.h
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-14 20:44:58 +02:00
Diego Biurrun 96c1e6d40d doxygen: Make sure parameter names match between .c and .h files. 2011-07-14 04:09:49 +02:00
Michael Niedermayer 3602ad7ee6 Merge commit '142e76f1055de5dde44696e71a5f63f2cb11dedf'
* commit '142e76f1055de5dde44696e71a5f63f2cb11dedf':
  swscale: fix crash with dithering due incorrect offset calculation.
  matroskadec: fix stupid typo (!= -> ==)
  build: remove duplicates from order-only directory prerequisite list
  build: rework rules for things in the tools dir
  configure: fix --cpu=host with gcc 4.6
  ARM: use const macro to define constant data in asm
  bitdepth: simplify FUNC/FUNCC macros
  dsputil: remove ff_emulated_edge_mc macro used in one place
  9/10-bit: simplify clipping macros
  matroskadec: reindent
  matroskadec: defer parsing of cues element until we seek.
  lavc: add support for codec-specific defaults.
  lavc: make avcodec_alloc_context3 officially public.
  lavc: remove a half-working attempt at different defaults for audio/video codecs.
  ac3dec: add a drc_scale private option
  lavf: add avformat_find_stream_info()
  lavc: introduce avcodec_open2() as a replacement for avcodec_open().

Conflicts:
	Makefile
	libavcodec/utils.c
	libavformat/avformat.h
	libswscale/swscale_internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-11 04:23:25 +02:00
Michael Niedermayer 3b2d285afb Merge branch 'sws_32bit_integration'
* sws_32bit_integration:
  regtests/sws: update checksums for recent changes
  sws: dont mess with XInc when the code needing it isnt used
  sws: Fix chroma init for 32bit buffers.
  swscale: error dithering for 16/9/10-bit to 8-bit.
  swscale: fix overflow in 16-bit vertical scaling.
  swscale: fix crash in 8-bpc bilinear output without alpha.
  swscale: fix 16-bit scaling when output is 8-bits.
  sws: fix non native endian 9-15 bit input with 16bit out
  sws: disable scale16 when int32 is used
  sws: fix rgb -> 16bit
  sws: fix uv overwrite in 32bt
  sws: fix gray16_1
  sws:ix yuv2rgb48_1_c_template()
  sws: fix 16/32 bug from merge
  swscale: for >8bit scaling, read in native bit-depth.
  swscale: fix another yuv range conversion overflow in 16bit scaling. (cherry picked from commit 81cc7d0bd1)
  swscale: fix yuv range correction when using 16-bit scaling. (cherry picked from commit e0b8fff6c7)
  swscale: implement >8bit scaling support.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-11 04:01:01 +02:00
Michael Niedermayer e1d9cee13d sws: dont mess with XInc when the code needing it isnt used
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-11 03:51:46 +02:00
Michael Niedermayer 29fb1b5a06 sws: Fix chroma init for 32bit buffers.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-11 03:51:46 +02:00
Ronald S. Bultje c59f9a68e2 swscale: error dithering for 16/9/10-bit to 8-bit.
Based on a somewhat similar idea in FFmpeg's swscale copy.
2011-07-11 03:51:46 +02:00
Ronald S. Bultje 93a10dd561 swscale: fix overflow in 16-bit vertical scaling.
We operated on 31-bits, but with e.g. lanczos scaling, values can
add up to beyond 0x80000000, thus leading to output of zeroes. Drop
one bit of precision fixes this.
2011-07-11 03:51:46 +02:00
Ronald S. Bultje 71a04bc19d swscale: fix crash in 8-bpc bilinear output without alpha.
We accessed the alpha array even it wasn't used and didn't
exist, hence leading to a NULL pointer segfault.
(cherry picked from commit bf2cba4532)
2011-07-11 03:51:46 +02:00
Ronald S. Bultje ac9ac45aca swscale: fix 16-bit scaling when output is 8-bits.
We would use the second half of the U plane buffer, rather than the
V plane buffer, to output the V plane pixels.
2011-07-11 03:51:46 +02:00
Michael Niedermayer 08b57574c6 sws: fix non native endian 9-15 bit input with 16bit out 2011-07-11 03:51:10 +02:00