Update to 0.3.3

This commit is contained in:
Josh Stone 2020-06-10 18:00:43 -07:00
parent 36dec122db
commit de6e139de2
6 changed files with 178 additions and 29 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/rav1e-0.3.0.crate
/rav1e-0.3.1.crate
/rav1e-0.3.3.crate

View File

@ -0,0 +1,72 @@
From 900ed9f0f4a57b07315f54001981f2776f760fc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Zumer?= <rzumer@tebako.net>
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<dyn Read>> {
+impl Decoder for y4m::Decoder<Box<dyn Read>> {
fn get_video_details(&self) -> VideoDetails {
let width = self.get_width();
let height = self.get_height();
@@ -77,7 +77,7 @@ impl From<y4m::Error> 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<T: Pixel>(
- y4m_enc: &mut y4m::Encoder<'_, Box<dyn Write>>, rec: &Frame<T>,
+ y4m_enc: &mut y4m::Encoder<Box<dyn Write>>, rec: &Frame<T>,
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<T: Pixel, D: Decoder>(
ctx: &mut Context<T>, output_file: &mut dyn Muxer, source: &mut Source<D>,
pass1file: Option<&mut File>, pass2file: Option<&mut File>,
buffer: &mut [u8], buf_pos: &mut usize,
- mut y4m_enc: Option<&mut y4m::Encoder<'_, Box<dyn Write>>>,
+ mut y4m_enc: Option<&mut y4m::Encoder<Box<dyn Write>>>,
) -> Result<Option<Vec<FrameSummary>>, CliError> {
let y4m_details = source.input.get_video_details();
let mut frame_summaries = Vec::new();
@@ -198,7 +198,7 @@ fn do_encode<T: Pixel, D: Decoder>(
cfg: Config, verbose: bool, mut progress: ProgressInfo,
output: &mut dyn Muxer, source: &mut Source<D>,
pass1file_name: Option<&String>, pass2file_name: Option<&String>,
- mut y4m_enc: Option<y4m::Encoder<'_, Box<dyn Write>>>,
+ mut y4m_enc: Option<y4m::Encoder<Box<dyn Write>>>,
) -> Result<(), CliError> {
let mut ctx: Context<T> =
cfg.new_context().map_err(|e| e.context("Invalid encoder settings"))?;
--
2.26.2

View File

@ -0,0 +1,95 @@
From 13771f767a4cb02ddd91aa35f8391b970178a6cb Mon Sep 17 00:00:00 2001
From: Luca Barbato <lu_zero@gentoo.org>
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<T: Pixel, D: Decoder>(
fn do_encode<T: Pixel, D: Decoder>(
cfg: Config, verbose: bool, mut progress: ProgressInfo,
- output: &mut dyn Muxer, source: &mut Source<D>,
+ output: &mut dyn Muxer, mut source: Source<D>,
pass1file_name: Option<&String>, pass2file_name: Option<&String>,
mut y4m_enc: Option<y4m::Encoder<Box<dyn Write>>>,
) -> Result<(), CliError> {
@@ -223,7 +223,7 @@ fn do_encode<T: Pixel, D: Decoder>(
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::<u8, y4m::Decoder<'_, Box<dyn Read>>>(
+ do_encode::<u8, y4m::Decoder<Box<dyn Read>>>(
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::<u16, y4m::Decoder<'_, Box<dyn Read>>>(
+ do_encode::<u16, y4m::Decoder<Box<dyn Read>>>(
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

View File

@ -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

View File

@ -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 <jistone@redhat.com> - 0.3.3-1
- Update to 0.3.3
* Mon Mar 09 17:45:25 CET 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0.3.1-2
- Fix pkgconfig prefix path

View File

@ -1 +1 @@
SHA512 (rav1e-0.3.1.crate) = 7e3b958ef0ac609599044f89631ce045e7a299fb4a7b6f3f5bfc3ab603befa037ba00a0973421db5eaa6a7109b3f8961febb5faa6738d3c71b98aff4b6aa4178
SHA512 (rav1e-0.3.3.crate) = d74dc5a36d0f7d2ff1183923eef3da6b74106f63e57b6f0051b62954298fcc25416e354781a4c6effa3b6ade27d1cd8adb24265b49891201ef20c0850ef01739