Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.00 KB | None | 0 0
  1. diff --git a/drivers/video/sunxi/disp/de_fe.c b/drivers/video/sunxi/disp/de_fe.c
  2. index 92799a0..d4966ba 100644
  3. --- a/drivers/video/sunxi/disp/de_fe.c
  4. +++ b/drivers/video/sunxi/disp/de_fe.c
  5. @@ -1382,10 +1382,15 @@ __s32 DE_SCAL_Set_CSC_Coef_Enhance(__u8 sel, __u8 in_csc_mode,
  6.     __u32 i;
  7.     __s32 sinv, cosv; /* sin_tab: 7 bit fractional */
  8.  
  9. -   bright = bright * 64 / 100;
  10. -   bright = saturation * 64 / 100;
  11. -   bright = contrast * 64 / 100;
  12. -   bright = hue * 64 / 100;
  13. +   bright = bright < 0 ? 0 : (bright > 100 ? 100);
  14. +   saturation = saturation < 0 ? 0 : (saturation > 100 ? 100);
  15. +   contrast = contrast < 0 ? 0 : (contrast > 100 ? 100);
  16. +   hue = hue < 0 ? 0 : (hue > 100 ? 100);
  17. +
  18. +   bright = DIV_ROUND_CLOSEST((bright * 63), 100);
  19. +   saturation = DIV_ROUND_CLOSEST((saturation * 63), 100);
  20. +   contrast = DIV_ROUND_CLOSEST((contrast * 63), 100);
  21. +   hue = DIV_ROUND_CLOSEST((hue * 63), 100);
  22.  
  23.     sinv = image_enhance_tab[8 * 12 + (hue & 0x3f)];
  24.     cosv = image_enhance_tab[8 * 12 + 8 * 8 + (hue & 0x3f)];
  25. --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement