From de6e139de247833e0dd68785ed445f00cce05597 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 10 Jun 2020 18:00:43 -0700 Subject: [PATCH] Update to 0.3.3 --- .gitignore | 1 + 0001-Update-the-y4m-dependency.patch | 72 ++++++++++++++ ...ection-now-that-we-can-directly-stor.patch | 95 +++++++++++++++++++ rav1e-fix-metadata.diff | 13 --- rust-rav1e.spec | 24 ++--- sources | 2 +- 6 files changed, 178 insertions(+), 29 deletions(-) create mode 100644 0001-Update-the-y4m-dependency.patch create mode 100644 0002-Avoid-some-indirection-now-that-we-can-directly-stor.patch delete mode 100644 rav1e-fix-metadata.diff diff --git a/.gitignore b/.gitignore index 75690a4..fb2737e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /rav1e-0.3.0.crate /rav1e-0.3.1.crate +/rav1e-0.3.3.crate diff --git a/0001-Update-the-y4m-dependency.patch b/0001-Update-the-y4m-dependency.patch new file mode 100644 index 0000000..8cb7077 --- /dev/null +++ b/0001-Update-the-y4m-dependency.patch @@ -0,0 +1,72 @@ +From 900ed9f0f4a57b07315f54001981f2776f760fc3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rapha=C3=ABl=20Zumer?= +Date: Fri, 22 May 2020 16:05:54 -0400 +Subject: [PATCH 1/2] Update the y4m dependency + +(cherry picked from commit fff4653c4e17eba3df4b10fad3fa299e8806c069) +--- + src/bin/decoder/y4m.rs | 4 ++-- + src/bin/muxer/y4m.rs | 2 +- + src/bin/rav1e.rs | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/bin/decoder/y4m.rs b/src/bin/decoder/y4m.rs +index b8d843871209..623a4bcac4d9 100644 +--- a/src/bin/decoder/y4m.rs ++++ b/src/bin/decoder/y4m.rs +@@ -16,7 +16,7 @@ use crate::decoder::VideoDetails; + use crate::Frame; + use rav1e::prelude::*; + +-impl Decoder for y4m::Decoder<'_, Box> { ++impl Decoder for y4m::Decoder> { + fn get_video_details(&self) -> VideoDetails { + let width = self.get_width(); + let height = self.get_height(); +@@ -77,7 +77,7 @@ impl From for DecodeError { + y4m::Error::EOF => DecodeError::EOF, + y4m::Error::BadInput => DecodeError::BadInput, + y4m::Error::UnknownColorspace => DecodeError::UnknownColorspace, +- y4m::Error::ParseError => DecodeError::ParseError, ++ y4m::Error::ParseError(_) => DecodeError::ParseError, + y4m::Error::IoError(e) => DecodeError::IoError(e), + // Note that this error code has nothing to do with the system running out of memory, + // it means the y4m decoder has exceeded its memory allocation limit. +diff --git a/src/bin/muxer/y4m.rs b/src/bin/muxer/y4m.rs +index e26c31dc2ab0..c61ffa5daa3a 100644 +--- a/src/bin/muxer/y4m.rs ++++ b/src/bin/muxer/y4m.rs +@@ -13,7 +13,7 @@ use std::io::Write; + use std::slice; + + pub fn write_y4m_frame( +- y4m_enc: &mut y4m::Encoder<'_, Box>, rec: &Frame, ++ y4m_enc: &mut y4m::Encoder>, rec: &Frame, + y4m_details: VideoDetails, + ) { + let bytes_per_sample = if y4m_details.bit_depth > 8 { 2 } else { 1 }; +diff --git a/src/bin/rav1e.rs b/src/bin/rav1e.rs +index 704434cbba30..675171f64e27 100644 +--- a/src/bin/rav1e.rs ++++ b/src/bin/rav1e.rs +@@ -100,7 +100,7 @@ fn process_frame( + ctx: &mut Context, output_file: &mut dyn Muxer, source: &mut Source, + pass1file: Option<&mut File>, pass2file: Option<&mut File>, + buffer: &mut [u8], buf_pos: &mut usize, +- mut y4m_enc: Option<&mut y4m::Encoder<'_, Box>>, ++ mut y4m_enc: Option<&mut y4m::Encoder>>, + ) -> Result>, CliError> { + let y4m_details = source.input.get_video_details(); + let mut frame_summaries = Vec::new(); +@@ -198,7 +198,7 @@ fn do_encode( + cfg: Config, verbose: bool, mut progress: ProgressInfo, + output: &mut dyn Muxer, source: &mut Source, + pass1file_name: Option<&String>, pass2file_name: Option<&String>, +- mut y4m_enc: Option>>, ++ mut y4m_enc: Option>>, + ) -> Result<(), CliError> { + let mut ctx: Context = + cfg.new_context().map_err(|e| e.context("Invalid encoder settings"))?; +-- +2.26.2 + diff --git a/0002-Avoid-some-indirection-now-that-we-can-directly-stor.patch b/0002-Avoid-some-indirection-now-that-we-can-directly-stor.patch new file mode 100644 index 0000000..df27445 --- /dev/null +++ b/0002-Avoid-some-indirection-now-that-we-can-directly-stor.patch @@ -0,0 +1,95 @@ +From 13771f767a4cb02ddd91aa35f8391b970178a6cb Mon Sep 17 00:00:00 2001 +From: Luca Barbato +Date: Wed, 27 May 2020 17:35:58 +0200 +Subject: [PATCH 2/2] Avoid some indirection now that we can directly store the + Writer/Reader in y4m + +(cherry picked from commit d9ee06aae99b2a6c6dcb9c88da78b931610981da) +--- + src/bin/rav1e.rs | 31 +++++++++++++++---------------- + 1 file changed, 15 insertions(+), 16 deletions(-) + +diff --git a/src/bin/rav1e.rs b/src/bin/rav1e.rs +index 675171f64e27..3ae2636bc87f 100644 +--- a/src/bin/rav1e.rs ++++ b/src/bin/rav1e.rs +@@ -196,7 +196,7 @@ fn process_frame( + + fn do_encode( + cfg: Config, verbose: bool, mut progress: ProgressInfo, +- output: &mut dyn Muxer, source: &mut Source, ++ output: &mut dyn Muxer, mut source: Source, + pass1file_name: Option<&String>, pass2file_name: Option<&String>, + mut y4m_enc: Option>>, + ) -> Result<(), CliError> { +@@ -223,7 +223,7 @@ fn do_encode( + while let Some(frame_info) = process_frame( + &mut ctx, + &mut *output, +- source, ++ &mut source, + pass1file.as_mut(), + pass2file.as_mut(), + &mut buffer, +@@ -348,15 +348,14 @@ fn run() -> Result<(), error::CliError> { + .saturating_mul(2304) + .saturating_add(1024), + }; +- let mut y4m_dec = +- match y4m::Decoder::new_with_limits(&mut cli.io.input, limit) { +- Err(_) => { +- return Err(CliError::new("Could not input video. Is it a y4m file?")) +- } +- Ok(d) => d, +- }; ++ let mut y4m_dec = match y4m::Decoder::new_with_limits(cli.io.input, limit) { ++ Err(_) => { ++ return Err(CliError::new("Could not input video. Is it a y4m file?")) ++ } ++ Ok(d) => d, ++ }; + let video_info = y4m_dec.get_video_details(); +- let y4m_enc = match cli.io.rec.as_mut() { ++ let y4m_enc = match cli.io.rec { + Some(rec) => Some( + y4m::encode( + video_info.width, +@@ -462,29 +461,29 @@ fn run() -> Result<(), error::CliError> { + }; + + #[cfg(all(unix, feature = "signal-hook"))] +- let mut source = ++ let source = + Source { limit: cli.limit, input: y4m_dec, count: 0, exit_requested }; + #[cfg(not(all(unix, feature = "signal-hook")))] +- let mut source = Source { limit: cli.limit, input: y4m_dec, count: 0 }; ++ let source = Source { limit: cli.limit, input: y4m_dec, count: 0 }; + + if video_info.bit_depth == 8 { +- do_encode::>>( ++ do_encode::>>( + cfg, + cli.verbose, + progress, + &mut *cli.io.output, +- &mut source, ++ source, + cli.pass1file_name.as_ref(), + cli.pass2file_name.as_ref(), + y4m_enc, + )? + } else { +- do_encode::>>( ++ do_encode::>>( + cfg, + cli.verbose, + progress, + &mut *cli.io.output, +- &mut source, ++ source, + cli.pass1file_name.as_ref(), + cli.pass2file_name.as_ref(), + y4m_enc, +-- +2.26.2 + diff --git a/rav1e-fix-metadata.diff b/rav1e-fix-metadata.diff deleted file mode 100644 index 02f1a28..0000000 --- a/rav1e-fix-metadata.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- rav1e-0.3.1/Cargo.toml 2020-02-20T06:41:37+00:00 -+++ rav1e-0.3.1/Cargo.toml 2020-02-20T20:15:46.972264+00:00 -@@ -99,8 +99,8 @@ - optional = true - - [dependencies.image] --version = "0.22.1" --features = ["png_codec"] -+version = "0.23" -+features = ["png"] - optional = true - default-features = false - diff --git a/rust-rav1e.spec b/rust-rav1e.spec index da8eb95..c5cef0b 100644 --- a/rust-rav1e.spec +++ b/rust-rav1e.spec @@ -16,8 +16,8 @@ %global crate rav1e Name: rust-%{crate} -Version: 0.3.1 -Release: 2%{?dist} +Version: 0.3.3 +Release: 1%{?dist} Summary: Fastest and safest AV1 encoder # Upstream license specification: BSD-2-Clause @@ -26,8 +26,11 @@ License: BSD and ISC URL: https://crates.io/crates/rav1e Source: %{crates_source} # Initial patched metadata -# * Update image to 0.23, https://github.com/xiph/rav1e/pull/2178 +# * Bump y4m to 0.6, https://github.com/xiph/rav1e/pull/2321/files +# * Remove fuzzing dependencies Patch0: rav1e-fix-metadata.diff +Patch1: 0001-Update-the-y4m-dependency.patch +Patch2: 0002-Avoid-some-indirection-now-that-we-can-directly-stor.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} @@ -151,18 +154,6 @@ which use "bench" feature of "%{crate}" crate. %files -n %{name}+bench-devel %ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml -%package -n %{name}+better-panic-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+better-panic-devel %{_description} - -This package contains library source intended for building other packages -which use "better-panic" feature of "%{crate}" crate. - -%files -n %{name}+better-panic-devel -%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml - %package -n %{name}+binaries-devel Summary: %{summary} BuildArch: noarch @@ -521,6 +512,9 @@ rm -v %{buildroot}%{_libdir}/librav1e.a %endif %changelog +* Thu Jun 11 2020 Josh Stone - 0.3.3-1 +- Update to 0.3.3 + * Mon Mar 09 17:45:25 CET 2020 Robert-André Mauchin - 0.3.1-2 - Fix pkgconfig prefix path diff --git a/sources b/sources index 2e70db9..c8525c0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rav1e-0.3.1.crate) = 7e3b958ef0ac609599044f89631ce045e7a299fb4a7b6f3f5bfc3ab603befa037ba00a0973421db5eaa6a7109b3f8961febb5faa6738d3c71b98aff4b6aa4178 +SHA512 (rav1e-0.3.3.crate) = d74dc5a36d0f7d2ff1183923eef3da6b74106f63e57b6f0051b62954298fcc25416e354781a4c6effa3b6ade27d1cd8adb24265b49891201ef20c0850ef01739