let mut sum = 0;
for x in 1..=scale {
let src_row = &data_origin[(src.cfg.stride * 2 + x)..];
for y in 1..=scale {
sum += u32::cast_from(src_row[col * 2 + y]) as usize
}
}let mut sum = 0;
for x in 1..=scale {
let src_row = &data_origin[(src.cfg.stride * 2 + x)..];
sum += (1..scale)
.into_par_iter()
.for_each(|y| u32::cast_from(src_row[col * 2 + y]) as usize)
.sum();
} for x in 1..=scale {
let src_row = &data_origin[(src.cfg.stride * 2 + x)..];
let local_sum: usize = (1..scale)
.into_par_iter()
.map(|y| u32::cast_from(src_row[col * 2 + y]) as usize)
.sum();
sum += local_sum;
}Current fast scene detection in rav1e relatively slow to compared methods of scene detection, and have proclivity to show false results or don't detect scene changes where they appear
This pr reworks fast scene detection algorithm, making it faster, better, and more accurate
Achieved goals are:
- Faster decision making ( Both less and more efficient computations )
- More accurate scene detection, by adjusting threshold based on previous frames
- Frame downscale for faster decisions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fields meanings: <source root>/av1/encoder/firstpass.h | |
| fields = [ | |
| "frame", | |
| "weight", | |
| "intra_error", | |
| "frame_avg_wavelet_energy", | |
| "coded_error", | |
| "sr_coded_error", | |
| "tr_coded_error", | |
| "pcnt_inter", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filmgrn1 | |
| E 0 834166 1 7391 1 | |
| p 3 8 0 11 0 1 128 192 256 128 192 256 | |
| sY 8 0 43 13 43 27 51 40 68 54 82 67 90 81 93 255 93 | |
| sCb 8 0 41 13 41 40 51 54 58 67 63 81 65 94 65 255 65 | |
| sCr 4 0 26 13 26 54 32 255 35 | |
| cY 1 0 -1 8 3 0 1 0 3 -1 -21 -12 2 1 1 0 -21 83 19 -10 2 17 -42 108 | |
| cCb 3 2 0 8 2 2 2 3 1 2 -16 -5 5 3 0 6 -16 73 8 -3 5 20 -37 90 -2 | |
| cCr 2 1 1 6 3 1 2 1 5 -2 -6 -8 4 1 2 -3 -14 85 15 -1 3 11 -12 87 -1 | |
| E 834166 1251250 1 0 1 |
- Install python
- Install rustup
- Install rust nightly
git clone https://github.com/master-of-zen/Av1an
cd Av1an
python3 -m venv env
source env/bin/activate
pip install maturin
---- api::test::output_frameno_no_scene_change_at_multiple_flashes stdout ----
[src/scenechange/mod.rs:186] scenecut = false
[src/scenechange/mod.rs:186] scenecut = false
[src/scenechange/mod.rs:186] scenecut = false
[src/scenechange/mod.rs:186] scenecut = false
[src/scenechange/mod.rs:186] scenecut = false
[src/scenechange/mod.rs:186] scenecut = false
[src/scenechange/mod.rs:186] scenecut = false
[src/scenechange/mod.rs:186] scenecut = false
> Using y4m decoder: 1920x1080p @ 25/1 fps, 4:2:0, 8-bit
> Using 16 tiles (4x4)
> encoded 250 frames, 5.239 fps, 2482.74 Kb/s, elap. time: 47s
> ----------
> Key frame: 3 | avg QP: 79.00 | avg size: 38309 B
> Inter frame: 247 | avg QP: 138.00 | avg size: 12099 B
> Intra only frame: 0 | avg QP: 0.00 | avg size: 0 B
> Switching frame: 0 | avg QP: 0.00 | avg size: 0 B