Video Compression

VideoNerd

Download and Build

To download HM SW type the following:

git clone https://vcgit.hhi.fraunhofer.de/jvet/HM.git

then enter to folder ‘HM’ and make the directory ‘build’ by typing ‘mkdir build’

then enter to the build directory and create Visual Studio Solution (i use the version 2019):

cmake .. -G "Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM=x64

Open HM.sln in the ‘build’ directory and build the solution, TAppEncoder.exe and TAppDecoder.exe are created in

\HM\bin\vs16\msvc-19.29\x86_64\release

 

Encoding Examples

Example 1: encode raw CIF-resolution video as IPP (i.e. no B frames, corresponds to low-latency) with the bitrate 200Kbps:

cfg-file: ipp_hm.cfg , this file contains GOP structure parameters, rate control configuration and other info relevant for encoding.

to generate IPPP sequence the following is set in ipp_hm.cfg file:

    # Type   POC     QPoffset   CbQPoffset     CrQPoffset    ...     temporal_id    #ref_pics_active   #ref_pics reference pictures   
Frame1:      P                 1             1                   0                              0                        0                      1                            1

here  chroma QP offsets set to zero, i.e. chroma QPs equal to those of the luma.

number of references is set to 1 ('#ref_pics_active   #ref_pics reference pictures')

 

TAppEncoder.exe -c ipp_hm.cfg -i akiyo_cif.yuv -wdt 352 -hgt 288 -o NUL -fr 30 -f 300 -vui 1 --AccessUnitDelimiter 1  --TargetBitrate=200000 -b test_cif.h265

 

Notes:

-o NUL – discard creating reconstructed yuv file

-fr 30 – specify the frame rate 30 fps

--AccessUnitDelimiter  put AUD at the start of each frame

--TargetBitrate=200000   set target bitrate to 200Kbps

          -vui    generate SPS VUI (empty VUI)

 

 

Example 2:  10 bpp (the input format yuv420p10le), we use the same config file ipp_hm.cfg as in the previous example, input resolution is 4K, the target bitrate 20Mbps:

TAppEncoder.exe -c ipp_hm.cfg -i ToddlerFountain_4096x2160_60fps_10bit_420.yuv  --Profile=main10 --InputBitDepth=10 --InternalBitDepth=10 -wdt 4096 -hgt 2160 -o NUL -fr 30 -f 60 --SAO=0 --AccessUnitDelimiter --TargetBitrate=20000000 -b test_4k_10bpp.h265

 

Notes:

--Profile=main10  set Main10 profile due to the input 10bpp

--InputBitDepth=10 --InternalBitDepth=10  instruct the encoder that input video is 10bpp

 

Example 3: encoding 4:2:2 input yuv sequence (yuv422p)

TAppEncoder.exe -c ipp_hm.cfg -i controlled_burn_1080p_422.yuv  -wdt 1920 -hgt 1080 -o NUL -fr 30 -f 50 --Profile=main-RExt --InputChromaFormat=422 --AccessUnitDelimiter --TargetBitrate=20000000 -b test_422_1080p.h265

 

Notes:

--Profile=main-RExt  it’s necessary to apply processing 4:2:2 input

--InputChromaFormat=422  specify 4:2:2 input

 

Example 4:  encoding 4:4:4 input yuv-sequence (the format yuv444p)

TAppEncoder.exe -c ipp_hm.cfg -i ducks_take_off_444_720p50.yuv -wdt 1280 -hgt 720 -o NUL -fr 50 -f 100 --Profile=main-RExt --InputChromaFormat=444 --AccessUnitDelimiter --TargetBitrate=15000000 -b test_444_1080p.h265

 

Notes:

--Profile=main-RExt  it’s necessary to apply processing 4:4:4 input

--InputChromaFormat=444  specify 4:4:4 input

 

 

 

Example 5:  lossless encoding by disabling quantization phase (--TransquantBypassEnable --CUTransquantBypassFlagForce)

TAppEncoder.exe -c ipp_hm.cfg -i akiyo_cif.yuv -wdt 352 -hgt 288 -o rec.yuv -fr 30 -f 20 --Profile=main --TransquantBypassEnable --CUTransquantBypassFlagForce --AccessUnitDelimiter -b test_cif_lossless.h265

 

 

Notes:

  • HEVC standard enables 32×32 transform, but such large transform is time-consuming, there is a way to instruct HM encoder to not use 32×32 transforms by   --QuadtreeTULog2MaxSize=4 (maximal transform size is 16×16).

 

  • Setting --FastSearch=0 activates full search motion estimation, encoding process gets extremely slow

 

  • In HM encoder lambda of RDO is the function of QP:

 

       The parameter ‘f’ (default f=0.5) in the above formulas is specified by --IQPFactor

Leave a Reply

Your email address will not be published. Required fields are marked *