Commit Graph

63 Commits

Author SHA1 Message Date
Rémi Denis-Courmont 66a03f4053 sws/rgb2rgb: RISC-V V shuffle_bytes_xxxx functions 2022-09-30 07:24:09 +02:00
Hao Chen 74d09b068d
swscale/la: Add yuv2rgb_lasx.c and rgb2rgb_lasx.c files
ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -pix_fmt rgb24 -y /dev/null -an
before: 178fps
after:  210fps

Signed-off-by: Hao Chen <chenhao@loongson.cn>
Reviewed-by: yinshiyou-hf@loongson.cn
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-09-10 22:56:38 +02:00
Andreas Rheinhardt 636631d9db Remove unnecessary libavutil/(avutil|common|internal).h inclusions
Some of these were made possible by moving several common macros to
libavutil/macros.h.

While just at it, also improve the other headers a bit.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24 12:56:49 +01:00
Martin Storsjö e0604d508e swscale: aarch64: Add a NEON implementation of interleaveBytes
This allows speeding up format conversions from yuv420 to nv12.

                             Cortex A53      A72      A73
interleave_bytes_c:             86077.5  51433.0  66972.0
interleave_bytes_neon:          19701.7  23019.2  15859.2
interleave_bytes_aligned_c:     86603.0  52017.2  67484.2
interleave_bytes_aligned_neon:   9061.0   7623.0   6309.0

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-05-15 23:38:17 +03:00
Martin Vignali 5f6126ea7f swscale/rgb2rgb : cosmetic, move shuffle_bytes func declaration
move shuffle_bytes_1230, 3012, 3210 with the other shuffle_byte
declaration
2018-03-24 20:22:17 +01:00
Martin Vignali d4f6640855 swscale/rgb : move shuffle func shuffle_bytes_1230, shuffle_bytes_3012, shuffle_bytes_3210 in order to add SIMD 2018-03-24 20:22:02 +01:00
Carl Eugen Hoyos cb1a3eecac lsws/rgb2rgb: Add unscaled 48bit to 64bit rgb conversion.
Based on b4befca2 and 6b7849e6 by Paul B Mahol.

Fixes ticket #6608.
2017-08-24 12:50:06 +02:00
Andreas Cadhalpun e8c3716064 swscale: rename sws_rgb2rgb_init to ff_sws_rgb2rgb_init
It is an internal swscale function and thus should not be exported.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-29 23:49:46 +01:00
Michael Niedermayer abb833c568 swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-23 05:09:06 +02:00
Michael Niedermayer ef627bf9ec swscale: add nv12/nv21->yuv420 converter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-19 15:13:48 +01:00
Michael Niedermayer 803445e02c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Drop pointless directory name prefixes from #includes in the current dir

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-11 12:51:01 +02:00
Diego Biurrun a0b901a348 Drop pointless directory name prefixes from #includes in the current dir 2013-09-10 12:38:41 +02:00
Michael Niedermayer a37fd7f957 sws: Update rgb24toyv12_c() to user supplied rgb2yuv tables
As the function arguments change, we also change the function name
to ensure that anyone using this (non public) function doesnt end
with hard to debug crashes. The new name also has a proper prefix.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-15 03:08:37 +02:00
Paul B Mahol 6b7849e6da swscale: unscaled rgba64->rgb48
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-07-19 00:17:16 +00:00
Paul B Mahol b4befca23e swscale: unscaled rgba64->bgr48
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-07-19 00:16:17 +00:00
Paul B Mahol 9d8eac6899 swscale: simplify unscaled rgb48<->bgr48
Using av_bswap16 should be enough.
2012-07-18 23:47:40 +00:00
Paul B Mahol 1d69dcb887 swscale: unscaled rgb48 <-> bgr48
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-06-09 11:55:52 +00:00
Michael Niedermayer e986a5d10d Merge remote-tracking branch 'qatar/master'
* qatar/master:
  FATE: add tests for targa
  ARM: fix Thumb-mode simple_idct_arm
  ARM: 4-byte align start of all asm functions
  rgb2rgb: rgb12to15()
  swscale-test: fix stack overread.
  swscale: fix invalid conversions and memory problems.
  cabac: split cabac.h into declarations and function definitions
  cabac: Mark ff_h264_mps_state array as static, it is only used within cabac.c.
  cabac: Remove ff_h264_lps_state array.

Conflicts:
	libswscale/rgb2rgb.h
	libswscale/swscale_unscaled.c
	tests/fate/image.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-14 02:22:09 +01:00
Paul B Mahol 0cc1a86dc3 rgb2rgb: rgb12to15()
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-12 16:43:17 -08:00
Paul B Mahol f7f3563214 rgb2rgb: rgb12tobgr12()
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-01-11 15:52:53 -08:00
Paul B Mahol 296a338261 rgb2rgb: remove unused bgr8torgb8()
RGB8 and BGR8 are paletted formats now.
2012-01-10 18:28:40 +00:00
Paul B Mahol 4ad40d6d9f rgb2rgb: rgb12tobgr12() 2012-01-10 18:00:38 +00:00
Michael Niedermayer dd3ca3ea15 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  fate: Add tests for more AAC features.
  aacps: Add missing newline in error message.
  fate: Add tests for vc1/wmapro in ism.
  aacdec: Add a fate test for 5.1 channel SBR.
  aacdec: Turn off PS for multichannel files that use PCE based configs.
  cabac: remove put_cabac_u/ueg from cabac-test.
  swscale: RGB4444 and BGR444 input
  FATE: add test for xWMA demuxer.
  FATE: add test for SMJPEG demuxer and associated IMA ADPCM audio decoder.
  mpegaudiodec: optimized iMDCT transform
  mpegaudiodec: change imdct window arrangment for better pointer alignment
  mpegaudiodec: move imdct and windowing function to mpegaudiodsp
  mpegaudiodec: interleave iMDCT buffer to simplify future SIMD implementations
  swscale: convert yuy2/uyvy/nv12/nv21ToY/UV from inline asm to yasm.
  FATE: test to exercise WTV demuxer.
  mjpegdec: K&R formatting cosmetics
  swscale: K&R formatting cosmetics for code examples
  swscale: K&R reformatting cosmetics for header files
  FATE test: cvid-grayscale; ensures that the grayscale Cinepak variant is exercised.

Conflicts:
	libavcodec/cabac.c
	libavcodec/mjpegdec.c
	libavcodec/mpegaudiodec.c
	libavcodec/mpegaudiodsp.c
	libavcodec/mpegaudiodsp.h
	libavcodec/mpegaudiodsp_template.c
	libavcodec/x86/Makefile
	libavcodec/x86/imdct36_sse.asm
	libavcodec/x86/mpegaudiodec_mmx.c
	libswscale/swscale-test.c
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/x86/swscale_template.c
	tests/fate/demux.mak
	tests/fate/microsoft.mak
	tests/fate/video.mak
	tests/fate/wma.mak
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-10 03:50:41 +01:00
Diego Biurrun 83890c66c4 swscale: K&R reformatting cosmetics for header files 2012-01-08 23:32:56 +01:00
Stefano Sabatini 4ce0a94656 lsws: remove deprecated and unused stuff after the 0->1 major bump 2011-08-04 00:23:00 +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
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 39e4206dc6 Merge remote-tracking branch 'qatar/master'
* qatar/master: (32 commits)
  doc: create separate section for audio encoders
  swscale: Remove orphaned, commented-out function declaration.
  swscale: Eliminate rgb24toyv12_c() duplication.
  Remove h263_msmpeg4 from MpegEncContext.
  APIchanges: Fill in git hash for fps_probe_size (30315a8)
  avformat: Add fpsprobesize as an AVOption.
  avoptions: Return explicitly NAN or {0,0} if the option isn't found
  rtmp: Reindent
  rtmp: Don't try to do av_malloc(0)
  tty: replace AVFormatParameters.sample_rate abuse with a private option.
  Fix end time of last chapter in compute_chapters_end
  ffmpeg: get rid of useless AVInputStream.nb_streams.
  ffmpeg: simplify managing input files and streams
  ffmpeg: purge redundant AVInputStream.index.
  lavf: deprecate AVFormatParameters.channel.
  libdc1394: add a private option for channel.
  dv1394: add a private option for channel.
  v4l2: reindent.
  v4l2: add a private option for channel.
  lavf: deprecate AVFormatParameters.standard.
  ...

Conflicts:
	doc/APIchanges
	doc/encoders.texi
	ffmpeg.c
	libavdevice/alsa-audio.h
	libavformat/version.h
	libavutil/opt.c
	libswscale/rgb2rgb.h
	libswscale/rgb2rgb_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-26 03:28:22 +02:00
Diego Biurrun 6f7a280ead swscale: Remove orphaned, commented-out function declaration. 2011-05-26 00:56:07 +02:00
Michael Niedermayer 7dc303a60e swscale: Eliminate rgb24toyv12_c() duplication.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-05-26 00:56:06 +02:00
Michael Niedermayer 4a056160be swscale: remove duplicatiopn of rgb24toyv12_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-25 20:58:59 +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
Ronald S. Bultje e66149e714 swscale: force --enable-runtime-cpudetect and remove SWS_CPU_CAPS_*. 2011-05-24 10:03:26 -04:00
Anton Khirnov 7dfe244fbd sws: remove disabled cruft. 2011-04-19 21:50:12 +02:00
Luca Barbato c003832883 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.
2011-04-14 22:16:47 +02: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
Ramiro Polla a51125b52f rgb2rgb: replace shuffle_bytes_2103() by optimized rgb32tobgr32()
Originally committed as revision 32190 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-09-12 13:03:41 +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
Reinhard Tartler 3d9408f4a7 remove palette8torgb15 and palette8tobgr15
They contain exactly the same code as their 16bit variants, so this is
effectively code de-duplication.

Originally committed as revision 31298 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2010-06-01 06:53:56 +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
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
Ramiro Polla 9b734d44ab Indent libswscale:
- Use 4 spaces throughout for indentation;
- Fix inconsistent indentation;
- Indent function calls and declarations aligning arguments on multiple lines
  to the column after the opening parentheses;
- Align asm code to the column 4 spaces after the call to __asm__();
- Align cases in switch statements to the same column as "switch".

Originally committed as revision 29522 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-08-16 00:32:04 +00:00
Michael Niedermayer 0411072ee3 Unscaled converters for
YUYV->YUV420P
YUYV->YUV422P
UYVY->YUV420P
UYVY->YUV422P

Originally committed as revision 28997 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2009-03-19 03:45:29 +00:00
Diego Biurrun 376924583a Delete unnecessary 'extern' keywords.
Originally committed as revision 28082 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2008-12-03 15:25:27 +00:00
Vitor Sessak 522ce95786 Fix broken palette8to*.
Originally committed as revision 27817 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2008-10-23 19:13:11 +00:00
Diego Biurrun 58f0ec5ff6 spelling/wording cosmetics
Originally committed as revision 27563 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2008-09-10 00:02:31 +00:00
Baptiste Coudurier a6100f39a1 enable yuv422p to uyvy converter
Originally committed as revision 27527 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2008-09-05 00:25:39 +00:00
Michael Niedermayer 6107059c2c rgb vs bgr fix for the unscaled converters.
Originally committed as revision 27518 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2008-09-04 19:11:39 +00:00
Stefano Sabatini 0eaf523548 Change headers' guardnames consistently with r15120.
Originally committed as revision 27499 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
2008-08-31 07:42:11 +00:00