[x265] [PATCH] Fix indentation issues
Pavan Tarun Chakka Venkata
pavan.tarun at multicorewareinc.com
Tue Nov 12 15:05:52 UTC 2024
>From abb3db6e09bc2cbe4509162a253165dda9f0a2c2 Mon Sep 17 00:00:00 2001
From: PavanTarun <pavan.tarun at multicorewareinc.com>
Date: Tue, 12 Nov 2024 20:19:13 +0530
Subject: [PATCH] Fix indentation issues
---
source/encoder/encoder.cpp | 2 +-
source/encoder/sei.cpp | 94 +++++++++++++++++++-------------------
2 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp
index 1fbaf3228..ce33e8f9b 100644
--- a/source/encoder/encoder.cpp
+++ b/source/encoder/encoder.cpp
@@ -6167,7 +6167,7 @@ void Encoder::readUserSeiFile(x265_sei_payload&
seiMsg, int curPoc)
char *base64Encode = strtok(NULL, "\n");
int base64EncodeLength = (int)strlen(base64Encode);
char* decodedString;
- decodedString = (char*)malloc(sizeof(char) * (base64EncodeLength));
+ decodedString = (char*)malloc(sizeof(char) * (base64EncodeLength));
char *base64Decode = SEI::base64Decode(base64Encode,
base64EncodeLength, decodedString);
if (nalType == NAL_UNIT_PREFIX_SEI && (!strcmp(prefix, "PREFIX")))
{
diff --git a/source/encoder/sei.cpp b/source/encoder/sei.cpp
index 85cd7894a..6f95bf3e6 100644
--- a/source/encoder/sei.cpp
+++ b/source/encoder/sei.cpp
@@ -94,52 +94,52 @@ void SEI::setSize(uint32_t size)
char* SEI::base64Decode(char encodedString[], int base64EncodeLength,
char* decodedString)
{
- int i, j, k = 0;
- // stores the bitstream
- int bitstream = 0;
- // countBits stores the current number of bits in bitstream
- int countBits = 0;
-
- for (i = 0; i < base64EncodeLength; i += 4)
- {
- bitstream = 0;
- countBits = 0;
-
- for (j = 0; j < 4; j++)
- {
- if (encodedString[i + j] != '=')
- {
- int value = 0;
- if (encodedString[i + j] >= 'A' && encodedString[i + j] <= 'Z')
- value = encodedString[i + j] - 'A';
- else if (encodedString[i + j] >= 'a' && encodedString[i + j] <= 'z')
- value = encodedString[i + j] - 'a' + 26;
- else if (encodedString[i + j] >= '0' && encodedString[i + j] <= '9')
- value = encodedString[i + j] - '0' + 52;
- else if (encodedString[i + j] == '+')
- value = 62;
- else if (encodedString[i + j] == '/')
- value = 63;
- else
- value = 0;
-
- bitstream = (bitstream << 6) | value;
- countBits += 6;
- }
- }
-
- while (countBits >= 8)
- {
- countBits -= 8;
- decodedString[k++] = (bitstream >> countBits) & 0xFF;
- }
- }
-
- if (k < base64EncodeLength)
- {
- decodedString[k] = '\0';
- }
-
- return decodedString;
+ int i, j, k = 0;
+ // stores the bitstream
+ int bitstream = 0;
+ // countBits stores the current number of bits in bitstream
+ int countBits = 0;
+
+ for (i = 0; i < base64EncodeLength; i += 4)
+ {
+ bitstream = 0;
+ countBits = 0;
+
+ for (j = 0; j < 4; j++)
+ {
+ if (encodedString[i + j] != '=')
+ {
+ int value = 0;
+ if (encodedString[i + j] >= 'A' && encodedString[i + j] <=
'Z')
+ value = encodedString[i + j] - 'A';
+ else if (encodedString[i + j] >= 'a' && encodedString[i +
j] <= 'z')
+ value = encodedString[i + j] - 'a' + 26;
+ else if (encodedString[i + j] >= '0' && encodedString[i +
j] <= '9')
+ value = encodedString[i + j] - '0' + 52;
+ else if (encodedString[i + j] == '+')
+ value = 62;
+ else if (encodedString[i + j] == '/')
+ value = 63;
+ else
+ value = 0;
+
+ bitstream = (bitstream << 6) | value;
+ countBits += 6;
+ }
+ }
+
+ while (countBits >= 8)
+ {
+ countBits -= 8;
+ decodedString[k++] = (bitstream >> countBits) & 0xFF;
+ }
+ }
+
+ if (k < base64EncodeLength)
+ {
+ decodedString[k] = '\0';
+ }
+
+ return decodedString;
}
--
2.41.0.windows.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20241112/b0c2fe4a/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-indentation-issues.patch
Type: application/octet-stream
Size: 4020 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20241112/b0c2fe4a/attachment-0001.obj>
More information about the x265-devel
mailing list