[x265] [PATCH] Fix lowpassdct negative shift operator
Pavan Tarun Chakka Venkata
pavan.tarun at multicorewareinc.com
Fri Aug 30 10:19:26 UTC 2024
>From 465d64623a692f73f0bb87d3b14b07eba0d97c37 Mon Sep 17 00:00:00 2001
From: Pavan Tarun <pavan.tarun at multicorewareinc.com>
Date: Tue, 13 Aug 2024 15:27:44 +0530
Subject: [PATCH] Fix lowpassdct negative shift operator
---
source/common/lowpassdct.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/source/common/lowpassdct.cpp b/source/common/lowpassdct.cpp
index 0dc10a6aa..b1c75bc7c 100644
--- a/source/common/lowpassdct.cpp
+++ b/source/common/lowpassdct.cpp
@@ -58,7 +58,7 @@ static void lowPassDct8_c(const int16_t* src, int16_t*
dst, intptr_t srcStride)
}
// replace first coef with total block average
- dst[0] = totalSum >> (-1 + (X265_DEPTH - 8));
+ dst[0] = (X265_DEPTH == 8) ? (totalSum << 1) : (totalSum >>
((X265_DEPTH - 9)));
}
static void lowPassDct16_c(const int16_t* src, int16_t* dst, intptr_t
srcStride)
@@ -83,7 +83,7 @@ static void lowPassDct16_c(const int16_t* src, int16_t*
dst, intptr_t srcStride)
{
memcpy(&dst[i * 16], &coef[i * 8], 8 * sizeof(int16_t));
}
- dst[0] = static_cast<int16_t>(totalSum >> (1 + (X265_DEPTH - 8)));
+ dst[0] = static_cast<int16_t>(totalSum >> (1 + (X265_DEPTH - 8)));
}
static void lowPassDct32_c(const int16_t* src, int16_t* dst, intptr_t
srcStride)
@@ -108,7 +108,7 @@ static void lowPassDct32_c(const int16_t* src, int16_t*
dst, intptr_t srcStride)
{
memcpy(&dst[i * 32], &coef[i * 16], 16 * sizeof(int16_t));
}
- dst[0] = static_cast<int16_t>(totalSum >> (3 + (X265_DEPTH - 8)));
+ dst[0] = static_cast<int16_t>(totalSum >> (3 + (X265_DEPTH - 8)));
}
namespace X265_NS {
--
2.46.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240830/c727d9d0/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-lowpassdct-negative-shift-operator.patch
Type: application/octet-stream
Size: 1649 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240830/c727d9d0/attachment-0001.obj>
More information about the x265-devel
mailing list