Restoration tips: spoRv Corollaries to the Kush Gauge™

prologue: DON’T (always) TRUST COMPANIES!

Following many HDTV and internet broadcaster advices, a “studio quality” transmission for an H.264 1080p transmission could be achieved with a bitrate of a mere 6mbps; if we use the Kush Gauge formula, we can see that this is true only if the motion factor is lower than medium… for 16/9 sport material at 29.97fps, for example, a 17.4mbps bitrate is needed!

spoRv main Corollary to the Kush Gauge™

To calculate video bitrate for a codec different from H.264, the Kush Gauge costant value should be changed accordingly to the codec used.

Other lossy video codecs (apart H.264/MPEG-4 part 10, or AVC)

Even if AVC is widely used, also thanks to the x.264 open source encoder, there are many other codecs still in use nowadays; the main ones are:

  • MPEG-2 – used in many DTV and HDTV broadcasting, in DVD and sometimes in BD
  • VC-1 – used sometimes in BD; once used in HD-DVD
  • H.265, or HEVC – new codec, used in particular for 4K/UHD

There are also many other ones – H.263 (divx/xvid), MPEG-1 (VCD), WMV9 – that are slowly replaced by newer (or better) ones.

So, let’s focus on the main three alternative codecs to AVC.

VC-1

Quality is really similar to AVC; but it has some technical features missing or worst than AVC; the constant will therefore be set at 0.075 – sligthly worse than AVC.

HEVC

New codec, still in development; few serious comparisons were made, and it seems that bitrate gain could vary from 35% to over 70%; based on past studies, it could be difficult to believe that; if an AVC encoded video had a bitrate factor of 100, HEVC could achieve the same video quality at 30… so, to be fair, I’ll put it at 60 – 40% gain – so the constant is set for the moment at 0.0482; this is obviously a value that will change in time, whenever more deep comparisons will be conducted, and newer encoders will be developed.

MPEG-2

This is the most known and valid alternative to AVC; widely used aroud the globe thanks mostly to DVD and DVB, it will be used for many years to come.

And it’s the most difficult to rate in comparison to AVC… According to many, AVC have the same quality of MPEG-2 at half the bitrate; so, if MPEG-2 bitrate factor is 100, AVC should be 50 – setting the constant at 0.14.

Is it true? Well, probably in many cases it could be, but there are so many variables that plays against or in favour of this, that a simple, unique value is difficult to set at the moment.

Comparison papers state that average AVC bitrate gain is around 55.4%; this value is mainly calculated using PSNR as main video quality valutation. But it’s known now that modern video codecs (including MPEG-2) rely on the fact that human vision could be “tricked” more easily than measurement; therefore, this value should not be taken as an absolute truth; infact, following tests results that used SSIM, when MPEG-2 and AVC have the same subjective quality, AVC gain is lower.

Some HDTV stations claims that their MPEG-2 1080i broadcasting have a perfect quality at 6/8mpbs; obviously it’s not true; even if in some cases this bitrate is more than enough – news, weather reports, soap operas, studio transmissions – it is not the case for movies, or worst for sport!

In their defense, there were great improvements in the latest year in MPEG-2 encoders, gaining more than 30% in bitrate Vs. the first encoders; plus, some technique “borrowed” from the H.264 format helped to achieve extraordinary results – in comparison to old MPEG-2 encoders, of course.

Speaking about software encoders, these is not always true; despite the fact that there were improvements, they were not so outstanding as hardware encoders of broadcast level…

So, at the end, I think it’s fair to set the constant for MPEG-2 at 0.136 – considering AVC bitrate gain between 40 and 55%: this constant could be lowered to 0.116 – setting the AVC gain at 40% – only for evaluating existing encoded material that was produced with industry level hardware encoders, like DVD, BD or HDTV material, as it’s a matter of fact that those kind of encoders work better than available software ones that we could use at home.

FINAL NOTES:

As the Kush Gauge is a “rule of thumb” and not a law, of course also these constants are approximate; nevertheless, this rule should be used with the most part of video sources, but must still be used with a grain of salt!

spoRv Corollary to the Kush Gauge™

To calculate video bitrate for a codec different from H.264, the Kush Gauge costant value should be changed accordingly to the codec used.

To obtain a good quality video:

width x height x FPS x motion rank x

  • 0.0482 for HEVC
  • 0.075 for VC-1
  • 0.136 for MPEG-2

= final bitrate in bps

or higher should be used* to obtain a good quality result.

exception: a source material, made using industry standard MPEG-2 hardware decoder, must have a bitrate* higher than

width x height x FPS x motion rank x 0.116

to be considered of good quality.

*CBR or VBR average bitrate


EXAMPLE – CHECKING QUALITY OF A GIVEN VIDEO MPEG-2 ENCODED SOURCE:

HD-NET is known to have a fairly good quality; let’s take “Escape from New York”: its actual resolution is 1920×804, FPS is 29.97fps and motion factor could be set at 2; it is interlaced, and grain is not so apparent, so:

1920 x 804 x 29.97 x 2 x 0.1160 x 1.2 x 1.0 = 112879921 = ~11.29mbps

or, according to higher constant value,

1920 x 804 x 29.97 x 2 x 0.1360 x 1.2 x 1.0 = 15100598 = ~15.1mbps

as its bitrate is 17.2mbps, its quality could be considered very good!

***

Also WOWOW, a japanese HDTV station, has a good quality; “Indiana Jones and the Temple of Doom” has an actual resolution of 1920×816, FPS is 23.976fps and motion factor could be set at 2; grain is present, so:

1920 x 816 x 23.976 x 2 x 0.1160 x 1.0 x 1.5 = 13072159, = ~13mbps

or, according to higher constant value,

1920 x 816 x 23.976 x 2 x 0.1360 x 1.0 x 1.5 = 15325980 = ~15.32mbps

as its bitrate is 19.9mbps, its quality could be considered really high!

***

“Matrix Reloaded” is a movie full of action; so a motion factor of 3 should be quite good; interlaced, no grain.

NTSC DVD:

720 x 480 x 29.97 x 3 x 0.1624 x 1.2 x 1.0 =6055485 = ~5.77mbps

as its average bitrate is 6.34mbps, the quality is a higher than needed.

PAL DVD:

720 x 576 x 25 x 3 x 0.1624 x 1.2 x 1.0 = 6061547 = ~5.78mbps

its average bitrate is 6.5mbps – slightly better than the NTSC DVD – and again higher than needed.


ADDENDUM (2016-11-09):

Chroma subsampling and bit depth: the Kush Gauge takes in account the 4:2:0 and 8 bit, but it could be possible to use the formula even with others, so I updated it accordingly, using the following data:

Chroma Subsampling 4:2:0 = 1 4:2:2 = 1.333… 4:4:4 = 2
Bit Depth 8 bit = 1 10 bit =1.25 12 bit = 1.5

Also, do remember to use the effective width or height, following the aspect ratio of display and source.

updated Kush Gauge formula:

width x height x FPS x motion rank x codec constant
x chroma subsampling x bit depth = optimal bitrate

Example: 1920×1080 2.20:1 source = 1920×872, motion rank high, codec x265, 24 frames per second, 4:2:2 10bit

1920 x 872 x 24 x 4 x 0.045 x 1.3333 x 1.25 = 12054226 = ~12mbps


ADDENDUM (2019-01-14):

Further lossy video codecs

Some other codecs are added to the previous list:

  • MPEG-1
    One of the first important and well known video codec, that started the digital video revolution with its use in the VCD standard. Not used anymore (as far as I know), still could be useful in certain cases.
    According to the “Future Performance of Video Codecs” paper, leap gain of MPEG-2 was not that great, around 2-5%; hence, I decided to set the costant for MPEG-1 at 0.143.
  • MPEG-4 part 2 (divx/xvid)
    Mainly used to compress further other compressed video sources, it is almost never used anymore, supplanted by the more efficient AVC codec; yet, it could be useful to evaluate the quality of old files.
    Always according to the “Future Performance of Video Codecs” paper, leap gain towards MPEG-2 was 20-40% for h.263, and further 8-10% of the MPEG-4 part 2 towards h.263. As AVC leap gain towards the latter was around 10-30%, I think that a safe costant for the MPEG-4 part 2 (used to compress video with the divx and xvid codecs) should be set at 0.09.

Progressive / Interlaced

As interlaced material takes more bitrate, I added this new variable, that multiply x 1.2 interlaced video (and of course progressive will be x 1.0).

Grain

Also grain implies higher bitrate; difficult to calculate this – it depends from many factors – but I think multiply x 1.5 video with grain is a right decision (and of course no grain will be x 1.0).

updated Kush Gauge formula:

width x height x FPS x motion rank x codec constant x chroma subsampling
x bit depth x grain x progressive = optimal bitrate

Example: 1920×1080 2.20:1 source = 1920×872, motion rank high, codec x265, 24 frames per second, 4:2:2 10bit, grain, interlaced

1920 x 872 x 24 x 4 x 0.045 x 1.3333 x 1.25 x 1.5 x 1.2 = 21697606,8 = ~21.7mbps


ADDENDUM (2021-12-27):

Whenever possible, the constant is calculated taking in account the bitrate saving compared to AVC constant (set to 0.07); when not available, it is calculated in comparison to HEVC constants.
When available, SSIMplus (which seems to be the best perceptual video quality measure, taking the human visual system into account) will be used, followed by SSIM, VMAF and then PSNR.
There are a lot of comparisons around the web, many with contradictory results; I tried to follow the main trends – like HEVC = -30% AVC; VP9 = -10% HEVC; AV1 = -30% HEVC; VVC = -40% HEVC – and stick with few references.

Format added:

  • disc.blue (db) – experimental niche format

Codec constants revised:

  • HEVC

Codecs added:

  • AV-1
  • VP-9
  • VVC

Display resolutions revised:

  • UHD/8K | 4320
  • UHD/4K | 2160
  • FHD/2K | 1080
  • HD | 720
  • SD PAL | 576
  • SD qHD | 540
  • SD NTSC | 480
  • SD nHD | 360
  • SIF PAL | 288
  • SD sHD | 270
  • SIF NTSC| 240

Display aspect ratio added:

  • 17:9 | 1.89:1

Picture aspect ratio added:

  • 2.00:1
  • 1.89:1 | 17:9
  • 2.37:1 | 21:9

Grain added:

  • grain synthesis

ADDENDUM (2022-08-30):

Revised codec constants, taking in account the “power of 0.75” rule for old codecs only – MPG1, MPEG2, DIVX, VC-1, AVC, MVC – using previous values as base for FullHD, and then bitrate savings according to the following sources:

Codec constants revised:

  • AOMedia AV1
    0.0465 (SD) ― 0.0407 (720p) ― 0.0342 (1080p) ― 0.0174 (2160p) ― 0.0123 (4320p)
  • Google  VP9
    0.0616 (SD) ― 0.0481 (720p) ― 0.0388 (1080p) ― 0.0213 (2160p) ― 0.0168 (4320p)
  • h.266 | VVC
    0.0403 (SD) ― 0.0315 (720p) ― 0.0254 (1080p) ― 0.0155 (2160p) ― 0.0110 (4320p)
  • h.265 | HEVC
    0.0683 (SD) ― 0.0534 (720p) ― 0.0430 (1080p) ― 0.0263 (2160p) ― 0.0186 (4320p)
  • h.264 | AVC
    0.0980 (SD) ― 0.0840 (720p) ― 0.0700 (1080p) ― 0.0495 (2160p) ― 0.0350 (4320p)
  • h.264 | MVC
    0.1575 (SD) ― 0.1350 (720p) ― 0.1125 (1080p) ― 0.0796 (2160p) ― 0.0563 (4320p)
  • h.263 | MPEG-4 part 2
    0.1260 (SD) ― 0.1080 (720p) ― 0.0900 (1080p) ― 0.0637 (2160p) ― 0.0450 (4320p)
  • h.262 | MPEG-2 (hardware encoder)
    0.1624 (SD) ― 0.1392 (720p) ― 0.1160 (1080p) ― 0.0821 (2160p) ― 0.0580 (4320p)
  • h.262 | MPEG-2 (software encoder)
    0.1904 (SD) ― 0.1632 (720p) ― 0.1360 (1080p) ― 0.0962 (2160p) ― 0.0680 (4320p)
  • h.261 | MPEG-1
    0.2002 (SD) ― 0.1716 (720p) ― 0.1430 (1080p) ― 0.1012 (2160p) ― 0.0715 (4320p)
  • VC-1  | WMV3
    0.1050 (SD) ― 0.0900 (720p) ― 0.0750 (1080p) ― 0.0531 (2160p) ― 0.0375 (4320p)

Frames per second added:

  • 100fps
  • 119.88fps
  • 120fps

Dynamic range added:

  • SDR
  • HLG
  • HDR10
  • HDR10+
  • Dolby Vision

ADDENDUM (2022-09-18):

Super Resolution added:

  • none
  • 8:9
  • 8:10
  • 8:11
  • 8:12
  • 8:13
  • 8:14
  • 8:15
  • 8:16

Picture aspect ratio name revised:

  • 1.33:1 | 4:3
  • 1.66:1 | European wide screen
  • 1.78:1 | 16:9
  • 1.85:1 | DCI flat
  • 1.89:1 | DCI full
  • 2.00:1 | Univisium
  • 2.20:1 | Todd-AO
  • 2.35:1 | Cinemascope
  • 2.37:1 | Ultrawide Cinema
  • 2.39:1 | DCI scope
  • 2.55:1 | Cinemascope 55
  • 2.66:1 | Cinerama
  • 2.76:1 | Ultra Panavision 70

ADDENDUM (2022-09-23):

One format added:

  • DCP | Digital Cinema Package

One codec added:

  • JP2K | JPEG 2000

Added max bitrate for each format, deleted VBR results, improved compliance checks.


ADDENDUM (2023-04-23):

Stereoscopy added:

  • 2D
  • 3D | frame sequential
  • 3D | full over-under
  • 3D | full side-by-side
  • 3D | half over-under
  • 3D | half side-by-side
  • 3D | anaglyph

One Display Aspect Ratio added:

  • 21:9 | 2.37:1

using the following resolutions:

  • UHD|8K – 10240×4320
  • UHD|4K –   5120×2160
  • FHD|2K –   2560×1080

ADDENDUM (2023-07-09):

One codec added:

  • AOMEDIA AV2 (experimental)

To find out the constants to use, I’ve used the Codec War comparison tool, and averaged the result, getting a 22.6% bitrate gain compared to AV1 (AOM and SVT-AV1 encoders), so the new constants are:

AOMedia AV2 (experimental)
0.0360 (SD) ― 0.0315 (720p) ― 0.0265 (1080p) ― 0.0135 (2160p) ― 0.0095 (4320p)


The spoRv Gauge™ formula:

codec constant ✕ resolution ✕ super resolution ✕ frame rate ✕ scan mode
✕ chroma subsampling ✕ bit depth ✕ grain ✕ dynamic range ✕ motion rank
= optimal bitrate


TAKE ME TO THE SPORV GAUGE CALCULATOR!


References:

The Kush Gauge – H.264 FOR THE REST OF US (page 21)
SUBJECTIVE QUALITY ASSESSMENT OF THE EMERGING AVC/H.264 VIDEO CODING STANDARD
EBU Technical Report 008 – HDTV Contribution Codecs
Using AVC/H.264 and H.265 expertise to boost MPEG-2 efficiency
BBC Guidelines – Technical and Delivery Standards for Worldwide
Comparison of the Coding Efficiency of Video Coding Standards
Future Performance of Video Codecs
AVC, HEVC, VP9, AVS2 or AV1? — A Comparative Study of State-of-the-art Video Encoders on 4K Videos
AV1 Has Arrived: Comparing Codecs from AOMedia, Visionular, and Intel/Netflix
AV1 vs HEVC: Perceptual Evaluation of Video Encoders
CodecWar.com – Codecs Comparison