From 0bccd5dc480255a3cb1d29e21026bc4e3b241c43 Mon Sep 17 00:00:00 2001 From: "Nathan E. Egge" Date: Wed, 28 Dec 2016 15:48:17 -0500 Subject: [PATCH] Use aom_reader with od_decode_pvq_codeword(). Change the od_decode_pvq_codeword() function to take an aom_reader struct instead of an od_ec_dec struct. Rename od_decode_pvq_codeword() to aom_decode_pvq_codeword(). Change-Id: I9fc2dda28a6169cb04410e822070991f3bcbc25a --- av1/decoder/pvq_decoder.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/av1/decoder/pvq_decoder.c b/av1/decoder/pvq_decoder.c index 5f6ad53bd..b57429106 100644 --- a/av1/decoder/pvq_decoder.c +++ b/av1/decoder/pvq_decoder.c @@ -27,12 +27,16 @@ #include "av1/decoder/decint.h" #include "av1/decoder/pvq_decoder.h" -static void od_decode_pvq_codeword(od_ec_dec *ec, od_pvq_codeword_ctx *ctx, +static void aom_decode_pvq_codeword(aom_reader *r, od_pvq_codeword_ctx *ctx, od_coeff *y, int n, int k) { int i; - od_decode_band_pvq_splits(ec, ctx, y, n, k, 0); +#if CONFIG_DAALA_EC + od_decode_band_pvq_splits(&r->ec, ctx, y, n, k, 0); +#else +# error "CONFIG_PVQ currently requires CONFIG_DAALA_EC." +#endif for (i = 0; i < n; i++) { - if (y[i] && od_ec_dec_bits(ec, 1, "pvq:sign")) y[i] = -y[i]; + if (y[i] && aom_read_bit(r, "pvq:sign")) y[i] = -y[i]; } } @@ -260,12 +264,8 @@ static void pvq_decode_partition(aom_reader *r, k = od_pvq_compute_k(qcg, itheta, theta, *noref, n, beta, nodesync); if (k != 0) { /* when noref==0, y is actually size n-1 */ -#if CONFIG_DAALA_EC - od_decode_pvq_codeword(&r->ec, &adapt->pvq.pvq_codeword_ctx, y, + aom_decode_pvq_codeword(r, &adapt->pvq.pvq_codeword_ctx, y, n - !*noref, k); -#else -# error "CONFIG_PVQ currently requires CONFIG_DAALA_EC." -#endif } else { OD_CLEAR(y, n);