Refactor:rename functions to avoid double negation
Double negation is not easy to read and follow. For example:
if (!av1_superres_unscaled) {}.
Rename following function names to avoid double negation:
av1_superres_unscaled --> av1_superres_scaled
av1_resize_unscaled --> av1_resize_scaled
av1_frame_unscaled --> av1_frame_scaled
Change-Id: I50438639fd3a214c99d722cf7fa59a823fd4ea9c
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 507190f..10dca6d 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -856,14 +856,14 @@
ubufs[new_uidx].ref_count++;
}
-// Returns 1 if a frame is unscaled and 0 otherwise.
-static INLINE int av1_resize_unscaled(const AV1_COMMON *cm) {
- return cm->superres_upscaled_width == cm->render_width &&
- cm->superres_upscaled_height == cm->render_height;
+// Returns 1 if a frame is scaled and 0 otherwise.
+static INLINE int av1_resize_scaled(const AV1_COMMON *cm) {
+ return !(cm->superres_upscaled_width == cm->render_width &&
+ cm->superres_upscaled_height == cm->render_height);
}
-static INLINE int av1_frame_unscaled(const AV1_COMMON *cm) {
- return av1_superres_unscaled(cm) && av1_resize_unscaled(cm);
+static INLINE int av1_frame_scaled(const AV1_COMMON *cm) {
+ return !av1_superres_scaled(cm) && av1_resize_scaled(cm);
}
#ifdef __cplusplus