FFMPEG用于将yuv420p转换为rgb bmp的所有操作是什么?

问题描述 投票:0回答:1

我试图在我自己的代码中复制,而不是使用ffmpeg库,ffmpeg将yuv420p转换为rgb的操作。最初我以为它会在函数内部:swyale.c中的xyz12Torgb48但是做一些跟踪,它看起来是在yuv2rgb.c ff_yuv2rgb_c_init_tables中,我看不到它。

c ffmpeg rgb yuv
1个回答
0
投票

好吧,因为没有人提出解决方案,我只想发布我发现使用valgrind tool = callgrind ffmpeg_g这是一个版本的ffmpeg,调试对象向我展示了被调用的函数,在\ libswscale \ x86里面有yuv2rgb_template。 c,在装配中似乎有你做yuv2rgb的操作

 * Conversion is performed in usual way:
 * R = Y' * Ycoef + Vred * V'
 * G = Y' * Ycoef + Vgreen * V' + Ugreen * U'
 * B = Y' * Ycoef               + Ublue * U'
 *
 * where X' = X * 8 - Xoffset (multiplication is performed to increase
 * precision a bit).
 * Since it operates in YUV420 colorspace, Y component is additionally
 * split into Y1 and Y2 for even and odd pixels.
 *
 * Input:
 * mm0 - U (4 elems), mm1 - V (4 elems), mm6 - Y (8 elems), mm4 - zero register
 * Output:
 * mm1 - R, mm2 - G, mm0 - B
 */ ```
© www.soinside.com 2019 - 2024. All rights reserved.