iOS上YCrCb像素格式的全范围(420f)和视频范围(420v)之间的差异

chr*_*838 15 image colors avfoundation ios

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

kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
Run Code Online (Sandbox Code Playgroud)

有没有人知道这种差异,并且使用一个而不是另一个有什么后果/好处吗?

从苹果的描述基本一致:http://developer.apple.com/library/mac/#documentation/QuartzCore/Reference/CVPixelFormatDescriptionRef/Reference/reference.html

Cod*_*odo 22

视频范围意味着Y分量仅使用16到235之间的字节值(由于某些历史原因).全范围使用整个字节范围,即0到255.

色度分量(Cb,Cr)总是使用全范围.


ble*_*ter 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'.
Run Code Online (Sandbox Code Playgroud)

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