21

iPhone 4S 上的两种(三种支持的)像素格式是:

kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
kCVPixelFormatType_420YpCbCr8BiPlanarFullRange

有谁知道其中的区别,使用其中一个有什么后果/优势吗?

Apple 的描述基本相同:http: //developer.apple.com/library/mac/#documentation/QuartzCore/Reference/CVPixelFormatDescriptionRef/Reference/reference.html

4

2 回答 2

26

视频范围意味着 Y 分量仅使用从 16 到 235 的字节值(出于某些历史原因)。全范围使用一个字节的全范围,即 0 到 255。

色度分量(Cb、Cr)始终使用全范围。

于 2012-04-12T18:10:45.737 回答
6

这是一个非常古老的问题,但之前接受的答案是不正确的,所以发布一个正确的答案。

视频范围与全范围是指亮度和色度分量占据的范围。视频范围定义了“动态余量”、亮度和色度值,这些值通常不会被占用,但会在信号通过各种可能引入信号增益或衰减的模拟过程转换时保留信号。

kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange

     8-bit 4:2:0 Component Y'CbCr format. Each 2x2 pixel block is represented
     by 4 unsigned eight bit luminance values and two unsigned eight bit
     chroma values. The chroma plane and luma plane are separated in memory. The
     luminance components have a range of [16, 235], while the chroma value
     has a range of [16, 240]. This is consistent with the CCIR601 spec.
     '420v' is the Apple Core Video four-character code for this pixel format.

kCVPixelFormatType_420YpCbCr8BiPlanarFullRange

     8-bit 4:2:0 Component Y'CbCr format. Each 2x2 pixel block is represented
     by 4 unsigned eight bit luminance components and two unsigned eight bit
     chroma components. The chroma plane and luma plane are separated in memory. The
     luminance components have a range of [0, 255], while the chroma value
     has a range of [1, 255].
     '420f' is the Apple Core Video four-character code for this pixel format.
     The equivalent Microsoft fourCC is 'NV12'.

如果您可以选择格式,则最好使用全范围变体,因为它可以更准确地量化信号值。

于 2020-04-15T00:34:48.243 回答