Skip to content

Commit

Permalink
Eliminate final usage of Arc::get_mut on rec
Browse files Browse the repository at this point in the history
  • Loading branch information
shssoichiro committed Jun 6, 2022
1 parent 6f56ac5 commit a1a00c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/api/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,9 @@ impl<T: Pixel> ContextInner<T> {

if self.rc_state.needs_trial_encode(fti) {
let mut trial_fs = frame_data.fs.clone();
// We need to modify the rec during the trial,
// so we need to clone the inner contents.
trial_fs.rec = Arc::new((*frame_data.fs.rec).clone());
let data =
encode_frame(&frame_data.fi, &mut trial_fs, &self.inter_cfg);
self.rc_state.update_state(
Expand Down
2 changes: 1 addition & 1 deletion src/tiling/tile_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl<'a, T: Pixel> TileStateMut<'a, T> {
input_hres: &fs.input_hres,
input_qres: &fs.input_qres,
deblock: &fs.deblock,
rec: TileMut::new(Arc::make_mut(&mut fs.rec), luma_rect),
rec: TileMut::new(Arc::get_mut(&mut fs.rec).unwrap(), luma_rect),
qc: Default::default(),
segmentation: &fs.segmentation,
restoration: TileRestorationStateMut::new(
Expand Down

0 comments on commit a1a00c3

Please sign in to comment.