Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-08-14imgutils: expose av_image_copy_plane_uc_from()Lynne
The reason why the generic av_image_copy_uc_from() doesn't really fit in the case for Vulkan is because some planes may be copied via other methods (such as mapping GPU memory), and if they don't satisfy the strict alignment requirements, a gpu image->gpu buffer->cpu ram copy is performed. We need this for hwcontext_vulkan, and I think this will also be useful to API users like libplacebo who would rather not write a custom SIMD memcpy.
2021-05-12avutil/imgutils: don't add offsets to NULL pointersJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPALAndreas Rheinhardt
Deprecated in d6fc031caf64eed921bbdef86d79d56bfc2633b0. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-27avutil/imgutils: always zero data pointers in av_image_fill_pointers()James Almer
This restores the relevant behavior of the function as it was before 3a8e927176. Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-27avutil/imgutils: don't fill data pointers for missing planesJames Almer
The size for a previous plane doesn't signal the presence of another after it. If the plane is present, av_image_fill_plane_sizes() will have returned a size for it. Fixes a regression since 3a8e927176. Reported-by: Imad R. Faiad <irfaiad@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-22avutil/imgutils: add utility to get plane sizesBrian Kim
This utility helps avoid undefined behavior when doing things like checking how much memory we need to allocate for an image before we have allocated a buffer. Signed-off-by: Brian Kim <bkkim@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-22avutil/imgutils: remove dead assignmentMarton Balint
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-02-02lavu/imgutils: Use FFABS() instead of abs() for ptrdiff_t.Carl Eugen Hoyos
Fixes a warning with clang: libavutil/imgutils.c:314:16: warning: absolute value function 'abs' given an argument of type 'ptrdiff_t' (aka 'long') but has parameter of type 'int' which may cause truncation of value
2019-01-20avutil/imgutils: Optimize memset_bytes() by using av_memcpy_backptr()Michael Niedermayer
This is strongly based on code by Marton Balint, and depends on the previous commit Fixes: Timeout Fixes: 11502/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in 11209 ms After: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 in 4104 ms Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-03avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPALwm4
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.
2017-11-02Merge commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24'James Almer
* commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24': Convert all AVClass struct declarations to designated initializers. Merged-by: James Almer <jamrial@gmail.com>
2017-09-16avutil/imgutils: Fix warning: missing braces around initializerMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-08imgutils: add function to clear an image to blackwm4
Black isn't always just memset(ptr, 0, size). Limited YUV in particular requires relatively non-obvious values, and filling a frame with repeating 0 bytes is disallowed in some contexts. With component sizes larger than 8 or packed YUV, this can become relatively complicated. So having a generic function for this seems helpful. In order to handle the complex cases in a generic way without destroying performance, this code attempts to compute a black pixel, and then uses that value to clear the image data quickly by using a function like memset. Common cases like yuv410p10 or rgba can't be handled with a simple memset, so there is some code to fill memory with 2/4/8 byte patterns. For the remaining cases, a generic slow fallback is used. Signed-off-by: Anton Khirnov <anton@khirnov.net> Merged from Libav commit 45df7adc1d9b7.
2017-06-12Convert all AVClass struct declarations to designated initializers.Diego Biurrun
2017-03-20Merge commit 'd7bc52bf456deba0f32d9fe5c288ec441f1ebef5'Clément Bœsch
* commit 'd7bc52bf456deba0f32d9fe5c288ec441f1ebef5': imgutils: add a function for copying image data from GPU mapped memory Merged-by: Clément Bœsch <u@pkh.me>
2016-12-11avutil: Add av_image_check_size2()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-31imgutils: add a function for copying image data from GPU mapped memoryAnton Khirnov
See https://software.intel.com/en-us/articles/copying-accelerated-video-decode-frame-buffers
2016-02-28avutil/imgutils: Assert that the 2nd av_image_fill_linesizes() call in ↵Michael Niedermayer
av_image_fill_linesizes() still succeeds Fixes CID1271742 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14avutil/imgutils: remove special case for aligning the paletteMichael Niedermayer
This was suggested by wm4 and stefano. After this patch using align=1 the size used by various functions would not contain padding, while the palette would be aligned at align>1 This patch makes it required to use align>=4 if the palette is to be accessed as uint32 As a side-effect It fixes storing pal8 in nut with odd with&height Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-13avutil/imgutils: only align the palette in av_image_copy_to_buffer() if ↵Michael Niedermayer
there is enough space This allows disabling the alignment by using a compact buffer Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-13avutil/imgutils: do not ignore align parameter for pseudo-pal in ↵Michael Niedermayer
av_image_get_buffer_size() Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-27avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis
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-11lavu: add AV_CEIL_RSHIFT and use it in various placesClément Bœsch
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-11-24imgutils: Use designated initializers for AVClassTimothy Gu
More readable and less breakable.
2015-09-08Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'Hendrik Leppkes
* commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba': lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-07lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fieldsVittorio Giovara
The new fields can be accessed directly and are more intelligible. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-06-13avutil/imgutils: Simplify pix_fmt validity check in av_image_get_linesize()Michael Niedermayer
Found-by: Daemon404 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-13imgutils: initialize palette padding bytes in av_image_allocAndreas Cadhalpun
av_image_fill_pointers always aligns the palette, but the padding bytes don't (and can't) get initialized in av_image_copy. Thus initialize them in av_image_alloc. This fixes 'Syscall param write(buf) points to uninitialised byte(s)' valgrind warnings. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-28avutil/imgutils: correctly check for negative SAR componentsMichael Niedermayer
These could trigger assert failures previously Found-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15Merge commit 'e2ad0b66fa273c5c823978e8f601f2c0d9ee42f8'Michael Niedermayer
* commit 'e2ad0b66fa273c5c823978e8f601f2c0d9ee42f8': imgutils: create misc functions for dealing with buffers Conflicts: doc/APIchanges libavcodec/avcodec.h libavcodec/avpicture.c libavutil/imgutils.c libavutil/imgutils.h libavutil/version.h See: e6674e46ecdd7aaa93d7f7d818eb1c8224b35eae Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-14imgutils: create misc functions for dealing with buffersStefano Sabatini
Move the lavc/imgconvert functions and rename them as follows: avpicture_get_size -> av_image_get_buffer_size() avpicture_fill -> av_image_fill_arrays() avpicture_layout -> av_image_copy_to_buffer() The new functions have an align parameter, which allows to define the linesize alignment assumed in the buffer (which is set or read). The names of the functions are consistent with the lavu/samples API (av_samples_get_buffer_size(), av_samples_fill_arrays()). A redundant check has been dropped from av_image_fill_arrays(). Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-11-27lavu/imgutils: remove redundant and wrong check in av_image_fill_arraysStefano Sabatini
2014-06-21Merge commit '9e500efdbe0deeff1602500ebc229a0a6b6bb1a2'Michael Niedermayer
* commit '9e500efdbe0deeff1602500ebc229a0a6b6bb1a2': Add av_image_check_sar() and use it to validate SAR Conflicts: libavcodec/dpx.c libavcodec/dvdec.c libavcodec/ffv1dec.c libavcodec/utils.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20Add av_image_check_sar() and use it to validate SARJustin Ruggles
2014-05-27Merge commit '4d8c28deab2488579f585406110b1be790896e59'Michael Niedermayer
* commit '4d8c28deab2488579f585406110b1be790896e59': imgutils: make systematic palette opaque. Conflicts: libavutil/imgutils.c See: 4d8c28deab2488579f585406110b1be790896e59 Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-25imgutils: make systematic palette opaque.Carl Eugen Hoyos
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-05-15replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_*Michael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-15Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_* Conflicts: doc/APIchanges libavcodec/avpicture.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/imgconvert.c libavcodec/tiffenc.c libavfilter/vf_pixdesctest.c libavfilter/vf_scale.c libavutil/imgutils.c libavutil/pixdesc.c libavutil/version.h libswscale/swscale_internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-15pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_*Anton Khirnov
2013-05-09lavu: add FF_CEIL_RSHIFT and use it in various places.Clément Bœsch
2012-11-25lavu/imgutils: add consistency checks to av_image_copy_plane()Stefano Sabatini
Add assertions and abort in case of invalid |dst_linesize| < bytewidth or |src_linesize| < bytewidth. Avoid to silently corrupt memory.
2012-11-23replace av_log(0, by av_log(NULL,Michael Niedermayer
The first parameter is a pointer and NULL is more correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-31av_image_copy: check for av_image_get_linesize() failure.Michael Niedermayer
Fixes CID703722 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-14Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: avutil: Do not make ff_ symbols globally visible. avutil: Rename ff_set_systematic_pal2() ---> avpriv_set_systematic_pal2() build: tms470: work around glibc math.h problems configure: improve tms470 compiler usage with glibc Conflicts: libavcodec/bmpenc.c libavcodec/rawdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-14avoid more "0xFF << 24" as it is considered a integer overflow in C99Michael Niedermayer
missed these in my previous search and replace Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-13avutil: Rename ff_set_systematic_pal2() ---> avpriv_set_systematic_pal2()Diego Biurrun
Functions used across libraries should have avpriv_ and not ff_ prefixes.
2012-10-12imgutils: do not use av_pix_fmt_descriptors directlyPaul B Mahol
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-12Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: lavu,lavd: do not use av_pix_fmt_descriptors directly. Conflicts: libavutil/imgutils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-12lavu,lavd: do not use av_pix_fmt_descriptors directly.Anton Khirnov
2012-10-08Merge commit '716d413c13981da15323c7a3821860536eefdbbb'Michael Niedermayer
* commit '716d413c13981da15323c7a3821860536eefdbbb': Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat Conflicts: doc/examples/muxing.c ffmpeg.h ffmpeg_filter.c ffmpeg_opt.c ffplay.c ffprobe.c libavcodec/8bps.c libavcodec/aasc.c libavcodec/aura.c libavcodec/avcodec.h libavcodec/avs.c libavcodec/bfi.c libavcodec/bmp.c libavcodec/bmpenc.c libavcodec/c93.c libavcodec/cscd.c libavcodec/cyuv.c libavcodec/dpx.c libavcodec/dpxenc.c libavcodec/eatgv.c libavcodec/escape124.c libavcodec/ffv1.c libavcodec/flashsv.c libavcodec/fraps.c libavcodec/h264.c libavcodec/huffyuv.c libavcodec/iff.c libavcodec/imgconvert.c libavcodec/indeo3.c libavcodec/kmvc.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libx264.c libavcodec/ljpegenc.c libavcodec/mjpegdec.c libavcodec/mjpegenc.c libavcodec/motionpixels.c libavcodec/mpeg12.c libavcodec/mpeg12enc.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo_enc.c libavcodec/pamenc.c libavcodec/pcxenc.c libavcodec/pgssubdec.c libavcodec/pngdec.c libavcodec/pngenc.c libavcodec/pnm.c libavcodec/pnmdec.c libavcodec/pnmenc.c libavcodec/ptx.c libavcodec/qdrw.c libavcodec/qpeg.c libavcodec/qtrleenc.c libavcodec/raw.c libavcodec/rawdec.c libavcodec/rl2.c libavcodec/sgidec.c libavcodec/sgienc.c libavcodec/snowdec.c libavcodec/snowenc.c libavcodec/sunrast.c libavcodec/targa.c libavcodec/targaenc.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/tmv.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/vb.c libavcodec/vp3.c libavcodec/wnv1.c libavcodec/xl.c libavcodec/xwddec.c libavcodec/xwdenc.c libavcodec/yop.c libavdevice/v4l2.c libavdevice/x11grab.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/buffersrc.c libavfilter/drawutils.c libavfilter/formats.c libavfilter/src_movie.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_format.c libavfilter/vf_hflip.c libavfilter/vf_lut.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vf_yadif.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/movenc.c libavformat/mxf.h libavformat/utils.c libavformat/yuv4mpeg.c libavutil/imgutils.c libavutil/pixdesc.c libswscale/input.c libswscale/output.c libswscale/swscale_internal.h libswscale/swscale_unscaled.c libswscale/utils.c libswscale/x86/swscale_template.c libswscale/x86/yuv2rgb.c libswscale/x86/yuv2rgb_template.c libswscale/yuv2rgb.c Merged-by: Michael Niedermayer <michaelni@gmx.at>