Simplify conditional expressions
Convert
if (A) {
foo;
} else {
if (B || C)
foo;
}
to the equivalent
if (A || B || C) {
foo;
}
Bug: aomedia:3534
Change-Id: Ie2fd39a07b9d7e6b1193b2baeac338ee86c10180
(cherry picked from commit 8c56649d7962c47ddc554684e060e33214bb668c)
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 878f69f..07b6ffe 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -2588,21 +2588,17 @@
if (cpi->ref_frame_flags & av1_ref_frame_flag_list[GOLDEN_FRAME]) {
const YV12_BUFFER_CONFIG *const ref =
get_ref_frame_yv12_buf(cm, GOLDEN_FRAME);
- if (ref == NULL) {
+ if (ref == NULL || ref->y_crop_width != cm->width ||
+ ref->y_crop_height != cm->height) {
cpi->ref_frame_flags ^= AOM_GOLD_FLAG;
- } else {
- if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height)
- cpi->ref_frame_flags ^= AOM_GOLD_FLAG;
}
}
if (cpi->ref_frame_flags & av1_ref_frame_flag_list[ALTREF_FRAME]) {
const YV12_BUFFER_CONFIG *const ref =
get_ref_frame_yv12_buf(cm, ALTREF_FRAME);
- if (ref == NULL) {
+ if (ref == NULL || ref->y_crop_width != cm->width ||
+ ref->y_crop_height != cm->height) {
cpi->ref_frame_flags ^= AOM_ALT_FLAG;
- } else {
- if (ref->y_crop_width != cm->width || ref->y_crop_height != cm->height)
- cpi->ref_frame_flags ^= AOM_ALT_FLAG;
}
}
}