diff options
author | Nathan E. Egge <unlord@xiph.org> | 2024-02-25 04:57:15 +0000 |
---|---|---|
committer | Nathan E. Egge <unlord@xiph.org> | 2024-03-08 20:16:13 +0000 |
commit | b9f5333021578345bf11dac8b7c0b18955f6e3d1 (patch) | |
tree | a4f937592d5de7d2ee7da30e799a0f1fc660cb62 | |
parent | b5b394cd6e1b49731573b55d57447fc27762ab85 (diff) | |
download | libdav1d-b9f5333021578345bf11dac8b7c0b18955f6e3d1.tar.gz |
arm64/msac: Trim C functions, saves 1392 bytes
-rw-r--r-- | src/msac.c | 34 |
1 files changed, 18 insertions, 16 deletions
@@ -57,6 +57,23 @@ static inline void ctx_refill(MsacContext *const s) { s->buf_pos = buf_pos; } +int dav1d_msac_decode_subexp(MsacContext *const s, const int ref, + const int n, unsigned k) +{ + assert(n >> k == 8); + + unsigned a = 0; + if (dav1d_msac_decode_bool_equi(s)) { + if (dav1d_msac_decode_bool_equi(s)) + k += dav1d_msac_decode_bool_equi(s) + 1; + a = 1 << k; + } + const unsigned v = dav1d_msac_decode_bools(s, k) + a; + return ref * 2 <= n ? inv_recenter(ref, v) : + n - 1 - inv_recenter(n - 1 - ref, v); +} + +#if !(HAVE_ASM && TRIM_DSP_FUNCTIONS && ARCH_AARCH64) /* Takes updated dif and range values, renormalizes them so that * 32768 <= rng < 65536 (reading more bytes from the stream into dif if * necessary), and stores them back in the decoder context. @@ -107,22 +124,6 @@ unsigned dav1d_msac_decode_bool_c(MsacContext *const s, const unsigned f) { return !ret; } -int dav1d_msac_decode_subexp(MsacContext *const s, const int ref, - const int n, unsigned k) -{ - assert(n >> k == 8); - - unsigned a = 0; - if (dav1d_msac_decode_bool_equi(s)) { - if (dav1d_msac_decode_bool_equi(s)) - k += dav1d_msac_decode_bool_equi(s) + 1; - a = 1 << k; - } - const unsigned v = dav1d_msac_decode_bools(s, k) + a; - return ref * 2 <= n ? inv_recenter(ref, v) : - n - 1 - inv_recenter(n - 1 - ref, v); -} - /* Decodes a symbol given an inverse cumulative distribution function (CDF) * table in Q15. */ unsigned dav1d_msac_decode_symbol_adapt_c(MsacContext *const s, @@ -195,6 +196,7 @@ unsigned dav1d_msac_decode_hi_tok_c(MsacContext *const s, uint16_t *const cdf) { } return tok; } +#endif void dav1d_msac_init(MsacContext *const s, const uint8_t *const data, const size_t sz, const int disable_cdf_update_flag) |