Commit Graph

276 Commits

Author SHA1 Message Date
Øyvind Kolås 3e6016622e swscale: add two spatially stable dithering methods
Both of these dithering methods are from http://pippin.gimp.org/a_dither/ for
GIF they can be considered better than bayer (provides more gray-levels), and
spatial stability - often more than twice as good compression and less visual
flicker than error diffusion methods (the methods also avoids error-shadow
artifacts of diffusion dithers).

These methods are similar to blue/green noise type dither masks; but are
simple enough to generate their mask on the fly. They are still research work
in progress; though more expensive to generate masks (which can be used in a
LUT) like 'void and cluster' and similar methods will yield superior results
2014-03-25 13:48:06 +01:00
Michael Niedermayer 6b1ca1709f Merge commit '1481d24c3a0abf81e1d7a514547bd5305232be30'
* commit '1481d24c3a0abf81e1d7a514547bd5305232be30':
  RGBA64 pixel formats

Conflicts:
	doc/APIchanges
	libavutil/pixdesc.c
	libavutil/pixfmt.h
	libavutil/version.h
	libswscale/utils.c

See: 9569a3c9f4
See: 92afb43162, as well as others
Note: the enum values added in libav are incompatible/different to what ffmpeg used since 3 years
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 14:41:13 +01:00
Jean First 1481d24c3a RGBA64 pixel formats
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-03-16 23:05:47 +01:00
Michael Niedermayer 3fc2362aef Merge commit 'b4dd424d96f09f9bafb88e47f37df65dc4529143'
* commit 'b4dd424d96f09f9bafb88e47f37df65dc4529143':
  Remove all SPARC architecture optimizations

Conflicts:
	Makefile
	configure
	libavcodec/sparc/dsputil_vis.c
	libavcodec/sparc/dsputil_vis.h
	libavcodec/sparc/hpeldsp_vis.c
	libavcodec/sparc/simple_idct_vis.c
	libavcodec/sparc/vis.h
	libswscale/sparc/yuv2rgb_vis.c
	libswscale/swscale_internal.h

If someone wants to maintain these (or other) SPARC optimizations, please
contact me or ffmpeg-devel.
I am happy to revert this removial if theres someone considering to
maintain this code.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-13 22:35:47 +01:00
Diego Biurrun b4dd424d96 Remove all SPARC architecture optimizations
SPARC is no longer being used in any multimedia-related fields and the
VIS optimizations only represent a maintenance burden.
2014-03-13 05:50:28 -07:00
Peter Ross 02b63246cf libswscale: bayer to rgb24 & yv12 colorspace converters
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-23 02:38:22 +01:00
Yu Xiaolei 1c67ad9d93 swscale: NEON optimized unscaled rgba to nv12 conversion
Signed-off-by: Yu Xiaolei <dreifachstein@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-16 00:47:39 +01:00
Reimar Döffinger 4fab08c94f Optimize pure C unscaled yuv2rgb.
Aligning the tables reduces the amount of code generated on
e.g. ARM as the offset constant then has few enough set bits
so it can be encoded inside a single instruction instead of 2.
Ideally all should be declared aligned, but the DECLARE_ALIGNED
macros does not work with pointer tables, thus also reordered
the tables.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-10-30 20:52:24 +01:00
Michael Niedermayer 01cac26f68 Merge commit '1909f6b1b6da2db371c179bed5a19aaf979b7557'
* commit '1909f6b1b6da2db371c179bed5a19aaf979b7557':
  swscale: cosmetics: Drop silly camelCase from swScale function pointer name

Conflicts:
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 15:56:03 +02:00
Michael Niedermayer c5cec9a42b Merge commit '3aa682f25324d811ec284edc808eb71a46eae950'
* commit '3aa682f25324d811ec284edc808eb71a46eae950':
  swscale: consistent names for arch-specific acceleration functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 15:41:05 +02:00
Michael Niedermayer 5ff1b588eb Merge commit 'c2503d9c8ab42ea55922e9f5a10c8bfbbbfeaf19'
* commit 'c2503d9c8ab42ea55922e9f5a10c8bfbbbfeaf19':
  swscale: ppc: Hide arch-specific initialization details

Conflicts:
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 15:10:09 +02:00
Michael Niedermayer db6b389c7f Merge commit 'a519583991c38d38503ab08357716513facc5725'
* commit 'a519583991c38d38503ab08357716513facc5725':
  swscale: x86: Hide arch-specific initialization details

Conflicts:
	libswscale/x86/Makefile
	libswscale/x86/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 14:42:34 +02:00
Diego Biurrun 1909f6b1b6 swscale: cosmetics: Drop silly camelCase from swScale function pointer name 2013-08-29 10:23:54 +02:00
Diego Biurrun 3aa682f253 swscale: consistent names for arch-specific acceleration functions 2013-08-29 10:23:52 +02:00
Diego Biurrun c2503d9c8a swscale: ppc: Hide arch-specific initialization details
Also give consistent names to init functions.
2013-08-29 10:23:41 +02:00
Diego Biurrun a519583991 swscale: x86: Hide arch-specific initialization details
Also give consistent names to init functions.
2013-08-28 23:59:24 +02:00
Michael Niedermayer c62801270f swscale: change ff_dither_8x8_128 dimensions to be consistent with the others
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-16 16:06:59 +02:00
Michael Niedermayer c14fc4585c Merge commit 'aa2ba8c99e5708884a56aea9c1d96e014866f8a3'
* commit 'aa2ba8c99e5708884a56aea9c1d96e014866f8a3':
  swscale: Move extern declarations for tables to swscale_internal.h

Conflicts:
	libswscale/output.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c
	libswscale/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-16 12:56:48 +02:00
Michael Niedermayer 1ef0b8f9cc Merge commit 'd258531502b24cb653204fe4f003c8815755bdc4'
* commit 'd258531502b24cb653204fe4f003c8815755bdc4':
  swscale: Mark a bunch of tables only used within one file static

Conflicts:
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-16 12:40:32 +02:00
Michael Niedermayer 1e0e193240 sws: add dither enum
This allows specifying more dither algorithms without using up flags and
without ambiguities.

Also initialize the new field based on the flags and use it.
Note, improving the logic of the checks is left to subsequent
commits, this here only switches from flags to enum.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-15 21:39:32 +02:00
Michael Niedermayer 60e9b8556a swscale_unscaled: make dither_scale static, its not used elsewhere and has no prefix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-15 21:38:22 +02:00
Diego Biurrun aa2ba8c99e swscale: Move extern declarations for tables to swscale_internal.h
Also add missing ff_ prefixes where necessary.
2013-08-15 14:38:03 +02:00
clook b9b1a2c3e4 libswscale: Adding RGB => XYZ support 2013-07-23 01:02:41 +02:00
Michael Niedermayer b405f4e916 swscale: Add support to specify chroma position
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-17 01:59:10 +02:00
Michael Niedermayer 034b31df2c swscale: Fix PAL8 input with alpha
Fixes Ticket2158

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-26 15:14:00 +02:00
Michael Niedermayer c7c71f95f8 replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_*
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-15 11:23:14 +02:00
Michael Niedermayer ff4680922f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_*

Conflicts:
	doc/APIchanges
	libavcodec/avpicture.c
	libavcodec/ffv1dec.c
	libavcodec/ffv1enc.c
	libavcodec/imgconvert.c
	libavcodec/tiffenc.c
	libavfilter/vf_pixdesctest.c
	libavfilter/vf_scale.c
	libavutil/imgutils.c
	libavutil/pixdesc.c
	libavutil/version.h
	libswscale/swscale_internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-15 11:10:09 +02:00
Anton Khirnov e6c4ac7b5f pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_* 2013-05-15 07:46:51 +02:00
Paul B Mahol 443181c0a9 libswscale: simplify isAnyRGB macro
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-05-08 12:48:05 +00:00
Paul B Mahol 5c057433cc libswscale: GBRAP input & output and GBRAP16 input support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-05-08 12:48:05 +00:00
Michael Niedermayer 2514b80045 sws: share xyzgamma tables.
They are currently always constant and thus theres no point to
store them in the context.
This makes the context 16kb smaller

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-01 17:52:18 +02:00
Michael Niedermayer 0c47c9028b sws: support xyz input
The implementation is heavily based on Matthias Buerchers and Nicolas Bertrands vf_xyz2rgb.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-28 19:30:01 +02:00
Michael Niedermayer 003bf33747 sws: fix alignment of rgb2yuv
This should fix mingw32 fate

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-16 05:59:47 +02:00
Michael Niedermayer 3950236332 sws/x86: update RENAME(rgb24toyv12)() to using the user provided rgb2yuv table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 21:44:50 +02:00
Michael Niedermayer 357da7ed42 sws: remove forgotten FAST_BGR2YV12 define
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 11:04:52 +02:00
Michael Niedermayer 17ad06c753 sws/x86: update rgb/bgr->yuv code to use provided coefficient table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 01:31:01 +02:00
Michael Niedermayer 3662e49dde sws: move RGB2YUV_SHIFT to swscale_internal.h
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 01:23:29 +02:00
Michael Niedermayer d4956b0bfb sws/input: replace hardcoded rgb2yuv coefficients by table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-14 20:04:55 +02:00
Michael Niedermayer bb2f4ae434 Merge commit '05b0998f511ffa699407465d48c7d5805f746ad2'
* commit '05b0998f511ffa699407465d48c7d5805f746ad2':
  dsputil: Fix error by not using redzone and register name
  swscale: GBRP output support

Conflicts:
	libswscale/output.c
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/utils.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>
2013-01-28 14:11:31 +01:00
Michael Niedermayer 4eb93bed4e swscale: GBRP output support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-01-27 15:28:07 -05:00
Michael Niedermayer f0d3a03115 sws: include isRGB in isAnyRGB() so that future RGB formats wont be missed again
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-26 21:38:01 +01:00
Michael Niedermayer 02001a372d sws: add planar RGB formats to isAnyRGB
We have to make some symetric changes elsewhere as this increases
the precission with which samples are stored.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-26 20:40:44 +01:00
Michael Niedermayer 61884d1985 sws: GBRP output support
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-26 06:11:52 +01:00
Paul B Mahol d07b0d9927 swscale: check flags instead of nb_components to find if pixel format have alpha
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-25 13:06:00 +00:00
Michael Niedermayer 646ade7679 sws: Support error diffusion dither for mono output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 23:26:00 +01:00
Michael Niedermayer 4b874fc4fc Merge commit 'a65bdceb060628881578afb29df4eb222421381f'
* commit 'a65bdceb060628881578afb29df4eb222421381f':
  x86: mmx2 ---> mmxext in variable names

Conflicts:
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-31 14:08:49 +01:00
Michael Niedermayer 78ec407d5a Merge commit '652f5185945c8405fc57aed353286858df8d066f'
* commit '652f5185945c8405fc57aed353286858df8d066f':
  x86: mmx2 ---> mmxext in comments and messages

Conflicts:
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-31 14:02:35 +01:00
Diego Biurrun a65bdceb06 x86: mmx2 ---> mmxext in variable names 2012-10-31 00:37:42 +01:00
Diego Biurrun 652f518594 x86: mmx2 ---> mmxext in comments and messages 2012-10-31 00:37:42 +01:00
Michael Niedermayer 70c25c6205 sws: move fillPlane16() to header so it can be used from more than 1 place
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-30 18:51:21 +01:00