zoukankan      html  css  js  c++  java
  • Processing in the 8-bit YUV Color Space

    Working in the YUV color space simplifies the calculations involved for ProcAmp adjustment control of a video stream.

    Y Processing

    To perform ProcAmp adjustment for the Y component, subtract 16 from the Y value to position the black level at zero. This removes the DC offset so that adjusting the contrast does not vary the black level. Because Y values might be less than 16, negative Y values should be supported at this point. Contrast is adjusted by multiplying the YUV pixel values by a constant. If U and V are not adjusted, a color shift will result whenever the contrast is changed. The brightness property value is added (or subtracted) from the contrast adjusted Y values; this is done to avoid introducing a DC offset due to adjusting the contrast. Finally, the value 16 is added to reposition the black level at 16.

    The following equation summarizes the steps described in the previous paragraph. C is the contrast value and B is the brightness value.

     
     
    Y' = ((Y - 16) x C) + B + 16
    
    

    UV Processing

    To perform ProcAmp adjustment for the U and V components, subtract 128 from both U and V values to position the range around zero. The hue property is implemented by mixing the U and V values together as shown in the following equations. H is the desired hue angle:

     
     
    U' = (U-128) x Cos(H) + (V-128) x Sin(H)
    V' = (V-128) x Cos(H) - (U-128) x Sin(H)
    
    

    Saturation is adjusted by multiplying U' and V' by a pair of constants, and then by adding 128 to each. The combined processing of hue and saturation on the UV data is shown in the following equations. H is the desired hue angle, C is the contrast value, and S is the saturation value:

     
     
    U'' = (((U-128) x Cos(H) + (V-128) x Sin(H)) x C x S) + 128
    V'' = (((V-128) x Cos(H) - (U-128) x Sin(H)) x C x S) + 128
    
    https://msdn.microsoft.com/en-us/library/ff569191%28v=vs.85%29.aspx
  • 相关阅读:
    asp.net(.net 4.0)+ json 分页
    在两张表(A表和B表)里面找出A中不存在B表的记录
    linq to sql 的List<Table> 数据表缓存
    linq 并发冲突概念
    阿里RocketMq节约成本
    阿里巴巴java手册异常日志
    阿里巴巴java手册安全规约
    阿里巴巴java手册单元测试
    Spring boot自定义starter
    MongoDB权限
  • 原文地址:https://www.cnblogs.com/artestlove/p/4655459.html
Copyright © 2011-2022 走看看