Move C implementations of DCT functions into the X265_NS namespace, and remove the static modifier from their declarations, so that they can be referenced from external code when linking to libx265. --- source/common/dct.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/source/common/dct.cpp b/source/common/dct.cpp index b102b6e31..a0b977f4a 100644 --- a/source/common/dct.cpp +++ b/source/common/dct.cpp @@ -439,7 +439,8 @@ static void partialButterfly4(const int16_t* src, int16_t* dst, int shift, int l } } -static void dst4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +namespace X265_NS { +void dst4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 1 + X265_DEPTH - 8; const int shift_2nd = 8; @@ -456,7 +457,7 @@ static void dst4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) fastForwardDst(coef, dst, shift_2nd); } -static void dct4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +void dct4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 1 + X265_DEPTH - 8; const int shift_2nd = 8; @@ -473,7 +474,7 @@ static void dct4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) partialButterfly4(coef, dst, shift_2nd, 4); } -static void dct8_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +void dct8_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 2 + X265_DEPTH - 8; const int shift_2nd = 9; @@ -490,7 +491,7 @@ static void dct8_c(const int16_t* src, int16_t* dst, intptr_t srcStride) partialButterfly8(coef, dst, shift_2nd, 8); } -static void dct16_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +void dct16_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 3 + X265_DEPTH - 8; const int shift_2nd = 10; @@ -507,7 +508,7 @@ static void dct16_c(const int16_t* src, int16_t* dst, intptr_t srcStride) partialButterfly16(coef, dst, shift_2nd, 16); } -static void dct32_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +void dct32_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 4 + X265_DEPTH - 8; const int shift_2nd = 11; @@ -524,7 +525,7 @@ static void dct32_c(const int16_t* src, int16_t* dst, intptr_t srcStride) partialButterfly32(coef, dst, shift_2nd, 32); } -static void idst4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idst4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -541,7 +542,7 @@ static void idst4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) } } -static void idct4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idct4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -558,7 +559,7 @@ static void idct4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) } } -static void idct8_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idct8_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -575,7 +576,7 @@ static void idct8_c(const int16_t* src, int16_t* dst, intptr_t dstStride) } } -static void idct16_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idct16_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -592,7 +593,7 @@ static void idct16_c(const int16_t* src, int16_t* dst, intptr_t dstStride) } } -static void idct32_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idct32_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -608,6 +609,7 @@ static void idct32_c(const int16_t* src, int16_t* dst, intptr_t dstStride) memcpy(&dst[i * dstStride], &block[i * 32], 32 * sizeof(int16_t)); } } +} // namespace X265_NS static void dequant_normal_c(const int16_t* quantCoef, int16_t* coef, int num, int scale, int shift) { -- 2.42.1
>From 9495c2d54b39f14f436b767ec8193adada77143b Mon Sep 17 00:00:00 2001 Message-ID: <9495c2d54b39f14f436b767ec8193adada77143b.1724771133.git.hari.lim...@arm.com> In-Reply-To: <cover.1724771133.git.hari.lim...@arm.com> References: <cover.1724771133.git.hari.lim...@arm.com> From: Hari Limaye <hari.lim...@arm.com> Date: Tue, 13 Feb 2024 23:06:34 +0000 Subject: [PATCH v2 1/9] Move C DCT implementations into X265_NS Move C implementations of DCT functions into the X265_NS namespace, and remove the static modifier from their declarations, so that they can be referenced from external code when linking to libx265. --- source/common/dct.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/source/common/dct.cpp b/source/common/dct.cpp index b102b6e31..a0b977f4a 100644 --- a/source/common/dct.cpp +++ b/source/common/dct.cpp @@ -439,7 +439,8 @@ static void partialButterfly4(const int16_t* src, int16_t* dst, int shift, int l } } -static void dst4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +namespace X265_NS { +void dst4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 1 + X265_DEPTH - 8; const int shift_2nd = 8; @@ -456,7 +457,7 @@ static void dst4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) fastForwardDst(coef, dst, shift_2nd); } -static void dct4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +void dct4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 1 + X265_DEPTH - 8; const int shift_2nd = 8; @@ -473,7 +474,7 @@ static void dct4_c(const int16_t* src, int16_t* dst, intptr_t srcStride) partialButterfly4(coef, dst, shift_2nd, 4); } -static void dct8_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +void dct8_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 2 + X265_DEPTH - 8; const int shift_2nd = 9; @@ -490,7 +491,7 @@ static void dct8_c(const int16_t* src, int16_t* dst, intptr_t srcStride) partialButterfly8(coef, dst, shift_2nd, 8); } -static void dct16_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +void dct16_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 3 + X265_DEPTH - 8; const int shift_2nd = 10; @@ -507,7 +508,7 @@ static void dct16_c(const int16_t* src, int16_t* dst, intptr_t srcStride) partialButterfly16(coef, dst, shift_2nd, 16); } -static void dct32_c(const int16_t* src, int16_t* dst, intptr_t srcStride) +void dct32_c(const int16_t* src, int16_t* dst, intptr_t srcStride) { const int shift_1st = 4 + X265_DEPTH - 8; const int shift_2nd = 11; @@ -524,7 +525,7 @@ static void dct32_c(const int16_t* src, int16_t* dst, intptr_t srcStride) partialButterfly32(coef, dst, shift_2nd, 32); } -static void idst4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idst4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -541,7 +542,7 @@ static void idst4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) } } -static void idct4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idct4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -558,7 +559,7 @@ static void idct4_c(const int16_t* src, int16_t* dst, intptr_t dstStride) } } -static void idct8_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idct8_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -575,7 +576,7 @@ static void idct8_c(const int16_t* src, int16_t* dst, intptr_t dstStride) } } -static void idct16_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idct16_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -592,7 +593,7 @@ static void idct16_c(const int16_t* src, int16_t* dst, intptr_t dstStride) } } -static void idct32_c(const int16_t* src, int16_t* dst, intptr_t dstStride) +void idct32_c(const int16_t* src, int16_t* dst, intptr_t dstStride) { const int shift_1st = 7; const int shift_2nd = 12 - (X265_DEPTH - 8); @@ -608,6 +609,7 @@ static void idct32_c(const int16_t* src, int16_t* dst, intptr_t dstStride) memcpy(&dst[i * dstStride], &block[i * 32], 32 * sizeof(int16_t)); } } +} // namespace X265_NS static void dequant_normal_c(const int16_t* quantCoef, int16_t* coef, int num, int scale, int shift) { -- 2.42.1
_______________________________________________ x265-devel mailing list x265-devel@videolan.org https://mailman.videolan.org/listinfo/x265-devel