summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* avcodec/mjpegdec: fix skipping of bytes for unknown APPx markersRamiro Polla2025-09-041-3/+3
| | | | | | | | | The loop to skip the remaining bytes was off by one for all markers except for Adob. This patch uses post-decrement instead of pre-decrement in the while loop to make the len value easier to understand, and updates the len value to reflect this change for the Adob marker.
* avcodec/librsvgdec: fix compilation with librsvg 2.50.3Andrey Semashev2025-09-041-2/+2
| | | | | | | | | | | This fixes compilation with librsvg 2.50.3: error: viewport undeclared This was a regression since commit 86ed68420d3b60439d0b7767c53d0fdc1deb7277. Fixes #10722. Reviewed-by: Leo Izen <[email protected]>
* avcodec/cbrt_tablegen: Deduplicate common codeAndreas Rheinhardt2025-09-045-30/+71
| | | | | | | | Namely the part that creates a temporary LUT. Reviewed-by: Zhao Zhili <[email protected]> Reviewed-by: Lynne <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/cbrt_tablegen: Avoid LUT only used onceAndreas Rheinhardt2025-09-043-21/+40
| | | | | | | | | | | | | | | | This can be done by reusing the destination array to store a temporary LUT (with only half the amount of elements, but double the element size). This relies on certain assumptions about sizes, but they are always fulfilled for systems supported by us (sizeof(double) == 8 is needed/guaranteed since commit 3383a53e7d0abb9639c3ea3481f0eda9dca61a26). Furthermore, sizeof(uint32_t) is always >= four because CHAR_BIT is eight (in fact, sizeof(uint32_t) is four, because the exact width types don't have any padding). Reviewed-by: Zhao Zhili <[email protected]> Reviewed-by: Lynne <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/cbrt_tablegen: Reduce size of LUT only used onceAndreas Rheinhardt2025-09-041-21/+37
| | | | | | | | | | | | | | | ff_cbrt_tableinit{,_fixed}() uses a LUT of doubles of the same size as the actual LUT to be initialized (8192 elems). Said LUT is only used to initialize another LUT, but because it is static, the dirty memory (64KiB) is not released. It is also too large to be put on the stack. This commit mitigates this: We only use a LUT for the powers of odd values, thereby halving its size. The generated LUT stays unchanged. Reviewed-by: Zhao Zhili <[email protected]> Reviewed-by: Lynne <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/cbrt_tablegen: Remove always-false branchAndreas Rheinhardt2025-09-041-2/+0
| | | | | | | | | Each ff_cbrt_tableinit*() is called at most once, making this check always-false. Reviewed-by: Zhao Zhili <[email protected]> Reviewed-by: Lynne <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avutil/hwcontext_drm: fix mapping when dst format is unsetCameron Gutman2025-09-031-1/+3
| | | | | | | av_hwframe_map() is documented to work with a blank dst frame, but hwcontext_drm currently fails if dst->format == AV_PIX_FMT_NONE. Signed-off-by: Cameron Gutman <[email protected]>
* avutil/version: bump minor after recent changeWu Jianhua2025-09-031-1/+1
| | | | | | See c2ce387385996c4e6824116931930b08cfcaecc9 Signed-off-by: Wu Jianhua <[email protected]>
* avformat/demux: Reindent after the previous commitAndreas Rheinhardt2025-09-031-6/+6
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avformat/demux: Avoid always-true branchAndreas Rheinhardt2025-09-031-3/+0
| | | | | | | | Since 9d037c54f209958d47ac376d2a9561608f98dfae id3v2_extra_meta can only be != NULL if the input format wants ID3v2 tags to be read generically. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avformat/avformat: Make AVFMT_FLAG_ID3V2_AUTO privateAndreas Rheinhardt2025-09-037-6/+13
| | | | | | | | | | | | | | | This flag governs whether avformat_open_input() reads ID3v2 tags generically; some demuxers without this flag read these tags themselves in a non-generic way, e.g. oma. This makes this flag an implementation detail that should not be exposed to the user, i.e. an internal flag. Given that 9d037c54f209958d47ac376d2a9561608f98dfae did not bump version and added no APIchanges entry I deemded it inappropriate to bump version or add an APIchanges entry for the removal of AVFMT_FLAG_ID3V2_AUTO. Signed-off-by: Andreas Rheinhardt <[email protected]>
* swscale: Don't pass a concrete SwsOpPriv as parameterMartin Storsjö2025-09-033-5/+5
| | | | | | | | | | | | | | | | | This fixes the following compiler error, if compiling with MSVC for ARM (32 bit): src/libswscale/ops_chain.c(48): error C2719: 'priv': formal parameter with requested alignment of 16 won't be aligned This change shouldn't affect the performance of this operation (which in itself probably isn't relevant); instead of copying the contents of the SwsOpPriv struct from the stack as parameter, it gets copied straight from the caller function's stack frame instead. Separately from this issue, MSVC 17.8 and 17.9 end up in an internal compiler error when compiling libswscale/ops.c, but older and newer versions do compile it successfully.
* avformat/demux: avoid unconditional ID3v2 tag consumptionnilfm2025-09-036-6/+11
| | | | | | | | | ID3v2 headers are now only parsed for formats that explicitly support them, avoiding premature data consumption that broke demuxing in other formats. Introduces AVFMT_FLAG_ID3V2_AUTO and applies it to mp3, aac, tta, and wav. Signed-off-by: nilfm <[email protected]>
* avformat/aviobuf: Don't pretend to support avio_context_free(NULL)Andreas Rheinhardt2025-09-031-2/+2
| | | | | | | | | | It makes no sense to ever call it that way given that avio_context_free() accepts a pointer to a pointer to an AVIOContext. Other double-pointer-free functions like av_freep() also do it that way (and therefore avio_context_free(NULL) still crashes even with 870cfed2317e311a71bc14773332486a162f059c). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/pcm_tablegen: Fix CONFIG_HARDCODED_TABLESAndreas Rheinhardt2025-09-031-0/+1
| | | | | | | | | | Broken in ae448e00afb43d7f72dfa9c82a4c45994e4fea6a. Notice that config_components.h is safe to include, as it is valid for both the host and the target (in contrast to config.h). Reviewed-by: Zhao Zhili <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/d3d12va_encode: texture array support for HEVCAraz Iusubov2025-09-036-52/+273
| | | | | | | | | This patch adds support for the texture array feature used by AMD boards in the D3D12 HEVC encoder. In texture array mode, a single texture array is shared for all reference and reconstructed pictures using different subresources. The implementation ensures compatibility and has been successfully tested on AMD, Intel, and NVIDIA GPUs.
* avcodec/aarch64/vvc: Optimize apply_bdofZhao Zhili2025-09-033-138/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, prof_grad_filter calculate gh[0], gh[1], gv[0], gv[1] and save them to stack. derive_bdof_vx_vy load them from stack and calculate gh[0] + gh[1], gv[0] + gv[1]. apply_bdof_min_block load them from stack and calculate gh[0] - gh[1], gv[0] - gv[1] This patch add bdof_grad_filter, which calculate gh[0] + gh[1], gh[0] - gh[1], gv[0] + gv[1], gv[0] - gv[1], and save them to stack, so derive_bdof_vx_vy and apply_bdof_min_block can use the results directly. prof_grad_filter is kept for reuse by other functions in the future. Benchmark on rpi5 with gcc 12 Before After -------------------------------------------------------------------- apply_bdof_8_8x16_c: | 7431.4 ( 1.00x) | 7371.7 ( 1.00x) apply_bdof_8_8x16_neon: | 1175.4 ( 6.32x) | 1036.3 ( 7.11x) apply_bdof_8_16x8_c: | 7182.2 ( 1.00x) | 7201.1 ( 1.00x) apply_bdof_8_16x8_neon: | 1021.7 ( 7.03x) | 879.9 ( 8.18x) apply_bdof_8_16x16_c: | 14577.1 ( 1.00x) | 14589.3 ( 1.00x) apply_bdof_8_16x16_neon: | 2012.8 ( 7.24x) | 1743.3 ( 8.37x) apply_bdof_10_8x16_c: | 7292.4 ( 1.00x) | 7308.5 ( 1.00x) apply_bdof_10_8x16_neon: | 1156.3 ( 6.31x) | 1045.3 ( 6.99x) apply_bdof_10_16x8_c: | 7112.4 ( 1.00x) | 7214.4 ( 1.00x) apply_bdof_10_16x8_neon: | 1007.6 ( 7.06x) | 904.8 ( 7.97x) apply_bdof_10_16x16_c: | 14363.3 ( 1.00x) | 14476.4 ( 1.00x) apply_bdof_10_16x16_neon: | 1986.9 ( 7.23x) | 1783.1 ( 8.12x) apply_bdof_12_8x16_c: | 7433.3 ( 1.00x) | 7374.7 ( 1.00x) apply_bdof_12_8x16_neon: | 1155.9 ( 6.43x) | 1040.8 ( 7.09x) apply_bdof_12_16x8_c: | 7171.1 ( 1.00x) | 7376.3 ( 1.00x) apply_bdof_12_16x8_neon: | 1010.8 ( 7.09x) | 899.4 ( 8.20x) apply_bdof_12_16x16_c: | 14515.5 ( 1.00x) | 14731.5 ( 1.00x) apply_bdof_12_16x16_neon: | 1988.4 ( 7.30x) | 1785.2 ( 8.25x)
* avcodec/aarch64/vvc: Optimize derive_bdof_vx_vyZhao Zhili2025-09-033-264/+428
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement line tricks and pixel tricks. See comments in inter.S for details. Benchmark on rpi5 with gcc 12 Before After ----------------------------------------------------------------- apply_bdof_8_8x16_c: | 7375.5 ( 1.00x) | 7473.8 ( 1.00x) apply_bdof_8_8x16_neon: | 1875.1 ( 3.93x) | 1135.8 ( 6.58x) apply_bdof_8_16x8_c: | 7273.9 ( 1.00x) | 7204.0 ( 1.00x) apply_bdof_8_16x8_neon: | 1738.2 ( 4.18x) | 1013.0 ( 7.11x) apply_bdof_8_16x16_c: | 14744.9 ( 1.00x) | 14712.6 ( 1.00x) apply_bdof_8_16x16_neon: | 3446.7 ( 4.28x) | 1997.7 ( 7.36x) apply_bdof_10_8x16_c: | 7352.4 ( 1.00x) | 7485.7 ( 1.00x) apply_bdof_10_8x16_neon: | 1861.0 ( 3.95x) | 1134.1 ( 6.60x) apply_bdof_10_16x8_c: | 7330.5 ( 1.00x) | 7232.8 ( 1.00x) apply_bdof_10_16x8_neon: | 1747.2 ( 4.20x) | 1002.6 ( 7.21x) apply_bdof_10_16x16_c: | 14522.4 ( 1.00x) | 14664.8 ( 1.00x) apply_bdof_10_16x16_neon: | 3490.5 ( 4.16x) | 1978.4 ( 7.41x) apply_bdof_12_8x16_c: | 7389.0 ( 1.00x) | 7380.1 ( 1.00x) apply_bdof_12_8x16_neon: | 1861.3 ( 3.97x) | 1134.0 ( 6.51x) apply_bdof_12_16x8_c: | 7283.1 ( 1.00x) | 7336.9 ( 1.00x) apply_bdof_12_16x8_neon: | 1749.1 ( 4.16x) | 1002.3 ( 7.32x) apply_bdof_12_16x16_c: | 14580.7 ( 1.00x) | 14502.7 ( 1.00x) apply_bdof_12_16x16_neon: | 3472.9 ( 4.20x) | 1978.3 ( 7.33x) Signed-off-by: Zhao Zhili <[email protected]>
* add clamping for escpase coeffdamitha2025-09-031-1/+1
|
* avfilter/vf_zscale: simplify and fix alpha handlingNiklas Haas2025-09-021-87/+10
| | | | | | | | | | There's no reason to use a completely separate graph just to process the alpha plane in isolation - zimg supports native alpha handling as part of the main image. Fixes several issues with this filter when adding or removing alpha planes, and also adds support for scaling premultiplied alpha (which reduces artefacts near the image borders).
* avfilter/vf_scale: require straight alpha for alpha blendingNiklas Haas2025-09-021-0/+6
| | | | | | | | | | Fortunately, we only care if this flag is set - otherwise, this filter is alpha mode agnostic (since it is purely scaling, etc). That said, there is an argument to be made that we should prefer premul alpha when scaling, because scaling in straight alpha will leak garbage pixels; but I think that would be a too backwards-incompatible change to be worth thinking about at this time.
* avfilter: add alpha_mode consistency assertionNiklas Haas2025-09-021-0/+2
|
* avfilter/drawutils: add alpha mode supportNiklas Haas2025-09-023-5/+12
| | | | | This allows drawing colors onto images with premultiplied alpha, by first premultiplying the specified RGBA values.
* avfilter: use ff_draw_init_from_link() where possibleNiklas Haas2025-09-0212-21/+16
|
* avfilter/drawutils: add ff_draw_init_from_link()Niklas Haas2025-09-022-0/+13
| | | | | | The overwhelming majority of references to ff_draw_init2() just set the colorspace properties from a filter link. This wrapper allows us to update all such referencen automatically.
* avfilter/vf_fade: set correct alpha mode requirementNiklas Haas2025-09-021-1/+18
| | | | | Fading to black in non-alpha mode works for either straight or premultiplied alpha, but fading to a color does not.
* avfilter/x86/vf_overlay: simplify function signatureNiklas Haas2025-09-023-13/+15
| | | | | No reason to pass all the variables again, if we're already passing the context.
* avfilter/vf_overlay: support premultiplied base layersNiklas Haas2025-09-021-155/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conceptually, these are pretty simple to handle, since they are basically equivalent to the case of alpha being absent, since the only thing the destination alpha plane is used for is unpremultiplyng straight alpha. For planar formats, the total number of cases doesn't change in principle, since before this patch we have: - alpha present, overlay straight - alpha present, overlay premultiplied - alpha absent, overlay straight - alpha absent, overlay premultiplied And now we have: - main straight, overlay straight - main straight, overlay premultiplied - main premultiplied, overlay straight - main premultiplied, overlay premultiplied That said, we do gain some cases now that we used to (incorrectly) ignore, like premultiplied yuva420p10. Notably, we can skip defining separate functions for the case of main alpha being absent, since that can be a single cheap branch inside the function itself, on whether or not to also process the alpha plane. Otherwise, as long as we treat "alpha absent" as "main premultiplied", the per-plane logic will skip touching the nonexistent alpha plane. The only format that actually needs extra cases is packed rgb, but that's only two additional cases in total. Also arguably simplifies the assignment logic massively.
* avfilter/vf_overlay: rename variables for clarityNiklas Haas2025-09-023-19/+19
| | | | | `is_straight`, `alpha_mode` etc. are more consistently named to refer to either the main image, or the overlay.
* avfilter/vf_overlay: configure alpha mode on the linkNiklas Haas2025-09-024-98/+121
| | | | And use the link-tagged value instead of the hard-coded parameter.
* avfilter/vf_libplacebo: add an alpha_mode settingNiklas Haas2025-09-022-0/+18
| | | | | | Chooses the desired output alpha mode. Note that this depends on an upstream version of libplacebo new enough to respect the corresponding AVFrame field in pl_map_avframe_ex.
* avfilter/vf_setparams: add alpha_mode parameterNiklas Haas2025-09-022-0/+32
|
* avfilter/vf_scale: set correct alpha mode after format changeNiklas Haas2025-09-021-0/+1
| | | | | | While vf_scale cannot directly convert between premultiplied and straight alpha, the effective tagging can still change as a result of a change in the pixel format (i.e. adding or removing an alpha channel).
* avfilter/vf_extractplanes: require straight alpha inputNiklas Haas2025-09-021-0/+4
|
* avfilter/vf_alphamerge: configure correct alpha modeNiklas Haas2025-09-021-0/+7
|
* fftools/ffprobe: add AVFrame.alpha_mode supportNiklas Haas2025-09-0217-81/+130
|
* fftools/ffplay: add alpha_mode supportNiklas Haas2025-09-021-0/+10
| | | | SDL seems to hard-code straight alpha compositing.
* fftools/ffmpeg: add alpha_mode supportNiklas Haas2025-09-025-3/+35
| | | | | The implementation exactly mirrors the existing plumbing for color_ranges and color_spaces.
* avfilter/vf_showinfo: print alpha mode when relevantNiklas Haas2025-09-021-0/+8
|
* avfilter/vf_format: add alpha_modes parameterNiklas Haas2025-09-022-3/+23
|
* avfilter/buffersrc: add alpha_mode parameterNiklas Haas2025-09-025-10/+48
|
* avfilter/buffersink: add support for alpha modesNiklas Haas2025-09-024-2/+32
|
* avcodec/jpegxl: parse and signal correct alpha modeNiklas Haas2025-09-023-2/+11
| | | | This header bit ("alpha_associated") was incorrectly ignored.
* avcodec/libjxlenc: also attach extra channel infoNiklas Haas2025-09-021-0/+13
| | | | | Works around a bug where older versions of libjxl don't correctly forward the alpha channel information to the extra channel info.
* avcodec/libjxl: set correct alpha modeNiklas Haas2025-09-022-0/+21
| | | | | | JPEG XL supports both premultiplied and straight alpha, and the basic info struct contains signalling for this. Forward the correct tagging on decode and encode.
* avcodec/exr: set correct alpha modeNiklas Haas2025-09-022-0/+6
| | | | | | | | | | | | | | OpenEXR always uses premultiplied alpha, as per the spec. cf. https://openexr.com/en/latest/TechnicalIntroduction.html > By convention, all color channels are premultiplied by alpha, so that > `foreground + (1-alpha) x background` performs a correct “over” operation. > (See Premultiplied vs. Un-Premultiplied Color Channels) > > In the visual effects industry premultiplied color channels are the norm, > and application software packages typically use internal image > representations that are also premultiplied.
* avcodec/png: set correct alpha modeNiklas Haas2025-09-022-0/+11
| | | | | | | | | | PNG always uses straight alpha. cf. https://www.w3.org/TR/PNG-Rationale.html > Although each form of alpha storage has its advantages, we did not want to > require all PNG viewers to handle both forms. We standardized on non- > premultiplied alpha as being the lossless and more general case.
* avcodec/encode: enforce alpha mode compatibility at encode timeNiklas Haas2025-09-021-0/+27
| | | | Error out if trying to encode frames with an incompatible alpha mode.
* avcodec/avcodec: add AVCodecContext.alpha_modeNiklas Haas2025-09-0210-2/+48
| | | | | | | | | | Following in the footsteps of the previous commit, this commit adds the new fields to AVCodecContext so we can start properly setting it on codecs, as well as limiting the list of supported options to detect a format mismatch during encode. This commit also sets up the necessary infrastructure to start using the newly added field in all codecs.
* avfilter/formats: use vf_premultiply_dynamic for alpha mode autoconversionNiklas Haas2025-09-021-0/+1
|