overlay: Add support for rotator downscale
Add support for rotator downscale. This is enabled from 8994 onwards
Constraints:
--Downscale should be a power of 2, max upto 32
--Both directions should have equal downscale
--{src_w, src_h} mod downscale = 0
--No BWC
--No Interlaced video support
The rotator's destination rect is modified to reflect the presence of
downscale. Any downscale calcs should be done only after adjusting
crop to meet rotator's requirements.
Smaller downscale is used if we need to chop off any more than 1
line or pixel.
Change-Id: Id07d62fefa3213035f16cca49497800716484a95
diff --git a/liboverlay/overlayUtils.h b/liboverlay/overlayUtils.h
index 530377b..4a989f6 100644
--- a/liboverlay/overlayUtils.h
+++ b/liboverlay/overlayUtils.h
@@ -379,8 +379,6 @@
int getMdpFormat(int format);
int getMdpFormat(int format, bool tileEnabled);
int getHALFormat(int mdpFormat);
-int getDownscaleFactor(const int& src_w, const int& src_h,
- const int& dst_w, const int& dst_h);
void getDecimationFactor(const int& src_w, const int& src_h,
const int& dst_w, const int& dst_h, uint8_t& horzDeci,
uint8_t& vertDeci);
@@ -399,6 +397,10 @@
T c(a); a=b; b=c;
}
+template<typename T> inline T max(T a, T b) { return (a > b) ? a : b; }
+
+template<typename T> inline T min(T a, T b) { return (a < b) ? a : b; }
+
inline int alignup(int value, int a) {
//if align = 0, return the value. Else, do alignment.
return a ? ((((value - 1) / a) + 1) * a) : value;