- 03 Jan, 2023 27 commits
-
-
Clément Bœsch authored
-
Clément Bœsch authored
-
Clément Bœsch authored
Now that the sort function is deterministic, we can rely on the libc sorting function.
-
Clément Bœsch authored
Currently, in case of equality on the first color channel, the order of the ref colors is defined by the hashing function. This commit makes the sorting deterministic and improve the hierarchical ordering.
-
Clément Bœsch authored
-
Clément Bœsch authored
Similar to the change in paletteuse, we rely on a perceptual model to decide how and where to split the box.
-
Clément Bœsch authored
This prevents mixed sign arithmetic (typically because we have signed color channel differences), which has nasty side effects in C.
-
Clément Bœsch authored
This variable is used only for the running weight (used to reach the target median). The places where we actually need the box weight are changed to use box->weight.
-
Clément Bœsch authored
-
Clément Bœsch authored
-
Clément Bœsch authored
This is following the results from personal research¹. ¹: https://github.com/ubitux/research/tree/main/color-quantization#results
-
Clément Bœsch authored
"Variance" wasn't exactly the correct word; "cut score" is more agnostic, which will be useful when changing the algorithm in the next commit.
-
Clément Bœsch authored
The variance computation is simple enough now (since we can use the axis squared errors) that it doesn't need to have a complex lazy computation logic.
-
Clément Bœsch authored
-
Clément Bœsch authored
This is following the results from personal research¹. ¹: https://github.com/ubitux/research/tree/main/color-quantization#results
-
Clément Bœsch authored
-
Clément Bœsch authored
Now the selection of the color is based on a distance built around human perception of color instead of the unreliable sRGB triplet one.
-
Clément Bœsch authored
This is redundant with a != 0xff below.
-
Clément Bœsch authored
The equalities in the w{r,g,b} range checks make sure longest is never 0. Even if the alpha ended up being selected in get_next_color() it would cause underread memory accesses in its caller (colormap_insert).
-
Clément Bœsch authored
-
Clément Bœsch authored
This change simplifies the code quite a bit and make it consistent with how it's done in palettegen.
-
Clément Bœsch authored
These color management helpers will be shared by palettegen and paletteuse in the following commits. Note that it probably makes sense to share at least the sRGB/linear functions with other filters at some point. More information on OkLab can be found here: https://bottosson.github.io/posts/oklab/ For the arithmetic integer version, see: http://blog.pkh.me/p/38-porting-oklab-colorspace-to-integer-arithmetic.html and https://github.com/ubitux/oklab-int
-
Clément Bœsch authored
-
Clément Bœsch authored
This reverts commit dea673d0. This change cannot work for several reasons, the most obvious ones are: - the alpha is being part of the scoring of the color difference, even though we can not interpret the alpha as part of the perception of the color (we don't even know if it's premultiplied or postmultiplied) - the colors are averaged with their alpha value which simply cannot work The command proposed in the original thread of the patch actually produces a completely broken file: ffmpeg -y -loglevel verbose -i fate-suite/apng/o_sample.png -filter_complex "split[split1][split2];[split1]palettegen=max_colors=254:use_alpha=1[pal1];[split2][pal1]paletteuse=use_alpha=1" -frames:v 1 out.png We can see that many color pixels are off, but more importantly some colors have a random alpha value: https://imgur.com/eFQ2UK7 I don't see any easy fix for this unfortunately, the approach appears to be flawed by design.
-
Clément Bœsch authored
-
Paul B Mahol authored
-
Zhao Zhili authored
Signed-off-by:
Zhao Zhili <zhilizhao@tencent.com>
-
- 02 Jan, 2023 3 commits
-
-
Paul B Mahol authored
-
Paul B Mahol authored
-
Paul B Mahol authored
-
- 31 Dec, 2022 1 commit
-
-
Lynne authored
-
- 29 Dec, 2022 1 commit
-
-
Gyan Doshi authored
New option can be used to avoid creating very short segments with inputs whose GOP size is variable or unharmonic with segment_time. Only effective with segment_time.
-
- 27 Dec, 2022 7 commits
-
-
Michael Niedermayer authored
Fixes: signed integer overflow: -2147483648 - 5 cannot be represented in type 'int' Fixes: 54242/clusterfuzz-testcase-minimized-ffmpeg_BSF_DTS2PTS_fuzzer-472928339243827 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by:
Michael Niedermayer <michael@niedermayer.cc>
-
Michael Niedermayer authored
Fixes: signed integer overflow: 48000 * 223587 cannot be represented in type 'int' Fixes: 54513/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5817594836025344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by:
Tomas Härdin <git@haerdin.se> Signed-off-by:
Michael Niedermayer <michael@niedermayer.cc>
-
Michael Niedermayer authored
Fixes: Timeout Fixes: 54386/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HDR_fuzzer-5053598268784640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by:
Paul B Mahol <onemda@gmail.com> Signed-off-by:
Michael Niedermayer <michael@niedermayer.cc>
-
James Almer authored
Similar to how the encoder looks at frame color information to write the frame header bitstream. Should workaround ticket #10091, where container level color parameters passed to the decoder context were being overwritten. Signed-off-by:
James Almer <jamrial@gmail.com>
-
James Almer authored
Some encoders, like flac, can send side data only packets at the end. Eventually, said extradata update should ideally be used to update the header when writting to seekable output, but for now, ignore them. Should fix the undefined behavior of passing NULL to memcpy(). Signed-off-by:
James Almer <jamrial@gmail.com>
-
Leo Izen authored
PFM (aka Portable FloatMap) encodes its scanlines from bottom-to-top, not from top-to-bottom, unlike other NetPBM formats. Without this patch, FFmpeg ignores this exception and decodes/encodes PFM images mirrored vertically from their proper orientation. For reference, see the NetPBM tool pfmtopam, which encodes a .pam from a .pfm, using the correct orientation (and which FFmpeg reads correctly). Also compare ffplay to magick display, which shows the correct orientation as well. See: http://www.pauldebevec.com/Research/HDR/PFM/ and see: https://netpbm.sourceforge.net/doc/pfm.html for descriptions of this image format. Signed-off-by:
Leo Izen <leo.izen@gmail.com> Reviewed-by:
Anton Khirnov <anton@khirnov.net> Signed-off-by:
James Almer <jamrial@gmail.com>
-
James Almer authored
EAGAIN is not correct in this scenario. FFCodec.cb.decode() callback decoders always return the amount of bytes consumed from the input packet (if any), and report if a frame was generated by setting got_frame. Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 26 Dec, 2022 1 commit
-
-
Martijn van Beurden authored
-