aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/utils.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | swscale: Commits that could not be pulled earlier due to bugs #2Michael Niedermayer2011-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 5a5a0f161359ca6c3fd03eac88a57bd026b8bc1d Author: Diego Biurrun <diego@biurrun.de> Date: Fri May 27 19:46:39 2011 +0200 swscale: Remove unused variables in x86 code. libswscale/x86/swscale_template.c:2072: warning: unused variable ‘canMMX2BeUsed’ libswscale/x86/swscale_template.c:2145: warning: unused variable ‘canMMX2BeUsed’ libswscale/x86/swscale_template.c:2209: warning: unused variable ‘chrVPixBuf’ libswscale/x86/swscale_template.c:2237: warning: unused variable ‘chrVSrcPtr’ commit 389e2000ebc299b9da24f7e5faf9a68a88f9ee7c Author: Ronald S. Bultje <rsbultje@gmail.com> Date: Fri May 27 12:23:32 2011 -0400 swscale: delay allocation of formatConvBuffer(). That means it won't be allocated when not needed. Alongside this, it fixes valgrind/fate-detected memory leaks. commit f327bfa6dcdbce4593213c30a328d8aaf7a4b86b Author: Ronald S. Bultje <rsbultje@gmail.com> Date: Fri May 27 11:36:43 2011 -0400 swscale: fix build with --disable-swscale-alpha. commit 9f5d45025e8df9d5f39832caad16b94cb6ac11c5 Author: Ronald S. Bultje <rsbultje@gmail.com> Date: Fri May 27 09:28:38 2011 -0400 swscale: fix non-bitexact yuv2yuv[X2]() MMX/MMX2 functions.
* | Commits that could not be pulled earlier due to bugs.Michael Niedermayer2011-05-291-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 93681fbd5082a3af896b7a730dacdd27a3052406 Author: Ronald S. Bultje <rsbultje@gmail.com> Date: Thu May 26 11:32:32 2011 -0400 swscale: fix compile on ppc. commit e758573a887cfb1155e81499ca54f433127cf24e Author: Ronald S. Bultje <rsbultje@gmail.com> Date: Thu May 26 10:36:47 2011 -0400 swscale: fix compile on x86-32. commit 0f4eb8b04341081591bf401eaa2c07d6bc3ff52e Author: Ronald S. Bultje <rsbultje@gmail.com> Date: Thu May 26 09:17:52 2011 -0400 swscale: remove VOF/VOFW. commit b4a224c5e4109cb2cca8bac38628673d685fe763 Author: Ronald S. Bultje <rsbultje@gmail.com> Date: Wed May 25 14:30:09 2011 -0400 swscale: split chroma buffers into separate U/V planes. Preparatory step to implement support for sizes > VOFW.
* | swscale: replace formatConvBuffer[VOF] by allocated array.Ronald S. Bultje2011-05-281-0/+2
| | | | | | | | | | This allows to convert between formats of arbitrary width, regardless of the value of VOF/VOFW.
* | swscale: Remove commented-out printf cruft.Diego Biurrun2011-05-281-1/+0
| |
* | swscale: Do not loose precission on yuv values after rgb->yuv.Michael Niedermayer2011-05-261-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Return -1 on invalid input instead of crashing.Jean-Tiare Le Bigot2011-05-251-1/+1
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-05-251-75/+53
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (22 commits) configure: enable memalign_hack automatically when needed swscale: unbreak the build on non-x86 systems. swscale: remove if(bitexact) branch from functions. swscale: remove if(canMMX2BeUsed) conditional. swscale: remove swScale_{c,MMX,MMX2} duplication. swscale: use emms_c(). Move emms_c() from libavcodec to libavutil. tiff: set palette in the context when specified in TIFF_PAL tag rtsp: use strtoul to parse rtptime and seq values. pgssubdec: fix incorrect colors. dvdsubdec: fix incorrect colors. ape: Allow demuxing of files with metadata tags. swscale: remove dead macro WRITEBGR24OLD. swscale: remove AMD3DNOW "optimizations". swscale: remove duplicate code in ppc/ subdirectory. swscale: remove duplicated x86/ functions. swscale: force --enable-runtime-cpudetect and remove SWS_CPU_CAPS_*. vsrc_buffer.h: add file doxy vsrc_buffer: tweak error message in init() msmpeg4: reindent. ... Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * swscale: use emms_c().Ronald S. Bultje2011-05-241-4/+2
| |
| * swscale: force --enable-runtime-cpudetect and remove SWS_CPU_CAPS_*.Ronald S. Bultje2011-05-241-66/+54
| |
* | swscale: dont loose bits on planar >8bit yuv ind gray nput.Michael Niedermayer2011-05-251-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-05-131-5/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (33 commits) rtpdec_qdm2: Don't try to parse data packet if no configuration is received ac3enc: put the counting of stereo rematrixing bits in the same place to make the code easier to understand. ac3enc: clean up count_frame_bits() and count_frame_bits_fixed() mpegvideo: make FF_DEBUG_DCT_COEFF output coeffs via av_log() instead of just via AVFrame. srtdec: make sure we don't write past the end of buffer wmaenc: improve channel count and bitrate error handling in encode_init() matroskaenc: make sure we don't produce invalid file with no codec ID matroskadec: check that pointers were initialized before accessing them lavf: fix function name in compute_pkt_fields2 av_dlog message lavf: fix av_find_best_stream when providing a wanted stream. lavf: fix av_find_best_stream when decoder_ret is given and using a related stream. ffmpeg: factorize quality calculation tiff: add support for SamplesPerPixel tag in tiff_decode_tag() tiff: Prefer enum TiffCompr over int for TiffContext.compr. mov: Support edit list atom version 1. configure: Enable libpostproc automatically if GPL code is enabled. Cosmetics: fix prototypes in oggdec oggdec: fix memleak with continuous streams. matroskaenc: add missing new line in av_log() call dnxhdenc: add AVClass in private context. ... swscale changes largely rewritten by me or replaced by baptsites due to lots of bugs in ronalds code. Above code is also just in case its not obvios to a large extended duplicates that where cherry picked from ffmpeg. Conflicts: configure ffmpeg.c libavformat/matroskaenc.c libavutil/pixfmt.h libswscale/ppc/swscale_template.c libswscale/swscale.c libswscale/swscale_template.c libswscale/utils.c libswscale/x86/swscale_template.c tests/fate/h264.mak tests/ref/lavfi/pixdesc_le tests/ref/lavfi/pixfmts_copy_le tests/ref/lavfi/pixfmts_null_le tests/ref/lavfi/pixfmts_scale_le tests/ref/lavfi/pixfmts_vflip_le Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * configure: Do not unconditionally add -D_POSIX_C_SOURCE to CPPFLAGS.Diego Biurrun2011-05-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding _POSIX_C_SOURCE to CPPFLAGS globally produces all sorts of problems since it causes certain system functions to be hidden on some (BSD) systems. The solution is to only add the flag on systems that really require it, i.e. glibc-based ones. This change makes BSD systems compile out-of-the-box without the need for adding specific flags manually. It also allows dropping a number of flags set manually on a file-per-file basis, but were only present to work around breakage introduced by the presence of _POSIX_C_SOURCE. Also add _XOPEN_SOURCE to CPPFLAGS for glibc systems. We use XSI extensions in several places already, so it is preferable to define it globally instead of littering source files with individual #defines only needed for glibc.
| * swscale: fix YUV420P 9/10bit support.Ronald S. Bultje2011-05-111-0/+4
| | | | | | | | | | | | | | Fix handling of input if not in native endianness, and add support for 9/10-bit output. This allows us to force endianness of YUV420P 9/10bit in the H264/10bit fate tests, which should fix them on big-endian systems.
* | swscale: remove fork bug that i missed in the merge.Michael Niedermayer2011-05-111-4/+0
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-05-111-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (30 commits) AVOptions: make default_val a union, as proposed in AVOption2. arm/h264pred: add missing argument type. h264dsp_mmx: place bracket outside #if/#endif block. lavf/utils: fix ff_interleave_compare_dts corner case. fate: add 10-bit H264 tests. h264: do not print "too many references" warning for intra-only. Enable decoding of high bit depth h264. Adds 8-, 9- and 10-bit versions of some of the functions used by the h264 decoder. Add support for higher QP values in h264. Add the notion of pixel size in h264 related functions. Make the h264 loop filter bit depth aware. Template dsputil_template.c with respect to pixel size, etc. Template h264idct_template.c with respect to pixel size, etc. Preparatory patch for high bit depth h264 decoding support. Move some functions in dsputil.c into a new file dsputil_template.c. Move the functions in h264idct into a new file h264idct_template.c. Move the functions in h264pred.c into a new file h264pred_template.c. Preparatory patch for high bit depth h264 decoding support. Add pixel formats for 9- and 10-bit yuv420p. Choose h264 chroma dc dequant function dynamically. ... Conflicts: doc/APIchanges ffmpeg.c ffplay.c libavcodec/alpha/dsputil_alpha.c libavcodec/arm/dsputil_init_arm.c libavcodec/arm/dsputil_init_armv6.c libavcodec/arm/dsputil_init_neon.c libavcodec/arm/dsputil_iwmmxt.c libavcodec/arm/h264pred_init_arm.c libavcodec/bfin/dsputil_bfin.c libavcodec/dsputil.c libavcodec/h264.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_ps.c libavcodec/h264_refs.c libavcodec/h264dsp.c libavcodec/h264idct.c libavcodec/h264pred.c libavcodec/mlib/dsputil_mlib.c libavcodec/options.c libavcodec/ppc/dsputil_altivec.c libavcodec/ppc/dsputil_ppc.c libavcodec/ppc/h264_altivec.c libavcodec/ps2/dsputil_mmi.c libavcodec/sh4/dsputil_align.c libavcodec/sh4/dsputil_sh4.c libavcodec/sparc/dsputil_vis.c libavcodec/utils.c libavcodec/version.h libavcodec/x86/dsputil_mmx.c libavformat/options.c libavformat/utils.c libavutil/pixfmt.h libswscale/swscale.c libswscale/swscale_internal.h libswscale/swscale_template.c tests/ref/seek/lavf_avi Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Add pixel formats for 9- and 10-bit yuv420p.Oskar Arvidsson2011-05-101-0/+4
| | | | | | | | | | | | | | | | Also add support for these formats in libswscale. Needed for high bit depth h264 decoding. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
| * libswcale: PIX_FMT_BGR48LE and PIX_FMT_BGR48BE scaler implementationPeter Ross2011-04-281-0/+2
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * sws: remove disabled cruft.Anton Khirnov2011-04-191-7/+0
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* | swscale: 9,10 bits pixel format output supportBaptiste Coudurier2011-05-081-0/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Rename y400a to gray8a.Baptiste Coudurier2011-04-271-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix runtime CPU detection in libswscale.tateu2011-04-271-0/+8
| |
* | lsws: prevent overflow in sws_init_context()Stefano Sabatini2011-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the loop: for (i=0; i<dstH; i++) { int chrI= i*c->chrDstH / dstH; when i*c->chrDstH > INT_MAX this leads to an integer overflow, which results in a negative value for chrI and in out-of-buffer reads. The overflow is avoided by forcing int64_t arithmetic by casting i to int64_t. Fix crash, and trac issue #72. Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
* | Check mmap() return against correct valueunknown author2011-04-251-0/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Add pixel formats for 9- and 10-bit yuv420p.Oskar Arvidsson2011-04-101-0/+2
| | | | | | | | | | | | | | | | Also add support for these formats in libswscale. Needed for high bit depth h264 decoding. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libswcale: PIX_FMT_BGR48LE and PIX_FMT_BGR48BE scaler implementationPeter Ross2011-03-261-0/+2
| |
* | Revert "replace FFMPEG with LIBAV in FFMPEG_CONFIGURATION"Michael Niedermayer2011-03-171-1/+1
| | | | | | | | This reverts commit 29ba091136a5e04574f7bfc1b17536c923958f6f.
* | Revert "use LIBAV_LICENSE and LIBAV_VERSION instead of FFMPEG_*"Michael Niedermayer2011-03-171-1/+1
|/ | | | This reverts commit a03be6e1ba4cbf9984b0bbdb674704bbb2da6713.
* use LIBAV_LICENSE and LIBAV_VERSION instead of FFMPEG_*Janne Grunau2011-03-161-1/+1
|
* replace FFMPEG with LIBAV in FFMPEG_CONFIGURATIONJanne Grunau2011-03-161-1/+1
| | | | also update the multiple inclusion guards in config.h|mak
* Store src/dstFormat after calling handle_jpegMartin Storsjö2010-10-291-2/+2
| | | | | | | | | | | handle_jpeg may update the src/dstFormat variables, this makes sure the updated version is stored in the context. This fixes roundup issue 2302. Patch by Troot, all_crap_goes_here at hotmail Originally committed as revision 32562 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* 100l, fix sws_getCachedContext. It did not set the colorspace details,Reimar Döffinger2010-10-031-0/+5
| | | | | | | but worse it did not set up destination dimensions, thus every user of it would necessarily fail. Originally committed as revision 32424 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Set default values for the scale context in sws_alloc_context().Stefano Sabatini2010-09-291-3/+2
| | | | Originally committed as revision 32415 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Cosmetics: put "if (...)" and "av_log(...)" in the same line forStefano Sabatini2010-09-291-10/+5
| | | | | | improving vertical alignment and readability. Originally committed as revision 32405 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Put if (...) av_log() in the same line, more compact and increaseStefano Sabatini2010-09-291-24/+12
| | | | | | readibility. Originally committed as revision 32404 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Cosmetics: fix braces placement.Stefano Sabatini2010-09-291-2/+4
| | | | Originally committed as revision 32402 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Deprecate sws_getContext(), use sws_alloc_context() andStefano Sabatini2010-09-281-3/+15
| | | | | | sws_init_context() instead. Originally committed as revision 32401 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Y400A (gray alpha) input support in libswscaleBaptiste Coudurier2010-09-271-0/+1
| | | | Originally committed as revision 32394 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* swscale: clear SWS_CPU_CAPS_SSE2 in update_flags_cpu() missed in r32068Janne Grunau2010-09-271-0/+1
| | | | Originally committed as revision 32393 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* cosmetics: break long line update_flags_cpuJanne Grunau2010-09-271-1/+5
| | | | Originally committed as revision 32392 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Split alloc and init of context so that parameters can be set in the contextMichael Niedermayer2010-09-261-44/+70
| | | | | | | instead of requireing being passed through function parameters. This also makes sws work with AVOptions. Originally committed as revision 32368 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* swscale: use full chroma input for point scalerRamiro Polla2010-09-261-1/+1
| | | | Originally committed as revision 32360 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* swscale: also update flags on sws_getCachedContext()Ramiro Polla2010-09-061-4/+12
| | | | Originally committed as revision 32052 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* fix anonymous memory mapping for NetBSDGrant Carver2010-08-191-2/+2
| | | | | | | | | mmap() with MAP_ANONYMOUS requires the file descriptor to be -1 in NetBSD. Linux just ignores this parameter. Patch by Grant Carver <grantc at cat dot co dot za> Originally committed as revision 31984 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* darwin: allow 64-bit darwin to allocate executable memoryRamiro Polla2010-07-211-0/+1
| | | | | | | | | darwin requires _DARWIN_C_SOURCE to be defined for MAP_ANON, which is used by swscale to determine whether to use malloc() or mmap(). 64-bit darwin does not have an executable heap, so mmap() must be used instead of malloc(), and therefore _DARWIN_C_SOURCE must be defined. Originally committed as revision 31760 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Move internal scale context fields initialization fromStefano Sabatini2010-06-011-50/+0
| | | | | | | | sws_setColorspaceDetails() to ff_yuv2rgb_c_init_tables(). Allow to factorize duplicated code. Originally committed as revision 31300 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Cosmetics: make more compact the code for handle_jpeg(), this also allowsStefano Sabatini2010-05-191-14/+5
| | | | | | vertical alignment. Improve readability. Originally committed as revision 31186 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* Remove PI definition and use M_PI instead.Stefano Sabatini2010-05-191-1/+1
| | | | | | M_PI is defined by the included file libavutil/mathematics.h. Originally committed as revision 31185 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* libswscale: Relicense almost all x86 assembler optimizations as LGPL.Diego Biurrun2010-03-271-17/+14
| | | | | | | This is of course done with permissions from the authors. The only GPL component left are MMX optimizations for YUV to RGB conversion. Originally committed as revision 30965 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
* AltiVec implies a PPC CPU, so there is no need to check for both.Diego Biurrun2010-03-231-3/+3
| | | | Originally committed as revision 30954 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale