1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-02 14:33:23 +02:00
Commit Graph

1195 Commits

Author SHA1 Message Date
Michael Niedermayer
b89ce2d6af swscale: alpha less rgb32 support.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-28 04:14:22 +01:00
Michael Niedermayer
5c15b78e4a Merge remote-tracking branch 'qatar/master'
* qatar/master: (42 commits)
  swscale: fix signed overflow in yuv2mono_X_c_template
  snow: fix integer overflows
  svq1enc: remove stale altivec-related hack
  snow: fix signed overflow in byte to 32-bit replication
  adx: rename ff_adx_decode_header() to avpriv_adx_decode_header()
  avformat: add CRI ADX format demuxer
  adx: add an ADX parser.
  adx: move header decoding to ADX common code
  adx: calculate the number of blocks in a packet
  adx: define and use 2 new macro constants BLOCK_SIZE and BLOCK_SAMPLES
  adx: check for unsupported ADX formats
  adx: simplify encoding by using put_sbits()
  adx: calculate correct LPC coeffs
  adx: use 12-bit coefficients instead of 14-bit to avoid integer overflow
  adx: simplify adx_decode() by using get_sbits() to read residual samples
  adx: fix the data offset parsing in adx_decode_header()
  adx: remove unneeded post-decode channel interleaving
  adx: validate header values
  adx: cosmetics: general pretty-printing and comment clean-up
  adx: remove useless comments
  ...

Conflicts:
	Changelog
	libavcodec/cook.c
	libavcodec/fraps.c
	libavcodec/nuv.c
	libavcodec/pthread.c
	libavcodec/version.h
	libavformat/Makefile
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-27 00:30:13 +01:00
Mans Rullgard
7c5ce99bd9 swscale: fix signed overflow in yuv2mono_X_c_template
As old bits are shifted out of the accumulator, they cause signed
overflows when they reach the end.  Making the variable unsigned fixes
this.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-11-26 22:53:47 +00:00
Michael Niedermayer
31a1342e7a swscale: remove duplicate code from yesterdays merge.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-26 01:26:24 +01:00
Martin Storsjö
f32dfad9dc swscale: Readd #define _SVID_SOURCE
This was removed erroneously in
046f081b46. This define still is
necessary for getting MAP_ANONYMOUS defined on linux/glibc,
despite the define reshuffling done in that commit.

Without MAP_ANONYMOUS defined, the mprotect calls for setting the
generated mmx2 scaler code pages executable are left out, causing
crashes if that codepath is chosen.

This patch fixes scaling from 192x144 to 320x240 with
-sws_flags fast_bilinear, which crashes on linux at the
moment.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-25 19:59:15 +02:00
Michael Niedermayer
92afb43162 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  snow: split snow in snowdec and snowenc
  tiffenc: deprecate using compression_level
  swscale: fix failing fate tests.
  swscale: add support for planar RGB input.
  h264: add support for decoding planar RGB images.
  Clean up swscale pixfmt macros using av_pix_fmt_descriptors[].
  pixfmt: add planar RGB formats.

Conflicts:
	libavcodec/h264.c
	libavcodec/snow.c
	libavcodec/utils.c
	libavutil/avutil.h
	libavutil/pixdesc.c
	libavutil/pixfmt.h
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-25 04:34:44 +01:00
Ronald S. Bultje
f7f1835258 swscale: fix failing fate tests.
isGray() is left as a FIXME for later.
2011-11-24 12:21:03 -08:00
Ronald S. Bultje
185655c601 swscale: add support for planar RGB input. 2011-11-24 10:40:05 -08:00
Ronald S. Bultje
6b0768e202 Clean up swscale pixfmt macros using av_pix_fmt_descriptors[]. 2011-11-24 08:24:55 -08:00
Michael Niedermayer
dbb38bc389 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: Fix stack alignment for SSE
  avcodec: move some AVCodecContext fields to an internal struct.
  avcodec: use av_opt_set() instead of deprecated av_set_string3()
  avcodec: fix some const warnings
  avcodec: remove pointless AVOption, internal_buffer_count
  imgutils: Fix illegal read.

Conflicts:
	doc/APIchanges
	libavcodec/avcodec.h
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-20 02:46:06 +01:00
John Stebbins
09d243ddd0 swscale: Fix stack alignment for SSE
Although gcc guarantees 16 byte stack alignment, threads under WinXP
don't appear to be guaranteed to start stack aligned.  So fix the
alignment.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-11-19 09:55:07 -08:00
Michael Niedermayer
6f326b5054 sws: fix:
libswscale/swscale_unscaled.c:915:9: warning: new qualifiers in middle of multi-level non-const cast are unsafe

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-18 22:00:33 +01:00
Michael Niedermayer
8c3ab3094b sws: Fix:
libswscale/swscale_unscaled.c:805:5: warning: passing argument 1 of ‘check_image_pointers’ from incompatible pointer type
libswscale/swscale_unscaled.c:774:12: note: expected ‘uint8_t **’ but argument is of type ‘const uint8_t * const*’
libswscale/swscale_unscaled.c:809:5: warning: passing argument 1 of ‘check_image_pointers’ discards qualifiers from pointer target type
libswscale/swscale_unscaled.c:774:12: note: expected ‘uint8_t **’ but argument is of type ‘uint8_t * const*’

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-18 22:00:33 +01:00
Michael Niedermayer
58eca5178a sws: Fix:
libswscale/utils.c:941:13: warning: passing argument 5 of ‘initMMX2HScaler’ from incompatible pointer type
libswscale/utils.c:524:12: note: expected ‘int32_t *’ but argument is of type ‘int16_t *’
libswscale/utils.c:942:13: warning: passing argument 5 of ‘initMMX2HScaler’ from incompatible pointer type
libswscale/utils.c:524:12: note: expected ‘int32_t *’ but argument is of type ‘int16_t *’

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-18 22:00:27 +01:00
Michael Niedermayer
6ed000c8e6 sws: Fix warning: ‘abase’ may be used uninitialized in this function
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-18 21:51:29 +01:00
Michael Niedermayer
0a3a125fd9 sws: update copyright dates
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-18 21:44:26 +01:00
Michael Niedermayer
5bccb2d096 sws: handle jpeg pixel formats in sws_init_context()
Fixes Ticket576

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-17 22:00:20 +01:00
Michael Niedermayer
5f268ca5c5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: pass options from AVFormatContext to avio.
  avformat: Use avio_open2, pass the AVFormatContext interrupt_callback onwards
  avio: add avio_open2, taking an interrupt callback and options
  avio: add support for passing options to protocols.
  avio: add and use ffurl_protocol_next().
  avformat: Pass the interrupt callback on to chained muxers/demuxers
  avio: Add an AVIOInterruptCB parameter to ffurl_open/ffurl_alloc
  avformat: Use ff_check_interrupt
  avio: Add an internal utility function for checking the new interrupt callback
  avio: Add AVIOInterruptCB
  texi2html: remove stray \n
  doc: prettyfy the texi2html documentation
  swscale: handle unaligned buffers in yuv2plane1

Conflicts:
	libavformat/avformat.h
	libavformat/avio.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-14 00:33:39 +01:00
Ronald S. Bultje
8283f90a52 swscale: handle unaligned buffers in yuv2plane1
The issue had been introduced in
c435653627

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-11-13 08:27:20 +01:00
Sean McGovern
124e56454d swscale: add padding to conversion buffer.
Altivec does unaligned reads from this buffer in
hscale_altivec_real(), and can thus read up to 16 bytes beyond
the end of the buffer. Therefore, add an extra 16 bytes of
padding at the end of the conversion buffer.

This fixes fate-lavfi-pixfmts_scale on AltiVec-enabled builds
under valgrind.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-11-11 07:44:35 -08:00
Michael Niedermayer
7437db84a9 sws: Fix compilation with disabled MMX2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-11 15:54:08 +01:00
Themaister
0827222b9c Use more accurate conversion for rgb15/16 to rgb24/32 (C/MMX).
Fate update by michael.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-09 01:58:22 +01:00
Michael Niedermayer
13b7781ec8 Merge remote-tracking branch 'qatar/master'
* qatar/master: (23 commits)
  x86inc: use sse versions of common macros instead of sse2 when applicable
  doc/APIchanges: add missing dates and hashes
  lavf: don't return from void av_update_cur_dts()
  Changelog: add more entries.
  Changelog: update ffmpeg/avconv incompatibility list.
  avconv: remove some redundant temporary variables.
  avconv: fix broken indentation
  avconv: move copy_initial_nonkeyframes to the options context.
  avconv: use file:stream instead of file.stream in log messages.
  doc/avconv: elaborate on basic functionality.
  doc/avconv: -sample_fmts, not -help sample_fmts prints the sample formats
  openssl: Only use CRYPTO_set_id_callback on OpenSSL < 1.0.0
  Call avformat_network_init/deinit in the programs
  Remove leftover includes of strings.h
  avutil: Don't allow using strcasecmp/strncasecmp
  Replace all usage of strcasecmp/strncasecmp
  avstring: Add locale independent implementations of strcasecmp/strncasecmp
  avstring: Add locale independent implementations of toupper/tolower
  cosmetics: insert some spaces in explicit enum value assignments
  move 8SVX audio codecs to the audio codec list part on the next bump
  ...

Conflicts:
	avprobe.c
	doc/APIchanges
	ffplay.c
	ffserver.c
	libavcodec/avcodec.h
	libavdevice/bktr.c
	libavdevice/v4l.c
	libavdevice/v4l2.c
	libavformat/matroskaenc.c
	libavformat/wtv.c
	libavutil/avstring.c
	libavutil/avstring.h
	libavutil/avutil.h
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-07 03:01:43 +01:00
Michael Niedermayer
b13ba5cb9a swscale: use isByteRGB() to simplify check for palToRgbWrapper.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-06 13:30:10 +01:00
Michael Niedermayer
307b650270 swscale: Fix packed rgb check for planarRgbToRgbWrapper.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-06 13:28:22 +01:00
Themaister
1e79926f9e Unscaled Planar RGB -> RGB support in swscale.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-06 13:20:25 +01:00
Ronald S. Bultje
c435653627 swscale: write yuv2plane1 MMX/SSE2/SSE4/AVX functions. 2011-11-05 20:48:14 -07:00
Michael Niedermayer
d8cab5c26b Merge remote-tracking branch 'qatar/master'
* qatar/master:
  http: Remove the custom function for disabling chunked posts
  rtsp: Disable chunked http post through AVOptions
  movdec: Set frame_size for AMR
  h264_weight: remove duplication functions.
  swscale: align vertical filtersize by 2 on x86.
  libavfilter: reindent.
  matroskadec: empty blocks are in fact valid.
  avfilter: don't abort() on zero-size allocations.
  h264: improve calculation of codec delay.
  movenc: Set a correct packet size for AMR-NB mode 15, "no data"
  avformat: Add functions for doing global network initialization
  avformat: Add the https protocol
  avformat: Add the tls protocol, using OpenSSL or gnutls
  avformat: Initialize gnutls in ff_tls_init()
  w32threads: Wrap the mutex functions in inline functions returning int
  configure: Allow linking to the gnutls library
  avformat: Add ff_tls_init()/deinit() that initialize OpenSSL
  configure: Allow linking to openssl
  avcodec: Allow locking and unlocking an avformat specific mutex
  avformat: Split out functions from network.h to a new file, network.c

Conflicts:
	Changelog
	configure
	doc/APIchanges
	libavcodec/internal.h
	libavcodec/version.h
	libavfilter/formats.c
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-06 02:23:34 +01:00
Ronald S. Bultje
1deb08fcb6 swscale: align vertical filtersize by 2 on x86.
The vertical scaler handles 2 rows at a time and thus requires
alignment by 2, or else it'll read invalid memory and result in
corrupt output.
2011-11-05 07:06:38 -07:00
Michael Niedermayer
e484b64ce3 sws: fallback to mmx2 when yuv2yuvX_sse3() cannot be used.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-31 01:53:37 +01:00
Michael Niedermayer
f44ad92c3f sws: print a warning on unaligned input on SSE2+
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-31 01:53:37 +01:00
Michael Niedermayer
fbf4b390d0 sws: increase stride alignment requirement for the warning print code.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-31 01:53:37 +01:00
Michael Niedermayer
b616600516 sws: replace long by x86_reg in x86 asm
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-24 12:23:51 +02:00
Michael Niedermayer
2b0cdb7364 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Move id3v2 tag writing to a separate file.
  swscale: add missing colons to x86 assembly yuv2planeX.
  g722: split decoder and encoder into separate files
  cosmetics: remove extra spaces before end-of-statement semi-colons
  vorbisdec: check output buffer size before writing output
  wavpack: calculate bpp using av_get_bytes_per_sample()
  ac3enc: Set max value for mode options correctly
  lavc: move get_b_cbp() from h263.h to mpeg4videoenc.c
  mpeg12: move closed_gop from MpegEncContext to Mpeg1Context
  mpeg12: move full_pel from MpegEncContext to Mpeg1Context
  mpeg12: move Mpeg1Context from mpeg12.c to mpeg12.h
  mpegvideo: remove some unused variables from MpegEncContext.

Conflicts:
	libavcodec/mpeg12.c
	libavformat/mp3enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-24 01:01:21 +02:00
Michael Niedermayer
9eb867e117 sws: add yuv2yuvX_sse3()
Code is about 2x as fast as previous

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 23:36:06 +02:00
Michael Niedermayer
f4bf06eb96 sws-test: Fix data alignment
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 23:35:28 +02:00
Michael Niedermayer
90640cc764 sws: fix assert failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 20:18:21 +02:00
Michael Niedermayer
8b4b2ddf8d sws: x86_32 fix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 20:15:37 +02:00
Michael Niedermayer
76a3490672 sws: add yuv2yuvX() back and updated to the just 1 plane API
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 19:31:55 +02:00
Michael Niedermayer
74fdb7a0f8 sws: factorize v*Filter use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 19:22:58 +02:00
Michael Niedermayer
4d31f42020 sws: port to thw new 1 plane API and add back yuv2yuv1_ar().
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 19:22:58 +02:00
Michael Niedermayer
f15359727d sws: better MOVNTQ macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 19:22:58 +02:00
Michael Niedermayer
b6dcd6dfcc sws cleanup yuv2planeX_10_c_template()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 19:22:58 +02:00
Michael Niedermayer
b1a4b735f9 sws: remove nonsensical code that leaked in from libav
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 19:22:58 +02:00
Michael Niedermayer
1c26f2da81 sws: drop unused code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 19:22:58 +02:00
Ronald S. Bultje
9e66b892e8 swscale: add missing colons to x86 assembly yuv2planeX.
This fixes assembling using "nasm".
2011-10-23 09:44:03 -07:00
Michael Niedermayer
1ac5b51203 swscale: disable functions that do not yet work
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 05:14:15 +02:00
Michael Niedermayer
f97faf6751 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  id3v2: fix doxy comment - 'machine byte order' makes no sense on char arrays
  VC1: restore mistakenly removed code
  twinvq: check output buffer size before decoding
  twinvq: return an error when the packet size is too small
  lavf: export some forgotten symbols with non-av prefixes.
  swscale: update altivec yuv2planeX asm to new per-plane API.
  swscale: make yuv2yuvX_10_sse2/avx 8/9/16-bits aware.
  yuv2planeX10 SIMD
  swscale: decide whether to use yuv2plane1/X on a per-plane basis.
  swscale: reintroduce full precision in 16-bit output.
  Split up yuv2yuvX functions
  Split out yuv2yuv1 luma and chroma in order to make them generic DSP functions
  lavc: replace references to deprecated AVCodecContext.error_recognition to use AVCodecContext.err_recognition
  lavc: translate non-flag-based er options into flag-based ef options at codec open
  add -err_filter AVOptions to access flag-based error recognition
  h264_weight: initialize "height" function argument properly.
  presets: spelling error in libvpx 1080p50_60
  avplay: fix fullscreen behaviour with SDL 1.2.14 on Mac OS X

Conflicts:
	ffplay.c
	libavformat/libavformat.v
	libswscale/swscale.c
	libswscale/x86/swscale_template.c
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-23 05:13:56 +02:00
Ronald S. Bultje
f48b12e0a6 swscale: update altivec yuv2planeX asm to new per-plane API. 2011-10-22 10:35:14 -07:00
Ronald S. Bultje
6cacecdca3 swscale: make yuv2yuvX_10_sse2/avx 8/9/16-bits aware.
Also implement MMX/MMX2 versions and SSE4 versions.
2011-10-22 10:35:14 -07:00