Skip to content

Commit

Permalink
Use GPU based transfer to do chroma conversions of native decoder out…
Browse files Browse the repository at this point in the history
…put (#7682)

### What

* Important chunk of #7605
* Related to #7608
   * todo: create a new ticket for bgr shenanigans and close this one

---

Fixes performance issues with our previous inefficient cpu based chroma
conversion:


![image](https://github.com/user-attachments/assets/fed67eb9-902b-43d8-bbd6-8574a5f3b18d)

... and fixes color space issues:

Top left: now
Top right: before
Bottom: VLC

![image](https://github.com/user-attachments/assets/f5b797bd-e12d-46b0-96dd-32176d43e78c)

---

There was an oversight in the conversion pipeline that if fixed now: It
only allowed for creating new textures.
Now it can also update existing textures! This means that it takes a
target texture from the outside. Naturally, there's some constraints on
what the target texture looks like and as a consequence I added some
validation for that. Could be more, but I think this is solid enough for
our purposes :)


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7682?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7682?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7682)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
Wumpf authored Oct 11, 2024
1 parent fd46ce3 commit bf26fb6
Show file tree
Hide file tree
Showing 14 changed files with 488 additions and 326 deletions.
7 changes: 4 additions & 3 deletions crates/store/re_video/examples/frames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ fn main() {
video.config.coded_height
);

let mut decoder = create_decoder(&video);
let mut decoder = create_decoder(video_path, &video);

write_video_frames(&video, decoder.as_mut(), &output_dir);
}

fn create_decoder(video: &VideoData) -> Box<dyn SyncDecoder> {
fn create_decoder(debug_name: &str, video: &VideoData) -> Box<dyn SyncDecoder> {
if video.config.is_av1() {
Box::new(
re_video::decode::av1::SyncDav1dDecoder::new().expect("Failed to start AV1 decoder"),
re_video::decode::av1::SyncDav1dDecoder::new(debug_name.to_owned())
.expect("Failed to start AV1 decoder"),
)
} else {
panic!("Unsupported codec: {}", video.human_readable_codec_string());
Expand Down
Loading

0 comments on commit bf26fb6

Please sign in to comment.