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
  •  | 
  •  

Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top