Commit 7300db5f authored by Yushin Cho's avatar Yushin Cho

Fix pvq to use OD_ICDF when directly accessing skip_cdf

Change-Id: Iac66b12dc6b1e6c3bc3c3ae54af45a97c81e34de
parent 0481e8b6
......@@ -847,8 +847,8 @@ PVQ_SKIP_TYPE od_pvq_encode(daala_enc_ctx *enc,
int tell2;
od_rollback_buffer dc_buf;
dc_rate = -OD_LOG2((double)(skip_cdf[3] - skip_cdf[2])/
(double)(skip_cdf[2] - skip_cdf[1]));
dc_rate = -OD_LOG2((double)(OD_ICDF(skip_cdf[3]) - OD_ICDF(skip_cdf[2]))/
(double)(OD_ICDF(skip_cdf[2]) - OD_ICDF(skip_cdf[1])));
dc_rate += 1;
#if !CONFIG_ANS
......@@ -931,12 +931,12 @@ PVQ_SKIP_TYPE od_pvq_encode(daala_enc_ctx *enc,
{
double skip_rate;
if (out[0] != 0) {
skip_rate = -OD_LOG2((skip_cdf[1] - skip_cdf[0])/
(double)skip_cdf[3]);
skip_rate = -OD_LOG2((OD_ICDF(skip_cdf[1]) - OD_ICDF(skip_cdf[0]))/
(double)OD_ICDF(skip_cdf[3]));
}
else {
skip_rate = -OD_LOG2(skip_cdf[0]/
(double)skip_cdf[3]);
skip_rate = -OD_LOG2(OD_ICDF(skip_cdf[0])/
(double)OD_ICDF(skip_cdf[3]));
}
tell -= (int)floor(.5+8*skip_rate);
}
......@@ -951,8 +951,8 @@ PVQ_SKIP_TYPE od_pvq_encode(daala_enc_ctx *enc,
int tell2;
od_rollback_buffer dc_buf;
dc_rate = -OD_LOG2((double)(skip_cdf[1] - skip_cdf[0])/
(double)skip_cdf[0]);
dc_rate = -OD_LOG2((double)(OD_ICDF(skip_cdf[1]) - OD_ICDF(skip_cdf[0]))/
(double)OD_ICDF(skip_cdf[0]));
dc_rate += 1;
#if !CONFIG_ANS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment