Unverified Commit 23535876 authored by Yushin Cho's avatar Yushin Cho Committed by GitHub

Don't use tx-domain distortion with top-down partition (#760)

parent e3243957
......@@ -1879,7 +1879,7 @@ fn encode_partition_bottomup(seq: &Sequence, fi: &FrameInvariants, fs: &mut Fram
};
let spmvs = &pmvs[pmv_idx];
let mode_decision = rdo_mode_decision(seq, fi, fs, cw, bsize, bo, spmvs).part_modes[0].clone();
let mode_decision = rdo_mode_decision(seq, fi, fs, cw, bsize, bo, spmvs, false).part_modes[0].clone();
let (mode_luma, mode_chroma) = (mode_decision.pred_mode_luma, mode_decision.pred_mode_chroma);
let cfl = mode_decision.pred_cfl_params;
{
......@@ -2060,7 +2060,7 @@ fn encode_partition_topdown(seq: &Sequence, fi: &FrameInvariants, fs: &mut Frame
let spmvs = &pmvs[pmv_idx];
// Make a prediction mode decision for blocks encoded with no rdo_partition_decision call (e.g. edges)
rdo_mode_decision(seq, fi, fs, cw, bsize, bo, spmvs).part_modes[0].clone()
rdo_mode_decision(seq, fi, fs, cw, bsize, bo, spmvs, false).part_modes[0].clone()
};
let mut mode_luma = part_decision.pred_mode_luma;
......
......@@ -342,7 +342,7 @@ impl Default for EncodingSettings {
pub fn rdo_mode_decision(
seq: &Sequence, fi: &FrameInvariants, fs: &mut FrameState,
cw: &mut ContextWriter, bsize: BlockSize, bo: &BlockOffset,
pmvs: &[Option<MotionVector>]
pmvs: &[Option<MotionVector>], needs_rec: bool
) -> RDOOutput {
let mut best = EncodingSettings::default();
......@@ -488,11 +488,11 @@ pub fn rdo_mode_decision(
tx_type,
mode_context,
mv_stack,
true
!needs_rec
);
let cost = wr.tell_frac() - tell;
let rd = if fi.use_tx_domain_distortion {
let rd = if fi.use_tx_domain_distortion && !needs_rec {
compute_tx_rd_cost(
fi,
fs,
......@@ -845,7 +845,7 @@ pub fn rdo_partition_decision(
.part_modes
.get(0)
.unwrap_or(
&rdo_mode_decision(seq, fi, fs, cw, bsize, bo, spmvs).part_modes[0]
&rdo_mode_decision(seq, fi, fs, cw, bsize, bo, spmvs, false).part_modes[0]
).clone();
child_modes.push(mode_decision);
}
......@@ -880,7 +880,7 @@ pub fn rdo_partition_decision(
.iter().zip(pmv_idxs)
.map(|(&offset, pmv_idx)| {
rdo_mode_decision(seq, fi, fs, cw, subsize, &offset,
&pmvs[pmv_idx])
&pmvs[pmv_idx], true)
.part_modes[0]
.clone()
}).collect::<Vec<_>>()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment