aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/utils.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * swscale: enforce a minimum filtersize.Ronald S. Bultje2012-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | At very small dimensions, this calculation could lead to zero-sized filters, which leads to uninitialized output, zero-sized allocations, loop overflows in SIMD that uses do{..}while(i++<filtersize); instead of for(i=0;i<filtersize;i++){..} and several other similar failures. Therefore, require a minimum filtersize of 1. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* | 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
| |
| * Revert "sws/pixfmt/pixdesc: add support for yuva444p"Alex Converse2012-01-261-1/+0
| | | | | | | | | | | | This reverts commit fc115c80b7bf6f1f5a937ee7f6e14630d99eb4dd. Tests are broken.
| * sws/pixfmt/pixdesc: add support for yuva444pPaul B Mahol2012-01-271-0/+1
| | | | | | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | sws/pixfmt/pixdesc: add support for yuva444pPaul B Mahol2012-01-281-0/+1
| | | | | | | | | | | | | | | | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> Conflicts: libavutil/avutil.h libavutil/pixfmt.h
* | sws: Fix RGB0->alpha containing formats.Michael Niedermayer2012-01-241-4/+17
| | | | | | | | | | | | Fixes Ticket869 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | sws: In case of an invalid scaler algorithm, show the invalid value.Michael Niedermayer2012-01-221-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-151-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: sgidec: Use bytestream2 functions to prevent buffer overreads. cosmetics: Move static and inline attributes to more standard places. configure: provide libavfilter/version.h header to get_version() swscale: change yuv2yuvX code to use cpuflag(). libx264: Don't leave max_b_frames as -1 if the user didn't set it FATE: convert output to rgba for the targa tests which currently output pal8 fate: add missing reference files for targa tests in 9c2f9b0e2 FATE: enable the 2 remaining targa conformance suite tests targa: add support for rgb555 palette FATE: fix targa tests on big-endian systems Conflicts: libavcodec/sgidec.c libavcodec/targa.c libswscale/x86/output.asm tests/fate/image.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Move static and inline attributes to more standard places.Diego Biurrun2012-01-141-1/+1
| | | | | | | | Fixes several "‘static’ is not at beginning of declaration" warnings.
* | swscale: Force full horizontal chroma internally when the output has a odd size.Michael Niedermayer2012-01-111-1/+8
| | | | | | | | | | | | | | This fixes a gray line on the right side due to 1 column of pixels being skiped. Fixes Ticket891 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-101-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: fate: Add tests for more AAC features. aacps: Add missing newline in error message. fate: Add tests for vc1/wmapro in ism. aacdec: Add a fate test for 5.1 channel SBR. aacdec: Turn off PS for multichannel files that use PCE based configs. cabac: remove put_cabac_u/ueg from cabac-test. swscale: RGB4444 and BGR444 input FATE: add test for xWMA demuxer. FATE: add test for SMJPEG demuxer and associated IMA ADPCM audio decoder. mpegaudiodec: optimized iMDCT transform mpegaudiodec: change imdct window arrangment for better pointer alignment mpegaudiodec: move imdct and windowing function to mpegaudiodsp mpegaudiodec: interleave iMDCT buffer to simplify future SIMD implementations swscale: convert yuy2/uyvy/nv12/nv21ToY/UV from inline asm to yasm. FATE: test to exercise WTV demuxer. mjpegdec: K&R formatting cosmetics swscale: K&R formatting cosmetics for code examples swscale: K&R reformatting cosmetics for header files FATE test: cvid-grayscale; ensures that the grayscale Cinepak variant is exercised. Conflicts: libavcodec/cabac.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec.c libavcodec/mpegaudiodsp.c libavcodec/mpegaudiodsp.h libavcodec/mpegaudiodsp_template.c libavcodec/x86/Makefile libavcodec/x86/imdct36_sse.asm libavcodec/x86/mpegaudiodec_mmx.c libswscale/swscale-test.c libswscale/swscale.c libswscale/swscale_internal.h libswscale/x86/swscale_template.c tests/fate/demux.mak tests/fate/microsoft.mak tests/fate/video.mak tests/fate/wma.mak tests/ref/lavfi/pixfmts_scale Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * swscale: RGB4444 and BGR444 inputPaul B Mahol2012-01-081-4/+4
| | | | | | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
| * swscale: don't show full-chroma-int warning for non-RGB output.Ronald S. Bultje2012-01-031-0/+1
| | | | | | | | Non-RGB output always uses full chroma interpolation.
| * swscale: fix overflows in vertical scaling at top/bottom edges.Ronald S. Bultje2011-12-181-27/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes integer multiplication overflows in RGB48 output (vertical) scaling as detected by IOC. What happens is that for certain types of filters (lanczos, spline, bicubic), the intermediate sum of coefficients in the middle of a filter can be larger than the fixed-point equivalent of 1.0, even if the final sum is 1.0. This is fine and we support that. However, at frame edges, initFilter() will merge the coefficients for the off-screen pixels into the top or bottom pixel, such as to emulate edge extension. This means that suddenly, a single coefficient can be larger than the fixed-point equivalent of 1.0, which the vertical scaling routines do not support. Therefore, remove the merging of coefficients for edges for the vertical scaling filter, and instead add edge detection to the scaler itself so that it copies the pointers (not data) for the edges (i.e. it uses line[0] for line[-1] as well), so that a single coefficient is never larger than the fixed-point equivalent of 1.0.
* | libswscale: increase LIBSWSCALE_VERSION_MICRO to 100Michael Niedermayer2011-12-221-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | sws: Print an error in case of av_malloc() failureMichael Niedermayer2011-12-191-0/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | swscale: Fix several (real world) integer overflows.Michael Niedermayer2011-12-191-5/+5
| | | | | | | | | | | | | | Fixes Ticket795 Bug Found by: Oana Stratulat Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-021-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (25 commits) rtpenc: Add support for G726 audio rtpdec: Interpret the different G726 names as bits_per_coded_sample rtpenc: Change rtp_send_samples to handle sample sizes other than even bytes rtpenc: Cast a rescaling parameter to int64_t h264: cap max has_b_frames at MAX_DELAYED_PIC_COUNT - 1. ARM: fix indentation in ff_dsputil_init_neon() ARM: NEON put/avg_pixels8/16 cosmetics ARM: add remaining NEON avg_pixels8/16 functions ARM: clean up NEON put/avg_pixels macros fate: split acodec-pcm into individual tests swscale: #include "libavutil/mathematics.h" pmpdec: don't use deprecated av_set_pts_info. rv34: align temporary block of "dct" coefs Add PlayStation Portable PMP format demuxer proto: Realign struct initializers proto: Use .priv_data_size to allocate the private context mmsh: Properly clean up if the second ffurl_alloc failed rtmp: Clean up properly if the handshake failed md5proto: Remove the get_file_handle function applehttpproto: Use the close function if the open function fails ... Conflicts: libavcodec/vble.c libavformat/mmsh.c libavformat/pmpdec.c libavformat/udp.c tests/ref/acodec/pcm Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * swscale: #include "libavutil/mathematics.h"Reinhard Tartler2011-12-011-0/+1
| | | | | | | | | | | | | | | | this file uses the M_PI macro since 4e74187db2f5db52f88729efc662df9d6bc763e1, so include the correct header directly. Signed-off-by: Reinhard Tartler <siretart@tauware.de>
| * swscale: Readd #define _SVID_SOURCEMartin Storsjö2011-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was removed erroneously in 046f081b46c8479820409cf8f530b988221bd15b. 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>
* | swscale: alpha less rgb32 support.Michael Niedermayer2011-11-281-0/+8
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-251-0/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * swscale: add support for planar RGB input.Ronald S. Bultje2011-11-241-0/+7
| |
| * swscale: add padding to conversion buffer.Sean McGovern2011-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | sws: Fix:Michael Niedermayer2011-11-181-2/+2
| | | | | | | | | | | | | | | | | | 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>
* | sws: handle jpeg pixel formats in sws_init_context()Michael Niedermayer2011-11-171-0/+9
| | | | | | | | | | | | Fixes Ticket576 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-061-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * swscale: align vertical filtersize by 2 on x86.Ronald S. Bultje2011-11-051-1/+1
| | | | | | | | | | | | 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.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-10-221-8/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (35 commits) flvdec: Do not call parse_keyframes_index with a NULL stream libspeexdec: include system headers before local headers libspeexdec: return meaningful error codes libspeexdec: cosmetics: reindent libspeexdec: decode one frame at a time. swscale: fix signed shift overflows in ff_yuv2rgb_c_init_tables() Move timefilter code from lavf to lavd. mov: add support for hdvd and pgapmetadata atoms mov: rename function _stik, some indentation cosmetics mov: rename function _int8 to remove ambiguity, some indentation cosmetics mov: parse the gnre atom mp3on4: check for allocation failures in decode_init_mp3on4() mp3on4: create a separate flush function for MP3onMP4. mp3on4: ensure that the frame channel count does not exceed the codec channel count. mp3on4: set channel layout mp3on4: fix the output channel order mp3on4: allocate temp buffer with av_malloc() instead of on the stack. mp3on4: copy MPADSPContext from first context to all contexts. fmtconvert: port float_to_int16_interleave() 2-channel x86 inline asm to yasm fmtconvert: port int32_to_float_fmul_scalar() x86 inline asm to yasm ... Conflicts: libavcodec/arm/h264dsp_init_arm.c libavcodec/h264.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_ps.c libavcodec/h264dsp_template.c libavcodec/h264idct_template.c libavcodec/h264pred.c libavcodec/h264pred_template.c libavcodec/x86/h264dsp_mmx.c libavdevice/Makefile libavdevice/jack_audio.c libavformat/Makefile libavformat/flvdec.c libavformat/flvenc.c libavutil/pixfmt.h libswscale/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * sws/pixfmt/pixdesc: add support for yuv420p9le/be.Ronald S. Bultje2011-10-211-0/+2
| |
| * swscale: prevent overflow in coefficient calculation.Ronald S. Bultje2011-10-211-11/+12
| |
| * swscale: prevent overflow during initializationRonald Bultje2011-10-181-2/+4
| | | | | | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
| * sws: support yuv444p9/10 output.Anton Khirnov2011-10-121-4/+4
| |
* | sws: gbr24p input supportMichael Niedermayer2011-10-091-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Enable conversions to YUV444P9/YUV444P10, they seem to work fine.Reimar Döffinger2011-10-031-4/+4
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Add new pix_fmt RGBA64Jean First2011-09-241-0/+4
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-09-151-6/+10
|\| | | | | | | | | | | | | | | | | * 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>
| * swscale: fix byte overreads in SSE-optimized hscale().Ronald S. Bultje2011-09-151-6/+10
| | | | | | | | | | | | 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.
* | sws: remove hScale16N() and use ronalds reformated version of it.Michael Niedermayer2011-08-141-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-08-131-9/+13
|\| | | | | | | | | | | | | | | | | | | * 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>
| * swscale: use 15-bit intermediates for 9/10-bit scaling.Ronald S. Bultje2011-08-121-7/+13
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-08-051-54/+5
|\| | | | | | | | | | | | | | | | | | | | | * 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>
| * lsws: remove optimization debug logs in sws_init_context()Stefano Sabatini2011-08-051-66/+0
| | | | | | | | | | | | | | | | | | 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>
| * lsws: use array for storing the supported in/out informationStefano Sabatini2011-08-051-122/+79
| | | | | | | | | | | | | | | | | | 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>
| * Revert "swscale: use 15-bit intermediates for 9/10-bit scaling."Ronald S. Bultje2011-08-021-8/+4
| | | | | | | | | | | | This reverts commit ac0fb5934893be554a44d2a1eb7a3bc7bf39da4a. It causes valgrind errors which I'll want to investigate before resubmitting this.
| * swscale: use 15-bit intermediates for 9/10-bit scaling.Ronald S. Bultje2011-08-021-4/+8
| |
* | lsws: remove deprecated and unused stuff after the 0->1 major bumpStefano Sabatini2011-08-041-7/+0
| |
* | lsws: apply logging factorization in sws_scale_init()Stefano Sabatini2011-07-281-6/+3
| |
* | lsws: remove redundant macros isSupportedIn/OutStefano Sabatini2011-07-271-6/+2
| | | | | | | | Directly call sws_isSupportedInput/Output.