Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dav1d and dcv-color-primitives #1870

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ tiff = { version = "0.8.0", optional = true }
ravif = { version = "0.11.0", optional = true }
rgb = { version = "0.8.25", optional = true }
mp4parse = { version = "0.12.0", optional = true }
dav1d = { version = "0.6.0", optional = true }
dcv-color-primitives = { version = "0.4.0", optional = true }
dav1d = { version = "0.9.3", optional = true }
dcv-color-primitives = { version = "0.5.2", optional = true }
color_quant = "1.1"
exr = { version = "1.5.0", optional = true }
qoi = { version = "0.4", optional = true }
Expand Down
11 changes: 5 additions & 6 deletions src/codecs/avif/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ impl<R: Read> AvifDecoder<R> {
/// Create a new decoder that reads its input from `r`.
pub fn new(mut r: R) -> ImageResult<Self> {
let ctx = read_avif(&mut r, ParseStrictness::Normal).map_err(error_map)?;
let mut primary_decoder = dav1d::Decoder::new();
let coded = ctx.primary_item_coded_data();
let mut primary_decoder = dav1d::Decoder::new().map_err(error_map)?;
let coded = ctx.primary_item_coded_data().to_owned();
primary_decoder
.send_data(coded, None, None, None)
.map_err(error_map)?;
let picture = primary_decoder.get_picture().map_err(error_map)?;
let alpha_item = ctx.alpha_item_coded_data();
let alpha_item = ctx.alpha_item_coded_data().to_owned();
let alpha_picture = if !alpha_item.is_empty() {
let mut alpha_decoder = dav1d::Decoder::new();
let mut alpha_decoder = dav1d::Decoder::new().map_err(error_map)?;
alpha_decoder
.send_data(alpha_item, None, None, None)
.map_err(error_map)?;
Expand Down Expand Up @@ -111,7 +111,6 @@ impl<'a, R: 'a + Read> ImageDecoder<'a> for AvifDecoder<R> {
PixelLayout::I420 => dcp::PixelFormat::I420,
PixelLayout::I422 => dcp::PixelFormat::I422,
PixelLayout::I444 => dcp::PixelFormat::I444,
PixelLayout::Unknown => panic!("Unknown pixel layout"),
};
let src_format = dcp::ImageFormat {
pixel_format,
Expand All @@ -120,7 +119,7 @@ impl<'a, R: 'a + Read> ImageDecoder<'a> for AvifDecoder<R> {
};
let dst_format = dcp::ImageFormat {
pixel_format: dcp::PixelFormat::Rgba,
color_space: dcp::ColorSpace::Lrgb,
color_space: dcp::ColorSpace::Rgb,
num_planes: 1,
};
let (width, height) = self.dimensions();
Expand Down