Re: [PATCH 2/2] media: venus: add new rate control type MBR for encoder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18/01/2024 10:59, Sachin Kumar Garg wrote:
- switch (*in) {
-		case HFI_RATE_CONTROL_OFF:
-		case HFI_RATE_CONTROL_CBR_CFR:
-		case HFI_RATE_CONTROL_CBR_VFR:
-		case HFI_RATE_CONTROL_VBR_CFR:
-		case HFI_RATE_CONTROL_VBR_VFR:
-		case HFI_RATE_CONTROL_CQ:
-			break;
-		default:
-			ret = -EINVAL;
-			break;
+		if (hfi_ver == HFI_VERSION_4XX) {
+			switch (*in) {
+			case HFI_RATE_CONTROL_OFF:
+			case HFI_RATE_CONTROL_CBR_CFR:
+			case HFI_RATE_CONTROL_CBR_VFR:
+			case HFI_RATE_CONTROL_VBR_CFR:
+			case HFI_RATE_CONTROL_VBR_VFR:
+			case HFI_RATE_CONTROL_CQ:
+			case HFI_RATE_CONTROL_MBR_CFR:
+				break;
+			default:
+				ret = -EINVAL;
+				break;
+			}
+		} else {
+			switch (*in) {
+			case HFI_RATE_CONTROL_OFF:
+			case HFI_RATE_CONTROL_CBR_CFR:
+			case HFI_RATE_CONTROL_CBR_VFR:
+			case HFI_RATE_CONTROL_VBR_CFR:
+			case HFI_RATE_CONTROL_VBR_VFR:
+			case HFI_RATE_CONTROL_CQ:
+				break;
+			default:
+				ret = -EINVAL;
+				break;
+			}

The if/else you have here seems like a needless replication

Just have =>

case HFI_RATE_CONTROL_MBR_CFR:
   if (hfi_ver == HFI_VERSION_4XX)

---
bod




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux