Commit 8301018d authored by Urvang Joshi's avatar Urvang Joshi
Browse files

Superres: Fix writing/reading of denominator.

Range is 9 to 16, and not 8 to 15.

BUG=aomedia:972

Change-Id: I7de6cea16a6377d9cd3b2af73efc841b42dad1fa
parent 693ae522
......@@ -748,7 +748,7 @@ typedef enum ATTRIBUTE_PACKED {
#if CONFIG_FRAME_SUPERRES
#define SUPERRES_SCALE_BITS 3
#define SUPERRES_SCALE_DENOMINATOR_MIN 8
#define SUPERRES_SCALE_DENOMINATOR_MIN (SCALE_NUMERATOR + 1)
#endif // CONFIG_FRAME_SUPERRES
#if CONFIG_LPF_DIRECT
......
......@@ -3680,6 +3680,9 @@ static void write_superres_scale(const AV1_COMMON *const cm,
aom_wb_write_bit(wb, 0); // no scaling
} else {
aom_wb_write_bit(wb, 1); // scaling, write scale factor
assert(cm->superres_scale_denominator >= SUPERRES_SCALE_DENOMINATOR_MIN);
assert(cm->superres_scale_denominator <
SUPERRES_SCALE_DENOMINATOR_MIN + (1 << SUPERRES_SCALE_BITS));
aom_wb_write_literal(
wb, cm->superres_scale_denominator - SUPERRES_SCALE_DENOMINATOR_MIN,
SUPERRES_SCALE_BITS);
......
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