Computes the Bjontegaard metric for two set of RD points. The Bjontegaard metric enables the comparison of RD curves in terms of the average PSNR improvement or the average per cent bitrate saving. Although the original Bjontegaard metric works with 4 RD points, this script is able to handle RD curves with an arbitrary set of points. Look the embedded test_bjontegaard file for an example of usage.
I found some flaws in your implementation and corrected them:
Lines 40 & 41:
min_int = max([min(lR1); min(lR2)]);
max_int = min([max(lR1); max(lR2)]);
Lines 59 & 60:
min_int = max([min(PSNR1); min(PSNR2)]);
max_int = min([max(PSNR1); max(PSNR2)]);
You can read about this in this book:
High Efficiency Video Coding, Mathias Wien, page 96
Inspired: Bjontegaard metric calculation (BD-PSNR)
Create scripts with code, output, and formatted text in a single executable document.