summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <[email protected]>2025-03-12 03:56:03 +0100
committerAndreas Rheinhardt <[email protected]>2025-03-12 16:58:53 +0100
commite99faf28d586209256d00618a6049f04b4dd3d74 (patch)
treeaaff663fc9b031fc7c5b422344cba68ae2d9c619
parentfcd5df59047dfd70735d870235aa24c94be8be24 (diff)
avcodec/vc2enc: Avoid excessive inlining
There is no reason to inline put_vc2_ue_uint() everywhere; only one call site is actually hot: The one in encode_subband() (which accounts for 35735040 of 35739495 calls to said function in a FATE run). Uninline all the others. Reviewed-by: Lynne <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
-rw-r--r--libavcodec/vc2enc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 1fe973f4cd..d05df64911 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -204,7 +204,7 @@ static av_cold void vc2_init_static_data(void)
}
}
-static av_always_inline void put_vc2_ue_uint(PutBitContext *pb, uint32_t val)
+static av_always_inline void put_vc2_ue_uint_inline(PutBitContext *pb, uint32_t val)
{
uint64_t pbits = 1;
int bits = 1;
@@ -222,6 +222,11 @@ static av_always_inline void put_vc2_ue_uint(PutBitContext *pb, uint32_t val)
put_bits63(pb, bits, pbits);
}
+static av_noinline void put_vc2_ue_uint(PutBitContext *pb, uint32_t val)
+{
+ put_vc2_ue_uint_inline(pb, val);
+}
+
static av_always_inline int count_vc2_ue_uint(uint32_t val)
{
return 2 * av_log2(val + 1) + 1;
@@ -545,7 +550,7 @@ static void encode_subband(const VC2EncContext *s, PutBitContext *pb,
for (y = top; y < bottom; y++) {
for (x = left; x < right; x++) {
uint32_t c_abs = QUANT(FFABS(coeff[x]), q_m, q_a, q_s);
- put_vc2_ue_uint(pb, c_abs);
+ put_vc2_ue_uint_inline(pb, c_abs);
if (c_abs)
put_bits(pb, 1, coeff[x] < 0);
}