why to minus 128 from u,v compent of yuv420p for converting it from yuv420p to rgb888?

StackOverflow https://stackoverflow.com/questions/18917585

  •  29-06-2022
  •  | 
  •  

문제

i am converting my yuv420p file format to rgb888 so i took reference from http://en.wikipedia.org/wiki/YUV

but code give in section "Java source code used on Android" (at last section of wiki page) their are 2 statements
u = u-128; v = v-128;

I need mathematical reason for reducing 128 from u,v compent...

plz ,suggest some player for rendering video in Argb8888 format on ubuntu 12.04

도움이 되었습니까?

해결책

The u and v components can be positive or negative, but they're stored in an unsigned value. So 128 was added when they were generated to keep them positive. You need to subtract 128 again to restore the proper values.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top