当前位置:网站首页>Audio and video engineer YUV and RGB detailed explanation
Audio and video engineer YUV and RGB detailed explanation
2022-07-06 02:05:00 【Siege lion hundred miles】
Color space Color Space
Color space color space is the organization of color . With the help of color space and testing for physical devices , You can get a fixed analog and digital representation of color . Color space can be defined only by arbitrarily selecting some colors , For example, a color system is just a set of color samples , Then define a name and code for each color ; It can also be based on rigorous mathematical definitions , such as Adobe RGB
、sRGB
.
Color model
RGB It's a kind of Color model
( In fact, it can also be called color coding method ), Describe colors by a set of numbers . It is a additive model , Itself cannot represent absolute color space . But through the description of standard color space Adobe RGB
and sRGB
The combination of , You can determine the color of a pixel . Through this process , Colors in images and documents , It can be determined .( Therefore, it is combined with the description of different color spaces , You can see different effects on the monitor ).
YUV It is adopted by European television system Color coding method
( Belong to PAL), yes PAL and SECAM Simulate the color space of color TV system .
YUV Usually used for color images / Color space of video processing . It encodes color images / video , At the same time, considering the properties of human eyes , These properties allow the bandwidth of chrominance components to be reduced without perceptual distortion . Use YUV Color space helps images / video compression . It was originally used for analog television broadcasting . Color space YUV、YIQ、YCbCr and YPbPr All belong to YUV family .Y’UV, YUV, YCbCr,YPbPr And other proper nouns can be called YUV, There's overlap .「Y」 Indicates brightness (Luminance、Luma),「U」 and 「V」 It's chromaticity 、 concentration (Chrominance、Chroma).
Why is there YUV
Y’UV The invention of color TV is due to the transition period between color TV and black-and-white TV . Black and white video only Y(Luma,Luminance) video , That's the gray scale value . The customization of color TV specifications is based on YUV/YIQ To process color TV signals . hold UV See it as a symbol of chromaticity . be left over Y The signal is the same as that of black-and-white TV , This can solve the compatibility problem . meanwhile Y’UV The biggest advantage is that it only needs to occupy very little bandwidth .
In terms of historical evolution , among YUV and Y’UV Usually used to encode analog signals of TV , and YCbCr It is used to describe digital image signals , Suitable for film and picture compression and transmission , for example MPEG,JPEG.
YUV sampling
YUV 4:4:4 sampling
, every last Y Corresponding to a group of UV component , One YUV Occupy 8+8+8 = 24bits 3 Bytes .
YUV 4:2:2 sampling
, Every two Y Share a group UV component , One YUV Occupy 8+4+4 = 16bits 2 Bytes .
YUV 4:2:0 sampling
, Every four Y Share a group UV component , One YUV Occupy 8+2+2 = 12bits 1.5 Bytes .
YUV Format
YUV The format is divided into two formats : Compact format (packed format): take Y,U,V The value is stored as Macro Pixels array , and RGB Is stored in a similar manner . Flat format (planar format): take Y,U,V The three fragments of are placed in different matrices .
Start talking is : about planar Of YUV Format , First, store all pixels in a row Y, And then it stores all the pixels U, And then all the pixels V. about packed Of YUV Format , Every pixel point Y,U,V Is a continuous cross storage .
YUV420 type
1.YUV420p and YUV420sp difference
because YUV420 More commonly used , Here we will focus on YUV420.YUV420 Divided into two :YUV420p and YUV420sp. Let's first look at a brain map , Just have an impression of these types .
YUV420P
YUV420SP
2.YUV420p and YUV420sp Specific classification and details
YUV420p: Also called planer Flat pattern ,Y ,U,V And then different planes , That is, there are three planes .
I420: Also called YU12, Android mode . The storage order is save first Y, Save again U, Last deposit V.YYYYUUUVVV
YV12: The storage order is save first Y, Save again V, Last deposit U.YYYVVVUUU
UV420sp: Also called bi-planer or two-planer Biplane ,Y A plane ,UV Cross store on the same plane .
NV12:IOS There is only one mode . The storage order is save first Y, Again UV Alternate storage .YYYYUVUVUV
NV21: Android mode . The storage order is save first Y, Save again U, Again VU Alternate storage .YYYYVUVUVU
RGB and YUV Transformation between
HDTV(BT.601) Of RGB and YUV Conversion between .
HDTV(BT.709) Of RGB and YUV Conversion between .
YIQ yes NTSC Color space used by color TV
YDbDr, yes SÉCAM Color space used in
YCbCr yes YUV Scale and offset versions of the color space .Y Of 8 Bit range from 16 A to 235.Cb and Cr For the range of 16-240.YCbCr be used for JPEG Compress .
If RGB The range of data is 0-255( Black and white ), It's like PC As is common in , Then the following equation should be used to maintain the correct black and white level :
Standard setting body – International Telecommunication Union radio communication department (ITU-R)
ITU-R primary CCIR, stay 1982 Formulated in BT.601 standard ( It's also called Rec.601).
The color coding system confirmed by this standard is called YCbCr 4:2:2, It is used to digitally encode the interlaced digital video analog signal .
FFmpeg/WebRTC/RTMP/NDK/Android Advanced development of audio and video streaming media Interview questions 、 Learning materials 、 Teaching videos and learning roadmap can be added if necessary Learning exchange group perhaps Data acquisition
边栏推荐
- SQL statement
- [Clickhouse] Clickhouse based massive data interactive OLAP analysis scenario practice
- Alibaba canal usage details (pit draining version)_ MySQL and ES data synchronization
- Know MySQL database
- Text editing VIM operation, file upload
- How to upgrade kubernetes in place
- I like Takeshi Kitano's words very much: although it's hard, I will still choose that kind of hot life
- Virtual machine network, networking settings, interconnection with host computer, network configuration
- 通过PHP 获取身份证相关信息 获取生肖,获取星座,获取年龄,获取性别
- 一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
猜你喜欢
Force buckle 9 palindromes
Using SA token to solve websocket handshake authentication
Computer graduation design PHP part-time recruitment management system for College Students
Maya hollowed out modeling
[depth first search] Ji Suan Ke: Betsy's trip
A Cooperative Approach to Particle Swarm Optimization
leetcode3、实现 strStr()
Exness: Mercedes Benz's profits exceed expectations, and it is predicted that there will be a supply chain shortage in 2022
Leetcode3. Implement strstr()
Mongodb problem set
随机推荐
安装Redis
MySQL learning notes - subquery exercise
2022 PMP project management examination agile knowledge points (8)
[flask] response, session and message flashing
Computer graduation design PHP campus restaurant online ordering system
Reasonable and sensible
Maya hollowed out modeling
Online reservation system of sports venues based on PHP
A Cooperative Approach to Particle Swarm Optimization
Poj2315 football games
论文笔记: 图神经网络 GAT
【网络攻防实训习题】
MySQL index
Luo Gu P1170 Bugs Bunny and Hunter
Card 4G industrial router charging pile intelligent cabinet private network video monitoring 4G to Ethernet to WiFi wired network speed test software and hardware customization
抓包整理外篇——————状态栏[ 四]
leetcode-两数之和
NLP fourth paradigm: overview of prompt [pre train, prompt, predict] [Liu Pengfei]
Computer graduation design PHP college classroom application management system
[solution] add multiple directories in different parts of the same word document