[x265] [PATCH 1 of 4 RFC] dct: rename g_entropyStateBits to x265_entropyStateBits
Steve Borho
steve at borho.org
Sat Jun 6 19:42:37 CEST 2015
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1433609557 18000
# Sat Jun 06 11:52:37 2015 -0500
# Node ID 3ea5a868899c87517409e40ade3736453920ad33
# Parent 23a4157ffc4a35dbc3c4d521b80387a99d6a6a20
dct: rename g_entropyStateBits to x265_entropyStateBits
actually, use the X265_NS namespace prefix; this fixes link conflicts when the
8bit and 10bit libraries are linked together.
diff -r 23a4157ffc4a -r 3ea5a868899c source/common/contexts.h
--- a/source/common/contexts.h Fri Jun 05 21:26:27 2015 -0500
+++ b/source/common/contexts.h Sat Jun 06 11:52:37 2015 -0500
@@ -102,7 +102,7 @@
#define OFF_TQUANT_BYPASS_FLAG_CTX (OFF_TRANSFORMSKIP_FLAG_CTX + 2 * NUM_TRANSFORMSKIP_FLAG_CTX)
#define MAX_OFF_CTX_MOD (OFF_TQUANT_BYPASS_FLAG_CTX + NUM_TQUANT_BYPASS_FLAG_CTX)
-extern "C" const uint32_t g_entropyStateBits[128];
+extern "C" const uint32_t PFX(entropyStateBits)[128];
namespace X265_NS {
// private namespace
diff -r 23a4157ffc4a -r 3ea5a868899c source/common/dct.cpp
--- a/source/common/dct.cpp Fri Jun 05 21:26:27 2015 -0500
+++ b/source/common/dct.cpp Sat Jun 06 11:52:37 2015 -0500
@@ -853,7 +853,7 @@
//encodeBin(sig, baseCtx[ctxSig]);
const uint32_t mstate = baseCtx[ctxSig];
const uint32_t mps = mstate & 1;
- const uint32_t stateBits = g_entropyStateBits[mstate ^ sig];
+ const uint32_t stateBits = PFX(entropyStateBits)[mstate ^ sig];
uint32_t nextState = (stateBits >> 24) + mps;
if ((mstate ^ sig) == 1)
nextState = sig;
diff -r 23a4157ffc4a -r 3ea5a868899c source/common/x86/pixel-util8.asm
--- a/source/common/x86/pixel-util8.asm Fri Jun 05 21:26:27 2015 -0500
+++ b/source/common/x86/pixel-util8.asm Sat Jun 06 11:52:37 2015 -0500
@@ -71,7 +71,7 @@
cextern pb_64
cextern hmul_16p
cextern trans8_shuf
-cextern_naked g_entropyStateBits
+cextern_naked private_prefix %+ _entropyStateBits
;-----------------------------------------------------------------------------
; void getResidual(pixel *fenc, pixel *pred, int16_t *residual, intptr_t stride)
@@ -6387,7 +6387,7 @@
;
; const uint32_t mstate = baseCtx[ctxSig];
; const uint32_t mps = mstate & 1;
-; const uint32_t stateBits = g_entropyStateBits[mstate ^ sig];
+; const uint32_t stateBits = x265_entropyStateBits[mstate ^ sig];
; uint32_t nextState = (stateBits >> 24) + mps;
; if ((mstate ^ sig) == 1)
; nextState = sig;
@@ -6452,14 +6452,14 @@
; m0 - Zigzag
; m1 - sigCtx
; {m3,m2} - abs(coeff)
- ; r0 - g_entropyStateBits
+ ; r0 - x265_entropyStateBits
; r1 - baseCtx
; r2 - scanPosSigOff
; r3 - absCoeff
; r4 - nonZero
; r5 - scanFlagMask
; r6 - sum
- lea r0, [g_entropyStateBits]
+ lea r0, [private_prefix %+ _entropyStateBits]
mov r1, r6mp
xor r6d, r6d
xor r4d, r4d
@@ -6474,7 +6474,7 @@
; ctxSig = cnt & posZeroMask;
; const uint32_t mstate = baseCtx[ctxSig];
; const uint32_t mps = mstate & 1;
-; const uint32_t stateBits = g_entropyStateBits[mstate ^ sig];
+; const uint32_t stateBits = x265_entropyStateBits[mstate ^ sig];
; uint32_t nextState = (stateBits >> 24) + mps;
; if ((mstate ^ sig) == 1)
; nextState = sig;
@@ -6499,7 +6499,7 @@
mov r10d, r9d
and r10d, 1 ; mps = mstate & 1
xor r9d, r8d ; r9 = mstate ^ sig
- add r6d, [r0 + r9 * 4] ; sum += g_entropyStateBits[mstate ^ sig]
+ add r6d, [r0 + r9 * 4] ; sum += x265_entropyStateBits[mstate ^ sig]
add r10b, byte [r0 + r9 * 4 + 3] ; nextState = (stateBits >> 24) + mps
cmp r9b, 1
cmove r10d, r8d
@@ -6525,7 +6525,7 @@
mov r4d, r5d
xor r5d, r3d ; r0 = mstate ^ sig
and r3d, 1 ; mps = mstate & 1
- add r6d, [r0 + r5 * 4] ; sum += g_entropyStateBits[mstate ^ sig]
+ add r6d, [r0 + r5 * 4] ; sum += x265_entropyStateBits[mstate ^ sig]
add r3b, [r0 + r5 * 4 + 3] ; nextState = (stateBits >> 24) + mps
cmp r5b, 1
cmove r3d, r4d
diff -r 23a4157ffc4a -r 3ea5a868899c source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp Fri Jun 05 21:26:27 2015 -0500
+++ b/source/encoder/entropy.cpp Sat Jun 06 11:52:37 2015 -0500
@@ -2232,7 +2232,7 @@
}
// [8 24] --> [stateMPS BitCost], [stateLPS BitCost]
-extern "C" const uint32_t g_entropyStateBits[128] =
+extern "C" const uint32_t PFX(entropyStateBits)[128] =
{
// Corrected table, most notably for last state
0x02007B23, 0x000085F9, 0x040074A0, 0x00008CBC, 0x06006EE4, 0x02009354, 0x080067F4, 0x04009C1B,
More information about the x265-devel
mailing list