Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan E. Egge <unlord@xiph.org>2018-11-19 16:56:01 +0300
committerRonald S. Bultje <rsbultje@gmail.com>2019-01-25 17:30:24 +0300
commit45d4fde63754a685a6ba69c012b6f4db528664a0 (patch)
tree3bcbad049d91c85639e5529825e46fb8721c686c /src/recon_tmpl.c
parent250204038a3799d2a2377b9be5a87c5d4213e9ba (diff)
Add msac_decode_bool_equi() function
When decoding an equi-probable bit (e.g. prob = 1/2) we can simplify the decode function.
Diffstat (limited to 'src/recon_tmpl.c')
-rw-r--r--src/recon_tmpl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/recon_tmpl.c b/src/recon_tmpl.c
index 17f5d4a..e4c725d 100644
--- a/src/recon_tmpl.c
+++ b/src/recon_tmpl.c
@@ -50,8 +50,8 @@ static unsigned read_golomb(MsacContext *const msac) {
int len = 0;
unsigned val = 1;
- while (!msac_decode_bool(msac, EC_BOOL_EPROB) && len < 32) len++;
- while (len--) val = (val << 1) | msac_decode_bool(msac, EC_BOOL_EPROB);
+ while (!msac_decode_bool_equi(msac) && len < 32) len++;
+ while (len--) val = (val << 1) | msac_decode_bool_equi(msac);
return val - 1;
}
@@ -152,7 +152,7 @@ static int decode_coefs(Dav1dTileContext *const t,
unsigned mask = eob >> 1;
if (eob_hi_bit) eob |= mask;
for (mask >>= 1; mask; mask >>= 1) {
- const int eob_bit = msac_decode_bool(&ts->msac, EC_BOOL_EPROB);
+ const int eob_bit = msac_decode_bool_equi(&ts->msac);
if (eob_bit) eob |= mask;
}
if (dbg)
@@ -231,7 +231,7 @@ static int decode_coefs(Dav1dTileContext *const t,
dc_sign = sign ? 0 : 2;
dq = (dq_tbl[0] * qm_tbl[0] + 16) >> 5;
} else {
- sign = msac_decode_bool(&ts->msac, EC_BOOL_EPROB);
+ sign = msac_decode_bool_equi(&ts->msac);
if (dbg)
printf("Post-sign[%d=%d=%d]: r=%d\n", i, rc, sign, ts->msac.rng);
dq = (dq_tbl[1] * qm_tbl[rc] + 16) >> 5;