Roly's Blog

Whatever will be, will be, the future's not ours to see.

0%

#BD-Rate (Bjontegaard Delta-Rate Metric)

RD curve pic_1

The RD curve represents the encode performance: the higher the metric value for the lower bitrate, the better. The Bjontegaard Delta-Rate (BD Rate) metric provides a way to estimate the average difference between two RD-curves. BD Rate metric can be used to compare and choose the encoder or configuration.

Rate-Distortion Plot

Assume there are two video encoders to compare in terms of compression efficiency. Here by the term “compression efficiency” the following two measures are assumed:

  1. Bitrate (bits per second) of a compressed video sequence.
  2. Video distortion introduced by lossy compression.

Let us assume we have four different compression results for each of the two encoders (A and B). Marking the bitrate on the x-axis and PSNR distortion on the y-axis the rate-distortion plot can be drawn as shown in the figure below.

Rate-Distortion Compression Efficiency Points of Two Hypothetical Video Encoders.

Rate-Distortion Curve

One way to compare the efficiency in numerical form is to fix one measurement and compare by another. Let’s say, we want to compare bit rate savings at a certain PSNR distortion level of 38 dB, but available measure points are not exactly there. We need to interpolate the rate-distortion curve to get an approximation of the bit rate at the target distortion level (see figure below).

img

With the help of interpolation we now have two RD curves instead of points. By measuring the distance between the two curves at the certain distortion level the bitrate “savings” of the one encoder compared to the other one at this distortion level can be compared numerically.

BD Rate Metric

BD Rate Metric is a method for calculating the average difference between two rate-distortion (RD) curves. In other words, to compare two encoders (or two encoding configurations) the area between the two RD-curves must be divided by the integration interval as shown below.

img

In a comparison between Encoder A and Encoder B a negative BD Rate would mean Encoder A provides better compression efficiency (lower bitrate at a similar visual quality level). A positive value would indicate inferior compression efficiency.

If PSNR distortion value is compared using the bitrate as the basis of integration, the metric is called BD-PSNR and is measured in dB. In the same way you get BD-SSIM, BD-VMAF.

Reference

https://vicuesoft.com/glossary/term/rd_curve/

https://medium.com/innovation-labs-blog/bjontegaard-delta-rate-metric-c8c82c1bc42c

https://arxiv.org/pdf/2401.04039

https://netflixtechblog.com/performance-comparison-of-video-coding-standards-an-adaptive-streaming-perspective-d45d0183ca95

https://streaminglearningcenter.com/encoding/compute-bd-rate-functions.html

https://www.spiedigitallibrary.org/conference-proceedings-of-spie/11842/118420T/Towards-much-better-SVT-AV1-quality-cycles-tradeoffs-for-VOD/10.1117/12.2595598.full#_=_

The Video Buffering Verifier (VBV) is a theoretical MPEG video buffer model, used to ensure that an encoded video stream can be correctly buffered, and played back at the decoder device.

Read more »

有时,直接调试应用程序是不可能的。在这些情况下,可以在应用程序终止时收集有关该应用程序的信息,然后对其进行分析。识别应用程序中崩溃问题的最有效方法之一是通过分析 Core dump文件。

Read more »

从 API 级别 27 (Android O MR 1) 开始,Android NDK 支持 Address Sanitizer(也称为 ASan)。ASan 是一种基于编译器的快速检测工具,用于检测C/C++代码中的内存错误。ASan 的 CPU 开销约为 2 倍,代码大小开销在 50% 到 2 倍之间,并且内存开销很大。

注意: ASan在Android 平台上不支持检测内存泄漏!!!

Read more »

编译和链接是在C/C++软件开发过程中经常发生的两个非常基本的过程,为什么C/C++源代码分割成头文件和源文件? 编译器是如何看到每个部分的? 这如何影响编译和链接? 还有许多类似的问题,无论是在设计C/C++应用程序、为其实现新特性、试图解决bug(尤其是某些奇怪的bug),还是试图让C和C/C++代码协同工作,了解如何编译和链接将节省大量时间。

Read more »

如果你使用git 作版本控制工具,那么你可以轻松的使用android studio / Intellij IDEA 的.gitignore 插件来生成一份可以将这些文件排除在外的.gitignore 过滤清单。

Read more »

​ 消息驱动模式是android提供的用来更新UI的一套机制,即消息处理的机制,类似于Windows的消息机制,所有的外部来的按键消息、触屏消息、各种系统Intent、广播等都转化为内部消息,然后在主线程中分发处理。在Windows的消息处理模型中,存在一个系统消息队列,这个队列是整个进程的核心,几乎所有的动作都要转化成消息,然后放在队列中,消息的处理只能在主线程中完成。Android的消息处理则不太一样。Android没有全局的消息队列,消息队列是和某个线程关联在一起的。每个线程最多有一个消息队列,消息的取出和处理在线程中完成。

Read more »