当前位置: 首页 > 工具软件 > level > 使用案例 >

h264中profile和level的含义

孟浩然
2023-12-01

Profile是对视频压缩特性的描述(CABAC呀、颜色采样数等等)。Level是对视频本身特性的描述(码率、分辨率、fps)。
简单来说,Profile越高,就说明采用了越高级的压缩特性。Level越高,视频的码率、分辨率、fps越高。
一些移动设备(手机、游戏机、PMP)由于性能有限,不支持全部高级视频压缩特性和高分辨率图像,只支持基础压缩特性和分辨率低一些的图像。为了让这个限制更加清晰明了,H264从低到高划分了很多Profile和Level,设备只需要标出所支持的Profile和Level就可以让用户和开发者一看既知。
具体哪些Profile和Level对应哪些特性,上面的wiki已经列表写得很清楚了。我记得PSP是支持到MainProfile的Level 2.1。

这个解释也不能说错,只是个人觉得不够准确,profile主要是定义了编码工具的集合,不同的profile,包含了不同的编码技术;而level主要是对码流的关键参数的取值范围作了限定,与解码器的处理能力和存储能力相关联



For h.264 users, how to specify the profile/level seems to be a fairly common question. Profiles define sets of bit stream features a h.264 stream can use. Levels define restrictions on the video resolution, frame rate and some stuff called VBV (Video Buffer Verifier).


H.264 Profiles

H.264 Profiles are discussed in depth on Wikipedia, but to simplify the considerations for the average user, I will focus on the Baseline, Main and High Profiles.

  • Baseline Profile
    • I/P slices
    • Multiple reference frames (–refs <int>, >1 in the x264 CLI)
    • In-loop deblocking
    • CAVLC entropy coding (–no-cabac in the x264 CLI)
  • Main Profile
    • Baseline Profile features mentioned above
    • B slices
    • CABAC entropy coding
    • Interlaced coding – PAFF/MBAFF
    • Weighted prediction
  • High Profile
    • Main Profile features mentioned above
    • 8×8 transform option (–8×8dct in the x264 CLI)
    • Custom quantisation matrices

    H.264 Levels

    H.264 Levels are also discussed on Wikipedia, though in my opinion, less explicitly and less successfully than for the profiles. For practical use, to specify a Level, a number of constraints have to be met.

    The resolutions/frame rates in the following table are merely a guideline – the number of macroblocks per second is the actual restriction. To calculate this:

    Macroblocks are 16×16 in H.264 and so to code a frame one can calulate the number of macroblocks per frame as:

    ceil( width / 16.0 ) * ceil( height / 16.0 )

    Note: The ceil() function rounds up its argument to the next integer. For example, ceil( 10.2 ) returns 11.

    Then you need to multiply the number of macroblocks per frame by the number of frames per second to get the number of macroblocks per second.

    macroblocks per second = ceil( width / 16.0 ) * ceil( height / 16.0 ) * frame rate

    Level

    VBV maximum bit rate [1000bits/s]

    VBV buffer size [1000bits]

    Macroblocks/s

    Resolution and frame rate

    1

    64

    175

    1485

    128×96@30 or 176×144@15

    1b

    128

    350

    1485

    128×96@30 or 176×144@15

    1.1

    192

    500

    3000

    176×144@30 or 320×240@10

    1.2

    384

    1000

    6000

    176×144@60 or 320×240@20

    1.3

    768

    2000

    11880

    352×288@30

    2

    2000

    2000

    11880

    352×288@30

    2.1

    4000

    4000

    19800

    352×288@50

    2.2

    4000

    4000

    20250

    352×288@50 or 640×480@15

    3

    10000

    10000

    40500

    720×480@30 or720×576@25

    3.1

    14000

    14000

    108000

    1280×720@30

    3.2

    20000

    20000

    216000

    1280×720@60

    4

    20000

    25000

    245760

    1920×1088@30or 2Kx1K@30

    4.1

    50000

    62500

    245760

    1920×1088@30 or 2Kx1K@30

    4.2

    50000

    62500

    522240

    1920×1088@60 or or 2Kx1K@60

    5

    135000

    135000

    589824

    2560×1920@30

    5.1

    240000

    240000

    983040

    4Kx2K@30 or 4



 类似资料: