chore: Update h263-rs to newest master, add some debug asserts

This commit is contained in:
TÖRÖK Attila 2023-02-27 23:16:42 +01:00 committed by relrelb
parent cf0c32bd70
commit 262c456da2
4 changed files with 10 additions and 8 deletions

8
Cargo.lock generated
View File

@ -1731,7 +1731,7 @@ dependencies = [
[[package]] [[package]]
name = "h263-rs" name = "h263-rs"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/ruffle-rs/h263-rs?rev=f0083f5933f173798dd308d1678f06d181a99975#f0083f5933f173798dd308d1678f06d181a99975" source = "git+https://github.com/ruffle-rs/h263-rs?rev=78d96c0034c519482c8f81e1042c86fc3684f7b3#78d96c0034c519482c8f81e1042c86fc3684f7b3"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"lazy_static", "lazy_static",
@ -1742,7 +1742,7 @@ dependencies = [
[[package]] [[package]]
name = "h263-rs-yuv" name = "h263-rs-yuv"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/ruffle-rs/h263-rs?rev=f0083f5933f173798dd308d1678f06d181a99975#f0083f5933f173798dd308d1678f06d181a99975" source = "git+https://github.com/ruffle-rs/h263-rs?rev=78d96c0034c519482c8f81e1042c86fc3684f7b3#78d96c0034c519482c8f81e1042c86fc3684f7b3"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"wide", "wide",
@ -4709,9 +4709,9 @@ dependencies = [
[[package]] [[package]]
name = "wide" name = "wide"
version = "0.7.6" version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "feff0a412894d67223777b6cc8d68c0dab06d52d95e9890d5f2d47f10dd9366c" checksum = "b689b6c49d6549434bf944e6b0f39238cf63693cb7a147e9d887507fffa3b223"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"safe_arch", "safe_arch",

View File

@ -16,8 +16,8 @@ thiserror = "1.0"
flate2 = "1.0.25" flate2 = "1.0.25"
log = "0.4" log = "0.4"
h263-rs = { git = "https://github.com/ruffle-rs/h263-rs", rev = "f0083f5933f173798dd308d1678f06d181a99975", optional = true } h263-rs = { git = "https://github.com/ruffle-rs/h263-rs", rev = "78d96c0034c519482c8f81e1042c86fc3684f7b3", optional = true }
h263-rs-yuv = { git = "https://github.com/ruffle-rs/h263-rs", rev = "f0083f5933f173798dd308d1678f06d181a99975", optional = true } h263-rs-yuv = { git = "https://github.com/ruffle-rs/h263-rs", rev = "78d96c0034c519482c8f81e1042c86fc3684f7b3", optional = true }
nihav_core = { git = "https://github.com/ruffle-rs/nihav-vp6", rev = "9416fcc9fc8aab8f4681aa9093b42922214abbd3", optional = true } nihav_core = { git = "https://github.com/ruffle-rs/nihav-vp6", rev = "9416fcc9fc8aab8f4681aa9093b42922214abbd3", optional = true }
nihav_codec_support = { git = "https://github.com/ruffle-rs/nihav-vp6", rev = "9416fcc9fc8aab8f4681aa9093b42922214abbd3", optional = true } nihav_codec_support = { git = "https://github.com/ruffle-rs/nihav-vp6", rev = "9416fcc9fc8aab8f4681aa9093b42922214abbd3", optional = true }
nihav_duck = { git = "https://github.com/ruffle-rs/nihav-vp6", rev = "9416fcc9fc8aab8f4681aa9093b42922214abbd3", optional = true } nihav_duck = { git = "https://github.com/ruffle-rs/nihav-vp6", rev = "9416fcc9fc8aab8f4681aa9093b42922214abbd3", optional = true }

View File

@ -69,8 +69,9 @@ impl VideoDecoder for H263Decoder {
.into_width_and_height() .into_width_and_height()
.ok_or(H263Error::MissingWidthHeight)?; .ok_or(H263Error::MissingWidthHeight)?;
let chroma_width = picture.chroma_samples_per_row(); let chroma_width = picture.chroma_samples_per_row();
debug_assert_eq!(chroma_width, (width as usize + 1) / 2);
let (y, b, r) = picture.as_yuv(); let (y, b, r) = picture.as_yuv();
let rgba = yuv420_to_rgba(y, b, r, width.into(), chroma_width); let rgba = yuv420_to_rgba(y, b, r, width.into());
Ok(DecodedFrame { Ok(DecodedFrame {
width, width,
height, height,

View File

@ -156,6 +156,8 @@ impl VideoDecoder for Vp6Decoder {
let (mut width, mut height) = frame.get_dimensions(0); let (mut width, mut height) = frame.get_dimensions(0);
let (chroma_width, chroma_height) = frame.get_dimensions(1); let (chroma_width, chroma_height) = frame.get_dimensions(1);
debug_assert_eq!(chroma_width, (width + 1) / 2);
debug_assert_eq!(chroma_height, (height + 1) / 2);
// We assume that there is no padding between rows // We assume that there is no padding between rows
debug_assert!(frame.get_stride(0) == frame.get_dimensions(0).0); debug_assert!(frame.get_stride(0) == frame.get_dimensions(0).0);
@ -174,7 +176,6 @@ impl VideoDecoder for Vp6Decoder {
&yuv[offsets.1..offsets.1 + chroma_width * chroma_height], &yuv[offsets.1..offsets.1 + chroma_width * chroma_height],
&yuv[offsets.2..offsets.2 + chroma_width * chroma_height], &yuv[offsets.2..offsets.2 + chroma_width * chroma_height],
width, width,
chroma_width,
); );
// Adding in the alpha component, if present. // Adding in the alpha component, if present.