summaryrefslogtreecommitdiff
path: root/libswscale
Commit message (Collapse)AuthorAge
* swscale/yuv2rgb: Silence a set-but-unused-variable warningAndreas Rheinhardt2021-12-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* swscale: add P210/P410/P216/P416 inputrcombs2021-11-28
|
* swscale/input: clip rgbf32 values before lrintfMark Reid2021-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if the float pixel * 65535.0f > 2147483647.0f lrintf may overfow and return negative values, depending on implementation. nan and +/-inf values may also be implementation defined clip the value first so lrintf always works. values < 0.0f, -inf, nan = 0.0f values > 65535.0f, +inf = 65535.0f old timings 195960 decicycles in planar_rgbf32le_to_uv, 1 runs, 0 skips 186120 decicycles in planar_rgbf32le_to_uv, 2 runs, 0 skips 188645 decicycles in planar_rgbf32le_to_uv, 4 runs, 0 skips 183625 decicycles in planar_rgbf32le_to_uv, 8 runs, 0 skips 181157 decicycles in planar_rgbf32le_to_uv, 16 runs, 0 skips 177533 decicycles in planar_rgbf32le_to_uv, 32 runs, 0 skips 175689 decicycles in planar_rgbf32le_to_uv, 64 runs, 0 skips 232960 decicycles in planar_rgbf32be_to_uv, 1 runs, 0 skips 221380 decicycles in planar_rgbf32be_to_uv, 2 runs, 0 skips 216640 decicycles in planar_rgbf32be_to_uv, 4 runs, 0 skips 213505 decicycles in planar_rgbf32be_to_uv, 8 runs, 0 skips 211558 decicycles in planar_rgbf32be_to_uv, 16 runs, 0 skips 210596 decicycles in planar_rgbf32be_to_uv, 32 runs, 0 skips 210202 decicycles in planar_rgbf32be_to_uv, 64 runs, 0 skips 161680 decicycles in planar_rgbf32le_to_y, 1 runs, 0 skips 153540 decicycles in planar_rgbf32le_to_y, 2 runs, 0 skips 148255 decicycles in planar_rgbf32le_to_y, 4 runs, 0 skips 140600 decicycles in planar_rgbf32le_to_y, 8 runs, 0 skips 132935 decicycles in planar_rgbf32le_to_y, 16 runs, 0 skips 128531 decicycles in planar_rgbf32le_to_y, 32 runs, 0 skips 140933 decicycles in planar_rgbf32le_to_y, 64 runs, 0 skips 190980 decicycles in planar_rgbf32be_to_y, 1 runs, 0 skips 176080 decicycles in planar_rgbf32be_to_y, 2 runs, 0 skips 167980 decicycles in planar_rgbf32be_to_y, 4 runs, 0 skips 164685 decicycles in planar_rgbf32be_to_y, 8 runs, 0 skips 162751 decicycles in planar_rgbf32be_to_y, 16 runs, 0 skips 162404 decicycles in planar_rgbf32be_to_y, 32 runs, 0 skips 167849 decicycles in planar_rgbf32be_to_y, 64 runs, 0 skips new timings 183320 decicycles in planar_rgbf32le_to_uv, 1 runs, 0 skips 175700 decicycles in planar_rgbf32le_to_uv, 2 runs, 0 skips 179570 decicycles in planar_rgbf32le_to_uv, 4 runs, 0 skips 172932 decicycles in planar_rgbf32le_to_uv, 8 runs, 0 skips 168707 decicycles in planar_rgbf32le_to_uv, 16 runs, 0 skips 165224 decicycles in planar_rgbf32le_to_uv, 32 runs, 0 skips 163423 decicycles in planar_rgbf32le_to_uv, 64 runs, 0 skips 184940 decicycles in planar_rgbf32be_to_uv, 1 runs, 0 skips 185150 decicycles in planar_rgbf32be_to_uv, 2 runs, 0 skips 185790 decicycles in planar_rgbf32be_to_uv, 4 runs, 0 skips 185472 decicycles in planar_rgbf32be_to_uv, 8 runs, 0 skips 185277 decicycles in planar_rgbf32be_to_uv, 16 runs, 0 skips 185813 decicycles in planar_rgbf32be_to_uv, 32 runs, 0 skips 185332 decicycles in planar_rgbf32be_to_uv, 64 runs, 0 skips 145400 decicycles in planar_rgbf32le_to_y, 1 runs, 0 skips 145100 decicycles in planar_rgbf32le_to_y, 2 runs, 0 skips 143490 decicycles in planar_rgbf32le_to_y, 4 runs, 0 skips 136687 decicycles in planar_rgbf32le_to_y, 8 runs, 0 skips 131271 decicycles in planar_rgbf32le_to_y, 16 runs, 0 skips 128698 decicycles in planar_rgbf32le_to_y, 32 runs, 0 skips 127170 decicycles in planar_rgbf32le_to_y, 64 runs, 0 skips 156020 decicycles in planar_rgbf32be_to_y, 1 runs, 0 skips 146990 decicycles in planar_rgbf32be_to_y, 2 runs, 0 skips 142020 decicycles in planar_rgbf32be_to_y, 4 runs, 0 skips 141052 decicycles in planar_rgbf32be_to_y, 8 runs, 0 skips 138973 decicycles in planar_rgbf32be_to_y, 16 runs, 0 skips 138027 decicycles in planar_rgbf32be_to_y, 32 runs, 0 skips 143939 decicycles in planar_rgbf32be_to_y, 64 runs, 0 skips Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* swscale/input: unify grayf32 funcs with rgbf32 funcsMark Reid2021-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is ment to be a cosmetic change old timings: 42780 UNITS in grayf32le, 1 runs, 0 skips 56720 UNITS in grayf32le, 2 runs, 0 skips 67265 UNITS in grayf32le, 4 runs, 0 skips 58082 UNITS in grayf32le, 8 runs, 0 skips 63512 UNITS in grayf32le, 16 runs, 0 skips 52720 UNITS in grayf32le, 32 runs, 0 skips 46491 UNITS in grayf32le, 64 runs, 0 skips 68500 UNITS in grayf32be, 1 runs, 0 skips 66930 UNITS in grayf32be, 2 runs, 0 skips 62305 UNITS in grayf32be, 4 runs, 0 skips 55510 UNITS in grayf32be, 8 runs, 0 skips 50216 UNITS in grayf32be, 16 runs, 0 skips 44480 UNITS in grayf32be, 32 runs, 0 skips 42394 UNITS in grayf32be, 64 runs, 0 skips new timings: 46660 UNITS in grayf32le, 1 runs, 0 skips 51830 UNITS in grayf32le, 2 runs, 0 skips 53390 UNITS in grayf32le, 4 runs, 0 skips 50910 UNITS in grayf32le, 8 runs, 0 skips 44968 UNITS in grayf32le, 16 runs, 0 skips 40349 UNITS in grayf32le, 32 runs, 0 skips 38330 UNITS in grayf32le, 64 runs, 0 skips 39980 UNITS in grayf32be, 1 runs, 0 skips 49630 UNITS in grayf32be, 2 runs, 0 skips 53540 UNITS in grayf32be, 4 runs, 0 skips 59767 UNITS in grayf32be, 8 runs, 0 skips 51206 UNITS in grayf32be, 16 runs, 0 skips 44743 UNITS in grayf32be, 32 runs, 0 skips 41468 UNITS in grayf32be, 64 runs, 0 skips Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/swscale: check SWS_PRINT_INFO flag for printing alignment warningsSoft Works2021-11-13
| | | | | | | | This makes output consistent with a similar warning just few lines above where this flag is checked in the same way. Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* swscale/input: fix planar_rgb16_to_a for gbrap10be and gbrap12be formatsMark Reid2021-11-04
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/swscale: Improve *ColorspaceDetails() doxyMichael Niedermayer2021-10-24
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/utils: Improve return codes of sws_setColorspaceDetails()Michael Niedermayer2021-10-24
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/utils: Set all threads to the same colorspace even on failureMichael Niedermayer2021-10-24
| | | | | | Fixes: ./ffplay dav.y4m -vf "scale=hd1080:threads=4" Found-by: Paul Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libswscale/x86/rgb2rgb: add shuffle_bytes avx2Wu Jianhua2021-10-15
| | | | | | | | Performance data(Less is better): shuffle_bytes_ssse3 3.64654 shuffle_bytes_avx2 0.94288 Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
* swscale/swscale: Pass slice location into unscaled code also for dst scalingMichael Niedermayer2021-10-03
| | | | | | | Fixes: alphablend=checkerboard Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/alphablend: Fix slice handlingMichael Niedermayer2021-10-03
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/swscale_internal: Avoid unsigned for slice parametersMichael Niedermayer2021-09-30
| | | | | | | | Mixing unsigned and signed often leads to unexpected arithmetic results. Fixes: out of array write Found-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: add input/output support for X2BGR10LEManuel Stoeckl2021-09-26
| | | | | Signed-off-by: Manuel Stoeckl <code@mstoeckl.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/yuv2rgb: fix conversion to X2RGB10Manuel Stoeckl2021-09-26
| | | | | | | | | This resolves a problem where conversions from YUV to X2RGB10LE would produce color values a factor 4 too small, because an 8-bit value was placed in a 10-bit channel. Signed-off-by: Manuel Stoeckl <code@mstoeckl.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* swscale/swscale: Disable x86-specific code for other archesAndreas Rheinhardt2021-09-19
| | | | | | | | SSE2 is x86 specific, yet due to the call to av_get_cpu_flags() compilers were unable to optimize the checks (and the call) away on other arches. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* swscale/swscale: Fix races when using unaligned strides/dataAndreas Rheinhardt2021-09-19
| | | | | | | | | | | | | | | | | | | | | | | | In this case the current code tries to warn once; to do so, it uses ordinary static ints to store whether the warning has already been emitted. This is both a data race (and therefore undefined behaviour) as well as a race condition, because it is really possible for multiple threads to be the one thread to emit the warning. This is actually common since the introduction of the new multithreaded scaling API. This commit fixes this by using atomic integers for the state; furthermore, these are not static anymore, but rather contained in the user-facing SwsContext (i.e. the parent SwsContext in case of slice-threading). Given that these atomic variables are not intended for synchronization at all (but only for atomicity, i.e. only to output the warning once), the atomic operations use memory_order_relaxed. This affected the nv12, nv21, yuv420, yuv420p10, yuv422, yuv422p10 and yuv444 filter-overlay FATE-tests. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libswscale/options: Add parent_log_context_offset to AVClassAndreas Rheinhardt2021-09-19
| | | | | | | | This allows to associate log messages from slice contexts to the user-visible SwsContext. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libswscale/swscale: initialize all dst plane pointers in sws_receive_slice()James Almer2021-09-07
| | | | | | Fixes valgrind warnings about use of uninitialised values. Signed-off-by: James Almer <jamrial@gmail.com>
* sws: implement slice threadingAnton Khirnov2021-09-06
|
* sws: add a new scaling APIAnton Khirnov2021-09-06
|
* avutil/internal, swresample/audioconvert: Remove cpu.h inclusionsAndreas Rheinhardt2021-07-22
| | | | | | | | | | These inclusions are not necessary, as cpu.h is already included wherever it is needed (via direct inclusion or via the arch-specific headers). Also remove other unnecessary cpu.h inclusions from ordinary non-headers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* swscale/slice: Fix wrong return on errorMichael Niedermayer2021-07-09
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/utils: Use full chroma interpolation for rgb4/8 and dither noneMichael Niedermayer2021-07-09
| | | | | | | | Dither none is only implemented in full chroma interpolation for these rgb formats Its also a obscure choice (producing less nice images) that implementing it in the other code-paths makes no sense Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: Implement dither none for yuv2rgb_write_full()Michael Niedermayer2021-07-09
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/slice: Check slice for allocation failureMichael Niedermayer2021-07-09
| | | | | | | | Fixes: null pointer dereference Fixes: alloc_slice.mp4 Found-by: Rafael Dutra <rafael.dutra@cispa.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* sws: move updating the palette higher upAnton Khirnov2021-07-03
| | | | | It does not interact in any way with the code setting up the image pointers/strides, so it should not be intermixed with it.
* sws: move initializing dither_error higher upAnton Khirnov2021-07-03
| | | | | It does not interact in any way with the code setting up the image pointers/strides, so it should not be intermixed with it.
* sws: move the early return for zero-sized slices higher upAnton Khirnov2021-07-03
| | | | | Place it right after the input parameter validation. There is no point in performing any setup if the sws_scale() call won't do anything.
* sws: simplify setting sliceDirAnton Khirnov2021-07-03
|
* sws: merge handling frame start into a single blockAnton Khirnov2021-07-03
| | | | Also, return an error code on failure rather than 0.
* sws: make checking for the start of a new frame more explicitAnton Khirnov2021-07-03
|
* sws: reset sliceDir at the end of sws_scale()Anton Khirnov2021-07-03
| | | | | Makes it more clear that resetting it does not interact with the scaling code that it is currently intermixed with.
* sws: rename SwsContext.swscale to convert_unscaledAnton Khirnov2021-07-03
| | | | That function pointer is now used only for unscaled conversion.
* sws: separate the calls to scaled vs unscaled conversionAnton Khirnov2021-07-03
| | | | | | | | | | Call the scaler function directly rather than through a function pointer. Drop the now-unused return value from ff_getSwsFunc() and rename the function to reflect its new role. This will be useful in the following commits, where it will become important that the amount of output is different for scaled vs unscaled case.
* sws: do not reallocate scratch buffers for each sliceAnton Khirnov2021-07-03
|
* sws: group the parameters validity checks togetherAnton Khirnov2021-07-03
| | | | Also, fail with an error code rather than 0.
* sws: initialize {src,dst}Stride2 consistently with {src,dst}2Anton Khirnov2021-07-03
|
* sws: cosmeticsAnton Khirnov2021-07-03
| | | | Reindent after previous commit, rewrap long lines.
* sws: factor out cascaded scalingAnton Khirnov2021-07-03
|
* sws: cosmeticsAnton Khirnov2021-07-03
| | | | Reindent after previous commit, split long lines.
* sws: factor out gamma-correct scalingAnton Khirnov2021-07-03
|
* sws: return an error code on invalid parameters to sws_scale()Anton Khirnov2021-07-03
|
* sws: reindent after previous commitAnton Khirnov2021-07-03
|
* sws: factor out updating the paletteAnton Khirnov2021-07-03
|
* sws: remove unnecessary bracesAnton Khirnov2021-07-03
| | | | | There used to be more code inside them, but it was removed in 6de58b49032a206985602effec91e5e46c886ea2.
* libswscale: Make sws_init_context thread safe.Peter Lundblad2021-07-01
| | | | | | | Call ff_sws_rgb2rgb_init via ff_thread_once instead of checking one of the variables it updates. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/swscale_unscaled: don't use the optimized bgr24toYV12 unscaled ↵Limin Wang2021-06-06
| | | | | | | conversion when width%2 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* Bump major versions of all libraries.Anton Khirnov2021-04-27
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>