Files
ffmpeg-the-third/src/codec/encoder/motion_estimation.rs
Tadas Barzdžius 0bcd4550b8 *: format code with rustfmt and fix clippy suggestions
* Add avformat_close_input call to clean up AVFormantContext
* Format code with rustfmt
* Fix clippy lint double_parens
* Fix clippy lint deref_addrof
* Fix clippy lint identity_conversion
* Fix clippy lint match_ref_pats
* Fix clippy lint cast_lossless
* Fix clippy lint cmp_null
* Fix clippy lint clone_on_ref_ptr
* Fix clippy lint map_clone
* Fix clippy lint needless_borrow
* Fix clippy lint needless_pass_by_value
* Fix clippy lints for examples
* Fix clippy lint unused_io_amount
* Fix clippy lint new_without_default
* Ignore inline_always clippy lint
* Add vim temp files to .gitignore
2018-04-10 16:06:42 +02:00

52 lines
1.3 KiB
Rust

use libc::c_int;
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
pub enum MotionEstimation {
Zero,
Full,
Log,
Phods,
Epzs,
X1,
Hex,
Umh,
Iter,
Tesa,
}
impl From<c_int> 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<c_int> 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,
}
}
}