Commit 509934a5 authored by Rupert Swarbrick's avatar Rupert Swarbrick Committed by Debargha Mukherjee

Get tile sizes right at right/bottom of frame

The previous code cropped the width and height correctly when
CONFIG_FRAME_SUPERRES was enabled and we were doing scaling, but
didn't do so the rest of the time.


Change-Id: Ic0ced49b743431504b4ee54b20af69181dcae633
parent 6d1d85c6
......@@ -259,15 +259,21 @@ AV1PixelRect av1_get_tile_rect(const TileInfo *tile_info, const AV1_COMMON *cm,
av1_calculate_unscaled_superres_size(&r.right, &r.bottom,
// Make sure we don't fall off the bottom-right of the frame.
const int plane_width = (cm->superres_upscaled_width + ss_x) >> ss_x;
const int plane_height = (cm->superres_upscaled_height + ss_y) >> ss_y;
r.right = AOMMIN(r.right, plane_width);
r.bottom = AOMMIN(r.bottom, plane_height);
const int frame_w = cm->superres_upscaled_width;
const int frame_h = cm->superres_upscaled_height;
const int frame_w = cm->width;
const int frame_h = cm->height;
const int plane_w = (frame_w + ss_x) >> ss_x;
const int plane_h = (frame_h + ss_y) >> ss_y;
// Make sure we don't fall off the bottom-right of the frame.
r.right = AOMMIN(r.right, plane_w);
r.bottom = AOMMIN(r.bottom, plane_h);
return r;
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