xiph / rav1e Goto Github PK
View Code? Open in Web Editor NEWThe fastest and safest AV1 encoder.
License: BSD 2-Clause "Simplified" License
The fastest and safest AV1 encoder.
License: BSD 2-Clause "Simplified" License
Tests can be like:
Currently a number of experiments are disabled in the decoder. To update the decoder to the final AV1 bitstream, we must enable them. A number of these are quite easy - they simply add a bit to the uncompressed header indicating whether they are used or not, so you must simply add that bit, then remove the flag from the decoder's configuration. Experiments that have simple changes to the header:
--disable-aom_qm
--disable-ext-intra
--disable-ext_partition
--disable-loopfilter_level
--disable-cfl (requires look up table changes)
--disable-kf-ctx
--disable-striped_loop_restoration
--disable-max_tile
--disable-ext-intra-mod
--disable-frame_size
--disable-simplify_tx_mode
--disable-obu (more complex, but still only header changes)
smells like a decoder bug
This requires mostly adding support to the y4m crate:
I encoded park_joy_420_720p50.y4m, and then decoded it using the specific git checkout of aom listed in the README. It resulted in this (after being piped to ffmpeg to dump PNGs):
https://themayhaks.com/~gideon/test-av1-png/
IVF file is here (about 88MB):
https://themayhaks.com/~gideon/test.ivf
I'm not sure if this is just a result of me not resizing to 1280x768 before feeding it to rav1e, but it didn't complain and it seems to have converted it to 1280x768 during the encoding process.
rav1e is great and all, but it doesn't quite roll off the tongue. Let's comment on this issue with name ideas, and then vote on them using ๐.
Right now, cargo run
or cargo run -- --help
panics.
We failed to detect breakage. Requires ci to run nightly.
That is another lovely built-in feature of Rust. Let's use it asap, and not writing hassle separate unit-tests programs.
This is optional for inter mode coding, i.e. motion compensated blocks.
Would be happy if we can do this by 2020.
Currently in encode_tile
for every superblock, we search for the intra mode with the best RD (based on a 64x64 SSE), for PARTITION_NONE. We should extend this search to one-level of split.
This task will need sequence_header_read/write(), if not introduced yet.
Steps:
LV_Map slides
https://docs.google.com/presentation/d/1nbplj5yuq2OTNQFMbymfASRsfg58GLZjvzWE3MtoZWg/edit#slide=id.g245e1ced9c_1_5
More slides (improvements)
https://docs.google.com/presentation/d/1GcCv543QV10uIehWAaoM9xjJvJkXP-MbLV_Z6GVvIq8/edit#slide=id.p
Paper
https://usercontent.irccloud-cdn.com/file/KUIqFjBi/level_map.pdf
Remove experimental flag of LV_MAP_MULTI
78f7bb98558f513ab69b7d871bf45bf119b1fd5b
https://aomedia.googlesource.com/aom/+/78f7bb98558f513ab69b7d871bf45bf119b1fd5b
Remove experimental flag of LV_MAP
cad5ebce76b50cb413b980a17748941621a747e3
https://aomedia.googlesource.com/aom/+/cad5ebce76b50cb413b980a17748941621a747e3
Line 22 in 5ffbfe3
yushin@maui:~/workspace/rav1e$ cargo test
Compiling bitstream-io v0.6.3
Compiling bitflags v1.0.1
Compiling bencher v0.1.5
Compiling bitflags v0.4.0
Compiling encode_unicode v0.1.3
Compiling vec_map v0.8.0
Compiling unicode-width v0.1.4
Compiling ansi_term v0.10.2
Compiling y4m v0.1.1
Compiling byteorder v1.2.1
Compiling libc v0.2.36
Compiling strsim v0.7.0
Compiling textwrap v0.9.0
Compiling nix v0.5.1
Compiling atty v0.2.6
Compiling rand v0.4.2
Compiling clap v2.30.0
Compiling rustyline v1.0.0
Compiling rav1e v0.1.0 (file:///home/yushin/workspace/rav1e)
Finished dev [unoptimized + debuginfo] target(s) in 9.73 secs
Running target/debug/deps/rav1e-9b00cc822757fb1d
running 6 tests
test ec::test::booleans ... ok
test ec::test::cdf ... ok
test ec::test::mixed ... ok
test predict::test::pred_max ... ok
test predict::test::pred_same ... ok
test predict::test::pred_matches ... ok
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/rav1e-5895d273f770ce9f
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/rav1repl-81dcf9202be56248
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Doc-tests rav1e
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
yushin@maui:~/workspace/rav1e$ cargo bench
Compiling bencher v0.1.5
Compiling rav1e v0.1.0 (file:///home/yushin/workspace/rav1e)
warning: unused import: rav1e::predict::*;
--> benches/bench.rs:95:5
|
95 | use rav1e::predict::*;
| ^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
warning: unused variable: mode
--> benches/bench.rs:111:9
|
111 | let mode = PredictionMode::DC_PRED;
| ^^^^
|
= note: #[warn(unused_variables)] on by default
= note: to avoid this warning, consider using _mode
instead
warning: foreign function is never used: highbd_dc_left_predictor
--> benches/bench.rs:15:5
|
15 | / fn highbd_dc_left_predictor(dst: *mut u16, stride: libc::ptrdiff_t, bw: libc::c_int,
16 | | bh: libc::c_int, above: *const u16,
17 | | left: *const u16, bd: libc::c_int);
| |______________________________________________________________^
|
= note: #[warn(dead_code)] on by default
warning: foreign function is never used: highbd_dc_top_predictor
--> benches/bench.rs:18:5
|
18 | / fn highbd_dc_top_predictor(dst: *mut u16, stride: libc::ptrdiff_t, bw: libc::c_int,
19 | | bh: libc::c_int, above: *const u16,
20 | | left: *const u16, bd: libc::c_int);
| |______________________________________________________________^
warning: foreign function is never used: highbd_h_predictor
--> benches/bench.rs:21:5
|
21 | / fn highbd_h_predictor(dst: *mut u16, stride: libc::ptrdiff_t, bw: libc::c_int,
22 | | bh: libc::c_int, above: *const u16,
23 | | left: *const u16, bd: libc::c_int);
| |______________________________________________________________^
warning: foreign function is never used: highbd_v_predictor
--> benches/bench.rs:24:5
|
24 | / fn highbd_v_predictor(dst: *mut u16, stride: libc::ptrdiff_t, bw: libc::c_int,
25 | | bh: libc::c_int, above: *const u16,
26 | | left: *const u16, bd: libc::c_int);
| |___________________________________________^
warning: function is never used: pred_h_4x4
--> benches/bench.rs:37:1
|
37 | fn pred_h_4x4(output: &mut [u16], stride: usize, above: &[u16], left: &[u16]) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: function is never used: pred_v_4x4
--> benches/bench.rs:44:1
|
44 | fn pred_v_4x4(output: &mut [u16], stride: usize, above: &[u16], left: &[u16]) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Finished release [optimized] target(s) in 3.83 secs
Running target/release/deps/rav1e-c60027f9b9bd002f
running 6 tests
test ec::test::booleans ... ignored
test ec::test::cdf ... ignored
test ec::test::mixed ... ignored
test predict::test::pred_matches ... ignored
test predict::test::pred_max ... ignored
test predict::test::pred_same ... ignored
test result: ok. 0 passed; 0 failed; 6 ignored; 0 measured; 0 filtered out
Running target/release/deps/rav1e-ab1af7a55ae80597
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/release/deps/rav1repl-b79447a2b246d724
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/release/deps/bench-741fd4a6e67fa1d0
running 4 tests
test aom ... bench: 1,188,882 ns/iter (+/- 38,736)
test native ... bench: 975,183 ns/iter (+/- 59,961)
test native_trait ... bench: 269,857 ns/iter (+/- 10,470)
test write_b_bench ... bench: 123,071 ns/iter (+/- 6,586)
test result: ok. 0 passed; 0 failed; 0 ignored; 4 measured
yushin@maui:~/workspace/rav1e$
While the av1 syntax spec, https://aomediacodec.github.io/av1-spec, is for decoder,
we might want to consider following the variable and function names there as much as possible.
For example, instead of those confusing encode_superblock(), encode_b(), encode_sb(), ...etc.,
we can try find better names based on counterparts functions in decoder side,
https://aomediacodec.github.io/av1-spec/#decode-partition-syntax.
Probably by relying on aomdec being on the PATH
Found serious problem in our save/restore (i.e. checkpoint/rollback) states, that we are saving "blocks: Vec" of "struct BlockContext", which means all the MI blocks of a frame!
Since becced1, frames with show_existing_frame set are blank in the reconstruction stream.
Minimum prerequisite is a tiling support.
cargo run --bin rav1e --release
Compiling rav1e v0.1.0 (file:///Users/.../Workspace/rav1e)
Finished release [optimized] target(s) in 6.98 secs
Running `target/release/rav1e`
7s is too long to wait if the code hasn't changed.
rom1v works on #1126
If current block is skipped, the encoder should reset coeff contexts of above and left as zeros,
for width and height of the current block size, resp.
To reproduce, encode akiyo_qcif.y4m. (176x144)
We need to skip non-visible blocks in write_sb
(done), change the dimensions that we write in write_uncompressed_header
(done), change how partitions are coded on the edges of the frame (not started), get all sizes of intra-predictors (not needed since we force 4x4 everywhere).
Rename the existing task #127 as "Support Minimum Partition types" then create new task with old name from #127, "Support all partitions types".
As explained in #127, supporting all partition types does not seem essential and not meaningful w/o "ROD based block size decision", so I assume it is not part of MVP.
Currently they loop through (x,y) pixel coordinates which is slow.
(the code is at the very bottom of src/libr.s)
Do we want 128x128 from the start? Do this include 4:1 and 1:4 partitions? (use speed levels for this)
For now, set a constant CDEF level, and simply call the C CDEF implementation.
Test can be like:
Speed level decides the minimum partition block size, where recursive quadri-sect splitting stops at.
0(slowest) : BLOCK_4X4
1 : BLOCK_8X8
2 : BLOCK_16X16
3 : BLOCK_32X32
4~10(fastest) : BLOCK_64X64
Encoder option : "--speed=[0..10]" or "-s [0..10]".
Exception: SuperBlock(SB)s on right or bottom frame borders always split down to BLOCK_4X4.
In the future, min partition block size may be controlled by separate encoder option.
Fuzzing raw input is generally easier, but fuzzing the decisions would be more useful (but probably more involved/intrusive).
Some potentially helpful links:
https://github.com/pingcap/fail-rs
https://rust-fuzz.github.io/book/introduction.html
https://github.com/BurntSushi/quickcheck
https://github.com/altsysrq/proptest
and might as well add this link from @lu-zero for posterity:
https://doc.rust-lang.org/std/num/struct.Wrapping.html
Currently the encoder uses sse to do rate-distortion optimization. Make this function runtime switchable with a function that computes cdef-dist instead.
Reverting #99 would be an improvement.
For benchmarks, the Rust implementation must be wrapped in another function labeled #[inline(never)], for a fair comparison against the C.
Optionally, this could potentially be made more concise with a macro.
Want to remove this line, but cannot since it introduces desync, esp. at lower QIndex.
Line 23 in 91c95d6
Such as reference list, etc.
Investigate and fix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.