Skip to content

Commit e99faf2

Browse files
committed
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]>
1 parent fcd5df5 commit e99faf2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libavcodec/vc2enc.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static av_cold void vc2_init_static_data(void)
204204
}
205205
}
206206

207-
static av_always_inline void put_vc2_ue_uint(PutBitContext *pb, uint32_t val)
207+
static av_always_inline void put_vc2_ue_uint_inline(PutBitContext *pb, uint32_t val)
208208
{
209209
uint64_t pbits = 1;
210210
int bits = 1;
@@ -222,6 +222,11 @@ static av_always_inline void put_vc2_ue_uint(PutBitContext *pb, uint32_t val)
222222
put_bits63(pb, bits, pbits);
223223
}
224224

225+
static av_noinline void put_vc2_ue_uint(PutBitContext *pb, uint32_t val)
226+
{
227+
put_vc2_ue_uint_inline(pb, val);
228+
}
229+
225230
static av_always_inline int count_vc2_ue_uint(uint32_t val)
226231
{
227232
return 2 * av_log2(val + 1) + 1;
@@ -545,7 +550,7 @@ static void encode_subband(const VC2EncContext *s, PutBitContext *pb,
545550
for (y = top; y < bottom; y++) {
546551
for (x = left; x < right; x++) {
547552
uint32_t c_abs = QUANT(FFABS(coeff[x]), q_m, q_a, q_s);
548-
put_vc2_ue_uint(pb, c_abs);
553+
put_vc2_ue_uint_inline(pb, c_abs);
549554
if (c_abs)
550555
put_bits(pb, 1, coeff[x] < 0);
551556
}

0 commit comments

Comments
 (0)