Skip to content

Instantly share code, notes, and snippets.

@master-of-zen
master-of-zen / Sunrise.md
Last active July 17, 2023 20:29
SunRise

Dangers of the Zone

Emission/Radiation Storm

You will be informed when it starts, emmission is dangerous and lethal, as soon as you see the warning - find shelter, it could be a tent, building, bunker.

You have around 4 minutes before emmision starts killing you and will end in around 5 minutes after radiation stage started.

Emmision is lethal, you will not survive staying outside.

@master-of-zen
master-of-zen / Video.md
Last active March 6, 2023 02:53
Commentary

Video is messy

I speak on stuff that i noticed, if you have questions message me directly on discord Master Of Zen#7693

Video encoding is messy and a lot of stuff is poorely explained online, which leaves people with bad framework to understand and deal with video.

Base

  • Coding Standarts and Video encoders are different things. aomenc, rav1e, SVT-AV1 are all video encoders for AV1.

  • Coding standarts define how encoded video should be as a binary(file) and decoded(made back into pixels, usually to play it or feed into another program as pixels).

@master-of-zen
master-of-zen / sc.md
Last active September 15, 2021 17:41
scene change

Slow

>  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
---- 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
@master-of-zen
master-of-zen / av1an_rust.md
Last active July 13, 2021 20:11
av1an rust install
  • 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
@master-of-zen
master-of-zen / data.md
Last active April 28, 2021 14:03
Rav1e cost based scene change changes

Total wall time difference on speed 9

Version Time
old: 47,783.666
new: 44,202.432

-8% wall time diffrence

1080p is ~7 times faster

new | old

@master-of-zen
master-of-zen / Film Grain table
Created April 23, 2021 20:30
Film Grain table example
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
@master-of-zen
master-of-zen / fields.json
Last active April 23, 2021 19:04
Aomenc stat fields
# 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",

Goals and motivation

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.
  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;
  }