Simplify conditions in aom_img_plane_width/height
Simplify the if conditions in aom_img_plane_width() and
aom_img_plane_height().
Change-Id: I81fa7484ca706be33142824365df4dcd65e3bc8b
(cherry picked from commit 6b4246129daaec35a19a5854369403a49bfd7840)
diff --git a/aom/src/aom_image.c b/aom/src/aom_image.c
index f8d4c78..1d3b7df 100644
--- a/aom/src/aom_image.c
+++ b/aom/src/aom_image.c
@@ -304,15 +304,15 @@
}
int aom_img_plane_width(const aom_image_t *img, int plane) {
- if (plane > 0 && img->x_chroma_shift > 0)
- return (img->d_w + 1) >> img->x_chroma_shift;
+ if (plane > 0)
+ return (img->d_w + img->x_chroma_shift) >> img->x_chroma_shift;
else
return img->d_w;
}
int aom_img_plane_height(const aom_image_t *img, int plane) {
- if (plane > 0 && img->y_chroma_shift > 0)
- return (img->d_h + 1) >> img->y_chroma_shift;
+ if (plane > 0)
+ return (img->d_h + img->y_chroma_shift) >> img->y_chroma_shift;
else
return img->d_h;
}