This can change the resolution of any 420 yuv image to any arbitrary user input resolution. Among the three input algorithms supported (nearest neighbor, bilinear filter and polyphase filter), the polyphase filter implementation reuses a significant code from ffmpeg library. I only simplified some parts.