gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 16:19:27 28 4
gpt4 key购买 nike

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

最佳答案

好吧,由于没有人提出解决方案,我只是要发布我发现使用valgrind 工具=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
*/ ```

关于c - FFMPEG 用于从 yuv420p 转换为 rgb bmp 的所有操作是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55621559/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com