Used 3 * standard_deviation in internal threshold calculation
instead of fit curve. This actually approached the algorithm
better.
For comparison, similar tests were done:
The overall psnr loss is less than before.
1. derf set:
when static-thresh = 1, psnr loss is 0.329%;
when static-thresh = 500, psnr loss is 0.970%;
2. stdhd set:
when static-thresh = 1, psnr loss is 0.922%;
when static-thresh = 500, psnr loss is 1.307%;
Similar speedup is achieved. For example,
clip bitrate static-thresh psnr time
akiyo(cif) 500 0 48.952 5.077s(50f)
akiyo 500 500 48.866 4.169s(50f)
parkjoy(1080p) 4000 0 30.388 78.20s(30f)
parkjoy 4000 500 30.367 70.85s(30f)
sunflower(1080p) 4000 0 44.402 74.55s(30f)
sunflower 4000 500 44.414 68.69s(30f)
Change-Id: Ic78833642ce1911dbbd1cb6c899a2d7e2dfcc1f3
// The encode_breakout input
unsigned int encode_breakout = x->encode_breakout << 4;
- // Adjust threshold according to dequant value. Making threshold more
- // strict when dequant is high to avoid big PSNR loss.
- if (xd->plane[0].dequant[1] < 32)
- // Initial threshold value
- thresh_ac = xd->plane[0].dequant[1] * xd->plane[0].dequant[1];
- else
- thresh_ac = (xd->plane[0].dequant[1] << 6) - 1024;
+ // Calculate threshold according to dequant value.
+ thresh_ac = (xd->plane[0].dequant[1] * xd->plane[0].dequant[1]) / 9;
+ // Set a maximum for threshold to avoid big PSNR loss in low bitrate case.
if (thresh_ac > 36000)
thresh_ac = 36000;