From 4bf4bfcbdd1ea3a37a0082c26b52a6e97c1c8c86 Mon Sep 17 00:00:00 2001 From: tilpner Date: Fri, 21 Apr 2023 14:03:27 +0200 Subject: [PATCH] fix(codec/encoder): remove motion estimation settings, removed in 5.0 --- src/codec/encoder/mod.rs | 3 -- src/codec/encoder/motion_estimation.rs | 53 -------------------------- src/codec/encoder/video.rs | 17 +-------- 3 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 src/codec/encoder/motion_estimation.rs diff --git a/src/codec/encoder/mod.rs b/src/codec/encoder/mod.rs index ff9a028..88e4ea8 100644 --- a/src/codec/encoder/mod.rs +++ b/src/codec/encoder/mod.rs @@ -10,9 +10,6 @@ pub use self::audio::Encoder as Audio; pub mod subtitle; pub use self::subtitle::Encoder as Subtitle; -pub mod motion_estimation; -pub use self::motion_estimation::MotionEstimation; - pub mod comparison; pub use self::comparison::Comparison; diff --git a/src/codec/encoder/motion_estimation.rs b/src/codec/encoder/motion_estimation.rs deleted file mode 100644 index de79899..0000000 --- a/src/codec/encoder/motion_estimation.rs +++ /dev/null @@ -1,53 +0,0 @@ -use libc::c_int; - -#[derive(Eq, PartialEq, Clone, Copy, Debug)] -#[cfg_attr(feature = "serde", derive(serde_derive::Serialize, serde_derive::Deserialize))] -#[cfg_attr(feature = "serde", serde(crate = "serde_", rename_all = "kebab-case"))] -pub enum MotionEstimation { - Zero, - Full, - Log, - Phods, - Epzs, - X1, - Hex, - Umh, - Iter, - Tesa, -} - -impl From for MotionEstimation { - fn from(value: c_int) -> MotionEstimation { - match value { - 1 => MotionEstimation::Zero, - 2 => MotionEstimation::Full, - 3 => MotionEstimation::Log, - 4 => MotionEstimation::Phods, - 5 => MotionEstimation::Epzs, - 6 => MotionEstimation::X1, - 7 => MotionEstimation::Hex, - 8 => MotionEstimation::Umh, - 9 => MotionEstimation::Iter, - 10 => MotionEstimation::Tesa, - - _ => MotionEstimation::Zero, - } - } -} - -impl Into for MotionEstimation { - fn into(self) -> c_int { - match self { - MotionEstimation::Zero => 1, - MotionEstimation::Full => 2, - MotionEstimation::Log => 3, - MotionEstimation::Phods => 4, - MotionEstimation::Epzs => 5, - MotionEstimation::X1 => 6, - MotionEstimation::Hex => 7, - MotionEstimation::Umh => 8, - MotionEstimation::Iter => 9, - MotionEstimation::Tesa => 10, - } - } -} diff --git a/src/codec/encoder/video.rs b/src/codec/encoder/video.rs index 1811440..d7279e7 100644 --- a/src/codec/encoder/video.rs +++ b/src/codec/encoder/video.rs @@ -10,7 +10,7 @@ use crate::{ codec::{traits, Context}, color, ffi::*, - format, frame, packet, Dictionary, Error, Rational, + format, Dictionary, Error, Rational, }; pub struct Video(pub Super); @@ -119,14 +119,6 @@ impl Video { unsafe { format::Pixel::from((*self.as_ptr()).pix_fmt) } } - #[inline] - #[cfg(feature = "ff_api_motion_est")] - pub fn set_motion_estimation(&mut self, value: MotionEstimation) { - unsafe { - (*self.as_mut_ptr()).me_method = value.into(); - } - } - #[inline] pub fn set_max_b_frames(&mut self, value: usize) { unsafe { @@ -246,13 +238,6 @@ impl Video { } } - #[inline] - pub fn set_pre_me(&mut self, value: MotionEstimation) { - unsafe { - (*self.as_mut_ptr()).pre_me = value.into(); - } - } - #[inline] pub fn set_me_pre_comparison(&mut self, value: Comparison) { unsafe {