-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1637274
commit 47570a1
Showing
4 changed files
with
195 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Each texel stores two Y’s => two output RGBA pixels. | ||
let out_coords = gid.xy * vec2<u32>(2, 1); | ||
|
||
textureStore(rgba_output, out_coords, vec4<f32>(r1, g1, b1, 1.0)); | ||
textureStore(rgba_output, out_coords + vec2<u32>(1, 0), vec4<f32>(r2, g2, b2, 1.0)); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
pub struct FFVideo(ffmpeg::frame::Video); | ||
|
||
impl FFVideo { | ||
pub fn new(format: ffmpeg::format::Pixel, width: u32, height: u32) -> Self { | ||
Self(ffmpeg::frame::Video::new(format, width, height)) | ||
} | ||
|
||
pub fn data(&self, index: usize) -> &[u8] { | ||
self.0.data(index) | ||
} | ||
|
||
pub fn data_mut(&mut self, index: usize) -> &mut [u8] { | ||
self.0.data_mut(index) | ||
} | ||
|
||
pub fn stride(&self, index: usize) -> usize { | ||
self.0.stride(index) | ||
} | ||
|
||
pub fn as_mut_ptr(&mut self) -> *mut ffmpeg_sys_next::AVFrame { | ||
self.0.as_mut_ptr() | ||
} | ||
|
||
pub fn as_ptr(&self) -> *const ffmpeg_sys_next::AVFrame { | ||
self.0.as_ptr() | ||
} | ||
|
||
pub fn convert_with( | ||
&mut self, | ||
context: &mut ffmpeg::software::scaling::Context, | ||
output: &mut FFVideo, | ||
) -> Result<(), ffmpeg::Error> { | ||
unsafe { context.run(&self.0, &mut output.0) } | ||
} | ||
} |
This file contains 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
47570a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
cap-web – ./
cap-web-mc-ilroy.vercel.app
cap-web-git-main-mc-ilroy.vercel.app
cap.so
www.cap.so
cap-web-nu.vercel.app