Wenbin Chen
13d04e30d7
libavcodec/qsvenc_av1: Add max_frame_size support to av1_qsv encoder
...
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2 years ago
Wenbin Chen
c8e73558fe
libavcodec/qsvenc_av1: Add low_delay_brc support to av1_qsv encoder
...
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2 years ago
Zhao Zhili
a598be44df
avcodec/mediacodecenc: enable B frames only with -strict experimental
...
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2 years ago
Anton Khirnov
fcd557a2c2
lavc/get_bits: add a compat wrapper for the cached bitstream reader
...
Use that instead of the merged version.
2 years ago
Anton Khirnov
b6742259bf
lavc/tests: add a cached bitstream reader test
2 years ago
Anton Khirnov
9177970bca
lavc/bitstream: templatize for BE/LE
...
Allows using both BE and LE bitstream readers in the same file.
2 years ago
Alexandra Hájková
8fe551eca0
lavc: add standalone cached bitstream reader
...
The cached bitstream reader was originally written by Alexandra Hájková
for Libav, with significant input from Kostya Shishkov and Luca Barbato.
It was then committed to FFmpeg in ca079b0954
, by merging it with the
implementation of the current bitstream reader.
This merge makes the code of get_bits.h significantly harder to read,
since it now contains two different bitstream readers interleaved with
#ifdefs. Additionally, the code was committed without proper authorship
attribution.
This commit re-adds the cached bitstream reader as a standalone header,
as it was originally developed. It will be made useful in following
commits.
Integration by Anton Khirnov.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2 years ago
Aman Karmani
4b2b9a6604
avcodec/mpeg12dec: flush a53 data
...
Signed-off-by: Aman Karmani <aman@tmm1.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2 years ago
James Almer
4a80db5fc2
avcodec/mpeg12dec: use init_get_bits8 and check the return value in all remaining cases
...
Signed-off-by: James Almer <jamrial@gmail.com>
2 years ago
Thierry Foucu
efbe84eb1b
avcodec/mpeg12dec: use init_get_bits8 and check the return value
...
Signed-off-by: James Almer <jamrial@gmail.com>
2 years ago
Paul B Mahol
99bd2dbc91
swresample/swresample_frame: fix regression in detecting changes
...
Do not overwrite return variable values, instead use different
one for checking results.
2 years ago
Anton Khirnov
a0b5aaceca
lavc/libx265: restructure handling reordered_opaque
...
Current code stores a pointer to allocated data in libx265 and frees it
when the encoded packet is retrieved. This will leak if the packet is
never retrieved, e.g. if the encoder is closed without being flushed.
Restructure the code such that only indices to an array stored in our
private data are given to libx265. This ensures no allocated memory can
be lost.
2 years ago
Anton Khirnov
7399e5305c
lavc/libx264: do not leave an invalid array size on alloc error
2 years ago
Anton Khirnov
a4a81be1a8
lavc/libx264: zero reordered opaque on alloc
...
This is safer.
2 years ago
Anton Khirnov
141303f323
lavc/libx264: print an error on invalid opaque pointer
2 years ago
Anton Khirnov
89761c2122
lavc/libx264: use a local variable to shorten code
2 years ago
Anton Khirnov
4469ce10a6
lavc/libx264: reindent after previous commit
2 years ago
Anton Khirnov
9ed5b0ac3b
lavc/libx264: reorder control flow in setup_roi() to reduce nesting depth
2 years ago
Anton Khirnov
ce5b2d34b4
lavc/libx264: reindent after previous commit
2 years ago
Anton Khirnov
e17b609fc6
lavc/libx264: do not ignore memory allocation errors
2 years ago
Anton Khirnov
cccd2c2179
lavc/libx264: unify cleanup in setup_frame()
2 years ago
Anton Khirnov
87eb362693
lavc/libx264: reindent after previous commit
2 years ago
Anton Khirnov
b1a184283b
lavc/libx264: factor out setting up ROI
2 years ago
Anton Khirnov
c7a8a6939b
lavc/libx264: use a local variable for input frame in setup_frame()
2 years ago
Anton Khirnov
9f8f980165
lavc/libx264: reindent after previous commit
2 years ago
Anton Khirnov
33cbba165c
lavc/libx264: factor out setting up the input frame
...
X264_frame() is currently too large and complex.
2 years ago
James Almer
a781279871
avformat/oggenc: don't flush twice when the last packet is side data only
...
Commit 18f24527eb
accidentally made side data only packets be handled like a
flush request. Fix this regression by effectively ignoring them as was the
original intention.
Signed-off-by: James Almer <jamrial@gmail.com>
2 years ago
James Almer
99e3d26f20
avformat/mux: use only valid timestamps when calculating packet distance
...
Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long int'
Fixes: fate-cover-art-aiff-id3v2-remux, fate-cover-art-mp3-id3v2-remux and fate-mov-cover-image
under ubsan.
Signed-off-by: James Almer <jamrial@gmail.com>
2 years ago
Clément Bœsch
6e05622216
avfilter/paletteuse: use explicit key indexes in set_frame_lut
2 years ago
Clément Bœsch
68275043a0
avfilter/paletteuse: add atkinson dithering
...
Atkinson according to
https://bisqwit.iki.fi/jutut/kuvat/ordered_dither/error_diffusion.txt :
* 1 1 / 8
1 1 1
1
2 years ago
Clément Bœsch
c973e8ae79
avfilter/paletteuse: add burkes dithering
...
Burkes according to
https://bisqwit.iki.fi/jutut/kuvat/ordered_dither/error_diffusion.txt :
* 8 4
2 4 8 4 2 / 32
2 years ago
Clément Bœsch
9973343bf9
avfilter/paletteuse: add sierra3 dithering
...
Sierra3 according to
https://bisqwit.iki.fi/jutut/kuvat/ordered_dither/error_diffusion.txt :
* 5 3
2 4 5 4 2
2 3 2 / 32
2 years ago
Clément Bœsch
11926c4bd4
avfilter/palette{gen,use}: misc for-loop cosmetics
2 years ago
Clément Bœsch
1340fe7caf
avfilter/paletteuse: move r,g,b computation in a more local scope
2 years ago
Clément Bœsch
1ae1b707e2
avfilter/paletteuse: remove mean error tool
...
This belongs in another filter.
2 years ago
Clément Bœsch
8789a9e05b
avfilter/paletteuse: remove alternative search methods
...
This is a maintenance pain more than anything. It appears to make the
code slightly faster as a side effect.
2 years ago
Clément Bœsch
0f7942afa6
avfilter/paletteuse: switch to recursive method
...
It appears faster than the iterative method on my machine (1.06x
faster), so I'm guessing compilers improved over time (the iterative
version was slightly faster in the past).
2 years ago
Clément Bœsch
6c7b54e962
avfilter/paletteuse: use lowbias32 for color hashing
...
Impact is more negligible than previous commit but still faster (1.02x).
2 years ago
Clément Bœsch
c9084cd0e2
avfilter/palettegen: use lowbias32 for color hashing
...
1.12x faster overall in palettegen on my machine.
2 years ago
Clément Bœsch
3cafbdc083
avfilter/palette: add lowbias32 hashing
2 years ago
Clément Bœsch
051926868c
avfilter/palette{gen,use}: update Copyright after recent changes
2 years ago
Clément Bœsch
3a4a6c7815
avfilter/palettegen: use libc qsort
...
Now that the sort function is deterministic, we can rely on the libc
sorting function.
2 years ago
Clément Bœsch
8057e1a618
avfilter/palettegen: make refs order deterministic
...
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.
2 years ago
Clément Bœsch
2441e53c0a
avfilter/palettegen: add a warning about supporting only sRGB
2 years ago
Clément Bœsch
9026d92c13
avfilter/palettegen: base box split decision on a perceptual model
...
Similar to the change in paletteuse, we rely on a perceptual model to
decide how and where to split the box.
2 years ago
Clément Bœsch
724f52b906
avfilter/palettegen: switch to signed arithmetic
...
This prevents mixed sign arithmetic (typically because we have signed
color channel differences), which has nasty side effects in C.
2 years ago
Clément Bœsch
67ce6ad9a2
avfilter/palettegen: rename local variable box_weight to weight
...
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.
2 years ago
Clément Bœsch
61d334d8c3
avfilter/palettegen: misc cosmetics
2 years ago
Clément Bœsch
efb0a6f6ce
avfilter/palettegen: compute average color within compute_box_stats()
2 years ago
Clément Bœsch
dafd43b78d
avfilter/palettegen: change cut score from ∑e² to max e²
...
This is following the results from personal research¹.
¹: https://github.com/ubitux/research/tree/main/color-quantization#results
2 years ago