aom: Disable the check on 0 target_bitrate in validate_config

From e99100ea09e6b7079ffd667013e22729c028b271 Mon Sep 17 00:00:00 2001
From: Marco Paniconi <[EMAIL REDACTED]>
Date: Thu, 1 Feb 2024 19:36:32 +0000
Subject: [PATCH] Disable the check on 0 target_bitrate in validate_config

This is causing failures in latest libaom roll here:
https://webrtc-review.googlesource.com/c/src/+/337284

That check was added as part of this CL:
https://aomedia-review.googlesource.com/c/aom/+/186601

Revert that part for now to enable roll to proceed.

Some webrtc tests are creating the encoder with 0 target_bitrate
and then assigning non-zero bitrate before encoding the first
frames, so the check in validate_config() was causing
InitEncode to fail.

Bug: aomedia:3523

Change-Id: I8462ffba1d80219272d6225e572e047184337cd7
(cherry picked from commit 0cee19cfc8b69661a4c808624d36def44450f14e)
---
 av1/av1_cx_iface.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 0ad6f439e4..1175a32ef6 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -623,11 +623,6 @@ static aom_codec_err_t allocate_and_set_string(const char *src,
       ERROR(#memb " out of range [" #lo ".." #hi "]"); \
   } while (0)
 
-#define RANGE_CHECK_LO(p, memb, lo)                                     \
-  do {                                                                  \
-    if (!((p)->memb >= (lo))) ERROR(#memb " out of range [" #lo "..]"); \
-  } while (0)
-
 #define RANGE_CHECK_HI(p, memb, hi)                                     \
   do {                                                                  \
     if (!((p)->memb <= (hi))) ERROR(#memb " out of range [.." #hi "]"); \
@@ -667,7 +662,6 @@ static aom_codec_err_t validate_config(aom_codec_alg_priv_t *ctx,
   RANGE_CHECK(cfg, g_timebase.num, 1, cfg->g_timebase.den);
   RANGE_CHECK_HI(cfg, g_profile, MAX_PROFILES - 1);
 
-  RANGE_CHECK_LO(cfg, rc_target_bitrate, 1);
   RANGE_CHECK_HI(cfg, rc_max_quantizer, 63);
   RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer);
   RANGE_CHECK_BOOL(extra_cfg, lossless);