Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize (downsize) YUV420sp image

I am trying to resize (scale down) an image which comes in YUV420sp format. Is it possible to do such image resizing without converting it into RGB, so directly manipulating the YUV420sp pixel array? Where can I find such algorithm?

Thanks

like image 923
PerracoLabs Avatar asked Jun 19 '13 09:06

PerracoLabs


1 Answers

YUV420sp has the Y in one plane and the U&V in another. If you split the U& V into separate planes, you can then perform the same scaling operation on each of the 3 planes in turn, without first having to go from 4:2:0 -> 4:4:4.

Have a look at the source code for libyuv; it just scales the planes: https://code.google.com/p/libyuv/source/browse/trunk/source/scale.cc

like image 67
G Huxley Avatar answered Mar 01 '23 00:03

G Huxley