Commit Graph

680 Commits

Author SHA1 Message Date
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 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
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 109f62e8f8 swscale: decide whether to use yuv2plane1/X on a per-plane basis. 2011-10-22 10:35:14 -07:00
Ronald S. Bultje f99654d470 swscale: reintroduce full precision in 16-bit output. 2011-10-22 10:35:14 -07:00
Kieran Kunhya ff7913aef1 Split up yuv2yuvX functions
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-10-22 10:35:13 -07:00
Kieran Kunhya 34e8d147b3 Split out yuv2yuv1 luma and chroma in order to make them generic DSP functions
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-10-22 10:35:13 -07:00
Michael Niedermayer aedc908601 Merge remote-tracking branch 'qatar/master'
* 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>
2011-10-22 01:16:41 +02:00
Ronald S. Bultje dc49bf1270 sws/pixfmt/pixdesc: add support for yuv420p9le/be. 2011-10-21 00:58:01 -07:00
Michael Niedermayer cca81e7eb0 sws: gbr24p input support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-09 02:04:54 +02:00
Michael Niedermayer bd141af460 swscale: Fix prototypes of *toyv12 so they can be used with planar rgb input.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-09 02:04:23 +02:00
Michael Niedermayer a7758884db Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtp: factorize  dynamic payload type fallback
  flvdec: Ignore the index if it's from a creator known to be different
  cmdutils: move grow_array out of #if CONFIG_AVFILTER
  avconv: actually set InputFile.rate_emu
  ratecontrol: update last_qscale_for sooner
  Fix unnecessary shift with 9/10bit vertical scaling
  prores: mark prores as intra-only in libavformat/utils.c:is_intra_only()
  prores: return more meaningful error values
  prores: improve error message wording
  prores: cosmetics: prettyprinting, drop useless parentheses
  prores: lowercase AVCodec name entry

Conflicts:
	cmdutils.c
	libavcodec/proresdec_lgpl.c
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-24 01:03:07 +02:00
Kieran Kunhya 4d4d0e8176 Fix unnecessary shift with 9/10bit vertical scaling
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-09-23 02:13:30 +02:00
Michael Niedermayer d06c5b44cc swscale: drop redundant code.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-14 00:32:18 +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 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
Ronald S. Bultje 28c1115a91 swscale: use 15-bit intermediates for 9/10-bit scaling. 2011-08-12 11:54:25 -07: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 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
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
Michael Niedermayer 08b57574c6 sws: fix non native endian 9-15 bit input with 16bit out 2011-07-11 03:51:10 +02:00
Michael Niedermayer ca78fa24b7 sws: disable scale16 when int32 is used 2011-07-11 03:51:10 +02:00
Michael Niedermayer 987e4c1787 sws: fix rgb -> 16bit 2011-07-11 03:51:10 +02:00
Michael Niedermayer d2c910b9a4 sws: fix gray16_1 2011-07-11 03:51:10 +02:00
Michael Niedermayer 9470205414 sws:ix yuv2rgb48_1_c_template() 2011-07-11 03:51:10 +02:00
Michael Niedermayer ae05dd8731 sws: fix 16/32 bug from merge 2011-07-11 03:51:10 +02:00
Ronald S. Bultje 948ccdadf4 swscale: for >8bit scaling, read in native bit-depth.
For 9/10bit, it means we don't have to upscale to 16bit before
actual scaling or pixel format conversion, and thus a performance
gain.
2011-07-11 03:51:10 +02:00
Michael Niedermayer f2db5602ba Merge branch 'ronalds_buggy_gt8bit_sws'
* ronalds_buggy_gt8bit_sws:
  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.

Conflicts:
	libswscale/swscale.c
	libswscale/utils.c
	libswscale/x86/swscale_template.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-11 03:49:33 +02:00
Ronald S. Bultje 4e3e333a79 swscale: error dithering for 16/9/10-bit to 8-bit.
Based on a somewhat similar idea in FFmpeg's swscale copy.
2011-07-08 15:15:30 -07:00
Ronald S. Bultje 7d7bacf0f1 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-08 15:15:30 -07:00
Ronald S. Bultje bf2cba4532 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.
2011-07-08 15:15:30 -07:00
Ronald S. Bultje f44d50a94c swscale: fix 16-bit horizontal scaling underflow.
When using e.g. lanczos scaling, values can drop below 0, so they
should never be unsigned.
2011-07-08 15:15:30 -07:00
Michael Niedermayer 5d4fd1d1ad Merge remote-tracking branch 'qatar/master'
* qatar/master: (36 commits)
  ARM: allow unaligned buffer in fixed-point NEON FFT4
  fate: test more FFT etc sizes
  dca: set AVCodecContext frame_size for DTS audio
  YASM: Shut up unused variable compiler warning with --disable-yasm.
  x86_32: Fix build on x86_32 with --disable-yasm.
  iirfilter: add fate test
  doxygen: Add qmul docs.
  ogg: propagate return values and return more meaningful error values
  H.264: fix overreads of qscale_table
  Remove unused static tables and static inline functions.
  eval: clear Parser instances before using
  dct-test: remove 'ref' function pointer from tables
  build: Remove deleted 'check' target from .PHONY list.
  oggdec: Abort Ogg header parsing when encountering a data packet.
  Add LGPL license boilerplate to files lacking it.
  mxfenc: small typo fix
  doxygen: Fix documentation for some VP8 functions.
  sha: use AV_RB32() instead of assuming buffer can be cast to uint32_t*
  des: allow unaligned input and output buffers
  aes: allow unaligned input and output buffers
  ...

Conflicts:
	libavcodec/dct-test.c
	libavcodec/libvpxenc.c
	libavcodec/x86/dsputil_mmx.c
	libavcodec/x86/h264_qpel_mmx.c
	libavfilter/x86/gradfun.c
	libavformat/oggdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-05 02:26:17 +02:00
Diego Biurrun e589e4b82d Remove unused static tables and static inline functions. 2011-07-04 14:59:35 +02:00
Michael Niedermayer 3074f03a07 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  get_bits: remove x86 inline asm in A32 bitstream reader
  doc: Remove outdated information about our issue tracker
  avidec: Factor out the sync fucntionality.
  fate-aac: Expand coverage.
  ac3dsp: add x86-optimized versions of ac3dsp.extract_exponents().
  ac3dsp: simplify extract_exponents() now that it does not need to do clipping.
  ac3enc: clip coefficients after MDCT.
  ac3enc: add int32_t array clipping function to DSPUtil, including x86 versions.
  swscale: for >8bit scaling, read in native bit-depth.
  matroskadec: matroska_read_seek after after EBML_STOP leads to failure.
  doxygen: fix usage of @file directive in libavutil/{dict,file}.h
  doxygen: Help doxygen parser to understand the DECLARE_ALIGNED and offsetof macros

Conflicts:
	doc/issue_tracker.txt
	libavformat/avidec.c
	libavutil/dict.h
	libswscale/swscale.c
	libswscale/utils.c
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-02 03:24:32 +02:00
Ronald S. Bultje 8a8d0ce208 swscale: for >8bit scaling, read in native bit-depth.
For 9/10bit, it means we don't have to upscale to 16bit before
actual scaling or pixel format conversion, and thus a performance
gain.
2011-07-01 09:08:26 -07:00
Michael Niedermayer 721be99371 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  cosmetics: fix some then/than typos
  doxygen: Include libavcodec and libavformat examples into the documentation
  avutil: elaborate documentation for av_get_random_seed
  Add support for aac streams in mp4/mov without extradata.
  aes: whitespace cosmetics
  adler32: whitespace cosmetics
  swscale: fix another yuv range conversion overflow in 16bit scaling.
  Fix cpu flags test program
  opt-test: Add missing braces to silence compiler warnings.
  build: Eliminate obsolete test targets.
  udp: Fix a compilation warning
  swscale: Unbreak build with --enable-small
  base64: add fate test
  aes: improve test program and add fate test
  adler32: make test program more useful and add fate test
  swscale: fix yuv range correction when using 16-bit scaling.
  aacenc: Make chan_map const correct

Conflicts:
	Makefile
	doc/examples/muxing-example.c
	libavformat/udp.c
	libavutil/random_seed.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-01 05:35:26 +02:00
Ronald S. Bultje afb9d4e8f1 swscale: fix another yuv range conversion overflow in 16bit scaling.
(cherry picked from commit 81cc7d0bd1)
2011-07-01 03:07:37 +02:00
Ronald S. Bultje ebb0d60353 swscale: fix yuv range correction when using 16-bit scaling.
(cherry picked from commit e0b8fff6c7)
2011-07-01 03:07:18 +02:00
Ronald S. Bultje 81cc7d0bd1 swscale: fix another yuv range conversion overflow in 16bit scaling. 2011-06-30 07:05:52 -07:00
Mohamed Naufal 705b21a06e swscale: Unbreak build with --enable-small
This fixes building with --enable-small, by using the correct
variable name.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-06-30 11:58:38 +03:00
Ronald S. Bultje e0b8fff6c7 swscale: fix yuv range correction when using 16-bit scaling. 2011-06-29 21:04:45 -07:00
Ronald S. Bultje 45f6ffe5e9 swscale: implement >8bit scaling support.
This means that precision is retained when scaling between sample
formats with >8 bits per component (48bit RGB, 16bit grayscale,
9/10/16bit YUV).
2011-06-30 04:45:00 +02:00
Ronald S. Bultje ef1ee362b3 swscale: implement >8bit scaling support.
This means that precision is retained when scaling between sample
formats with >8 bits per component (48bit RGB, 16bit grayscale,
9/10/16bit YUV).
2011-06-29 09:45:52 -07:00
Michael Niedermayer bb9d5171a7 Merge remote-tracking branch 'qatar/master'
* qatar/master: (21 commits)
  swscale: Add Doxygen for hyscale_fast/hScale.
  fate: enable lavfi-pixmt tests on big endian systems
  PPC: swscale: disable altivec functions for unsupported formats
  fate: merge identical pixdesc_be/le tests
  swscale: Add Doxygen for yuv2planar*/yuv2packed* functions.
  build: call texi2pod.pl with full path instead of symlink
  build: include sub-makefiles using full path instead of symlinks
  swscale: update big endian reference values after dff5a835.
  wavpack: skip blocks with no samples
  cosmetics: remove outdated comment that is no longer true
  build: replace some addprefix/addsuffix with substitution refs
  avutil: Remove unused arbitrary precision integer code.
  configure: Drop check for availability of ten assembler operands.
  aacenc: Save channel configuration for later use.
  aacenc: Fix codebook trellising for zeroed bands.
  swscale: change prototypes of scaled YUV output functions.
  swscale: re-add support for non-native endianness.
  swscale: disentangle yuv2rgbX_c_full() into small functions.
  swscale: split yuv2packed[12X]_c() remainders into small functions.
  swscale: split yuv2packedX_altivec in smaller functions.
  ...

Conflicts:
	Makefile
	configure
	libavcodec/x86/dsputil_mmx.c
	libavfilter/Makefile
	libavformat/Makefile
	libavutil/integer.c
	libavutil/integer.h
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/x86/swscale_template.c
	tests/ref/lavfi/pixdesc_le
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-29 05:23:12 +02:00
Ronald S. Bultje 13a099799e swscale: change prototypes of scaled YUV output functions.
Remove unused variables "flags" and "dstFormat" in yuv2packed1,
merge source rows per plane for yuv2packed[12], and make every
source argument int16_t (some where invalidly set to uint16_t).
This prevents stack pollution and is part of the Great Evil Plan
to simplify swscale.
2011-06-27 21:24:44 -07:00
Ronald S. Bultje dff5a83532 swscale: re-add support for non-native endianness.
This works through some non-obvious hacks in utils.c.
2011-06-27 18:10:41 -07:00
Ronald S. Bultje 3d3c814937 swscale: disentangle yuv2rgbX_c_full() into small functions.
This is part of the Great Evil Plan to simplify swscale.
2011-06-27 18:10:24 -07:00
Ronald Bultje 6fba14eecb swscale: split yuv2packed[12X]_c() remainders into small functions.
This is part of the Great Evil Plan to simplify swscale.
2011-06-27 18:10:03 -07:00
Michael Niedermayer f211d9d839 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  build: improve rules for test programs
  build: factor out the .c and .S compile commands as a macro
  swscale: remove unused xInc/srcW arguments from hScale().
  H.264: disable 2tap qpel with CODEC_FLAG2_FAST and >8-bit
  H.264: make filter_mb_fast support 4:4:4
  mpeg4videoenc: Remove disabled variant of mpeg4_encode_block().
  configure: allow post-fixed cpu strings for athlon64, k8, and opteron when setting the -march flag.
  Move some variable declarations below the proper #ifdefs.

Conflicts:
	Makefile
	ffplay.c
	libswscale/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-27 03:32:45 +02:00
Ronald S. Bultje 97535ffb97 swscale: remove unused xInc/srcW arguments from hScale(). 2011-06-26 14:41:44 -07:00
Michael Niedermayer 15b4f6449d swscale: fix mono input for width%8
Fixes ticket193

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-19 03:54:16 +02:00
Michael Niedermayer c137fdd778 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: remove misplaced comment.
  ffmpeg: fix streaming to ffserver.
  swscale: split out RGB48 output functions from yuv2packed[12X]_c().
  build: move vpath directives to main Makefile
  swscale: fix JPEG-range YUV scaling artifacts.
  build: move ALLFFLIBS to a more logical place
  ARM: factor some repetitive code into macros
  Fix SVQ3 after adding 4:4:4 H.264 support
  H.264: fix CODEC_FLAG_GRAY
  4:4:4 H.264 decoding support
  ac3enc: fix allocation of floating point samples.

Conflicts:
	ffmpeg.c
	libavcodec/dsputil_template.c
	libavcodec/h264.c
	libavcodec/mpegvideo.c
	libavcodec/snow.c
	libswscale/swscale.c
	libswscale/swscale_internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-15 02:15:25 +02:00
Ronald S. Bultje 4e05830205 swscale: remove misplaced comment.
The comment should have been placed only in
yuv2rgb48_X_c_template, not yuv2rgb48_1_c_template.
2011-06-14 16:55:24 -04:00
Ronald S. Bultje 9f63211175 swscale: split out RGB48 output functions from yuv2packed[12X]_c().
This is part of the Great Evil Plan to simplify swscale. Note that
you'll see some code duplication between the output functions for
different RGB variants, and even between packed-YUV and RGB
variants. This is intentional because it improves readability.
2011-06-14 15:59:14 -04:00
Michael Niedermayer 0af8a71d66 swscale: fix JPEG-range YUV scaling artifacts.
YUV planes were marked as uint16_t, but they contained signed data.
Fixes issue 1108 and 675.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-06-14 09:46:49 -04:00
Michael Niedermayer 45fb647495 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  bitstream: Properly promote av_reverse values before shifting.
  libavutil/swscale: YUV444P10/YUV444P9 support.
  H.264: Fix high bit depth explicit biweight
  h264: Fix 10-bit H.264 x86 chroma v loopfilter asm.
  Replace DEBUG_SEEK/DEBUG_SI + av_log combinations by av_dlog.
  Update copyright year for ac3enc_opts_template.c.
  adts: Adjust frame size mask to follow the specification.
  movenc: Add RTP muxer/hinter options
  movenc: Pass the RTP AVFormatContext to the SDP generation
  rtspenc: Add RTP muxer options
  rtspenc: Add an AVClass for setting muxer specific options
  rtpenc_chain: Pass the rtpflags options through to the chained muxer
  rtpenc: Declare the rtp flags private AVOptions in rtpenc.h
  sdp: Reindent after the previous commit
  rtpenc: MP4A-LATM payload support
  avoptions: Add an av_opt_flag_is_set function for inspecting flag fields
  sdp: Allow passing an AVFormatContext to the SDP generation
  mov: Fix wrong timestamp generation for fragmented movies that have time offset caused by the first edit list entry.
  mpeg12: more advanced ffmpeg mpeg2 aspect guessing code.
  swscale: split YUYV output out of yuv2packed[12X]_c().

Conflicts:
	doc/APIchanges
	libavcodec/Makefile
	libavcodec/h264dsp_template.c
	libavcodec/mpeg12.c
	libavformat/aacdec.c
	libavformat/avidec.c
	libavformat/internal.h
	libavformat/movenc.c
	libavformat/rtpenc.c
	libavformat/rtpenc_latm.c
	libavformat/sdp.c
	libavformat/version.h
	libavutil/avutil.h
	libavutil/pixfmt.h
	libswscale/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-11 03:51:36 +02:00
Ronald S. Bultje 103278f7b0 libavutil/swscale: YUV444P10/YUV444P9 support.
Also add missing glue code for recently added YUV422P10 formats
to swscale.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-06-10 15:12:24 -04:00
Michael Niedermayer 2ec77aae67 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: make compute_pkt_fields2() return meaningful error values
  matroskadec: set timestamps for RealAudio packets.
  intelh263dec: aspect ratio processing fix.
  intelh263dec: fix "Strict H.263 compliance"  file playback
  oss,sndio: simplify by using FFMIN.
  swscale: extract monowhite/black output from yuv2packed[12X]_c().
  swscale: de-macro'ify RGB15/16/32 input functions.
  swscale: rearrange code.
  movdec: Add support for the 'wfex' atom.
  ffmpeg.c: Add a necessary const qualifier
  riff: Fix potential memleak.
  swscale: change 48bit RGB input macros to inline functions.
  swscale: change 9/10bit YUV input macros to inline functions.
  swscale: extract gray16 output functions from yuv2packed[12X]().
  swscale: use standard clipping functions.
  swscale: merge macros that are used only once.
  swscale: fix function declarations in swscale.c.
  swscale: fix function declaration keywords in x86/swscale_template.c.

Conflicts:
	ffmpeg.c
	libavcodec/intelh263dec.c
	libswscale/swscale.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-10 04:47:23 +02:00
Ronald S. Bultje af2faf2076 swscale: split YUYV output out of yuv2packed[12X]_c().
This is part of the Great Evil Plan to simplify swscale.
2011-06-09 20:52:38 -04:00
Ronald S. Bultje 6b105e3ee6 swscale: extract monowhite/black output from yuv2packed[12X]_c().
This is part of the Great Evil Plan to simplify swscale.
2011-06-09 16:47:45 -04:00
Ronald S. Bultje 6d4d483eee swscale: de-macro'ify RGB15/16/32 input functions.
Inline functions are easier to read, maintain, modify and test,
which justifies the slightly increased source size. This patch
also adds support for non-native endianness RGB15/16 and fixes
isSupportedOutput() to no longer claim that we support writing
non-native RGB565/555/444.
2011-06-09 16:47:45 -04:00
Ronald S. Bultje e2babb9b47 swscale: rearrange code.
This way the code in the file is less cluttered all-over-the-
place.
2011-06-09 16:47:45 -04:00
Ronald S. Bultje dbd3183935 swscale: change 48bit RGB input macros to inline functions.
Inline functions are slightly larger in source code, but
are easier to handle in source code editors. The binary code
generated is the same.
2011-06-09 09:29:20 -04:00
Ronald S. Bultje f30ee65700 swscale: change 9/10bit YUV input macros to inline functions.
Inline functions are slightly larger in source code, but
are easier to handle in source code editors. The binary code
generated is the same.
2011-06-09 09:29:03 -04:00
Ronald S. Bultje aa39f5f6d6 swscale: extract gray16 output functions from yuv2packed[12X]().
This is part of the Great Evil Plan to simplify swscale.
2011-06-09 09:29:02 -04:00
Ronald S. Bultje f1e0b90c64 swscale: use standard clipping functions.
This generates better code on some non-x86 architectures.
2011-06-09 09:27:51 -04:00
Ronald S. Bultje e458b53605 swscale: merge macros that are used only once.
This reduces source code size without affecting the binary.
2011-06-09 09:26:00 -04:00
Ronald S. Bultje 6e5a8d3c9a swscale: fix function declarations in swscale.c.
Remove inline keyword from functions that are never inlined.
Use av_always_inline for functions that should be force-inlined
for performance reasons. Use av_cold for init functions.
2011-06-09 09:25:59 -04:00
Michael Niedermayer f9ecb849ef Merge remote-tracking branch 'qatar/master'
* qatar/master:
  crypto: Use av_freep instead of av_free
  lavf: don't try to free private options if priv_data is NULL.
  swscale: fix types of assembly arguments.
  swscale: move two macros that are only used once into caller.
  swscale: remove unused function.
  options: Add missing braces around struct initializer.
  mov: Remove leftover crufty debug statement with references to a local file.
  dvbsubdec: Fix compilation of debug code.
  Remove all uses of now deprecated metadata functions.
  Move metadata API from lavf to lavu.

Conflicts:
	doc/APIchanges
	libavformat/aiffdec.c
	libavformat/asfdec.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/cafdec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/mp3enc.c
	libavformat/wtv.c
	libavutil/avutil.h
	libavutil/internal.h
	libswscale/swscale.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-09 04:47:19 +02:00
Ronald S. Bultje 9d84dfce93 swscale: remove unused function.
Use of this wrapper was removed in a previous patch, but I
forgot to actually remove the function itself.
2011-06-08 11:08:20 -04:00
Michael Niedermayer d552f616a2 Merge remote-tracking branch 'qatar/master'
* qatar/master: (28 commits)
  Remove some non-compiling debug messages.
  ffplay: Fix non-compiling debug printf and replace it by av_dlog.
  H264: x86 predict init cosmetics.
  ac3enc: Fix linking of AC-3 encoder without the E-AC-3 encoder.
  Move E-AC-3 encoder functions to a separate eac3enc.c file.
  ac3enc: remove convenience macro, #define DEBUG
  ac3enc: remove unused #define
  vc1: re-initialize tables after width/height change.
  APIchanges: fill-in git commit hash for av_get_bytes_per_sample() addition
  samplefmt: add av_get_bytes_per_sample()
  iirfilter: fix biquad filter coefficients.
  swscale: remove duplicate conversion routine in swScale().
  swscale: add yuv2planar/packed function typedefs.
  swscale: integrate yuv2nv12X_C into yuv2yuvX() function pointers.
  swscale: reindent x86 init code.
  swscale: extract SWS_FULL_CHR_H_INT conditional into init code.
  swscale: cosmetics.
  swscale: remove alp/chr/lumSrcOffset.
  swscale: un-special-case yuv2yuvX16_c().
  shorten: Remove stray DEBUG #define and corresponding av_dlog statement.
  ...

Conflicts:
	doc/APIchanges
	libavcodec/ac3enc.c
	libavutil/avutil.h
	libavutil/samplefmt.c
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-08 05:25:28 +02:00
Ronald S. Bultje edeb56fa31 swscale: remove duplicate conversion routine in swScale(). 2011-06-07 10:05:55 -04:00
Ronald S. Bultje df91d09174 swscale: integrate yuv2nv12X_C into yuv2yuvX() function pointers. 2011-06-07 10:05:54 -04:00
Ronald S. Bultje ca364a5b43 swscale: extract SWS_FULL_CHR_H_INT conditional into init code. 2011-06-07 10:03:47 -04:00
Ronald S. Bultje b3b28b080f swscale: cosmetics. 2011-06-07 10:03:46 -04:00
Ronald S. Bultje ea28175312 swscale: remove alp/chr/lumSrcOffset.
They are hacks added to reuse the same scaling function for
different formats and they may cause problems when SIMD
implementation of the same functions are used along with pure
C functions.
2011-06-07 10:03:18 -04:00
Ronald S. Bultje bda9b20fa4 swscale: un-special-case yuv2yuvX16_c().
Make yuv2yuvX16_c a function pointer for yuv2yuvX(), so that the
function pointer becomes bitdepth-independent.
2011-06-07 10:03:12 -04:00
Michael Niedermayer 7a8228c05e sws: make dither_scale const
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-07 13:23:04 +02:00
Michael Niedermayer ec4207c46a swscale: factor should_dither out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-05 04:24:45 +02:00
Michael Niedermayer 87f40364d1 Merge remote-tracking branch 'qatar/master'
* qatar/master: (21 commits)
  build: simplify commands for clean target
  swscale: split swscale.c in unscaled and generic conversion routines.
  swscale: cosmetics.
  swscale: integrate (literally) swscale_template.c in swscale.c.
  swscale: split out x86/swscale_template.c from swscale.c.
  swscale: enable hScale_altivec_real.
  swscale: split out ppc _template.c files from main swscale.c.
  swscale: remove indirections in ppc/swscale_template.c.
  swscale: split out unscaled altivec YUV converters in their own file.
  mpegvideoenc: fix multislice fate tests with threading disabled.
  mpegts: Wrap #ifdef DEBUG and av_hex_dump_log() combination in a macro.
  build: Simplify texi2html invocation through the --output option.
  Mark some variables with av_unused
  Replace avcodec_get_pix_fmt_name() by av_get_pix_fmt_name().
  svq3: Check negative mb_type to fix potential crash.
  svq3: Move svq3-specific fields to their own context.
  rawdec: initialize return value to 0.
  Remove unused get_psnr() prototype
  rawdec: don't leak option strings.
  bktr: get default framerate from video standard.
  ...

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-04 06:35:17 +02:00
Ronald S. Bultje 6af2801088 swscale: split swscale.c in unscaled and generic conversion routines.
This duplicates the function fillPlane().
2011-06-03 09:52:09 -07:00
Ronald S. Bultje 2762ee3034 swscale: cosmetics.
Remove duplicate "inC" and "_c" functions that do the same thing;
give each function that handles data and acts as a function pointer
a "_c" suffix; remove "_c" suffix from functions that are inherently
not optimizable. Remove inline keyword from functions that are only
used through function pointers.
2011-06-03 09:52:09 -07:00
Ronald S. Bultje 1674bd2abe swscale: integrate (literally) swscale_template.c in swscale.c. 2011-06-03 09:52:09 -07:00
Ronald S. Bultje 983260b0a4 swscale: split out x86/swscale_template.c from swscale.c. 2011-06-03 09:52:09 -07:00
Ronald S. Bultje 67d80a5421 swscale: split out ppc _template.c files from main swscale.c. 2011-06-03 09:52:09 -07:00
Ronald S. Bultje a3e9bb5dee swscale: remove indirections in ppc/swscale_template.c. 2011-06-03 09:52:09 -07:00
Ronald S. Bultje 0e5d31b16b swscale: split out unscaled altivec YUV converters in their own file. 2011-06-03 09:52:09 -07:00
Ronald S. Bultje 0d793db1b0 swscale: remove unused COMPILE_TEMPLATE_ALTIVEC. 2011-06-02 21:29:59 -07:00
Michael Niedermayer 6713989c23 swscale: dither for planar yuv outputs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-02 21:03:55 +02:00
Michael Niedermayer 201549d1a9 swscale: More accurate rounding in YSCALE_YUV_2_PACKEDX_FULL_C()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-01 05:01:22 +02:00
Reimar Döffinger 3d0424f2ff Add "const" to avoid "initialization discards qualifiers" warning. 2011-05-30 20:07:39 +02:00
Stefano Sabatini e1197b9e17 swscale: remove sws_format_name()
Use av_get_pix_fmt_name() instead.
2011-05-30 09:07:43 +02: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
Michael Niedermayer 986f0d86cb Commits that could not be pulled earlier due to bugs.
commit 93681fbd50
    Author: Ronald S. Bultje <rsbultje@gmail.com>
    Date:   Thu May 26 11:32:32 2011 -0400

        swscale: fix compile on ppc.

    commit e758573a88
    Author: Ronald S. Bultje <rsbultje@gmail.com>
    Date:   Thu May 26 10:36:47 2011 -0400

        swscale: fix compile on x86-32.

    commit 0f4eb8b043
    Author: Ronald S. Bultje <rsbultje@gmail.com>
    Date:   Thu May 26 09:17:52 2011 -0400

        swscale: remove VOF/VOFW.

    commit b4a224c5e4
    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.
2011-05-29 02:13:36 +02:00
Anton Khirnov b8e893399f sws: replace all long with int.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-28 10:03:37 -04:00
Michael Niedermayer 041dbd3c14 swscale: dont loose precission on RGB/BGR48 input, that is dont drop half the bits.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-27 13:21:17 +02:00
Michael Niedermayer 2b6bfff2b2 swscale: Do not loose precission on yuv values after rgb->yuv.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-26 22:00:40 +02:00
Ronald S. Bultje b4a224c5e4 swscale: split chroma buffers into separate U/V planes.
Preparatory step to implement support for sizes > VOFW.
2011-05-26 09:31:27 -04:00
Michael Niedermayer 034fc7bf12 Merge remote-tracking branch 'qatar/master'
* 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>
2011-05-25 06:32:45 +02:00
Michael Niedermayer d1adad3cca Merge swscale bloatup
This will be cleaned up in the next merge

Authorship / merged commits:
commit f668afd489
Author: Janne Grunau <janne-libav@jannau.net>
Date:   Fri Apr 15 09:12:34 2011 +0200

    swscale: fix "ISO C90 forbids mixed declarations and code" warning

    only hit with --enable-runtime-cpudetect

commit 7f2ae5c7af
Author: Janne Grunau <janne-libav@jannau.net>
Date:   Fri Apr 15 02:09:44 2011 +0200

    swscale: fix compilation with --enable-runtime-cpudetect

commit b6cad3df82
Author: Janne Grunau <janne-libav@jannau.net>
Date:   Fri Apr 15 00:31:04 2011 +0200

    swscale: correct include path to fix ppc altivec build

commit 6216fc70b7
Author: Luca Barbato <lu_zero@gentoo.org>
Date:   Thu Apr 14 22:03:45 2011 +0200

    swscale: simplify rgb2rgb templating

    MMX is always built. Drop the ifdefs

commit 33a0421bba
Author: Josh Allmann <joshua.allmann@gmail.com>
Date:   Wed Apr 13 20:57:32 2011 +0200

    swscale: simplify initialization code

    Simplify the fallthrough case when no accelerated functions
    can be initialized.

commit 735bf19511
Author: Josh Allmann <joshua.allmann@gmail.com>
Date:   Wed Apr 13 20:57:31 2011 +0200

    swscale: further cleanup swscale.c

    Move x86-specific constants out of swscale.c

commit 86330b4c92
Author: Luca Barbato <lu_zero@gentoo.org>
Date:   Wed Apr 13 20:57:30 2011 +0200

    swscale: partially move the arch specific code left

    PPC and x86 code is split off from swscale_template.c. Lots of code is
    still duplicated and should be removed later.

    Again uniformize the init system to be more similar to the dsputil one.

    Unset h*scale_fast in the x86 init in order to make the output
    consistent with the previous status. Thanks to Josh for spotting it.

commit c003832883
Author: Luca Barbato <lu_zero@gentoo.org>
Date:   Wed Apr 13 20:57:29 2011 +0200

    swscale: move away x86 specific code from rgb2rgb

    Keep only the plain C code in the main rgb2rgb.c and move the x86
    specific optimizations to x86/rgb2rgb.c
    Change the initialization pattern a little so some of it can be
    factorized to behave more like dsputils.

Conflicts:
	libswscale/rgb2rgb.c
	libswscale/swscale_template.c
2011-05-25 06:24:55 +02:00
Michael Niedermayer 895b616146 swscale: dont loose bits on planar >8bit yuv ind gray nput.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-25 04:08:34 +02:00
Michael Niedermayer 8050dfdfb2 swscale: Switch to ronalds yuv2yuvX16inC_template() its very similar to baptsites
and supports alpha

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-25 04:08:08 +02:00
Ronald S. Bultje aaca69c130 swscale: remove swScale_{c,MMX,MMX2} duplication. 2011-05-24 14:50:15 -04:00
Ronald S. Bultje 1dd4f4be5a swscale: remove AMD3DNOW "optimizations".
The functions are identical to their MMX counterparts. Thus,
pretending that swscale is highly optimized for AMD3DNOW
extensions is a poorly executed practical joke at best.
2011-05-24 10:19:41 -04:00
Ronald S. Bultje fe43d5d71e swscale: remove duplicate code in ppc/ subdirectory. 2011-05-24 10:16:32 -04:00
Ronald S. Bultje e66149e714 swscale: force --enable-runtime-cpudetect and remove SWS_CPU_CAPS_*. 2011-05-24 10:03:26 -04:00
Michael Niedermayer 26ed595bd0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  configure: Add -U__STRICT_ANSI__ to CPPFLAGS on Cygwin and DOS.
  aacdec: fix typo in scalefactor clipping check
  fate: fix fate-h264-conformance-frext-pph10i4-panasonic-a crcs.
  fate: update 9/10bit refs.
  h264: Properly set coded_{width, height} when parsing H.264.
  x86 asm: Add SECTION_TEXT to dct32_sse.asm.
  Fix 9/10 bit in swscale.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-24 04:35:08 +02:00
Kieran Kunhya 6465c820da Fix 9/10 bit in swscale.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-23 06:46:14 -04:00
Ronald S. Bultje b025431bfe swscale: 10l forgot git add this change from ronald.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-14 02:50:10 +02:00
Michael Niedermayer 58c03f6d7d Merge remote branch 'qatar/master'
* qatar/master:
  swscale: properly inline bits/endianness in yuv2yuvX16inC().
(We didnt pull the bug)  swscale: fix clipping of 9/10bit YUV420P.
  Add av_clip_uintp2() function
(our patch / duplicate)  dfa: fix buffer overflow checks to avoid integer overflows.
(our patch / duplicate)  movenc: always write esds descriptor length using 4 bytes.
(our patch / duplicate)  ffmpeg: use parse_number_and_die() when it makes sense
(No thanks)  ffmpeg: get rid of the 'q' key schizofrenia

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-14 02:19:58 +02:00
Ronald S. Bultje 9f54e461fe swscale: properly inline bits/endianness in yuv2yuvX16inC(). 2011-05-13 16:46:24 -04:00
Ronald S. Bultje c3d68ec9c5 swscale: fix clipping of 9/10bit YUV420P. 2011-05-13 16:45:28 -04:00
Michael Niedermayer 72153419b5 Merge remote branch 'qatar/master'
* 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>
2011-05-13 04:40:40 +02:00
Ronald S. Bultje c8f487deae swscale: fix YUV420P 9/10bit support.
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.
2011-05-11 19:15:14 -04:00
Michael Niedermayer 7bea13f111 swscale: Fix scaling for unscaled dithered planar convertions.
This fixes some overflow in bright areas and ensures that the maximum brightness level is
mapped to the maximum without cliping and without showing dither patterens in flat max
brightness areas.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-10 14:43:34 +02:00
Oskar Arvidsson 42239ced65 Add pixel formats for 9- and 10-bit yuv420p.
Also add support for these formats in libswscale.

Needed for high bit depth h264 decoding.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-10 07:24:19 -04:00
Michael Niedermayer 53789a27f8 swscale: use Nbit code to handle !is16BPS(c->srcFormat) && is16BPS(c->dstFormat)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-10 00:37:20 +02:00
Michael Niedermayer 42c9bd313f swscale: Support dither in is16BPS(c->srcFormat) && !is16BPS(c->dstFormat)
This is done by just letting the Nbit code handle it, which now can do it.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-10 00:21:18 +02:00
Michael Niedermayer c4f7050bb1 swscale: support unscaled planar Nbit->8bit with non native endian source.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-10 00:18:27 +02:00
Michael Niedermayer 09ff3cc77b swscale: fix unscaled yuv422p16be -> yuv422p10le
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-10 00:15:03 +02:00
Michael Niedermayer eb8aa13b54 swscale: make DITHER_COPY() support non native endian source
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-10 00:09:10 +02:00
Michael Niedermayer 9c49ca0f19 swscale: factor shift out of DITHER_COPY().
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-09 22:02:44 +02:00
Michael Niedermayer 300e497b5f swscale: factorize DITHER_COPY()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-09 21:38:46 +02:00
Michael Niedermayer 3dd779eb0a swscale: implement Nbit->non native endian 16bit. Fixes v210.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-09 00:22:12 +02:00
Baptiste Coudurier b9e608492a swscale: 9,10 bits pixel format output support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-08 14:27:13 +02:00
Michael Niedermayer 95f163b33b swscale: Dither for unscaled 10->8bit per channel
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-06 15:19:27 +02:00
Michael Niedermayer 7915e038c6 swscale: dont reshuffle bytes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-06 13:18:55 +02:00
Peter Ross 1afbae100b libswcale: PIX_FMT_BGR48LE and PIX_FMT_BGR48BE scaler implementation
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-28 07:25:27 +02:00
Baptiste Coudurier 624a7e005c Correctly support pal8 with alpha in libswscale, fix png pal8 with alpha.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-27 21:52:09 +02:00
Baptiste Coudurier dbfdb288c1 Set alpha of palettes to 0xff.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-27 21:49:45 +02:00
Baptiste Coudurier e91946ed23 Rename y400a to gray8a.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-27 21:36:30 +02:00
tateu 93c28a55fd Fix runtime CPU detection in libswscale. 2011-04-27 01:52:36 +02:00
Anton Khirnov 7dfe244fbd sws: remove disabled cruft. 2011-04-19 21:50:12 +02:00
Janne Grunau f668afd489 swscale: fix "ISO C90 forbids mixed declarations and code" warning
only hit with --enable-runtime-cpudetect
2011-04-15 10:06:53 +02:00
Josh Allmann 33a0421bba swscale: simplify initialization code
Simplify the fallthrough case when no accelerated functions
can be initialized.
2011-04-14 22:16:47 +02:00
Josh Allmann 735bf19511 swscale: further cleanup swscale.c
Move x86-specific constants out of swscale.c
2011-04-14 22:16:47 +02:00
Luca Barbato 86330b4c92 swscale: partially move the arch specific code left
PPC and x86 code is split off from swscale_template.c. Lots of code is
still duplicated and should be removed later.

Again uniformize the init system to be more similar to the dsputil one.

Unset h*scale_fast in the x86 init in order to make the output
consistent with the previous status. Thanks to Josh for spotting it.
2011-04-14 22:16:47 +02:00
Michael Niedermayer c55780dcef Merge remote branch 'qatar/master'
* qatar/master: (32 commits)
  libopencore-amr, libvo-amrwbenc: Allow enabling DTX via private AVOptions
  libopencore-amr, libvo-amrwbenc: Only check the bitrate when changed
  libopencore-amr, libvo-amrwbenc: Find the closest matching bitrate
  libvo-*: Fix up the long codec names
  libavcodec: Mark AVCodec->priv_class const
  swscale: Factorize FAST_BGR2YV12 definition.
  libvo-aacenc: Only produce extradata if the global header flag is set
  lavf: postpone removal of public metadata conversion API
  lavc: postpone removal of request_channels
  lavc: postpone removal of audioconvert and sample_fmt wrappers
  lavf: postpone removal of deprecated avio functions
  libopencore-amr: Cosmetics: Rewrap and align
  libopencore-amr, libvo-amrbwenc: Rename variables and functions
  libopencore-amr: Convert commented out debug logging into av_dlog
  libopencore-amr: Remove an unused state variable
  libvo-amrwbenc: Don't explicitly store bitrate modes in the bitrate table
  libopencore-amr: Remove a useless local variable
  libopencore-amr, libvo-amrwbenc: Make the bitrate/mode mapping array static const
  libopencore-amr, libvo-amrwbenc: Return proper error codes in most places
  libopencore-amr: Don't print carriage returns in log messages
  ...

Conflicts:
	doc/developer.texi
	libavcodec/avcodec.h
	libavcodec/libvo-aacenc.c
	libavcodec/libvo-amrwbenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-14 03:21:38 +02:00
Luca Barbato 0e1a5434e2 swscale: Factorize FAST_BGR2YV12 definition.
It is used only for x86 so it will eventually be moved with that code
into the x86 arch subdirectory.
2011-04-13 17:24:53 +02:00
Oskar Arvidsson d4497f6dfb Add pixel formats for 9- and 10-bit yuv420p.
Also add support for these formats in libswscale.

Needed for high bit depth h264 decoding.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Darren Horrocks 30c6fefd01 fix runtime-cpu-detect bug in swscale
swscale doesnt ever actually do any runtime detection at all when
runtime cpu detection is enabled, it simply passes whatever is passed
to -sws_flags, which could be nothing at all making swscale default to
the C implementation.
2011-04-05 02:36:57 +02:00
Michael Niedermayer 95c8bb03ed Fix compilation failure with runtime cpudetect (Ticket #22) 2011-03-28 16:46:45 +02:00
Peter Ross 3e2523db20 libswcale: PIX_FMT_BGR48LE and PIX_FMT_BGR48BE scaler implementation 2011-03-26 13:24:32 +11: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
Baptiste Coudurier bd8154d0b3 100l fix if condition
Originally committed as revision 32395 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-09-27 23:47:54 +00:00
Baptiste Coudurier df0743e01e Y400A (gray alpha) input support in libswscale
Originally committed as revision 32394 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-09-27 22:24:03 +00:00
Ramiro Polla 5a90173751 swscale: remove useless temporary variable
Originally committed as revision 32258 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-09-16 01:09:59 +00:00
Ramiro Polla cf1cd520c6 swscale: factorize plane copying code out of 2 functions
Originally committed as revision 32257 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-09-16 01:07:55 +00:00
Ramiro Polla 0132ab80a8 indent
Originally committed as revision 32157 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-09-11 14:31:13 +00:00
Ramiro Polla 4d8617496f swscale: remove unused code
yvu9ToYv12Wrapper() used to support yv12 with the chroma planes either in the
uv order or the vu order. FFmpeg no longer has a pixel format in vu order.

Originally committed as revision 32156 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-09-11 14:30:54 +00:00
Ramiro Polla a1899e0adc swscale: fix internal rgb->yv12 chroma conversion used by the main scaler path
The shift must be applied before the masking.

Originally committed as revision 32051 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-09-06 02:02:53 +00:00
Ramiro Polla 0fc29f2708 swscale: simplify selection of optimizations to compile.
Originally committed as revision 32013 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-08-25 14:39:11 +00:00
Ramiro Polla 8f02861636 swscale: Always define COMPILE_xxx to either 0 or 1.
Originally committed as revision 32012 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-08-25 14:38:30 +00:00
Måns Rullgård 66842fe874 swscale: fix unaligned accesses in (RGB|BGR)32_1 to YUV conversion
Originally committed as revision 32011 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-08-23 21:22:24 +00:00
Måns Rullgård 83761d5b58 swscale: remove unused macro parameter in BGR2UV template
Originally committed as revision 32010 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-08-23 21:22:20 +00:00
Ramiro Polla a42c29febc validate input data and linesizes
Originally committed as revision 31976 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-08-18 19:37:37 +00:00
Stefano Sabatini 04f6ab1cef Add missing comma, fix rgb2yuv_table[SWS_CS_SMPTE240M] coefficients.
Originally committed as revision 31779 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-07-24 11:19:39 +00:00
Stefano Sabatini 24911613a5 Add some comments to the rgb2yuv_table, clarifying the standard where
are defined.

Originally committed as revision 31778 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-07-24 11:19:35 +00:00
Martin Storsjö e593826b93 Cosmetics: reindent and unify whitespace
Originally committed as revision 31757 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-07-19 07:06:14 +00:00
Martin Storsjö 72ae5049e1 Do planar copy with a single memcpy only if the stride is equal to the length
This avoids writing outside of the designated rectangle.

Originally committed as revision 31756 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-07-19 07:02:31 +00:00
Martin Storsjö c4e2b8268f In planarCopyWrapper, Only copy length, not stride of the last line in the plane
If the destination planes are offset within the destination buffer,
writing the extra bytes at the end may write outside of the destination
buffer.

Originally committed as revision 31746 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-07-16 17:45:50 +00:00
Måns Rullgård 6a01eab73c Add av_ prefix to bswap macros
Originally committed as revision 31679 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-07-10 22:12:38 +00:00
Eli Friedman 3483d87752 Fix 'assignment from incompatible pointer type' warning.
Patch by Eli Friedman, eli d friedman a gmail

Originally committed as revision 31628 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-07-03 09:58:13 +00:00
Reinhard Tartler 2b991422f8 deprecate palette8topacked32 in favor of public API functions sws_convertPalette8ToPacked32 and -24
additionallym deprecate palette8torgb16 and its bgr variant without
replacement. These functions are not meant to be used by applications.

Discussed at: http://comments.gmane.org/gmane.comp.video.ffmpeg.devel/109340

Originally committed as revision 31301 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-06-01 19:35:16 +00:00
Stefano Sabatini 4e74187db2 Remove PI definition and use M_PI instead.
M_PI is defined by the included file libavutil/mathematics.h.

Originally committed as revision 31185 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-05-19 22:49:04 +00:00
Ramiro Polla c3ab0004ae Revert r31153. It failed to build on:
x86_64 / Mac OS X gcc 4.0.1
x86_64 / Linux icc (all)
x86_64 / Linux gcc 4.0.4
x86_64 / OpenBSD gcc 3.3.5
x86_64 / Linux suncc 5.10
and there are some reports of crashes.

Originally committed as revision 31170 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-05-12 20:47:32 +00:00
Ramiro Polla d9d14dc607 Use int instead of long to pass width parameters in non-public functions.
long was being incorrectly used as an x86-sized register, both for 32 and 64
bits, but this is not the case in win64.

Originally committed as revision 31153 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-05-11 00:36:34 +00:00
Diego Biurrun 819ee683d8 libswscale: Relicense almost all x86 assembler optimizations as LGPL.
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
2010-03-27 11:31:02 +00:00
Diego Biurrun f684f3c58a AltiVec implies a PPC CPU, so there is no need to check for both.
Originally committed as revision 30954 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-03-23 22:59:14 +00:00
Diego Biurrun 81bbd840fe Check whether COMPILE_ALTIVEC is defined, not if it is set to a 0/1 value.
COMPILE_ALTIVEC is never set to 1, it is just #defined.

Originally committed as revision 30937 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-03-19 09:57:36 +00:00
Janusz Krzysztofik 22e8222fd2 Extend the generic path of the yuv2rgb converter with support for rgb444
output format.

Patch by Janusz Krzysztofik, jkrzyszt A tis D icnet D pl

Originally committed as revision 30934 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-03-18 23:02:32 +00:00
Reinhard Tartler 07cea6d1cd Fix compilation on powerpc with --disable-altivec
in case altivec is disabled, even compilation of code using altivec
keywords or asm must be avoided.

Originally committed as revision 30869 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-03-09 08:07:34 +00:00
Stefano Sabatini 3de42635bd Avoid duplication of usePal() macro.
Originally committed as revision 30856 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-03-06 11:50:54 +00:00
Janusz Krzysztofik 601949b898 libswscale: Extend the unaccelerated path of the unscaled yuv2rgb special
converter with support for rgb444 output format.
Patch by Janusz Krzysztofik jkrzyszt chez tis icnet pl

Originally committed as revision 30841 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-03-05 08:32:54 +00:00
Alexis Ballier 1379b58482 Support BGR555, BGR565, RGB555 and RGB565 foreign endian output in
libswscale.

Patch by Alexis Ballier, alexis D ballier A gmail

Originally committed as revision 30840 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-03-04 16:57:04 +00:00
Stefano Sabatini 23bf3b2c97 Fill the r, g, b values used for computing the c->pal_yuv table in the
case where the source format is PIX_FMT_GRAY8.

This is required as PIX_FMT_GRAY8 has been declared as a paletted
format in FFmpeg r22191, fix GRAY8 -> RGB conversion.

Originally committed as revision 30826 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-03-04 00:31:13 +00:00
Stefano Sabatini 82e5f86bd5 Implement shuffle_bytes_abcd() functions and use them for shuffling
bytes when converting between RGB32 variants.

In particular fix the argb -> rgba and abgr -> bgra conversions.

See the thread:
Subject: [FFmpeg-devel] [RFC] RGB32 / BGR32 ethernal bug
Date: Tue, 26 Jan 2010 01:06:18 +0100

Originally committed as revision 30501 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-02-03 23:46:00 +00:00
Stefano Sabatini 909f659473 Reindent.
Originally committed as revision 30467 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-30 21:58:09 +00:00
Stefano Sabatini 3ece3e524f Use a consistent convention for the names of the internal wrapper
functions. Improve readability.
 -This line, and those below, will be ignored--

     swscale.c

Originally committed as revision 30466 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-30 21:56:33 +00:00
Michael Niedermayer 6022255774 Use isAnyRGB() where possible
Originally committed as revision 30435 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-26 08:03:28 +00:00
Michael Niedermayer 3b1ee70312 Rename isRGB() and isBGR() as their meaning is confusing.
Originally committed as revision 30433 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-26 07:40:14 +00:00
Stefano Sabatini aa2ead8215 Fix mis-computation of the needsDither variable erroneously introduced
in r30419, which was causing a swscale-example regression.

Also increase my liter count by 20.0 units.

Originally committed as revision 30431 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-24 21:28:17 +00:00
Stefano Sabatini 30b6147521 Use av_get_bits_per_pixel() for computing the bits per pixel of the
source and destination format, cache those values in the newly added
SwsContext:srcFormatBpp and SwsContext:dstFormatBpp fields, and remove
the fmt_depth() function.

Originally committed as revision 30419 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-24 12:55:05 +00:00
Ramiro Polla 59398ea9c0 Indent.
Originally committed as revision 30413 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-24 03:02:40 +00:00
Ramiro Polla a4388ebd37 Split swscale.c into scaler code (swscale.c) and utility code (utils.c).
Originally committed as revision 30411 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-24 02:08:22 +00:00
Måns Rullgård 4a88852623 Move array specifiers outside DECLARE_ALIGNED() invocations
Originally committed as revision 30385 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-22 03:26:30 +00:00
David Conrad 01cc47dcd3 More const-correctness for sws_scale
Originally committed as revision 30381 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-21 09:52:11 +00:00
Stefano Sabatini 0e21dcdb13 Split overly long line.
Originally committed as revision 30378 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-19 22:36:46 +00:00
Alexis Ballier f28cc5771f Make const prototypes for input sources of sws_scale_* stricter.
Patch by Alexis Ballier gmailify($firstname, $familyname)

Originally committed as revision 30374 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-19 16:30:20 +00:00
Ramiro Polla 3aca8b59f6 Remove useless forward declaration.
Originally committed as revision 30371 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-19 11:35:04 +00:00
Stefano Sabatini c36a4294dc Remove stray '\' at the end of macro definitions.
Originally committed as revision 30362 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 23:29:31 +00:00
Stefano Sabatini 90eb284a77 Remove duplicated or pointless newlines.
Originally committed as revision 30361 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 23:17:47 +00:00
Stefano Sabatini 398c193d0b Factorize error message logging, log it if the converter cannot be
set.

Originally committed as revision 30360 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 23:07:37 +00:00
Stefano Sabatini e36a545de5 Reindent after the last commit.
Originally committed as revision 30359 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 23:02:20 +00:00
Stefano Sabatini c0d1dc1c4f Make the pal2rgbWrapper set and use the converter in pal2rgbWrapper
only if the input format is paletted.

Fix potential crashes/weirdness if the input format is non-paletted.

Originally committed as revision 30358 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 23:00:01 +00:00
Måns Rullgård 00c4127ec9 Remove double const
Originally committed as revision 30357 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 19:26:35 +00:00
Stefano Sabatini 9a180390b9 Factorize error message logging in rgb2rgbWrapper().
Originally committed as revision 30356 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 15:11:25 +00:00
Måns Rullgård 1b5d46c6a6 Reindent
Originally committed as revision 30350 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 14:25:19 +00:00
Måns Rullgård d39d7cf693 Remove inline from initFilter()
It makes no sense having that function inlined.

Originally committed as revision 30349 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 14:25:17 +00:00
Stefano Sabatini e922e34c96 Add a const qualifier in a cast, fix the gcc warning:
swscale.c: In function ‘sws_scale’:
swscale.c:2968: warning: cast discards qualifiers from pointer target type

Originally committed as revision 30341 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 00:26:29 +00:00
Stefano Sabatini 5090d8e16a Add a const qualifier in a cast, fix the gcc warning:
swscale.c: In function ‘planarCopy’:
swscale.c:2256: warning: cast discards qualifiers from pointer target type

Originally committed as revision 30340 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-17 00:21:50 +00:00
Stefano Sabatini a630ed3ee9 Fix typo, "get rid off" -> "get rid of".
Originally committed as revision 30338 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-16 22:49:00 +00:00
Stefano Sabatini 730cb9dab3 Revert r30331, which broke compilation.
swScale_C is not templated if any optimization is to be used and
!runtime_cpudetect.

Originally committed as revision 30334 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-16 19:51:26 +00:00
Stefano Sabatini 80853cfc6a Factorize the code which calls the non optimized C functions in
getSwsFunc().

Originally committed as revision 30331 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-16 19:19:54 +00:00
Stefano Sabatini c70f1401df Prefer "to %s%s" over "to%s %s", slightly more readable.
Originally committed as revision 30330 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-16 19:14:29 +00:00
Stefano Sabatini a9e2878c48 Simplify code in sws_getContext() which logs if the destination format
support dithering, remove the const char *dither variable and use a
literal string instead.

Originally committed as revision 30329 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-16 19:11:03 +00:00
Ramiro Polla 0cc854e377 Reuse h{lum,chr}Filter{,Pos} variables for MMX2 fast_bilinear horizontal scaler.
Originally committed as revision 30327 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-16 18:39:06 +00:00
Stefano Sabatini d95c863850 Factorize code which logs the source and destination formats in
sws_getContext().

Originally committed as revision 30326 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-16 18:36:21 +00:00
Stefano Sabatini 3e906f4cfb Simplify reset_ptr(): employ usePal() macro rather than enumerating
all the paletted formats.

Originally committed as revision 30317 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-16 11:08:16 +00:00
Ramiro Polla 2e3e8031ec Don't initialize normal horizontal filter if MMX2 filter is used.
Originally committed as revision 30313 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-15 19:50:59 +00:00
Zuxy Meng a959e24780 Const correctness for src pointer. Remove all constness related warnings in
libswscale.

Originally committed as revision 30306 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-15 08:51:51 +00:00
Stefano Sabatini 3bfbbef64d Fix typo.
Originally committed as revision 30304 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-15 00:39:25 +00:00
Ramiro Polla 00c081a8f0 Remove unused clip_table code.
Originally committed as revision 30303 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-14 19:12:42 +00:00
Ramiro Polla efc034cc0f Add const qualifier to rgb48 to YV12 functions' src.
Originally committed as revision 30301 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-14 06:19:45 +00:00
Ramiro Polla a3e35e2852 Add missing parameter to rgb48 to YV12 functions.
Originally committed as revision 30300 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-14 06:19:10 +00:00
Reimar Döffinger 1b168a428d Ignore 0-height slice in sws_scale, otherwise a final 0-height slice will
cause libswscale to assume the incorrect slice order and complain about
slices starting in the middle.

Originally committed as revision 30246 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-08 19:31:33 +00:00
Stefano Sabatini 8e9767f6fd Implement sws_isSupportedInput() and sws_isSupportedOutput().
Originally committed as revision 30236 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-07 19:07:47 +00:00
Stefano Sabatini 634116df3e Prefer enum PixelFormat over int for the type of the format parameter
of getSubSampleFactors().

Originally committed as revision 30184 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-03 15:20:07 +00:00
Stefano Sabatini 997980f0d8 Prefer "*FUNC_NAME(" over "* FUNC_NAME(" for the
swscale_configuration() and swscale_license() functions, consistent
with the rest of FFmpeg.

Originally committed as revision 30180 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-03 14:35:20 +00:00
Stefano Sabatini f412d5e97a Simplify usePal() macro, make it use av_pix_fmt_descriptors.
Originally committed as revision 30172 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-03 00:22:49 +00:00
Stefano Sabatini b3cf7cb144 Simplify getSubSampleFactors(), make it use the values provided by
av_pix_fmt_descriptors().

Originally committed as revision 30171 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-01-03 00:09:24 +00:00
Ramiro Polla d3243d1431 Indentation.
Originally committed as revision 30087 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-12-20 17:42:35 +00:00
Ramiro Polla a8bcc7b42b Document the differences between the two asm fragments in initMMX2HScaler().
Originally committed as revision 29978 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-12-07 03:52:55 +00:00
Ramiro Polla f415be684d Add support for nv12/nv21 input.
Originally committed as revision 29974 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-12-03 18:18:13 +00:00
Stefano Sabatini a9af75ae85 Make sws_format_name() use av_pix_fmt_descriptors.
This also introduces a dependency of libswscale on libavutil.

Originally committed as revision 29968 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-11-26 21:08:45 +00:00
Diego Biurrun bd381fd3f6 Add functions to return library license and library configuration.
Originally committed as revision 29932 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-11-18 17:16:02 +00:00
NVIDIA Corporation 8cbcb1c732 Support VDPAU hardware accelerated decoding of MPEG-4 ASP on capable
hardware.

Original patch by NVIDIA corporation.

Originally committed as revision 29885 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-11-10 19:11:13 +00:00
Ramiro Polla 749fac310c Reset slice direction at end of each frame.
Originally committed as revision 29675 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-09-13 01:49:40 +00:00
Ramiro Polla 9cf484d06e Rename CHECKED_ALLOC(Z) to FF_ALLOC(Z)_OR_GOTO and add context and label
parameters.

Originally committed as revision 29652 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-09-06 00:07:35 +00:00
Ramiro Polla c2613a3137 Indent.
Originally committed as revision 29651 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-09-05 23:35:59 +00:00
Lars Täuber 991e579cae Make 16bit YUV formats compatible with NE avcodec_get_pix_fmt().
Patch by Lars Täuber <lars <dot> taeuber <at> gmx <dot> net>.

Originally committed as revision 29650 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-09-05 23:33:11 +00:00
Ramiro Polla 67c2c5bb2e Curly brackets cosmetics for previous commit.
Originally committed as revision 29587 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-08-29 23:08:32 +00:00
Ramiro Polla 1ddb5747df Check for return value of initFilter().
Originally committed as revision 29586 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-08-29 23:06:22 +00:00
Ramiro Polla 7248797c03 swscale: Check for return values of malloc.
Originally committed as revision 29584 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-08-29 23:02:01 +00:00
Ramiro Polla 0607b09069 Restore comment that was partially removed.
Originally committed as revision 29582 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-08-29 02:44:03 +00:00
Ramiro Polla 1b03a9d607 Check return values of sws_allocVec() and sws_getConstVec().
Originally committed as revision 29543 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-08-20 01:55:45 +00:00
Ramiro Polla 1aff375d41 Introduce and use sws_allocVec().
Originally committed as revision 29536 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-08-19 01:33:17 +00:00
Ramiro Polla 20484b90ec Reuse sws_getConstVec() where possible.
Originally committed as revision 29535 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-08-19 01:32:06 +00:00
Ramiro Polla dd68318cee Cosmetics:
- Place curly brackets in the same line as while/for/if/switch/else/do;
- Place curly brackets at column 0 in the next line starting a function.

Originally committed as revision 29523 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-08-16 21:11:28 +00:00