Commit Graph

373 Commits

Author SHA1 Message Date
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
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