Skip to content

Commit

Permalink
Merge 213ad77 into 392be13
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Nov 1, 2018
2 parents 392be13 + 213ad77 commit 0cf076a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ use std::sync::Arc;
// TODO: use the num crate?
#[derive(Clone, Copy, Debug)]
#[repr(C)]
pub struct Ratio {
pub num: usize,
pub den: usize
pub struct Rational {
pub num: u64,
pub den: u64
}

impl Ratio {
pub fn new(num: usize, den: usize) -> Self {
Ratio { num, den }
impl Rational {
pub fn new(num: u64, den: u64) -> Self {
Rational { num, den }
}
}

Expand Down Expand Up @@ -56,7 +56,7 @@ pub struct FrameInfo {
#[derive(Clone, Copy, Debug)]
pub struct Config {
pub frame_info: FrameInfo,
pub timebase: Ratio,
pub timebase: Rational,
pub enc: EncoderConfig
}

Expand Down Expand Up @@ -95,7 +95,7 @@ impl Config {
pub struct Context {
fi: FrameInvariants,
seq: Sequence,
// timebase: Ratio,
// timebase: Rational,
frame_count: u64,
idx: u64,
frame_q: BTreeMap<u64, Option<Arc<Frame>>>, // packet_q: VecDeque<Packet>
Expand Down
2 changes: 1 addition & 1 deletion src/bin/rav1e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn main() {

let cfg = Config {
frame_info: FrameInfo { width, height, bit_depth, chroma_sampling },
timebase: Ratio::new(framerate.den, framerate.num),
timebase: Rational::new(framerate.den as u64, framerate.num as u64),
enc
};

Expand Down
2 changes: 1 addition & 1 deletion src/bin/rav1repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn main() {

let cfg = Config {
frame_info: FrameInfo { width, height, bit_depth, chroma_sampling },
timebase: Ratio::new(framerate.den, framerate.num),
timebase: Rational::new(framerate.den as u64, framerate.num as u64),
enc
};
let mut ctx = cfg.new_context();
Expand Down
2 changes: 1 addition & 1 deletion src/test_encode_decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn setup_encoder(

let cfg = Config {
frame_info: FrameInfo { width: w, height: h, bit_depth, chroma_sampling },
timebase: Ratio::new(1, 1000),
timebase: Rational::new(1, 1000),
enc
};

Expand Down

0 comments on commit 0cf076a

Please sign in to comment.