2017년 11월 26일 일요일

YUV

참조: Link

YUV is a color encoding system typically used as part of a color image pipeline. It encodes a color image or video taking human perception into account, allowing reduced bandwidth for chrominance components, thereby typically enabling transmission errors or compression artifacts to be more efficiently masked by the human perception than using a "direct" RGB-representation. Other color encodings have similar properties, and the main reason to implement or investigate properties of Y′UV would be for interfacing with analog or digital television or photographic equipment that conforms to certain Y′UV standards.
YUV는 일반적으로 컬러 이미지 파이프 라인의 일부로 사용되는 컬러 인코딩 시스템입니다. 이는 인간의 인식을 고려한 컬러 이미지 또는 비디오를 인코딩하여 크로 미 넌스 구성 요소의 대역폭을 줄임으로써 전송 오류 또는 압축 아티팩트를 일반적으로 "직접"RGB 표현을 사용하는 것보다 인간의 인식으로보다 효율적으로 마스킹 할 수있게합니다. 다른 컬러 인코딩은 유사한 속성을 가지고 있으며 Y'UV의 속성을 구현하거나 조사하는 주된 이유는 특정 Y'UV 표준을 준수하는 아날로그 또는 디지털 TV 또는 사진 장비와 인터페이스하기위한 것입니다.

The scope of the terms Y′UV, YUV, YCbCr, YPbPr, etc., is sometimes ambiguous and overlapping. Historically, the terms YUV and Y′UV were used for a specific analog encoding of color information in television systems, while YCbCr was used for digital encoding of color information suited for video and still-image compression and transmission such as MPEG and JPEG. Today, the term YUV is commonly used in the computer industry to describe file-formats that are encoded using YCbCr.
용어 Y'UV, YUV, YCbCr, YPbPr 등의 범위는 때로는 모호하며 중복됩니다. 역사적으로, YUV 및 Y'UV는 텔레비전 시스템에서 컬러 정보의 특정 아날로그 인코딩에 사용되었고, YCbCr은 비디오 및 MPEG 및 JPEG와 같은 정지 이미지 압축 및 전송에 적합한 컬러 정보의 디지털 인코딩에 사용되었습니다. 오늘날 YUV라는 용어는 YCbCr을 사용하여 인코딩 된 파일 형식을 설명하기 위해 컴퓨터 업계에서 일반적으로 사용됩니다.

The Y′UV model defines a color space in terms of one luma (Y′) and two chrominance (UV) components. The Y′UV color model is used in the PAL composite color video (excluding PAL-N) standard. Previous black-and-white systems used only luma (Y′) information. Color information (U and V) was added separately via a sub-carrier so that a black-and-white receiver would still be able to receive and display a color picture transmission in the receiver's native black-and-white format.
Y'UV 모델은 하나의 휘도 (Y ') 및 2 개의 색차 (UV) 성분으로 색 공간을 정의합니다. Y'UV 컬러 모델은 PAL 합성 컬러 비디오 (PAL-N 제외) 표준에 사용됩니다. 이전의 흑백 시스템은 루마 (Y ') 정보 만 사용했습니다. 컬러 정보 (U 및 V)는 서브 캐리어를 통해 개별적으로 추가되어, 흑백 수신기는 여전히 수신기의 네이티브 흑백 포맷의 컬러 화상 전송을 수신하고 디스플레이 할 수있게됩니다.

Y′ stands for the luma component (the brightness) and U and V are the chrominance (color) components; luminance is denoted by Y and luma by Y′ – the prime symbols (') denote gamma compression,[1] with "luminance" meaning perceptual (color science) brightness, while "luma" is electronic (voltage of display) brightness.
Y '는 휘도 성분 (밝기)을 나타내며 U와 V는 색차 성분 (색)을 나타냅니다. 휘도는 Y로 표시되고 luma는 Y '로 표시됩니다. - 소수점 기호 (')는 감마 압축을 나타내며, '휘도'는 지각 (색 과학) 밝기를 의미하고 '루마'는 전자식 밝기입니다.

The YPbPr color model used in analog component video and its digital version YCbCr used in digital video are more or less derived from it, and are sometimes called Y′UV. (CB/PB and CR/PR are deviations from grey on blue–yellow and red–cyan axes, whereas U and V are blue–luminance and red–luminance differences respectively.) The Y′IQ color space used in the analog NTSC television broadcasting system is related to it, although in a more complex way. The YDbDr color space used in the analog SECAM and PAL-N television broadcasting systems, are also related.
아날로그 컴포넌트 비디오에 사용 된 YPbPr 컬러 모델디지털 비디오에 사용되는 YCbCr 디지털 버전은 다소 차이가 있으며 Y'UV라고도합니다. (CB / PB 및 CR / PR은 청색 - 황색 및 적색 - 시안 축상의 회색으로부터의 편차이고, U 및 V는 각각 청색 - 휘도 및 적색 - 휘도 차이이다.) 아날로그 NTSC 텔레비전에서 사용되는 Y'IQ 색 공간 방송 시스템은 좀 더 복잡한 방식으로 관련되어있다. 아날로그 SECAM 및 PAL-N 텔레비전 방송 시스템에 사용되는 YDbDr 색 공간 또한 관련되어 있습니다.

As for etymology, Y, Y′, U, and V are not abbreviations. The use of the letter Y for luminance can be traced back to the choice of XYZ primaries. This lends itself naturally to the usage of the same letter in luma (Y′), which approximates a perceptually uniform correlate of luminance. Likewise, U and V were chosen to differentiate the U and V axes from those in other spaces, such as the x and y chromaticity space. See the equations below or compare the historical development of the math.
어원에 관해서는 Y, Y ', U, V는 원래 단어를 축약한 것이 아닙니다. 휘도에 문자 Y를 사용하는 것은 XYZ 기본 색의 선택으로 거슬러 올라갈 수 있습니다. 이것은 휘도의 지각 적으로 일정한 상관 관계를 근사화하는 luma (Y ')에서 같은 문자를 사용하는 데 자연스럽게 적합합니다. 마찬가지로 U 및 V는 x 및 y 색도 공간과 같은 다른 공간의 U 및 V 축을 구분하기 위해 선택되었습니다. 아래의 방정식을 보거나 수학의 역사적 발전을 비교하십시오.

역사
Y′UV was invented when engineers wanted color television in a black-and-white infrastructure. They needed a signal transmission method that was compatible with black-and-white (B&W) TV while being able to add color. The luma component already existed as the black and white signal; they added the UV signal to this as a solution.

The UV representation of chrominance was chosen over straight R and B signals because U and V are color difference signals. In other words, the U and V signals tell the television to shift the color of a certain pixel without altering its brightness. Or the U and V signals tell the monitor to make one color brighter at the cost of the other and by how much it should be shifted. The higher the (or the lower when negative) the U and V values are, the more the saturated (colorful) the pixel gets. The closer the U and V values get to zero, the lesser it shifts the color meaning that the red, green and blue lights will be more equally bright, producing a greyer pixel. This is the benefit of using color difference signals, i.e. instead of telling how much red there is to a color, it tells by how much it is more red than green or blue. In turn this meant that when the U and V signals would be zero or absent, it would just display a greyscale image. If R and B were to have been used, these would have non-zero values even in a B&W scene, requiring all three data-carrying signals. This was important in the early days of color television, because old black and white TV signals had no U and V signals present, meaning the color TV would just display it as B&W TV out of the box. In addition, black and white receivers could take the Y′ signal and ignore the U- and V-color signals, making Y′UV backward-compatible with all existing black-and-white equipment, input and output. If the color-TV standard wouldn't have used color difference signals, it could mean a color TV would make funny colors out of a B&W broadcast or it would need additional circuitry to translate the B&W signal to color. It was necessary to assign a narrower bandwidth to the chrominance channel because there was no additional bandwidth available. If some of the luminance information arrived via the chrominance channel (as it would have if RB signals were used instead of differential UV signals), B&W resolution would have been compromised.
Y'UV는 엔지니어가 컬러 텔레비전을 흑백 인프라로 원할 때 발명되었습니다. 컬러를 추가 할 수있는 흑백 (B & W) TV와 호환되는 신호 전송 방법이 필요했습니다. 루마 성분은 이미 흑백 신호로 존재합니다. 그들은 솔루션에 자외선 신호를 추가했습니다.

U와 V는 색차 신호이기 때문에 직선의 R과 B 신호보다 색차의 UV 표현이 선택되었습니다. 즉, U 및 V 신호는 텔레비전에 밝기를 변경하지 않고 특정 픽셀의 색상을 이동 시키도록 지시합니다. 또는 U 및 V 신호는 모니터가 다른 색상의 비용으로 한 색상을 더 밝게 만들고 이동해야하는 정도를 알려줍니다. U 및 V 값이 높을수록 (또는 음수 일 때 더 낮아짐) 픽셀이 더 포화 된 (색상이 다양해질수록). U와 V 값이 0에 가까울수록 빨강, 녹색 및 파랑 조명이 더 밝아 져 회색 픽셀이 생성된다는 의미의 색상이 조금씩 이동합니다. 이는 색상 차이 신호를 사용하는 이점입니다. 즉, 색상에 빨간색이 얼마나 많은지 알려주지 않고 녹색 또는 파란색보다 더 많이 빨간색으로 표시합니다. 이것은 U 및 V 신호가 0이거나 없을 때 그레이 스케일 이미지 만 표시한다는 것을 의미합니다. R과 B를 사용하면 B & W 장면에서도 3 가지 데이터 운반 신호가 모두 필요하므로 0이 아닌 값을 갖게됩니다. 오래된 흑백 TV 신호에는 U 및 V 신호가 없으므로 컬러 TV 초기에는 중요했습니다. 즉, 컬러 TV는 B & W TV를 그대로 상자에 넣어 표시합니다. 또한 흑백 수신기는 Y '신호를 받아 U 및 V 색상 신호를 무시할 수 있으므로 기존의 모든 흑백 장비, 입력 및 출력과 Y'UV의 역 호환이 가능합니다. 컬러 TV 표준이 색차 신호를 사용하지 않는다면 컬러 TV가 흑백 방송에서 재미있는 색상을 만들거나 흑백 신호를 색상으로 변환하는 추가 회로가 필요하다는 것을 의미 할 수 있습니다. 사용 가능한 추가 대역폭이 없었기 때문에 색차 채널에 더 좁은 대역폭을 할당해야했습니다. 휘도 정보 중 일부가 색차 채널을 통해 도착한 경우 (차동 UV 신호 대신 RB 신호가 사용 된 것처럼) B & W 해상도가 손상되었을 수 있습니다.


Y'UV 는 RGB 와 서로 계산될 수 있다.
Y는 휘도
Y'는 루마
UV 는 색차

R, G, B 는 색의 값

그러면 왜 센서에서 바로 받은 값인 RGB를 사용하지 않고 Y'UV를 사용하느냐?


Conversion to/from RGB


Numerical approximations


Luminance/chrominance systems in general
The primary advantage of luma/chroma systems such as Y′UV, and its relatives Y′IQ and YDbDr, is that they remain compatible with black and white analog television (largely due to the work of Georges Valensi). The Y′ channel saves all the data recorded by black and white cameras, so it produces a signal suitable for reception on old monochrome displays. In this case, the U and V are simply discarded. If displaying color, all three channels are used, and the original RGB information can be decoded.
Y'UV 및 그 친척 Y'IQ 및 YDbDr과 같은 루마 / 크로마 시스템의 주요 이점은 흑백 아날로그 TV와 호환이 가능하다는 것입니다 (주로 Georges Valensi의 작업으로 인해). Y '채널은 흑백 카메라로 기록 된 모든 데이터를 저장하므로 오래된 흑백 디스플레이의 수신에 적합한 신호를 생성합니다. 이 경우 U와 V는 단순히 버려집니다. 색상을 표시하면 세 개의 채널이 모두 사용되고 원본 RGB 정보가 디코딩 될 수 있습니다.

Another advantage of Y′UV is that some of the information can be discarded in order to reduce bandwidth. The human eye has fairly little spatial sensitivity to color: the accuracy of the brightness information of the luminance channel has far more impact on the image detail discerned than that of the other two. Understanding this human shortcoming, standards such as NTSC and PAL reduce the bandwidth of the chrominance channels considerably. (Bandwidth is in the temporal domain, but this translates into the spatial domain as the image is scanned out.)
Y'UV의 또 다른 이점은 대역폭을 줄이기 위해 일부 정보를 삭제할 수 있다는 것입니다. 인간의 눈은 색에 대한 공간 감도가 거의 없습니다. 휘도 채널의 밝기 정보의 정확도는 다른 두 가지보다 더 세부적인 이미지 세부 사항에 훨씬 더 많은 영향을 미칩니다. NTSC 및 PAL과 같은 표준에서는 이러한 인간적인 단점을 이해하여 색차 채널의 대역폭을 상당히 줄입니다. (대역폭은 시간 영역에 있지만 이미지가 스캔되면 공간 영역으로 변환됩니다.)

Therefore, the resulting U and V signals can be substantially "compressed". In the NTSC (Y′IQ) and PAL systems, the chrominance signals had significantly narrower bandwidth than that for the luminance. Early versions of NTSC rapidly alternated between particular colors in identical image areas to make them appear adding up to each other to the human eye, while all modern analogue and even most digital video standards use chroma subsampling by recording a picture's color information at reduced resolution. Only half the horizontal resolution compared to the brightness information is kept (termed 4:2:2 chroma subsampling), and often the vertical resolution is also halved (giving 4:2:0). The 4:x:x standard was adopted due to the very earliest color NTSC standard which used a chroma subsampling of 4:1:1 (where the horizontal color resolution is quartered while the vertical is full resolution) so that the picture carried only a quarter as much color resolution compared to brightness resolution. Today, only high-end equipment processing uncompressed signals uses a chroma subsampling of 4:4:4 with identical resolution for both brightness and color information.
따라서, 결과적인 U 및 V 신호는 실질적으로 "압축"될 수있다. NTSC (Y'IQ) 및 PAL 시스템에서 색차 신호는 휘도보다 신호 대역폭이 상당히 좁습니다. 초기 버전의 NTSC는 동일한 이미지 영역에서 특정 색상을 신속하게 번갈아 가며 서로 눈을 가깝게 보이게하는 반면 현대의 모든 아날로그 및 대부분의 디지털 비디오 표준은 축소 된 해상도로 사진의 색상 정보를 기록하여 크로마 하위 샘플링을 사용합니다. 밝기 정보에 비해 수평 해상도의 절반 만 유지됩니다 (4 : 2 : 2 크로마 하위 샘플링이라고 함). 종종 수직 해상도도 절반으로 감소합니다 (4 : 2 : 0 제공). 4 : 1 : 1의 크로마 서브 샘플링을 사용하는 가장 초기의 컬러 NTSC 표준 (가로 해상도는 4 배, 세로 해상도는 4 등분)으로 인해 4 : x : x 표준이 채택되었습니다. 밝기 해상도보다 4 분의 1 컬러 해상도. 오늘날, 비 압축 신호를 처리하는 고급 장비 만이 밝기 및 색상 정보 모두에 대해 동일한 해상도로 4 : 4 : 4의 채도 서브 샘플링을 사용합니다.

The I and Q axes were chosen according to bandwidth needed by human vision, one axis being that requiring the most bandwidth, and the other (fortuitously at 90 degrees) the minimum. However, true I and Q demodulation was relatively more complex, requiring two analog delay lines, and NTSC receivers rarely used it.
I 및 Q 축은 인간의 시력에 필요한 대역폭에 따라 선택되었으며, 한 축은 가장 많은 대역폭을 필요로하고, 다른 축은 (최소 90도에서 우연히) 최소값을 필요로합니다. 그러나 사실 I 및 Q 복조는 상대적으로 더 복잡하여 두 개의 아날로그 지연 라인이 필요했으며 NTSC 리시버는 거의 사용하지 않았습니다.

However, this color space conversion is lossy, particularly obvious in crosstalk from the luma to the chroma-carrying wire, and vice versa, in analogue equipment (including RCA connectors to transfer a digital signal, as all they carry is analogue composite video, which is either YUV, YIQ, or even CVBS). Furthermore, NTSC and PAL encoded color signals in a manner that causes high bandwidth chroma and luma signals to mix with each other in a bid to maintain backward compatibility with black and white television equipment, which results in dot crawl and cross color artifacts. When the NTSC standard was created in the 1950s, this was not a real concern since the quality of the image was limited by the monitor equipment, not the limited-bandwidth signal being received. However today′s modern television is capable of displaying more information than is contained in these lossy signals. To keep pace with the abilities of new display technologies, attempts were made since the late 1970s to preserve more of the Y′UV signal while transferring images, such as SCART (1977) and S-Video (1987) connectors.
그러나이 색 공간 변환은 손실이 많습니다. 아날로그 장비 (디지털 신호를 전송하는 RCA 커넥터 포함, 루마에서 크로마 전송 와이어로의 크로스 토크에서 특히나 그 반대의 경우도 마찬가지 임)는 아날로그 합성 비디오입니다. YUV, YIQ 또는 CVBS 임). 또한 NTSC 및 PAL은 고 대역폭 크로마 및 루마 신호가 흑백 TV 장비와의 역 호환성을 유지하기 위해 서로 섞여서 도트 크롤 및 크로스 컬러 아티팩트를 발생시키는 방식으로 색상 신호를 인코딩했습니다. 1950 년대에 NTSC 표준이 만들어 졌을 때 이미지의 품질이 제한된 대역폭 신호가 아닌 모니터 장비에 의해 제한 되었기 때문에 이것은 실제 관심사가 아니 었습니다. 그러나 오늘날의 현대 TV는 이러한 손실 신호에 포함 된 것보다 많은 정보를 표시 할 수 있습니다. 새로운 디스플레이 기술의 능력에 발 맞추어 1970 년대 말 SCART (1977) 및 S-Video (1987) 커넥터와 같은 이미지를 전송하는 동안 Y'UV 신호를 더 많이 보존하려는 시도가있었습니다.

Instead of Y′UV, Y′CbCr was used as the standard format for (digital) common video compression algorithms such as MPEG-2. Digital television and DVDs preserve their compressed video streams in the MPEG-2 format, which uses a full Y′CbCr color space, although retaining the established process of chroma subsampling. The professional CCIR 601 digital video format also uses Y′CbCr at the common chroma subsampling rate of 4:2:2, primarily for compatibility with previous analog video standards. This stream can be easily mixed into any output format needed.
Y'UV 대신 Y'CbCr이 MPEG-2와 같은 (디지털) 공통 비디오 압축 알고리즘의 표준 형식으로 사용되었습니다. 디지털 텔레비전과 DVD는 압축 된 비디오 스트림을 MPEG-2 형식으로 보존합니다.이 형식은 확립 된 채도 서브 샘플링 프로세스를 유지하면서도 전체 Y'CbCr 색 공간을 사용합니다. 전문가 용 CCIR 601 디지털 비디오 형식은 이전 아날로그 비디오 표준과의 호환성을 위해 4 : 2 : 2의 공통 크로마 하위 샘플링 속도로 Y'CbCr을 사용합니다. 이 스트림은 필요한 모든 출력 형식으로 쉽게 혼합 될 수 있습니다.

Y′UV is not an absolute color space. It is a way of encoding RGB information, and the actual color displayed depends on the actual RGB colorants used to display the signal. Therefore, a value expressed as Y′UV is only predictable if standard RGB colorants are used (i.e. a fixed set of primary chromaticities, or particular set of red, green, and blue).
Y'UV는 절대 색 공간이 아닙니다. 이것은 RGB 정보를 인코딩하는 방법이며, 실제 표시되는 색은 신호를 표시하는 데 사용되는 실제 RGB 색소에 따라 다릅니다. 따라서,  Y'UV로 표현 된 값은 표준 RGB 색소가 사용되는 경우 (즉, 1 차 색도의 고정 된 세트 또는 적색, 녹색 및 청색의 특정 세트) 에만 예측 가능합니다.

Furthermore, the range of colors and brightnesses (known as the color gamut) of RGB (whether it be BT.601 or Rec.709) is far smaller than the range of colors and brightnesses allowed by Y′UV. This can be very important when converting from Y′UV (or Y′CbCr) to RGB, since the formulas above can produce "invalid" RGB values – i.e., values below 0% or very far above 100% of the range (e.g., outside the standard 16–235 luma range (and 16–240 chroma range) for TVs and HD content, or outside 0–255 for standard definition on PCs). Unless these values are dealt with they will usually be "clipped" (i.e., limited) to the valid range of the channel affected. This changes the hue of the color, which is very undesirable, so it is therefore often considered better to desaturate the offending colors such that they fall within the RGB gamut.[9] Likewise, when RGB at a given bit depth is converted to YUV at the same bit depth, several RGB colors can become the same Y′UV color, resulting in information loss.
또한 RGB (BT.601이든 Rec.709이든)의 색상과 밝기 (색상 영역으로 알려짐)의 범위는 Y'UV가 허용하는 색상 및 밝기의 범위보다 훨씬 작습니다. 위의 공식은 범위의 0 % 이하 또는 100 %를 훨씬 초과하는 값 (예 : 0 %)을 생성 할 수 있기 때문에 Y'UV (또는 Y'CbCr)에서 RGB로 변환 할 때 매우 중요 할 수 있습니다. TV 및 HD 컨텐츠의 표준 16-235 루마 범위 (및 16-240 크로마 범위)를 벗어나거나 PC의 표준 정의를위한 0-255 범위를 벗어납니다. 이 값을 처리하지 않으면 영향을받는 채널의 유효 범위에 대해 일반적으로 "클리핑"(즉, 제한)됩니다. 이렇게하면 색상의 색조가 바뀌므로 매우 바람직하지 않습니다. 따라서 RGB 색상 영역에 해당하는 색상을 채도 감소시키는 것이 더 좋습니다. [9] 마찬가지로 특정 비트 심도의 RGB가 동일한 비트 심도에서 YUV로 변환되면 여러 RGB 색상이 동일한 Y'UV 색상이되어 정보가 손실 될 수 있습니다.


Relation with Y′CbCr
Y′UV is often used as a term for YCbCr. However, they are completely different formats with different scale factors.
Y'UV는 종종 YCbCr의 용어로 사용됩니다. 그러나, 그들은 다른 스케일 팩터와 완전히 다른 포맷입니다.

Nevertheless, the relationship between them in the standard case is simple. In particular, the Y channel is the same in both, both Cb and U are proportional to (B-Y), and both Cr and V are proportional to (R-Y).
그럼에도 불구하고, 표준 경우에 그들 사이의 관계는 간단합니다. 특히 Y 채널은 둘 다 동일하며 Cb와 U는 (B-Y)에 비례하고 Cr과 V는 (R-Y)에 비례합니다.


Types of sampling


Converting between Y′UV and RGB



Y′UV444 to RGB888 conversion
Y′UV420p is a planar format, meaning that the Y′, U, and V values are grouped together instead of interspersed. The reason for this is that by grouping the U and V values together, the image becomes much more compressible. When given an array of an image in the Y′UV420p format, all the Y′ values come first, followed by all the U values, followed finally by all the V values.

The Y′V12 format is essentially the same as Y′UV420p, but it has the U and V data switched: the Y′ values are followed by the V values, with the U values last. As long as care is taken to extract U and V values from the proper locations, both Y′UV420p and Y′V12 can be processed using the same algorithm.

As with most Y′UV formats, there are as many Y′ values as there are pixels. Where X equals the height multiplied by the width, the first X indices in the array are Y′ values that correspond to each individual pixel. However, there are only one fourth as many U and V values. The U and V values correspond to each 2 by 2 block of the image, meaning each U and V entry applies to four pixels. After the Y′ values, the next X/4 indices are the U values for each 2 by 2 block, and the next X/4 indices after that are the V values that also apply to each 2 by 2 block.

Translating Y′UV420p to RGB is a more involved process compared to the previous formats. Lookup of the Y′, U and V values can be done using the following method:
Y'UV420p는 평면 형식이므로 Y ', U 및 V 값이 산재되어있는 대신 함께 그룹화됩니다. 그 이유는 U와 V 값을 함께 그룹화하면 이미지가 훨씬 압축 될 수 있기 때문입니다. Y'UV420p 형식의 이미지 배열이 주어지면 모든 Y 값이 먼저오고 그 다음에는 모든 U 값이옵니다. 마지막으로 모든 V 값이옵니다.

Y'V12 형식은 기본적으로 Y'UV420p와 동일하지만 U 및 V 데이터가 전환됩니다. Y 값 뒤에는 V 값이 나오고 U 값이 마지막에옵니다. 올바른 위치에서 U 및 V 값을 추출하는 데주의를 기울이는 한 동일한 알고리즘을 사용하여 Y'UV420p 및 Y'V12를 모두 처리 할 수 ​​있습니다.

대부분의 Y'UV 형식과 마찬가지로 픽셀만큼 많은 Y '값이 있습니다. X가 높이에 폭을 곱한 값인 경우 배열의 첫 번째 X 인덱스는 각 픽셀에 해당하는 Y '값입니다. 그러나 U와 V 값이 4 분의 1에 불과합니다. U 및 V 값은 이미지의 각 2 x 2 블록에 해당합니다. 즉, 각 U 및 V 항목은 4 개의 픽셀에 적용됩니다. Y '값 다음에 다음 X / 4 인덱스는 각 2 x 2 블록에 대한 U 값이고 그 다음 X / 4 인덱스는 각 2 x 2 블록에도 적용되는 V 값입니다.

Y'UV420p를 RGB로 변환하는 것은 이전 형식에 비해 더 복잡한 프로세스입니다. Y ', U 및 V 값의 검색은 다음 방법을 사용하여 수행 할 수 있습니다.
Y'UV420p는 평면 형식이므로 Y ', U 및 V 값이 산재되어있는 대신 함께 그룹화됩니다. 그 이유는 U와 V 값을 함께 그룹화하면 이미지가 훨씬 압축 될 수 있기 때문입니다. Y'UV420p 형식의 이미지 배열이 주어지면 모든 Y 값이 먼저오고 그 다음에는 모든 U 값이옵니다. 마지막으로 모든 V 값이옵니다.

Y'V12 형식은 기본적으로 Y'UV420p와 동일하지만 U 및 V 데이터가 전환됩니다. Y 값 뒤에는 V 값이 나오고 U 값이 마지막에옵니다. 올바른 위치에서 U 및 V 값을 추출하는 데주의를 기울이는 한 동일한 알고리즘을 사용하여 Y'UV420p 및 Y'V12를 모두 처리 할 수 ​​있습니다.

대부분의 Y'UV 형식과 마찬가지로 픽셀만큼 많은 Y '값이 있습니다. X가 높이에 폭을 곱한 값인 경우 배열의 첫 번째 X 인덱스는 각 픽셀에 해당하는 Y '값입니다. 그러나 U와 V 값이 4 분의 1에 불과합니다. U 및 V 값은 이미지의 각 2 x 2 블록에 해당합니다. 즉, 각 U 및 V 항목은 4 개의 픽셀에 적용됩니다. Y '값 다음에 다음 X / 4 인덱스는 각 2 x 2 블록에 대한 U 값이고 그 다음 X / 4 인덱스는 각 2 x 2 블록에도 적용되는 V 값입니다.

Y'UV420p를 RGB로 변환하는 것은 이전 형식에 비해 더 복잡한 프로세스입니다. Y ', U 및 V 값의 검색은 다음 방법을 사용하여 수행 할 수 있습니다.


댓글 없음:

댓글 쓰기