Skip to content

Commit

Permalink
Remove assert in guess_frame_subtypes
Browse files Browse the repository at this point in the history
According to derf, it shouldn't be there.
  • Loading branch information
YaLTeR committed Sep 4, 2019
1 parent 74d90cb commit c8dcb80
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2390,7 +2390,6 @@ impl<T: Pixel> ContextInner<T> {
prev_keyframe_nframes = nframes_total;
// We do not currently use forward keyframes, so they should always
// end the current TU.
debug_assert!(self.inter_cfg.get_show_frame(idx_in_group_output));
output_frameno += 1;
ntus += 1;
}
Expand Down
57 changes: 57 additions & 0 deletions src/api/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1670,3 +1670,60 @@ fn max_key_frame_interval_zero() {
let res: Result<Context<u8>, _> = config.new_context();
assert!(res.is_err());
}

#[test]
fn guess_frame_subtypes_assert() {
let config = Config {
enc: EncoderConfig {
width: 1,
height: 1,
bit_depth: 8,
chroma_sampling: ChromaSampling::Cs420,
chroma_sample_position: ChromaSamplePosition::Unknown,
pixel_range: PixelRange::Limited,
color_description: None,
mastering_display: None,
content_light: None,
still_picture: false,
time_base: Rational { num: 1, den: 25 },
min_key_frame_interval: 0,
max_key_frame_interval: 1,
reservoir_frame_delay: None,
low_latency: false,
quantizer: 100,
min_quantizer: 0,
bitrate: 16384,
tune: Tune::Psychovisual,
tile_cols: 0,
tile_rows: 0,
tiles: 0,
rdo_lookahead_frames: 40,
speed_settings: SpeedSettings {
min_block_size: BlockSize::BLOCK_64X64,
multiref: false,
fast_deblock: true,
reduced_tx_set: true,
tx_domain_distortion: true,
tx_domain_rate: false,
encode_bottomup: false,
rdo_tx_decision: false,
prediction_modes: PredictionModesSetting::Simple,
include_near_mvs: false,
no_scene_detection: true,
diamond_me: true,
cdef: true,
quantizer_rdo: false,
use_satd_subpel: false,
},
show_psnr: false,
train_rdo: false,
},
threads: 1,
};

let mut ctx: Context<u8> = config.new_context().unwrap();
ctx.send_frame(ctx.new_frame()).unwrap();
ctx.flush();

ctx.receive_packet().unwrap();
}

0 comments on commit c8dcb80

Please sign in to comment.