Skip to content
Snippets Groups Projects
Commit 3dc56f93 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Simplifying arithmetic by using multiply+shift

ntt_short1:
         MEDIUM (%) HIGH (%)
    PSNR -0.002561  0.044074
 PSNRHVS  0.021798  0.082885
    SSIM  0.005793  0.082526
FASTSSIM -0.054113 -0.130136

Change-Id: Icbc38383d27acb4abd3aa30c11d7fb4e51c8ce4c
parent cf2aaba9
No related branches found
No related tags found
2 merge requests!6Rav1e 11 yushin 1,!3Rav1e 10 yushin
......@@ -20,10 +20,10 @@
int compute_level_from_index(int global_level, int gi) {
static const double dering_gains[4] = {0, .7, 1, 1.4};
static const int dering_gains[4] = {0, 11, 16, 22};
int level;
if (global_level == 0) return 0;
level = (int)floor(.5 + global_level*dering_gains[gi]);
level = (global_level*dering_gains[gi] + 8) >> 4;
return clamp(level, gi, MAX_DERING_LEVEL-1);
}
......@@ -112,7 +112,7 @@ void vp10_dering_frame(YV12_BUFFER_CONFIG *frame, VP10_COMMON *cm,
#endif
/* FIXME: This is a temporary hack that uses more conservative
deringing for chroma. */
if (pli) level = level*2/3;
if (pli) level = (level*5 + 4) >> 3;
if (sb_all_skip(cm, sbr*MI_BLOCK_SIZE, sbc*MI_BLOCK_SIZE)) level = 0;
threshold = level << coeff_shift;
od_dering(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment