Commit Graph

2534 Commits

Author SHA1 Message Date
Chip Kerchner 3a557c5d88 lsws/ppc/yuv2rgb_altivec: Replace vec_lvsl/vec_perm with vec_xl
gcc 6.x and 7.x generate wrong code for little endian machines
for the vec_lvsl/vec_perm instruction combos in some cases.
The bug was fixed in version 8.x
If these instructions are replaced with vec_xl, the problem goes
away for all versions of the compilers.

Fixes ticket #7124.
2019-08-13 02:21:24 +02:00
Michael Niedermayer 80bb65fafa Bump minor versions again on master to keep 4.2 versions separate from master
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-21 18:36:31 +02:00
Michael Niedermayer 22db337a40 Bump minor versions to separate 4.2 from master
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-21 18:36:18 +02:00
Michael Niedermayer 9d269301f0 swscale/tests/swscale: Lengthen pixfmt name buffer to 21 bytes
Some formats use longer names than 12.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-13 13:39:49 +02:00
Adam Richter b8ed493061 libswcale: Fix possible string overflow in test.
In libswcale/tests/swcale.c, the function fileTest() calls sscanf in
an argument of "%12s" on character srcStr[] and dstStr[], which are
only 12 bytes.  So, if the input string is 12 characters, a
terminating null byte can be written past the end of these arrays.

This bug was found by cppcheck.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-13 13:39:40 +02:00
Philip Langdale 4fa4f1d7a9 swscale: Add test for isSemiPlanarYUV to pixdesc_query
Lauri had asked me what the semi planar formats were and that reminded
me that we could add it to pixdesc_query so we know exactly what the
list is.
2019-05-12 07:51:02 -07:00
Philip Langdale cd48318035 swscale: Add support for NV24 and NV42
The implementation is pretty straight-forward. Most of the existing
NV12 codepaths work regardless of subsampling and are re-used as is.
Where necessary I wrote the slightly different NV24 versions.

Finally, the one thing that confused me for a long time was the
asm specific x86 path that did an explicit exclusion check for NV12.
I replaced that with a semi-planar check and also updated the
equivalent PPC code, which Lauri kindly checked.
2019-05-12 07:51:02 -07:00
Lauri Kasanen e25bddf5fc swscale/ppc: Shorten power8 tests via a var 2019-05-07 10:08:16 +03:00
Lauri Kasanen a2a16206aa swscale/ppc: VSX-optimize hScale16To*
./ffmpeg -loop 1 -s 1200x1440 -i tux16.png \
    -s 2400x720 -f rawvideo -y -vframes 5 -pix_fmt yuv420p16le -nostats test.raw

./ffmpeg -loop 1 -s 1200x1440 -i tux16.png \
    -s 2400x720 -f rawvideo -y -vframes 5 -pix_fmt yuv420p -nostats test.raw

32-bit mul, power8 only

2x speedup for hScale8To19_vsx (x86 SSE2 is 2.37):
  30896 UNITS in hscale,    8192 runs,      0 skips
  63956 UNITS in hscale,    8192 runs,      0 skips

2.06 for hScale16To15_vsx:
  30531 UNITS in hscale,    8192 runs,      0 skips
  63161 UNITS in hscale,    8192 runs,      0 skips
2019-05-07 10:08:16 +03:00
Lauri Kasanen 3437111f17 swscale/ppc: Indent 2019-05-07 10:08:16 +03:00
Lauri Kasanen 9456adc223 swscale/ppc: VSX-optimize hScale8To19
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
    -s 2400x720 -f rawvideo -y -vframes 5 -pix_fmt yuv420p16le -nostats test.raw

2.26 speedup (x86 SSE2 is 2.32):
  23772 UNITS in hscale,    4096 runs,      0 skips
  53862 UNITS in hscale,    4096 runs,      0 skips
2019-05-07 10:08:16 +03:00
Lauri Kasanen d0e4d0429e swscale/ppc: VSX-optimize hscale_fast
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags fast_bilinear \
        -s 2400x720 -f rawvideo -vframes 5 -pix_fmt abgr -nostats test.raw

4.27 speedup for hyscale_fast:
  24796 UNITS in hyscale_fast,    4096 runs,      0 skips
   5797 UNITS in hyscale_fast,    4096 runs,      0 skips

4.48 speedup for hcscale_fast:
  19911 UNITS in hcscale_fast,    4095 runs,      1 skips
   4437 UNITS in hcscale_fast,    4096 runs,      0 skips
2019-04-30 14:41:28 +03:00
Lauri Kasanen ce92ee4b4f swscale/ppc: VSX-optimize non-full-chroma yuv2rgb_2
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags fast_bilinear \
        -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
        -cpuflags 0 -v error -

32-bit mul, power8 only.

~2x speedup:

rgb24
  24431 UNITS in yuv2packed2,   16384 runs,      0 skips
  13783 UNITS in yuv2packed2,   16383 runs,      1 skips
bgr24
  24396 UNITS in yuv2packed2,   16384 runs,      0 skips
  14059 UNITS in yuv2packed2,   16384 runs,      0 skips
rgba
  26815 UNITS in yuv2packed2,   16383 runs,      1 skips
  12797 UNITS in yuv2packed2,   16383 runs,      1 skips
bgra
  27060 UNITS in yuv2packed2,   16384 runs,      0 skips
  13138 UNITS in yuv2packed2,   16384 runs,      0 skips
argb
  26998 UNITS in yuv2packed2,   16384 runs,      0 skips
  12728 UNITS in yuv2packed2,   16381 runs,      3 skips
bgra
  26651 UNITS in yuv2packed2,   16384 runs,      0 skips
  13124 UNITS in yuv2packed2,   16384 runs,      0 skips

This is a low speedup, but the x86 mmx version also gets only ~2x. The mmx version
is also heavily inaccurate, while the vsx version has high accuracy.
2019-04-11 09:08:51 +03:00
Lauri Kasanen 8607e29fa3 swscale/ppc: VSX-optimize yuv2rgb_full_X
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
                -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
                -cpuflags 0 -v error -

32-bit mul, power8 only.

~6.4x speedup:

rgb24
 214278 UNITS in yuv2packedX,   16384 runs,      0 skips
  33249 UNITS in yuv2packedX,   16384 runs,      0 skips
bgr24
 214616 UNITS in yuv2packedX,   16384 runs,      0 skips
  33233 UNITS in yuv2packedX,   16384 runs,      0 skips
rgba
 214517 UNITS in yuv2packedX,   16384 runs,      0 skips
  33271 UNITS in yuv2packedX,   16384 runs,      0 skips
bgra
 214973 UNITS in yuv2packedX,   16384 runs,      0 skips
  33397 UNITS in yuv2packedX,   16384 runs,      0 skips
argb
 214613 UNITS in yuv2packedX,   16384 runs,      0 skips
  33310 UNITS in yuv2packedX,   16384 runs,      0 skips
bgra
 214637 UNITS in yuv2packedX,   16384 runs,      0 skips
  33330 UNITS in yuv2packedX,   16384 runs,      0 skips
2019-04-07 09:20:34 +03:00
Lauri Kasanen 3256e949be swscale/ppc: VSX-optimize yuv2rgb_full_2
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags area \
            -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
            -cpuflags 0 -v error -

32-bit mul, power8 only.

~4x speedup:

rgb24
  52763 UNITS in yuv2packed2,   16384 runs,      0 skips
  13453 UNITS in yuv2packed2,   16384 runs,      0 skips
bgr24
  53144 UNITS in yuv2packed2,   16384 runs,      0 skips
  13616 UNITS in yuv2packed2,   16384 runs,      0 skips
rgba
  52796 UNITS in yuv2packed2,   16384 runs,      0 skips
  12904 UNITS in yuv2packed2,   16384 runs,      0 skips
bgra
  52732 UNITS in yuv2packed2,   16384 runs,      0 skips
  13262 UNITS in yuv2packed2,   16384 runs,      0 skips
argb
  52661 UNITS in yuv2packed2,   16384 runs,      0 skips
  12879 UNITS in yuv2packed2,   16384 runs,      0 skips
bgra
  52662 UNITS in yuv2packed2,   16384 runs,      0 skips
  12932 UNITS in yuv2packed2,   16384 runs,      0 skips
2019-04-07 09:20:33 +03:00
Lauri Kasanen 50e672bc54 swscale/ppc: VSX-optimize non-full-chroma yuv2rgb_1
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags fast_bilinear \
        -s 1200x1440 -f null -vframes 100 -pix_fmt $i -nostats \
        -cpuflags 0 -v error -

32-bit mul, power8 only.

1.8-2.3x speedup:

rgb24
  18192 UNITS in yuv2packed1,   32767 runs,      1 skips
   9983 UNITS in yuv2packed1,   32760 runs,      8 skips
bgr24
  18665 UNITS in yuv2packed1,   32766 runs,      2 skips
   9925 UNITS in yuv2packed1,   32763 runs,      5 skips
rgba
  20239 UNITS in yuv2packed1,   32767 runs,      1 skips
   8794 UNITS in yuv2packed1,   32759 runs,      9 skips
bgra
  20354 UNITS in yuv2packed1,   32768 runs,      0 skips
   8770 UNITS in yuv2packed1,   32761 runs,      7 skips
argb
  20185 UNITS in yuv2packed1,   32768 runs,      0 skips
   8761 UNITS in yuv2packed1,   32761 runs,      7 skips
bgra
  20360 UNITS in yuv2packed1,   32766 runs,      2 skips
   8759 UNITS in yuv2packed1,   32764 runs,      4 skips

This is a low speedup, but the x86 mmx version also gets only ~2x. The mmx version
is also heavily inaccurate, while the vsx version has high accuracy.
2019-04-07 09:20:31 +03:00
Lauri Kasanen 7adce3e64c swscale/ppc: VSX-optimize yuv2422_X
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
          -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
          -cpuflags 0 -v error -

7.2x speedup:

yuyv422
 126354 UNITS in yuv2packedX,   16384 runs,      0 skips
  16383 UNITS in yuv2packedX,   16382 runs,      2 skips
yvyu422
 117669 UNITS in yuv2packedX,   16384 runs,      0 skips
  16271 UNITS in yuv2packedX,   16379 runs,      5 skips
uyvy422
 117310 UNITS in yuv2packedX,   16384 runs,      0 skips
  16226 UNITS in yuv2packedX,   16382 runs,      2 skips
2019-03-31 12:41:34 +03:00
Lauri Kasanen 9a2db4dc61 swscale/ppc: VSX-optimize yuv2422_2
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags area \
                -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
                -cpuflags 0 -v error -

5.1x speedup:

yuyv422
  19339 UNITS in yuv2packed2,   16384 runs,      0 skips
   3718 UNITS in yuv2packed2,   16383 runs,      1 skips
yvyu422
  19438 UNITS in yuv2packed2,   16384 runs,      0 skips
   3800 UNITS in yuv2packed2,   16380 runs,      4 skips
uyvy422
  19128 UNITS in yuv2packed2,   16384 runs,      0 skips
   3721 UNITS in yuv2packed2,   16380 runs,      4 skips
2019-03-31 12:41:33 +03:00
Lauri Kasanen a6a31ca3d9 swscale/ppc: VSX-optimize yuv2422_1
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
            -s 1200x1440 -f null -vframes 100 -pix_fmt $i -nostats \
            -cpuflags 0 -v error -

15.3x speedup:

yuyv422
  14513 UNITS in yuv2packed1,   32768 runs,      0 skips
    949 UNITS in yuv2packed1,   32767 runs,      1 skips
yvyu422
  14516 UNITS in yuv2packed1,   32767 runs,      1 skips
    943 UNITS in yuv2packed1,   32767 runs,      1 skips
uyvy422
  14530 UNITS in yuv2packed1,   32767 runs,      1 skips
    941 UNITS in yuv2packed1,   32766 runs,      2 skips
2019-03-31 12:41:32 +03:00
Michael Niedermayer 8865ae959b swscale/swscale_unscaled: Fix chroma slice height
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-28 22:47:32 +01:00
Dong, Jerry c47fada298 swscale/swscale_unscaled: fixed the issue that when width/height is not 2-multiple, transition of nv12 to u/v planes is not completed.
Signed-off-by: Dong, Jerry <jerry.dong@intel.com>
Signed-off-by: Decai Lin <decai.lin@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-28 20:28:43 +01:00
Lauri Kasanen 681957b88d swscale/ppc: VSX-optimize yuv2rgb_full
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
        -s 1200x1440 -f null -vframes 100 -pix_fmt $i -nostats \
        -cpuflags 0 -v error -

This uses 32-bit mul, so POWER8 only.

The following output formats get about 4.5x speedup:

rgb24
  39980 UNITS in yuv2packed1,   32768 runs,      0 skips
   8774 UNITS in yuv2packed1,   32768 runs,      0 skips
bgr24
  40069 UNITS in yuv2packed1,   32768 runs,      0 skips
   8772 UNITS in yuv2packed1,   32766 runs,      2 skips
rgba
  39759 UNITS in yuv2packed1,   32768 runs,      0 skips
   8681 UNITS in yuv2packed1,   32767 runs,      1 skips
bgra
  39729 UNITS in yuv2packed1,   32768 runs,      0 skips
   8696 UNITS in yuv2packed1,   32766 runs,      2 skips
argb
  39766 UNITS in yuv2packed1,   32768 runs,      0 skips
   8672 UNITS in yuv2packed1,   32766 runs,      2 skips
bgra
  39784 UNITS in yuv2packed1,   32768 runs,      0 skips
   8659 UNITS in yuv2packed1,   32767 runs,      1 skips
2019-03-27 09:05:08 +02:00
Lauri Kasanen 81a4719d8e swscale: Remove duplicated code
In this function, the exact same clamping happens both in the if and unconditionally.
2019-03-27 09:00:06 +02:00
Lauri Kasanen 6b5ea90eac swscale/ppc: Add av_unused to template vars only used in one includer 2019-03-20 10:21:55 +02:00
Lauri Kasanen ac3062f1a4 swscale/ppc: Clean up some mixed decl warnings 2019-03-20 10:21:53 +02:00
Lauri Kasanen 8522d219ce libswscale/ppc: VSX-optimize 9-16 bit yuv2planeX
./ffmpeg_g -f rawvideo -pix_fmt rgb24 -s hd1080 -i /dev/zero -pix_fmt yuv420p16be \
-s 1920x1728 -f null -vframes 100 -v error -nostats -

9-14 bit funcs get about 6x speedup, 16-bit gets about 15x.
Fate passes, each format tested with an image to video conversion.

Only POWER8 includes 32-bit vector multiplies, so POWER7 is locked out
of the 16-bit function. This includes the vec_mulo/mule functions too,
not just vmuluwm.

With TIMER_REPORT skips disabled:
yuv420p9le
  12412 UNITS in planarX,  131072 runs,      0 skips
  73136 UNITS in planarX,  131072 runs,      0 skips
yuv420p9be
  12481 UNITS in planarX,  131072 runs,      0 skips
  73410 UNITS in planarX,  131072 runs,      0 skips
yuv420p10le
  12322 UNITS in planarX,  131072 runs,      0 skips
  72546 UNITS in planarX,  131072 runs,      0 skips
yuv420p10be
  12291 UNITS in planarX,  131072 runs,      0 skips
  72935 UNITS in planarX,  131072 runs,      0 skips
yuv420p12le
  12316 UNITS in planarX,  131072 runs,      0 skips
  72708 UNITS in planarX,  131072 runs,      0 skips
yuv420p12be
  12319 UNITS in planarX,  131072 runs,      0 skips
  72577 UNITS in planarX,  131072 runs,      0 skips
yuv420p14le
  12259 UNITS in planarX,  131072 runs,      0 skips
  72516 UNITS in planarX,  131072 runs,      0 skips
yuv420p14be
  12440 UNITS in planarX,  131072 runs,      0 skips
  72962 UNITS in planarX,  131072 runs,      0 skips
yuv420p16le
  10548 UNITS in planarX,  131072 runs,      0 skips
  73429 UNITS in planarX,  131072 runs,      0 skips
yuv420p16be
  10634 UNITS in planarX,  131072 runs,      0 skips
 150959 UNITS in planarX,  131072 runs,      0 skips

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2019-02-05 09:34:53 +02:00
Michael Niedermayer fe17f9b956 swscale/yuv2rgb: Return a more specific error code from ff_yuv2rgb_c_init_tables()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-01 21:11:47 +01:00
Lauri Kasanen 8dd9df9ecd swscale/output: Altivec-optimize float yuv2plane1
This function wouldn't benefit from VSX instructions, so I put it
under altivec.

./ffmpeg_g -f rawvideo -pix_fmt rgb24 -s hd1080 -i /dev/zero -pix_fmt grayf32le \
-f null -vframes 100 -v error -nostats -

3743 UNITS in planar1,   65495 runs,     41 skips

-cpuflags 0

23511 UNITS in planar1,   65530 runs,      6 skips

grayf32be

4647 UNITS in planar1,   65449 runs,     87 skips

-cpuflags 0

28608 UNITS in planar1,   65530 runs,      6 skips

The native speedup is 6.28133, and the bswapping one 6.15623.
Fate passes, each format tested with an image to video conversion.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-26 20:28:58 +01:00
Lauri Kasanen b4c8c03b00 swscale/output: VSX-optimize 16-bit yuv2plane1
./ffmpeg_g -f rawvideo -pix_fmt rgb24 -s hd1080 -i /dev/zero -pix_fmt yuv420p16le \
-f null -vframes 100 -v error -nostats -

2120 UNITS in planar1,   65393 runs,    143 skips

-cpuflags 0

19157 UNITS in planar1,   65512 runs,     24 skips

9.03632 speedup, 16be similarly.

Fate passes, each format tested with an image to video conversion.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-14 19:09:11 +01:00
Lauri Kasanen 1046cba24b swscale/output: VSX-optimize nbps yuv2plane1
./ffmpeg_g -f rawvideo -pix_fmt rgb24 -s hd1080 -i /dev/zero -pix_fmt yuv420p9le \
-f null -vframes 100 -v error -nostats -

Speedups:
yuv2plane1_9BE_vsx	11.2042
yuv2plane1_9LE_vsx	11.156
yuv2plane1_10BE_vsx	9.89428
yuv2plane1_10LE_vsx	10.3637
yuv2plane1_12BE_vsx	9.71923
yuv2plane1_12LE_vsx	11.0404
yuv2plane1_14BE_vsx	10.1763
yuv2plane1_14LE_vsx	11.2728

Fate passes, each format tested with an image to video conversion.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-12 01:56:57 +01:00
Lauri Kasanen 78c7ff7d25 swscale/ppc: Move VSX-using code to its own file
Passes fate on LE (with "lavc/jrevdct: Avoid an aliasing violation" applied).

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Tested-by: Michael Kostylev on BE
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-04 02:59:07 +01:00
Lauri Kasanen 46c5693ea3 swscale/output: Altivec-optimize yuv2plane1_8
./ffmpeg_g -f rawvideo -pix_fmt rgb24 -s hd1080 -i /dev/zero -pix_fmt yuv420p \
-f null -vframes 100 -v error -nostats -

1158 UNITS in planar1,   65528 runs,      8 skips

-cpuflags 0

19082 UNITS in planar1,   65533 runs,      3 skips

16.48 speedup ratio. On x86, SSE2 is ~7. Curiously, the Power C version
takes as many cycles as the x86 SSE2 version, yikes it's fast.

Note that this function uses VSX instructions, but is not marked so.
This is because several existing functions also make that mistake.
I'll submit a patch moving them once this is reviewed.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-26 02:56:25 +01:00
Martin Vignali 86e6f0dbc7 swscale : add support for YUVA444P12 and YUVA422P12 2018-11-24 16:24:47 +01:00
Michael Niedermayer 517573a670 Bump minor version for master after 4.1 branchpoint
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-02 00:53:07 +01:00
Michael Niedermayer 780d5e30a0 Bump minor versions for branching 4.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-02 00:15:32 +01:00
Martin Vignali 156120fcf8 swscale/swscale_unscaled : rename packed_16bpc_bswap
is used for packed and planar format
2018-10-24 21:21:20 +02:00
Martin Vignali 26bf4a4050 swscale/unscaled : add grayf32 le to be 2018-10-24 21:21:14 +02:00
Martin Vignali 3db33b446f swscale/utils : simplify unscaled initial test for float pixfmt 2018-10-24 21:21:10 +02:00
Martin Vignali db4771af81 swscale : add YA16 LE/BE output 2018-10-18 21:43:24 +02:00
Martin Vignali 658bbc0060 swscale/x86/rgb2rgb.asm : add Ivo Van Poorten name to the top of the file
suggested by Carl Eugen Hoyos
2018-10-18 21:43:19 +02:00
Martin Vignali 296609f859 swscale/x86/rgb2rgb : port shuffle 2103 mmxext to external asm and remove inline asm version 2018-10-13 14:12:41 +02:00
Martin Vignali 04afdbb560 swscale/x86/rgb2rgb : remove mmx version for shuffle2103 2018-10-13 14:12:36 +02:00
Paul B Mahol 931e7c050e swscale/swscale_unscaled: add gbrap -> packed rgb path 2018-09-09 22:58:26 +02:00
Martin Vignali bdd6754648 swscale/swscale : small cosmetic 2018-08-22 11:36:15 +02:00
Martin Vignali 3af1c4ea7d swscale : treat float input data as uint 16bpc
Currently float are converted to 16b uint in input part
using src depth (32 bits) in hScale16To19 and hScale16to15,
make an invalid shift for the data

So shift the value when using float input
like 16 bpc uint.
2018-08-22 11:36:09 +02:00
Sergey Lavrushkin 582bc5a348 libswscale: Adds conversions from/to float gray format.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-14 18:22:39 +02:00
Carl Eugen Hoyos 3a56ade1f3 lsws/rgb2rgb_template: Do not compile unneeded shuffle functions on big-endian.
Fixes the following warnings:
In file included from libswscale/rgb2rgb.c:128:0:
libswscale/rgb2rgb_template.c:346:13: warning: 'shuffle_bytes_3210_c' defined but not used
libswscale/rgb2rgb_template.c:346:13: warning: 'shuffle_bytes_3012_c' defined but not used
libswscale/rgb2rgb_template.c:346:13: warning: 'shuffle_bytes_1230_c' defined but not used
2018-06-10 03:22:59 +02:00
Paul B Mahol b9dd058f7a swscale: add gray14 support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-05-05 21:35:31 +02:00
Martin Vignali 07a566e7d6 swscale/swscale_unscaled : add X86_64 (SSE2 and AVX) for uyvyto422
and checkasm test
2018-04-22 19:15:32 +02:00
Michael Niedermayer 3c1ecb057d Bump minor versions after release/4.0 branching
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-16 12:35:12 +02:00
Michael Niedermayer 7e3a070d9a Bump minor versions for branching release/4.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-16 12:35:12 +02:00
wm4 d6fc031caf avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPAL
PSEUDOPAL pixel formats are not paletted, but carried a palette with the
intention of allowing code to treat unpaletted formats as paletted. The
palette simply mapped the byte values to the resulting RGB values,
making it some sort of LUT for RGB conversion.

It was used for 1 byte formats only: RGB4_BYTE, BGR4_BYTE, RGB8, BGR8,
GRAY8. The first 4 are awfully obscure, used only by some ancient bitmap
formats. The last one, GRAY8, is more common, but its treatment is
grossly incorrect. It considers full range GRAY8 only, so GRAY8 coming
from typical Y video planes was not mapped to the correct RGB values.
This cannot be fixed, because AVFrame.color_range can be freely changed
at runtime, and there is nothing to ensure the pseudo palette is
updated.

Also, nothing actually used the PSEUDOPAL palette data, except xwdenc
(trivially changed in the previous commit). All other code had to treat
it as a special case, just to ignore or to propagate palette data.

In conclusion, this was just a very strange old mechnaism that has no
real justification to exist anymore (although it may have been nice and
useful in the past). Now it's an artifact that makes the API harder to
use: API users who allocate their own pixel data have to be aware that
they need to allocate the palette, or FFmpeg will crash on them in
_some_ situations. On top of this, there was no API to allocate the
pseuo palette outside of av_frame_get_buffer().

This patch not only deprecates AV_PIX_FMT_FLAG_PSEUDOPAL, but also makes
the pseudo palette optional. Nothing accesses it anymore, though if it's
set, it's propagated. It's still allocated and initialized for
compatibility with API users that rely on this feature. But new API
users do not need to allocate it. This was an explicit goal of this
patch.

Most changes replace AV_PIX_FMT_FLAG_PSEUDOPAL with FF_PSEUDOPAL. I
first tried #ifdefing all code, but it was a mess. The FF_PSEUDOPAL
macro reduces the mess, and still allows defining FF_API_PSEUDOPAL to 0.

Passes FATE with FF_API_PSEUDOPAL enabled and disabled. In addition,
FATE passes with FF_API_PSEUDOPAL set to 1, but with allocation
functions manually changed to not allocating a palette.
2018-04-03 17:53:00 +02:00
Martin Storsjö f33f728470 arm: swscale: Only compile the rgb2yuv asm if .dn aliases are supported
Vanilla clang supports altmacro since clang 5.0, and thus doesn't
require gas-preprocessor for building the arm assembly any longer.

However, the built-in assembler doesn't support .dn directives.

This readds checks that were removed in d7320ca3ed, when
the last usage of .dn directives within libav were removed.

Alternatively, the assembly could be rewritten to not use the
.dn directive, making it available to clang users.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-03-31 21:54:56 +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 1ba5ca2d72 swscale/rgb : add X86 SIMD (SSSE3), for shuffle_bytes_1230, shuffle_bytes_3012, shuffle_bytes_3210 2018-03-24 20:22:08 +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
Martin Vignali 923a324174 swscale/rgb : add X86 SIMD (SSSE3) for shuffle_bytes_2103 and shuffle_bytes_0321 2018-03-24 20:21:58 +01:00
Philip Langdale dd3f1e3a11 swscale: Introduce a helper to identify semi-planar formats
This cleans up the ever-more-unreadable list of semi-planar
exclusions for selecting the planar copy wrapper.
2018-03-03 15:20:19 -08:00
Philip Langdale 9d5aff09a7 swscale: Add p016 output support and generalise yuv420p1x to p010
To make the best use of existing code, I generalised the wrapper
that currently does yuv420p10 to p010 to support any mixture of
input and output sizes between 10 and 16 bits. This had the side
effect of yielding a working code path for all yuv420p1x formats
to p01x.
2018-03-02 14:52:48 -08:00
Thomas Köppe 43171a2a73 Fix missing used attribute for inline assembly variables
Variables used in inline assembly need to be marked with attribute((used)).
Static constants already were, via the define of DECLARE_ASM_CONST.
But DECLARE_ALIGNED does not add this attribute, and some of the variables
defined with it are const only used in inline assembly, and therefore
appeared dead. This change adds a macro DECLARE_ASM_ALIGNED that marks
variables as used.

This change makes FFMPEG work with Clang's ThinLTO.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-13 03:58:34 +01:00
James Almer 869401cefc Merge commit '29ccc641b17afad058a5c24071ea827865a8b3a9'
* commit '29ccc641b17afad058a5c24071ea827865a8b3a9':
  build: Drop check for sys/mman.h in favor of mmap() check

Merged-by: James Almer <jamrial@gmail.com>
2017-11-11 16:09:09 -03:00
James Almer 087e9ab1b3 Merge commit '0fd0d4fd0a518e30ff23972828ad7cf7f35cfb9d'
* commit '0fd0d4fd0a518e30ff23972828ad7cf7f35cfb9d':
  swscale-test: const correctness

Merged-by: James Almer <jamrial@gmail.com>
2017-10-30 12:34:40 -03:00
Carl Eugen Hoyos 9b0510a8e3 lsws/yuv2rgb: Fix yuva2rgb32 on big endian hardware. 2017-10-29 14:53:57 +01:00
Mateusz 50ce296026 swscale: use dithering in DITHER_COPY only if not set -sws_dither none
This patch uses dithering in DITHER_COPY macro only if
it was not used option '-sws_dither none'.
With option '-sws_dither none' it uses downshift.

For human eye dithering is OK, for video codecs not necessarily.
If user don't want to use dithering, we should respect that.

Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-25 21:50:37 +02:00
Mateusz f192f2f061 swscale: more accurate DITHER_COPY macro for full and limited range
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-23 23:00:05 +02:00
James Almer 69b5ce64d2 Merge commit '07a2b155949eb267cdfc7805f42c7b3375f9c7c5'
* commit '07a2b155949eb267cdfc7805f42c7b3375f9c7c5':
  Bump major versions of all libraries

A few API deprecated ~2 years ago or more are also postponed here for
varying reasons.

FF_API_LOWRES:
Since this functionality depends on AVStream->codec, i figure the two can
be removed at the same time in the next bump or so.

FF_API_AVCTX_TIMEBASE:
Couldn't get this one to work. Not just libavcodec but apparently also
libavformat and ffmpeg.c expect AVCodecContext->time_base to be set for
decoding. Upon removal some tests report a different generic stream time
base (like 1/25), and others lose packet duration values. I guess it's
somehow tied to the AVStream->codec clusterfuck.
It can be dealt with alongside FF_API_LAVF_AVCTX in the next bump.

FF_API_OLD_FILTER_OPTS_ERROR:
This one is meant to remain after FF_API_OLD_FILTER_OPTS is removed.
Its purpose is displaying the corrected command line using the new syntax
as a suggestion as part of the error message.

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 14:57:53 -03:00
James Almer 2904db9045 Merge commit '994c4bc10751e39c7ed9f67ffd0c0dea5223daf2'
* commit '994c4bc10751e39c7ed9f67ffd0c0dea5223daf2':
  x86util: Port all macros to cpuflags

See d5f8a642f6

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 12:15:57 -03:00
Michael Niedermayer 80154b1b3a Bump version for master after 3.4 branchpoint
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-11 02:45:37 +02:00
Michael Niedermayer e1de9eab3a Bump minor versions for branching 3.4
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-11 01:23:47 +02:00
Diego Biurrun 29ccc641b1 build: Drop check for sys/mman.h in favor of mmap() check
We already rely on just mmap() in other places.
2017-10-10 23:20:16 +02:00
Lou Logan 183fd30e0f Fix several typos
"apix_fmts" found by Marc Péchaud.
"speedloss" found by Mikhail V.

Signed-off-by: Lou Logan <lou@lrcd.com>
2017-09-21 16:17:02 -08:00
Derek Buitenhuis 5e3f6dc701 swscale: Do not expand a macro with 'defined' in it
Fixes:

    libswscale/utils.c:1632:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    #if USE_MMAP
        ^
    libswscale/utils.c:1577:49: note: expanded from macro 'USE_MMAP'
    #define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS)
                                                    ^
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-08-28 10:26:14 +02:00
Derek Buitenhuis add7b3bc3f utils: Do not expand a macro with 'defined' in it
Fixes:

    libswscale/utils.c:1632:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    #if USE_MMAP
        ^
    libswscale/utils.c:1577:49: note: expanded from macro 'USE_MMAP'
    #define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS)
                                                    ^
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-08-25 13:44:57 +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
Paul B Mahol de48710c11 libswscale: add gray9 support 2017-08-07 13:09:41 +02:00
James Cowgill 013ec23cbe swscale: fix gbrap16 alpha channel issues
Fixes filter-pixfmts-scale test failing on big-endian systems due to
alpSrc not being cast to (const int32_t**).

Also fixes distortions in the output alpha channel values by copying the
alpha channel code from the rgba64 case found elsewhere in output.c.

Fixes ticket 6555.

Signed-off-by: James Cowgill <James.Cowgill@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-05 23:24:02 +02:00
Clément Bœsch 797c232ef8 sws/tests/pixdesc_query: fix use of free() instead of av_free()
Fix CID 1415949
2017-07-30 20:48:57 +02:00
Clément Bœsch 4158fba3cd sws/tests/pixdesc_query: replace rgb based pix fmts with endianess agnostic names
Fixes ticket #6554
2017-07-30 16:05:32 +02:00
Clément Bœsch d2c70fc887 sws/tests/pixdesc_query: sort pixel formats 2017-07-30 16:04:36 +02:00
Clément Bœsch ca23d3491d sws/tests/pixdesc_query: save every pix fmts in a list
This will be required for the next commit.
2017-07-30 16:04:36 +02:00
Diego Biurrun 825e463a17 build: Add feature test macros for glibc 2.19+
glibc introduced _DEFAULT_SOURCE in version 2.19 to replace _BSD_SOURCE and
_SVID_SOURCE, which were deprecated in version 2.20. Add _DEFAULT_SOURCE
where the latter two are used to be forwards-compatible and avoid warnings
about the use of deprecated definitions.
2017-07-10 10:22:56 +02:00
Diego Biurrun fd502f4f5f build: Generalize yasm/nasm-related variable names
None of them are specific to the YASM assembler.

(Cherry-picked from libav commit 39e208f4d4)

Signed-off-by: James Almer <jamrial@gmail.com>
2017-06-21 17:00:29 -03:00
James Almer 6fdd35a312 Merge commit '92db5083077a8b0f8e1050507671b456fd155125'
* commit '92db5083077a8b0f8e1050507671b456fd155125':
  build: Generate pkg-config files from Make and not from configure
  build: Store library version numbers in .version files

Includes cherry-picked commits 8a34f36593 and
ee164727dd to fix issues.

Changes were also made to retain support for raise_major and build_suffix.

Reviewed-by: ubitux
Merged-by: James Almer <jamrial@gmail.com>
2017-05-04 19:59:30 -03:00
Clément Bœsch 3f17751eeb Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'
* commit '11a9320de54759340531177c9f2b1e31e6112cc2':
  build: Move build-system-related helper files to a separate subdirectory

"ffbuild" directory name is used instead of "avbuild".

Merged-by: Clément Bœsch <u@pkh.me>
2017-05-03 16:49:12 +02:00
Michael Niedermayer 7796f29065 libswscale/tests/swscale: Fix uninitialized variables
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-30 14:23:27 +02:00
Clément Bœsch 172b0e2e88 Merge commit 'ea7ee4b4e381e0fa731458de0cbf740430eeb013'
* commit 'ea7ee4b4e381e0fa731458de0cbf740430eeb013':
  ppc: Centralize compiler-specific altivec.h #include handling in one place

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-26 16:23:28 +02:00
Diego Biurrun 0fd0d4fd0a swscale-test: const correctness 2017-04-24 16:10:05 +02:00
Luca Barbato 37f573543c swscale: Convert the check check_image_pointers helper to a macro
Avoid warnings about types mismatch and make the code a little simpler.
2017-04-15 15:37:18 +02:00
Luca Barbato f56fa95cd1 swscale: Do not shift negative values directly
It is undefined in C as reported:
    warning: shifting a negative signed value is undefined
2017-04-15 15:37:18 +02:00
Michael Niedermayer ac29b82ec5 swscale: Add gbrap10 output
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-04-15 15:37:10 +02:00
Paul B Mahol f6a9c20a52 swscale: Add input support for gbrap10 pixel format
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-13 16:11:24 +02:00
Carl Eugen Hoyos c1616b454d lsws/utils: Make gray10 and gray12 full-scale like gray8 and gray16. 2017-04-12 23:00:04 +02:00
Michael Niedermayer 22b0daa1b3 Bump versions for master after 3.3
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-02 19:54:12 +02:00
Michael Niedermayer e1cc7f83df Bump minor for 3.3
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-02 19:49:45 +02:00
Michael Niedermayer 58b867a7cf Bump minor versions for master after release/3.3 branchpoint
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-31 13:21:06 +02:00
Michael Niedermayer fc332f3e29 Bump minor versions for staring release/3.3 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-31 13:21:06 +02:00
Clément Bœsch 46f4f8ad86 Merge commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50'
* commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50':
  Adjust printf conversion specifiers to match variable signedness

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 13:34:39 +01:00
Clément Bœsch 99dd6fe62c sws/tests/pixdesc_query: remove func wrappers 2017-03-24 00:06:35 +01:00
Clément Bœsch bc7308aae8 sws: make is{RGB,BGR}inInt functions 2017-03-24 00:06:35 +01:00
Vittorio Giovara 07a2b15594 Bump major versions of all libraries
This disables everything that was deprecated at least 18 months ago.

Readjust the minimum API version as needed, postponing any
API-incompatible changes until the next bump.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-03-23 09:56:20 +01:00
Clément Bœsch fa8db3f597 Merge commit 'de8e096c7eda2bce76efd0a1c1c89d37348c2414'
* commit 'de8e096c7eda2bce76efd0a1c1c89d37348c2414':
  swscale: Consistently order input YUV pixel formats

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-21 08:24:39 +01:00
Clément Bœsch e811f84a2e swscale: cosmetics in is{RGB,BGR}inInt
Reduce diff with Libav.
2017-03-20 08:02:30 +01:00
Clément Bœsch d6635daded swscale: remove unused is{RGB,BGR}inBytes 2017-03-20 08:02:30 +01:00
Clément Bœsch ff6bc16c5a swscale: use a (more correct) function for isPacked 2017-03-20 08:02:30 +01:00
Clément Bœsch 2b9a52bcca swscale: use a function for isAnyRGB 2017-03-20 08:02:30 +01:00
Clément Bœsch c30875e8b2 swscale: use a function for isBayer 2017-03-20 08:02:30 +01:00
Clément Bœsch f052b1b40f swscale: use a function for isGray 2017-03-20 08:02:30 +01:00
Clément Bœsch 08e1376d81 fate: add fate-sws-pixdesc-query
Test the pixel format querying within libswscale.
2017-03-20 08:02:30 +01:00
Clément Bœsch 8e950c9b42 Merge commit 'aa37d2bf4505afc106e2a23c44afc722bb204a8e'
* commit 'aa37d2bf4505afc106e2a23c44afc722bb204a8e':
  swscale: Kill non-compiling disabled cruft

The isGray() chunk is not merged as an alternative patch actually fixing
the dead code is currently under review on the mailing-list.

The SWS_X chunk is merged, with an additional cosmetic.

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-19 15:40:03 +01:00
Diego Biurrun 994c4bc107 x86util: Port all macros to cpuflags
Also do some small cosmetic changes: Drop pointless _MMX suffix from ABSD2
macro name, drop pointless check for MMX support, we always assume MMX is
available in our SIMD code, fix spelling.
2017-03-14 17:23:32 +01:00
Carl Eugen Hoyos 851f4255e0 lsws/slice: Move a misplaced const.
Fixes a gcc warning:
libswscale/slice.c:178:56: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
2017-03-08 00:33:21 +01:00
Carl Eugen Hoyos a9c20598b5 lsws/input: Do not define unused functions.
Fixes warnings like the following:
libswscale/input.c:951:13: warning: ‘planar_rgb14be_to_a’ defined but not used
2017-03-08 00:30:06 +01:00
Diego Biurrun 39e208f4d4 build: Generalize yasm/nasm-related variable names
None of them are specific to the YASM assembler.
2017-03-01 10:18:15 +01:00
Philip Langdale 4c2176d45b swscale: add P016 input support 2017-02-01 14:29:11 -08:00
Diego Biurrun 5c0e2b13eb swscale-test: const correctness for pointer variable
libswscale/swscale-test.c:369:20: warning: passing argument 2 of ‘sws_scale’ from incompatible pointer type [-Wincompatible-pointer-types]
libswscale/swscale.h:207:5: note: expected ‘const uint8_t * const* {aka const unsigned char * const*}’ but argument is of type ‘uint8_t ** {aka unsigned char **}’
2017-01-24 13:03:57 +01:00
Michael Niedermayer 03ce71e4a1 swscale/swscale: Fix dereference of stride array before null check
Fixes: CID1396263
Fixes: CID1396271

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-23 21:47:47 +01:00
Diego Biurrun 92db508307 build: Generate pkg-config files from Make and not from configure
This moves work from the configure to the Make stage where it can
be parallelized and ensures that pkgconfig files are updated when
library versions change.

Bug-Id: 449
2016-12-22 12:30:54 +01:00
Andreas Cadhalpun 319438e2f2 swscale: save ebx register when it is not available
Configure checks if the ebx register can be used for asm and it has to
be saved if and only if this is not the case.
Without this the build fails when configuring with --toolchain=hardened
--disable-pic on i386 using gcc 4.8:
error: PIC register clobbered by '%ebx' in 'asm'

In that case gcc 4.8 reserves the ebx register for the GOT needed for
PIE, so it can't be used in asm directly.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-12-21 01:26:10 +01:00
Diego Biurrun ea7ee4b4e3 ppc: Centralize compiler-specific altivec.h #include handling in one place
Also move #includes into canonical order where appropriate.
2016-12-14 14:08:43 +01:00
Paul B Mahol 6427c9ffee swscale: add gbr(a)p16 output support 2016-12-01 21:37:25 +01:00
Michael Niedermayer ac206bb175 swscale/options: Use AV_OPT_TYPE_PIXEL_FMT
Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-20 13:00:22 +01:00
Carl Eugen Hoyos b5177c7051 lsws: Add GRAY10 conversion.
Based on 19be5fb7 by Luca Barbato.
2016-11-14 10:35:06 +01:00
Luca Barbato 19be5fb728 swscale: Add GRAY12
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:49:29 +01:00
Michael Niedermayer b828788d58 swscale: Add GBRAP10 output
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Luca Barbato 2c7d8cbd66 swscale: Add the GBRAP12 output
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Michael Niedermayer 873d06c76e swscale/output: Fix alpha shift in yuv2gbrp_full_X_c()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Michael Niedermayer a340cfef82 swscale/input: Fix alpha bswap for set readAlpPlanar
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Michael Niedermayer d736b52a04 swscale: Drop is9_OR_10BPS() use, its name is not correct
Found-by: Luca Barbato
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 00:33:12 +01:00
Luca Barbato ab839054e6 swscale: Add GRAY12 2016-11-07 22:42:00 +01:00
Diego Biurrun 1263b2039e Adjust printf conversion specifiers to match variable signedness 2016-10-28 11:22:21 +02:00
Michael Niedermayer 1609935b6c Bump minor versions after 3.2 branchpoint to seperate release
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-26 20:52:42 +02:00
Michael Niedermayer 3f3025205f Bump minor versions for 3.2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-26 20:52:42 +02:00
Michael Niedermayer be9dba5c8a swscale: Properly load alpha for planar rgb
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-10-18 12:58:14 +02:00
Luca Barbato 881477c77b swscale: Add the GBRAP12 output 2016-10-12 21:33:34 +02:00
Kieran Kunhya 81f1f6c3f6 Add GBRAP12 pixel format support
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-10-12 21:33:34 +02:00
Luca Barbato ef3740c3a0 swscale: Enable GBRP12 output 2016-10-12 18:00:24 +02:00
Michael Niedermayer f59750641a swscale: x86: Add some forgotten 12-bit planar YUV cases
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-10-12 17:39:30 +02:00
Michael Niedermayer 328ea6a9a5 swscale: Add input support for 12-bit formats
Implemented for AV_PIX_FMT_GBRP12.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-10-12 17:39:30 +02:00
Vittorio Giovara eb54210602 swscale: Add missing yuv444p12 swapping
Missing from 9bd6ea5695.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-10-12 10:42:38 +02:00
Luca Barbato 9bd6ea5695 pixfmt: Add yuv444p12 pixel format 2016-09-27 18:48:30 +02:00
Luca Barbato 0aebbbd024 pixfmt: Add yuv422p12 pixel format 2016-09-27 18:48:30 +02:00
Luca Barbato 85406e7a8d pixfmt: Add yuv420p12 pixel format 2016-09-27 18:48:30 +02:00
Luca Barbato 2b5b1e1e9b swscale: Rename is9_OR_10 to match what it does
It is used to select functions that work with 9-15bits.
2016-09-27 18:48:30 +02:00
Luca Barbato e87a501e7d swscale: Update bitdepth range check
Make sure the scaling functions for the 9-15bits are used for
9-15bits bit depths correctly.
2016-09-27 17:17:54 +02:00
Vittorio Giovara de8e096c7e swscale: Consistently order input YUV pixel formats
Follow a 420, 422, 444 order instead of a random one.
This simplifies double-checking additions of new formats.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-09-27 08:33:09 +02:00
Pedro Arthur 8433d953e4 swscale: fix for sliced scaling artifacts
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2016-09-16 11:25:28 -03:00
Michael Niedermayer ba7be8c083 swscale: Fix "warning: ISO C90 forbids mixed declarations and code"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-07 01:44:16 +02:00
Timo Rothenpieler e3fd1857fb swscale: add unscaled conversion from yuv420p to p010 2016-09-06 12:41:28 +02:00
Michael Niedermayer b4d7c1f84b swscale/swscale_unscaled: Try to fix bayer_to_yv12_wrapper() with slices
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-03 14:14:06 +02:00
Michael Niedermayer e57d99dd4e swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-03 14:14:06 +02:00
Timo Rothenpieler 39f75645c8 swscale: add unscaled copy from yuv420p10 to p010 2016-09-03 00:09:39 +02:00
Michael Niedermayer 47bc1bdafb swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-02 21:53:53 +02:00
Michael Niedermayer 89ec11e096 swscale/swscale: Try to fix rgb48Toxyz12() with slices
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-02 21:53:53 +02:00
Michael Niedermayer f580719b1a swscale/swscale: Factor bottom to top handling
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-02 21:53:53 +02:00
Michael Niedermayer 7a6c288c2b swscale/tests/swscale: add cpuflags option
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-02 16:14:21 +02:00
Timo Rothenpieler 99882d05a6 swscale: add support for P010LE/BE output 2016-08-31 13:19:46 +02:00
Michael Niedermayer 76d377d0a0 swscale/output: Fix rounding offset in yuv2gbrp_full_X_c()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-23 02:46:02 +02:00
Diego Biurrun aa37d2bf45 swscale: Kill non-compiling disabled cruft 2016-08-17 12:16:42 +02:00
Timothy Gu 58c7bf789f doxygen: Standardize root-level modules 2016-08-02 22:15:25 -07:00
Diego Biurrun facdfe4080 swscale: Add proper ff_ prefix to init functions
They are internal symbols that should not be exported.

based on a patch by Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-07-16 17:38:37 +02:00
Andreas Cadhalpun c0fd2fb27b swscale: Rename sws_context_class to ff_sws_context_class
It is an internal swscale symbol and thus should not be exported.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-07-16 17:38:37 +02:00
Ronald S. Bultje 70d418c7e6 Revert "PPC64: Add versions of functions in libswscale/input.c optimized for POWER8 VSX SIMD."
This reverts commit 1df908f33f. The expected
performance improvements are essentially non-existent.
2016-07-11 10:15:05 -04:00
Hendrik Leppkes e78e5b735f swscale: add P010 input support
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-07-02 09:35:41 +02:00
Dan Parrot 1df908f33f PPC64: Add versions of functions in libswscale/input.c optimized for POWER8 VSX SIMD.
This patch addresses Trac ticket #5570. The optimized functions are in file
libswscale/ppc/input_vsx.c. Each optimized function name is a concatenation of the
corresponding name in libswscale/input.c with suffix _vsx.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-30 12:02:08 +02:00
Matthieu Bouron 0acc170aad Merge commit '535a742c2695a9e0c586b50d7fa76e318232ff24'
* commit '535a742c2695a9e0c586b50d7fa76e318232ff24':
  build: Change structure of the linker version script templates

Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-06-27 17:56:47 +02:00
Matthieu Bouron 9eb3da2f99 asm: FF_-prefix internal macros used in inline assembly
See merge commit '39d6d3618d48625decaff7d9bdbb45b44ef2a805'.
2016-06-27 17:21:18 +02:00
Hendrik Leppkes c142dc203e Merge commit 'dc40a70c5755bccfb1a1349639943e1f408bea50'
* commit 'dc40a70c5755bccfb1a1349639943e1f408bea50':
  Drop unnecessary libavutil/x86/asm.h #includes

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-06-26 15:53:00 +02:00
Clément Bœsch 5d48e4eafa Merge commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196'
* commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196':
  tests: Move all test programs to a subdirectory

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-22 13:44:34 +02:00
Clément Bœsch 8ef57a0d61 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
  cosmetics: Fix spelling mistakes

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Clément Bœsch c01f1157ac Merge commit '0f40c9098498ad90dbbd2380eb4269015e84bde4'
* commit '0f40c9098498ad90dbbd2380eb4269015e84bde4':
  Drop pointless assert.h #includes

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-21 15:26:20 +02:00
Paul B Mahol 9d30690f20 swscale: add input support for gbrap10 pixel format
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-06-10 17:17:12 +02:00
Pedro Arthur e616e9a4b8 swscale: fix ring buffer size when scaling slices of a frame
The ring buffer size should be able to store input lines
when there is not enough lines to output a single line.
2016-06-10 09:45:24 -03:00
Pedro Arthur b5deacfb1f swscale: fix crash with swscale-test when using slices 2016-06-10 08:50:57 -03:00
Diego Biurrun 535a742c26 build: Change structure of the linker version script templates
Split version files into one line per symbol/directive to allow compatibility
with the Solaris linker without preprocessing and eliminate $ from version file
templates to simplify the postprocessing shell command.
2016-05-29 16:43:11 +02:00
Diego Biurrun dc40a70c57 Drop unnecessary libavutil/x86/asm.h #includes 2016-05-28 19:18:26 +02:00
Diego Biurrun 1e9c5bf4c1 asm: FF_-prefix internal macros used in inline assembly
These warnings conflict with system macros on Solaris, producing
truckloads of warnings about macro redefinition.
2016-05-28 19:18:26 +02:00
Diego Biurrun a6a750c7ef tests: Move all test programs to a subdirectory 2016-05-13 14:55:56 +02:00
Derek Buitenhuis ca5ec2bf51 Merge commit '01621202aad7e27b2a05c71d9ad7a19dfcbe17ec'
* commit '01621202aad7e27b2a05c71d9ad7a19dfcbe17ec':
  build: miscellaneous cosmetics

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-09 16:25:28 +01:00
Vittorio Giovara 41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Diego Biurrun 0f40c90984 Drop pointless assert.h #includes 2016-05-03 15:45:10 +02:00
Matthieu Bouron 4c22441276 swscale/arm: add yuv2planeX_8_neon 2016-04-11 18:13:36 +02:00
Clément Bœsch c921f4f687 sws/aarch64: add ff_yuv2planeX_8_neon 2016-04-11 16:27:19 +02:00
Matthieu Bouron 7abc8e7ae3 swscale/arm: add ff_hscale_8_to_15_neon 2016-04-09 00:16:56 +02:00
Clément Bœsch cab9661dba sws/aarch64/yuv2rgb: honor iOS calling convention
y_offset and y_coeff being successive 32-bit integers, they are packed
into 8 bytes instead of 2x8 bytes.

See https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html

> iOS diverges from Procedure Call Standard for the ARM 64-bit
> Architecture in several ways
[...]
> In the generic procedure call standard, all function arguments passed
> on the stack consume slots in multiples of 8 bytes. In iOS, this
> requirement is dropped, and values consume only the space required.
[...]
> Padding is still inserted on the stack to satisfy arguments’ alignment
> requirements.
2016-04-08 17:58:43 +02:00
Diego Biurrun 01621202aa build: miscellaneous cosmetics
Restore alphabetical order in lists, break overly long lines, do some
prettyprinting, add some explanatory section comments, group parts
together that belong together logically.
2016-04-07 15:26:08 +02:00
Michael Niedermayer c169062073 swscale/utils: Remove unused variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-07 13:41:23 +02:00
Clément Bœsch 040598218f sws/aarch64: restore ff_hscale_8_to_15_neon()
Fix final scaling and required filter alignment. Pass FATE.
2016-04-05 12:00:36 +02:00
Ronald S. Bultje b3eda69490 swscale: add bt2020 yuv2rgb coefficients. 2016-04-01 15:39:48 -04:00
Ronald S. Bultje 98038e2ee0 swscale: fix bt709 yuv2rgb coefficients.
They were derived from incorrect values cr=0.2125 (should be cr=0.2126)
and cb=0.0721 (should be cb=0.0722).
2016-04-01 15:39:47 -04:00
Clément Bœsch eadaef2a63 sws/aarch64: disable ff_hscale_8_to_15_neon temporarly
Looks broken.
2016-04-01 17:33:01 +02:00
Matthieu Bouron 58994d7bca swscale/arm/yuv2rgb: make the code bitexact with its aarch64 counter part 2016-04-01 17:23:45 +02:00
Matthieu Bouron 5629361cc2 swscale/arm/yuv2rgb: save a few instructions by processing the luma line interleaved 2016-04-01 17:23:45 +02:00
Matthieu Bouron 339668301e swscale/arm/yuv2rgb: re-order compute_rgba macro arguments 2016-04-01 17:23:45 +02:00
Matthieu Bouron ff4885face swscale/arm/yuv2rgb: rename {process_1l,process_2l,compute}_16px{,_internal} macros 2016-04-01 17:23:45 +02:00
Matthieu Bouron 562653b731 swscale/arm/yuv2rgb: macro-ify 2016-04-01 17:23:45 +02:00
Matthieu Bouron 0286b56f2f swscale/arm/yuv2rgb: factorize lsl in load_args_nvx 2016-04-01 17:23:45 +02:00
Matthieu Bouron 0649fe0fae swscale/arm/yuv2rgb: factorize lsl in load_args_yuv420p 2016-04-01 17:23:45 +02:00
Matthieu Bouron 2aec59c07c swscale/arm/yuv2rgb: remove unused store of dst + linesize in load_args_yuv422p 2016-04-01 17:23:45 +02:00
Matthieu Bouron b3ea901945 swscale/arm/yuv2rgb: factorize lsl in load_args_yuv422p 2016-04-01 17:23:45 +02:00
Matthieu Bouron 466e209e6e swscale/arm/yuv2rgb: fix comments in load_args_yuv422p 2016-04-01 17:23:45 +02:00
Matthieu Bouron 11b4acab8b swscale/arm/yuv2rgb: remove 32bit code path 2016-04-01 17:23:45 +02:00
Pedro Arthur 6de58b4903 swscale: cleanup unused code
Removed previous swscale code under '#ifndef NEW_FILTER'
and removed unused fields of SwsContext
2016-03-31 16:36:16 -03:00
Michael Niedermayer 3b905b9fe6 swscale: Deprecate vector functions which are unused outside swscale
There are no known users of these functions within debian
It should be thus possible to remove these functions without recommandition of a
replacement

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-31 20:21:14 +02:00
Clément Bœsch 263eb76bdf sws/aarch64: add ff_hscale_8_to_15_neon
./ffmpeg -nostats -f lavfi -i testsrc2=4k:d=2 -vf bench=start,scale=1024x1024,bench=stop -f null -

    before: t:0.489726 avg:0.489883 max:0.491852 min:0.489482
    after:  t:0.256515 avg:0.256458 max:0.256999 min:0.253755
2016-03-31 10:12:55 +02:00
Lou Logan 06eef96b69 fix some a/an typos
Signed-off-by: Lou Logan <lou@lrcd.com>
2016-03-28 14:13:17 -08:00
Clément Bœsch 277408b7f1 sws/aarch64/yuv2rgb: save a few mul and add
27ms to 26ms with UHD 2160 input.
2016-03-25 16:14:13 +01:00
Clément Bœsch f1148390d7 sws/aarch64: add {nv12,nv21,yuv420p,yuv422p}_to_{argb,rgba,abgr,rgba}_neon 2016-03-01 17:53:33 +01:00
Clément Bœsch 1e7a37f0a0 sws/yuv2rgb: clarify precision of coeff and offset for mmx code
It makes easier looking at the difference with the generic code just
below.
2016-02-27 11:13:26 +01:00
Clément Bœsch f9987464cf sws/yuv2rgb: avoid a few ub on signed left shifts 2016-02-27 11:13:26 +01:00
Derek Buitenhuis 1a12eb4a73 Merge commit '29c2d06d67724e994980045afa055c6c34611b30'
* commit '29c2d06d67724e994980045afa055c6c34611b30':
  cosmetics: Drop empty comment lines

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 17:31:44 +00:00
Kieran Kunhya 4170a44bbc Add GBRAP12 pixel format
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-24 03:22:31 +01:00
Michael Niedermayer 67e5bd0c50 swscale/utils: Fix chrSrcHSubSample for GBRAP16
Fixes part of Ticket5264

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-24 00:02:44 +01:00
Michael Niedermayer df36257a53 swscale/input: Fix GBRAP16 input
Fixes part of Ticket5264

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-24 00:02:44 +01:00
Xiaolei Yu 5a91589476 swscale/arm: re-enable neon rgbx to nv12 routines
Commit '842b8f4ba2e79b9c004a67f6fdb3d5c5d05805d3' fixed clang/iphone
build but failed on some versions of cygwin. It has now been verified
to work on both platforms.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-22 17:29:58 +01:00
Diego Biurrun 29c2d06d67 cosmetics: Drop empty comment lines 2016-02-18 15:35:30 +01:00
Michael Niedermayer f6492a2ea8 swscale/x86/output: Fix yuv2planeX_16* with unaligned destination
Reviewed-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-17 04:47:51 +01:00
Michael Niedermayer d07f6e5f1c swscale/x86/output: Move code into yuv2planeX_mainloop
Reviewed-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-17 04:47:34 +01:00
Derek Buitenhuis 15d9645fb4 swscale/slice: Actually use the buffers' strides
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-16 14:25:25 +00:00
Michael Niedermayer 23261e6001 sws/output: fix ordered dither threshold for mono output
This makes sure that white stays white and black black

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-10 17:22:26 +01:00
Michael Niedermayer 61ea7f1509 swscale/swscale-test: Check av_image_fill_linesizes() for failure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-04 01:49:38 +01:00
Derek Buitenhuis 21f9468402 avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Hendrik Leppkes 2e31434d84 swscale: add P010 input support 2016-01-26 12:10:45 +01:00
Vittorio Giovara e9175634ec yuv2rgb: Document the color space coefficients
Based on the original documentation found in mpeg2dec (1995).

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-20 11:18:31 -05:00
Vittorio Giovara ff8c2c4103 yuv2rgb: Document the color space coefficients
Based on the original documentation found in mpeg2dec (1995).

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-19 23:30:36 +01:00
Michael Niedermayer 321e85e176 swscale/swscale: Add some sanity checks for srcSlice* parameters
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 20:35:36 +01:00
Michael Niedermayer c8a9aaab26 swscale/x86/rgb2rgb_template: Fix planar2x() for short width
Fixes: 451b3e0cf956c0bd2f27ed753ac24050/asan_heap-oob_2873c01_3231_7ed10a9464d15f0d57277f5917c566a8.AVI

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 12:34:34 +01:00
Michael Niedermayer 757248ea3c swscale/swscale_unscaled: Fix odd height inputs for bayer_to_yv12_wrapper()
Fixes: 372d2df1f04b49e25f109f07f90b1505/asan_heap-oob_2835d2e_8501_99e0114d7ba3a6db885d0b4684d200c1.cine
Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 01:19:43 +01:00
Michael Niedermayer ad3b6fa7d8 swscale/swscale_unscaled: Fix odd height inputs for bayer_to_rgb24_wrapper()
Fixes: 372d2df1f04b49e25f109f07f90b1505/asan_heap-oob_2835d2e_8501_99e0114d7ba3a6db885d0b4684d200c1.cine
Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 01:19:43 +01:00
Michael Niedermayer fc2588a1d6 swscale/vscale: Use matching sliceY/chrSliceY for luma/chroma
No case known where that makes a difference

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 23:49:52 +01:00
Michael Niedermayer eb7802afef swscale/vscale: Check that 2 tap filters are bilinear before using bilinear code
Fixes: out of array reads
Fixes: 07e8b9c5d348ccdf7add0f37de20cf6c/asan_heap-oob_27e8df7_6849_e56653f768070ec8cb52f587048444c2.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:59:12 +01:00
Michael Niedermayer b99f498716 swscale/output: Assert that yalpha and uvalpha are within their expected range
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer fe6372bb61 swscale/vscale: Add fixme comment to "ugly" code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer 705a2f70ee swscale/slice: Fix indention
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer 8feeffc1d7 swscale/slice: Fix doc typo
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer e06403331c swscale: Move Contexts used only in hscale.c into it
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer 7b6e6895f2 swscale: Move VScalerContext into vscale.c
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 21:58:02 +01:00
Michael Niedermayer cc538e9dbd swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
This avoids running various table inits unnecessarily

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 15:46:55 +01:00
Michael Niedermayer 8f3a9a8c27 swscale/yuv2rgb: Increase YUV2RGB table headroom
This makes SWS more robust
Fixes: 07650a772d98aa63b0fed6370dc89037/asan_heap-oob_27ddeaf_2657_2c81ff264dee5d9712cb3251fb9c3bbb.264
Fixes: out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 15:46:55 +01:00
Michael Niedermayer 5e5f82a287 swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 15:46:55 +01:00
Clément Bœsch e8bc642202 lavu: add AV_CEIL_RSHIFT and use it in various places
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-11 15:32:56 -05:00
Michael Niedermayer 1edf129cbc swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
Fixes Ticket4960

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-04 23:54:11 +01:00
Matthieu Bouron e4e9b9454e swscale/arm/yuv2rgb: add ff_yuv422p_to_{argb,rgba,abgr,bgra}_neon_{16,32} 2016-01-04 18:56:52 +01:00
Matthieu Bouron 44913d1945 swscale/arm/yuv2rgb: fix typo 2016-01-04 18:56:52 +01:00
Michael Niedermayer b83d8be6bf swscale/utils: Fix intermediate format for cascaded alpha downscaling
Fixes Ticket4926

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-24 21:46:15 +01:00
Matthieu Bouron b32a42295a swscale/arm/yuv2rgb: add ff_yuv420p_to_{argb,rgba,abgr,bgra}_neon_{16,32} 2015-12-19 22:09:28 +01:00
Matthieu Bouron e0dc22b99e swscale/arm/yuv2rgb: disable neon if accurate_rnd is enabled
This disables the 32bit precision neon code path in favor of the
default C one and avoids breaking fate.
2015-12-19 22:09:28 +01:00
Matthieu Bouron c2ad248321 swscale/arm/yuv2rgb: simplify process_16px_* macro call 2015-12-19 10:42:33 +01:00
Clément Bœsch 91b4afd58d swscale/arm/yuv2rgb: fix slicing 2015-12-18 16:21:49 +01:00
Michael Niedermayer a066ff89bc swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
This also as a sideeffect fixes the non aligned case

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-15 03:06:33 +01:00
Michael Niedermayer 80bfce35cc swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
Fixes Ticket5013

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-15 02:32:23 +01:00
Ganesh Ajjanagadde c8905e0d67 swscale/utils: replace pow by exp2
exp2 is a faster function.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-08 22:00:05 -05:00
Matthieu Bouron 5aca33c2cf swscale/arm: add ff_nv{12,21}_to_{argb,rgba,abgr,bgra}_neon_16 2015-12-08 08:12:42 +01:00
Michael Niedermayer 325b59368d swscale/utils: Fix for runtime error: left shift of negative value -1
Fixes: c106b36fa36db8ff8f3ed0c82be7bea2/asan_heap-oob_32699f0_6321_467b9a1d7e03d7cfd310b7e65dc53bcc.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-04 21:44:53 +01:00
Clément Bœsch 010caed261 swscale: use AV_OPT_TYPE_BOOL for {src,dst}_range options 2015-12-04 15:43:34 +01:00
Matthieu Bouron 46feb66972 swscale/arm: add ff_nv{12,21}_to_{argb,rgba,abgr,bgra}_neon
Signed-off-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
Signed-off-by: Clément Bœsch <clement@stupeflix.com>
2015-11-23 14:47:12 +01: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
Andreas Cadhalpun 8bfbc8c5e5 swscale: rename sws_context_class to ff_sws_context_class
It is an internal swscale symbol 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:10 +01:00
Ganesh Ajjanagadde cd8a0a9a9a swscale/swscale: add av_warn_unused_result to sws_init_context
This should not trigger any warnings; but adds robustness.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-16 17:18:21 -04:00
Pedro Arthur 5bd62a1b3c swscale: fix ticket #4881
When scaling only a slice of a frame the output was written always
in the first lines leaving the rest of the frame black.
2015-10-13 13:43:39 -03:00
Ganesh Ajjanagadde 3b2000c2bf doc/scaler, swscale/options: use proper capitalization
Proper names should be capitalized in all user facing API as far as
possible. The option names themselves have not been changed since:
1. We consistently keep option names in lower case.
2. Changing them would break existing scripts.

The converse is also true: improper names should not be capitalized
generally.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-10 19:32:56 +02:00
Ganesh Ajjanagadde 26e8895b73 all: add _DEFAULT_SOURCE locally wherever needed
Glibc 2.20 onwards generates a deprecation warning for usage of _BSD_SOURCE and _SVID_SOURCE.
The solution from man feature_test_macros is to define both _DEFAULT_SOURCE and the old macros.
This solution is on the lines of the one in commit af1818276e.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2015-10-04 12:15:16 -04:00
Pedro Arthur a8602dde5e swscale: fix ticket #4877 2015-09-25 12:18:58 -03:00
Pedro Arthur 77367f61b3 swscale: fix ticket 4850 2015-09-20 18:08:14 -03:00
Ganesh Ajjanagadde 7cf22c7970 swscale/output: fix undefined left shifts of negative numbers
This fixes -Wshift-negative-value reported with clang 3.7+, e.g
http://fate.ffmpeg.org/log.cgi?time=20150918181527&log=compile&slot=x86_64-darwin-clang-polly-vectorize-stripmine-3.7.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-20 01:14:36 +02:00
Ganesh Ajjanagadde b4cb597900 libswscale/swscale: fix -Wunused-function
hyscale, hcscale are only used in old filter code, hence place
header guard to silence -Wunused-function.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-18 23:19:42 +02:00
Ganesh Ajjanagadde 80d23d9d32 swscale/swscale: silence unused function warning
gamma_convert is only used with the old code. Thus, it is
placed under a header guard. This patch silences a -Wunused-function
observed on GCC 5.2.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-09-16 16:31:29 -07:00
Michael Niedermayer 0ae40c5a70 swscale/swscale: Fix "unused variable" warning
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-11 20:59:32 +02:00
Michael Niedermayer d730dd8c53 swscale: Forward colorspace updates to the 2nd cascaded context in case of alphablend
The first just does the blending and wouldnt do anything with the colorspace values

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 17:05:20 +02:00
Michael Niedermayer 21c7272859 swscale/utils: Forward luma range to the cascaded context for alphablending
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 17:05:20 +02:00
Michael Niedermayer 319898bba2 swscale/utils: handle gray+alpha formats like gray for luma ranges
Its illogic to handle gray differently depending on the existence of an alpha channel

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 15:00:19 +02:00
Michael Niedermayer 816cf5181e swscale/utils: If the source has no alpha then disable alpha blendaway
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-10 15:00:19 +02:00
Clément Bœsch c97cd1169c swscale: use AV_OPT_TYPE_BOOL 2015-09-08 22:39:24 +02:00
Hendrik Leppkes 5d8e836d0e Replace all remaining occurances of step/depth_minus1 and offset_plus1 2015-09-08 17:10:48 +02:00
Hendrik Leppkes 151aa2ebff Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'
* commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba':
  lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-08 16:35:28 +02:00
Vittorio Giovara 2268db2cd0 lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields
The new fields can be accessed directly and are more intelligible.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-07 12:37:47 +02:00
Hendrik Leppkes 160e92c8bf Merge commit 'e88103a7f92cf27a2868b50acc8a9912f6088249'
* commit 'e88103a7f92cf27a2868b50acc8a9912f6088249':
  Bump major versions of all libraries

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 21:35:46 +02:00
Hendrik Leppkes cebe51a625 Merge commit '9d58639e270f7612874681e0ca30fa461e2667b7'
* commit '9d58639e270f7612874681e0ca30fa461e2667b7':
  sws: Drop deprecated SWS_CPU_CAPS defines

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 15:58:52 +02:00
Pedro Arthur 3059562aa1 swscale: re-enable gamma
+added gamma conversion to refactored code
2015-09-04 19:00:20 -03:00
Pedro Arthur f67aff3ad7 swscale: added proper error check for ff_init_filters 2015-09-04 19:00:20 -03:00
Michael Niedermayer 1acd6311a1 swscale/utils: If cascaded contexts are used forward sws_setColorspaceDetails() to the first context
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-31 02:00:55 +02:00
Michael Niedermayer 8e05f9217a swscale/utils: Split scaling if possible and yuv->yuv with different matrixes is requested
This uses a RGB intermediate, a more optimal solution would be to perform the rematrixing
directly in subsampled YUV, this is quite a bit more complicated though

Fixes Ticket4805

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-31 02:00:19 +02:00
Vittorio Giovara e88103a7f9 Bump major versions of all libraries
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-08-28 16:04:28 +02:00
Vittorio Giovara 9d58639e27 sws: Drop deprecated SWS_CPU_CAPS defines
Deprecated in 07/2012.
2015-08-28 10:55:26 +02:00
Timothy Gu 68a9c8ac77 swscale: Silence an unused variable warning
Also remove a pair of extraneous ifdeffery.
2015-08-25 17:40:06 -07:00
Ganesh Ajjanagadde eb3cfa7dd3 swscale/alphablend: fix pointer cast
Commit 7c72a4bbd3 was slightly wrong

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-08-22 20:11:48 +00:00
Michael Niedermayer 7c72a4bbd3 swscale/alphablend: Fix pointer type warnings
Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 12:14:08 +02:00
Pedro Arthur 62d176de12 swscale: refactor vertical scaler 2015-08-19 10:43:52 -03:00
Pedro Arthur 4545906f60 swscale: Fixed typos
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-18 22:56:50 +02:00
Pedro Arthur ed80dec621 swscale: fixed compiler warnings
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-18 22:56:50 +02:00
Pedro Arthur 0f3687d6fb swscale: add license headers and copyrights
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-18 22:56:50 +02:00
Pedro Arthur 737aa902f0 swscale: process horizontal lines in batches
Process more lines in a single pass to improve performance

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-18 01:33:32 +02:00
Pedro Arthur e0a3173a94 swscale: refactor horizontal scaling
+ split color conversion from scaling
- disabled gamma correction, until it's refactored too

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-18 01:33:32 +02:00
Michael Niedermayer 3afca32561 swscale/swscale-test: Fix slice height in random reference data creation.
Found-by: Pedro Arthur <bygrandao@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-17 03:08:10 +02:00
Michael Niedermayer 0f9d46b70d swscale/alphablend: Support chroma subsampling
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 18:04:46 +02:00
Michael Niedermayer c5ebeaa308 swscale/alphablend: Support SWS_ALPHA_BLEND_CHECKERBOARD
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 17:11:53 +02:00
Michael Niedermayer 87100e828a swscale/alphablend: Factor target computation out of the loops
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 16:09:30 +02:00
Michael Niedermayer f28ba31b1b swscale/alphablend: Fix big endian formats on LE
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 15:59:12 +02:00
Michael Niedermayer b7faa9d314 swscale/alphablend: support packed pixel formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 15:58:43 +02:00
Michael Niedermayer c64f01227f swscale/swscale: Document param[0..1]
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-09 14:33:19 +02:00
Michael Niedermayer d0e0757e9a swscale: Implement alphablendaway for planar 4:4:4 formats
Fixes Ticket4746

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-08 13:24:52 +02:00
Michael Niedermayer c382d9e8cb swscale: Add sws_alloc_set_opts()
This simplifies allocating and initializing swscale contexts with custom options.
The function is internal currently but could be moved into the public header

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-08 13:08:16 +02:00
Michael Niedermayer 1909a9151c swscale/output: Fix "warning: assignment from incompatible pointer type"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-25 03:15:56 +02:00
Paul B Mahol 3cb8eee6f7 swscale: ayuv64le output support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-07-24 03:45:48 +00:00
Paul B Mahol 052f64ecb2 swscale: ayuv64le input support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-07-24 03:44:58 +00:00
Rong Yan 2af180bf1b swscale/ppc/yuv2rgb_altivec: POWER LE support in the macros vec_unh() and vec_unl()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-16 14:27:58 +02:00
Michael Niedermayer a5d44d5c22 swscale/utils: Clear pix buffers
Fixes use of uninitialized memory
Fixes: a96874b9466b6edc660a519c7ad47977_signal_sigsegv_7ffff713351a_744_nc_sample.avi with memlimit 2147483648

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-15 20:06:34 +02:00
Kevin Coyle 1262711388 YUV->BGR32 MMX support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-04 00:03:45 +02:00
Michael Niedermayer 8255b14c68 swscale/output: fix input indexing in yuv2ya8_2_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-04 00:03:45 +02:00
Michael Niedermayer ab80d3fb3a swscale/output: fix null pointer dereference in yuv2ya8_2_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-03 23:03:25 +02:00
Paul B Mahol 2778fdbe54 swscale: implement YA8 output
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-07-02 17:36:05 +00:00
Michael Niedermayer f6ab967eae swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian
Fixes fate/dds-rgb16 on big endian

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-29 13:54:35 +02:00
James Almer e22edbfd41 swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext}
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-06-23 13:28:09 -03:00
James Almer 0c15f2f158 swscale/x86/rgb2rgb_template: don't call emms on sse2/avx functions
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-06-23 13:28:03 -03:00
James Almer 910eeab480 swscale/x86/rgb2rgb_template: add missing xmm clobbers
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-06-23 13:27:56 -03:00
Michael Niedermayer 7604358018 swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-23 05:09:11 +02: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 4df3cf90bf swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
The function is specific to little endian

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-22 22:23:22 +02:00
Michael Niedermayer e29d996149 swscale/output: Add rgba64/rgb48/bgra64/bgr48 output functions with full chroma interpolation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 00:45:46 +02:00
Michael Niedermayer f140a99f8b swscale/output: Factorize rgb48 and 64bit code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-17 00:45:46 +02:00
Michael Niedermayer 80b5a1e2ee Mark vectors as NAN instead of dereferencing NULL pointers on malloc failure
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-12 15:06:32 +02:00
Michael Niedermayer ae0148ff60 swscale: Assert that pixel format descriptor is not NULL
This may help static analyzers, the pixel format is checked
during initialization

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-12 14:47:37 +02:00
Luca Barbato da60b99a88 ppc: Restrict some Altivec implementations to Big Endian
In Little Endian the vec_ld/vec_st operations work as
expected only for byte-vectors.
2015-05-31 12:07:11 +02:00
Nick Lewycky 891df2a1ae libswscale/x86/hscale_fast_bilinear_simd.c: There's no need to save BX if it's in the clobber list.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-13 11:59:30 +02:00
Nick Lewycky 48e9f68384 libswscale/x86/hscale_fast_bilinear_simd.c: Include BX in the clobber list on x86_64, because it isn't implicitly included when PIC is on.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-13 11:59:12 +02:00
Michael Niedermayer 54e64eaf68 swscale/x86/swscale: Fix warning about loosing significant bits in cast
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-10 15:09:04 +02:00
Michael Niedermayer 3b12335395 swscale/x86/hscale_fast_bilinear_simd: Remove ancient out-commented debug code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-07 23:58:08 +02:00
Michael Niedermayer b28d5c49f7 Merge remote-tracking branch 'rbultje/vp9-profile23-wip'
* rbultje/vp9-profile23-wip:
  libvpxdec: add 440 pixfmts.
  vp9: add profile 2/3 fate tests.
  vp9: add inter-frame profile 2/3 suport.
  vp9: add keyframe profile 2/3 support.
  vp9: parse profile 2/3 bitdepth in frame header.
  vp9: add profile 2/3 to exported profiles.
  fate: add/update reference files for 440 addition.
  swscale: add yuv440p10/12 pixfmts.
  lavc: add yuv440p10/12 formats to aligned pixfmt list.
  lavu: add yuv440p10/12 pixfmts.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-07 13:22:04 +02:00
Michael Niedermayer 21b30947f2 swscale/x86/hscale_fast_bilinear_simd: Fix variable names in comments
Found-by: Nick Lewycky <nlewycky@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-07 03:57:21 +02:00
Ronald S. Bultje 711d8812ad swscale: add yuv440p10/12 pixfmts. 2015-05-06 12:04:31 -04:00
Rong Yan 603c839398 swscale/ppc/swscale_altivec.c: POWER LE support in yuv2planeX_8() delete macro GET_VF() it was wrong
GCC tool had a bug of PPC intrinsic interpret, which has been fixed in GCC 4.9.1. This bug lead to
errors in two of our previous patches. We found this when we update our GCC tools to 4.9.1 and by
reading the related info on GCC website. We fix our previous error in two separate commits

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-27 12:59:05 +02:00
Michael Niedermayer b57f9f5724 swscale/swscale: Get rid of the SWS_GAMMA_CORRECT flag
This avoids using up a bit of the public flags

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-23 20:34:51 +02:00
Pedro Arthur 2a7128f4ed Add gamma encodign/decoding before/after scaling in libswscale
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-23 20:34:51 +02:00
Michael Niedermayer bdcd36a4c8 swscale/output: Fix undefined shifts
Fixes: da14e86d8462be6493eab16bc2d40f88/asan_heap-oob_204cfd2_528_cov_340150052_COMPRESS.BMP

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-25 18:31:25 +01:00
Michael Niedermayer 324067d18b Merge commit '7ebb3022297aa00afda6800105684b8303f2608e'
* commit '7ebb3022297aa00afda6800105684b8303f2608e':
  swscale: Check memory allocation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-22 03:40:37 +01:00
Federico Tomassetti 7ebb302229 swscale: Check memory allocation
Bug-Id: CID 1267890
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-21 23:18:11 +01:00
Michael Niedermayer 3e48616226 Merge commit '9a60b1fad02cb783b895b2145c3dafc01f7b337c'
* commit '9a60b1fad02cb783b895b2145c3dafc01f7b337c':
  libswscale: fix compiler warnings enumerated type mixed with another type

Conflicts:
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-16 00:15:16 +01:00
Himangi Saraogi 9a60b1fad0 libswscale: fix compiler warnings enumerated type mixed with another type
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-15 18:29:22 +01:00
Christophe Gisquet 5d38c628b0 ppc: libswscale: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
The later may yield incorrect code for on-stack variables.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 18:39:28 +01:00
Michael Niedermayer fa74058dd3 swscale/utils: Fix undefined shift in initFilter()
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 15:40:28 +01:00
Michael Niedermayer ae20682f6b swscale: Add prefix to updateMMXDitherTables()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-27 19:23:46 +01:00
Michael Niedermayer 007498fc1a swscale/utils: clear formatConvBuffer on allocation
Fixes use of uninitialized memory
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-27 03:13:14 +01:00
Michael Niedermayer fb8e5044b4 swscale/utils: add asserts to check filterpos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 01:00:24 +01:00
Michael Niedermayer 1895d414aa swscale/utils: More carefully merge and clear coefficients outside the input
Fixes out of array read
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 01:00:24 +01:00
Michael Niedermayer 03bffb68f6 swscale: Use av_clip_uintp2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 14:49:17 +01:00
Michael Niedermayer b20426398c swscale/yuv2rgb: Use av_clip_uint8()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 14:44:47 +01:00
Michael Niedermayer d501b986a9 swscale/bayer_template: Add () to protect the argument of BAYER_READ()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-18 01:55:15 +01:00
Michael Niedermayer 2a1b79d7e6 Merge commit 'e51f22122d23589e93ac4f0b3e570bb925755915'
* commit 'e51f22122d23589e93ac4f0b3e570bb925755915':
  swscale: Check memory allocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 22:22:17 +01:00
Federico Tomassetti e51f22122d swscale: Check memory allocations
CC: libav-stable@libav.org
Bug-Id: CID 1267888 / CID 1267890
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-02-17 12:16:43 -05:00
Michael Niedermayer 692b22626e swscale/utils: Limit filter shifting so as not to read from prior the array
Fixes out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-05 00:33:50 +01:00
Michael Niedermayer f30798584f swscale/input: fix rgba64 alpha non native
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-21 21:21:00 +01:00