[x265] [PATCH] Fix lowpassdct negative shift operator

Karam Singh karam.singh at multicorewareinc.com
Sun Sep 1 11:30:43 UTC 2024


This patch has been pushed to the master branch.
*__________________________*
*Karam Singh*
*Ph.D. IIT Guwahati*
Senior Software (Video Coding) Engineer
Mobile: +91 8011279030
Block 9A, 6th floor, DLF Cyber City
Manapakkam, Chennai 600 089


On Fri, Aug 30, 2024 at 3:49 PM Pavan Tarun Chakka Venkata <
pavan.tarun at multicorewareinc.com> wrote:

> 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
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240901/64201aab/attachment-0001.htm>


More information about the x265-devel mailing list