Commit 34f2b74d authored by Rupert Swarbrick's avatar Rupert Swarbrick Committed by Debargha Mukherjee
Browse files

Correct scaling in av1_loop_restoration_corners_in_sb

I'd got the scaling backwards. This gets it right and adds a comment
explaining the calculation.

Change-Id: Ife2913700cc73996c09b702b394832799c449a8c
parent cf842ad2
......@@ -1680,8 +1680,16 @@ int av1_loop_restoration_corners_in_sb(const struct AV1Common *cm, int plane,
const int mi_rel_col1 = mi_rel_col0 + mi_size_wide[bsize];
#if CONFIG_FRAME_SUPERRES
const int mi_to_num = MI_SIZE * SCALE_NUMERATOR;
const int denom = cm->superres_scale_denominator;
// Write m for the relative mi column or row, D for the superres denominator
// and N for the superres numerator. If u is the upscaled (called "unscaled"
// elsewhere) pixel offset then we can write the downscaled pixel offset in
// two ways as:
//
// MI_SIZE * m = N / D u
//
// from which we get u = D * MI_SIZE * m / N
const int mi_to_num = MI_SIZE * cm->superres_scale_denominator;
const int denom = SCALE_NUMERATOR;
#else
const int mi_to_num = MI_SIZE;
const int denom = 1;
......
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