Skip to content

Commit

Permalink
Version 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shssoichiro committed Nov 8, 2022
1 parent 5dbc305 commit 2f91ec1
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Version 0.8.0

- Upgrade clap to 4.0
- Add frame limit arg to API
- [Breaking] Change `progress_callback` to take a &dyn Fn
- Misc improvements including some speedups from rav1e
- Update to Rust edition 2021

## Version 0.7.2

- Bump to the final release of rav1e 0.5
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "av-scenechange"
version = "0.7.2"
version = "0.8.0"
authors = ["Josh Holmer <[email protected]>"]
edition = "2018"
edition = "2021"
description = "Estimates frames in a video where a scenecut would be ideal"
license = "MIT"
repository = "https://github.com/rust-av/av-scenechange"
Expand Down
45 changes: 45 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
#![deny(clippy::all)]
#![warn(clippy::nursery)]
#![warn(clippy::pedantic)]
#![allow(clippy::cast_possible_truncation)]
#![allow(clippy::cast_possible_wrap)]
#![allow(clippy::cast_precision_loss)]
#![allow(clippy::cast_sign_loss)]
#![allow(clippy::default_trait_access)]
#![allow(clippy::inconsistent_struct_constructor)]
#![allow(clippy::inline_always)]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::redundant_closure_for_method_calls)]
#![allow(clippy::similar_names)]
#![allow(clippy::struct_excessive_bools)]
#![allow(clippy::use_self)]
#![warn(clippy::clone_on_ref_ptr)]
#![warn(clippy::create_dir)]
#![warn(clippy::dbg_macro)]
#![warn(clippy::default_numeric_fallback)]
#![warn(clippy::exit)]
#![warn(clippy::filetype_is_file)]
#![warn(clippy::float_cmp_const)]
#![warn(clippy::if_then_some_else_none)]
#![warn(clippy::lossy_float_literal)]
#![warn(clippy::map_err_ignore)]
#![warn(clippy::mem_forget)]
#![warn(clippy::mod_module_files)]
#![warn(clippy::multiple_inherent_impl)]
#![warn(clippy::pattern_type_mismatch)]
#![warn(clippy::rc_buffer)]
#![warn(clippy::rc_mutex)]
#![warn(clippy::rest_pat_in_fully_bound_structs)]
#![warn(clippy::same_name_method)]
#![warn(clippy::str_to_string)]
#![warn(clippy::string_to_string)]
#![warn(clippy::undocumented_unsafe_blocks)]
#![warn(clippy::unnecessary_self_imports)]
#![warn(clippy::unneeded_field_pattern)]
#![warn(clippy::use_debug)]
#![warn(clippy::verbose_file_reads)]

mod y4m;

use std::{
Expand Down Expand Up @@ -112,6 +153,10 @@ pub fn new_detector<R: Read, T: Pixel>(
/// is analyzed. Arguments passed in will be, in order, the number of frames
/// analyzed, and the number of keyframes detected. This is generally useful
/// for displaying progress, etc.
///
/// # Panics
///
/// - If `opts.lookahead_distance` is 0.
#[allow(clippy::needless_pass_by_value)]
pub fn detect_scene_changes<R: Read, T: Pixel>(
dec: &mut Decoder<R>,
Expand Down
44 changes: 44 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
#![deny(clippy::all)]
#![warn(clippy::nursery)]
#![warn(clippy::pedantic)]
#![allow(clippy::cast_possible_truncation)]
#![allow(clippy::cast_possible_wrap)]
#![allow(clippy::cast_precision_loss)]
#![allow(clippy::cast_sign_loss)]
#![allow(clippy::default_trait_access)]
#![allow(clippy::inconsistent_struct_constructor)]
#![allow(clippy::inline_always)]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::redundant_closure_for_method_calls)]
#![allow(clippy::similar_names)]
#![allow(clippy::struct_excessive_bools)]
#![allow(clippy::use_self)]
#![warn(clippy::clone_on_ref_ptr)]
#![warn(clippy::create_dir)]
#![warn(clippy::dbg_macro)]
#![warn(clippy::default_numeric_fallback)]
#![warn(clippy::exit)]
#![warn(clippy::filetype_is_file)]
#![warn(clippy::float_cmp_const)]
#![warn(clippy::if_then_some_else_none)]
#![warn(clippy::lossy_float_literal)]
#![warn(clippy::map_err_ignore)]
#![warn(clippy::mem_forget)]
#![warn(clippy::mod_module_files)]
#![warn(clippy::multiple_inherent_impl)]
#![warn(clippy::pattern_type_mismatch)]
#![warn(clippy::rc_buffer)]
#![warn(clippy::rc_mutex)]
#![warn(clippy::rest_pat_in_fully_bound_structs)]
#![warn(clippy::same_name_method)]
#![warn(clippy::str_to_string)]
#![warn(clippy::string_to_string)]
#![warn(clippy::undocumented_unsafe_blocks)]
#![warn(clippy::unnecessary_self_imports)]
#![warn(clippy::unneeded_field_pattern)]
#![warn(clippy::use_debug)]
#![warn(clippy::verbose_file_reads)]
// For binary-only crates
#![allow(clippy::missing_errors_doc)]
#![allow(clippy::missing_panics_doc)]

use std::{
fs::File,
io::{self, BufReader, Read, Write},
Expand Down
11 changes: 7 additions & 4 deletions src/y4m.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::io::Read;

use rav1e::prelude::{ChromaSamplePosition, ChromaSampling, Frame, Pixel, Rational};

pub(crate) fn get_video_details<R: Read>(dec: &y4m::Decoder<R>) -> VideoDetails {
pub fn get_video_details<R: Read>(dec: &y4m::Decoder<R>) -> VideoDetails {
let width = dec.get_width();
let height = dec.get_height();
let color_space = dec.get_colorspace();
Expand All @@ -24,9 +24,12 @@ pub(crate) fn get_video_details<R: Read>(dec: &y4m::Decoder<R>) -> VideoDetails
const fn map_y4m_color_space(
color_space: y4m::Colorspace,
) -> (ChromaSampling, ChromaSamplePosition) {
use y4m::Colorspace::*;
use ChromaSamplePosition::*;
use ChromaSampling::*;
use y4m::Colorspace::{
C420jpeg, C420mpeg2, C420p10, C420p12, C420paldv, C422p10, C422p12, C444p10, C444p12,
Cmono, C420, C422, C444,
};
use ChromaSamplePosition::{Colocated, Unknown, Vertical};
use ChromaSampling::{Cs400, Cs420, Cs422, Cs444};
match color_space {
Cmono => (Cs400, Unknown),
C420jpeg | C420paldv => (Cs420, Unknown),
Expand Down

0 comments on commit 2f91ec1

Please sign in to comment.