FFmpeg源代码:av_image_get_buffer_size

网友投稿 979 2022-09-30

FFmpeg源代码:av_image_get_buffer_size

FFmpeg源代码:av_image_get_buffer_size

/** * Return the size in bytes of the amount of data required to store an * image with the given parameters. * * @param pix_fmt the pixel format of the image * @param width the width of the image in pixels * @param height the height of the image in pixels * @param align the assumed linesize alignment * @return the buffer size in bytes, a negative error code in case of failure */int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align);

根据像素格式、宽、高、linesize 对其方式来计算所需的内存大小。

重点说明一个参数align:此参数是设定​​内存​​对齐的对齐数,也就是按多大的字节进行内存对齐。比如设置为1,表示按1字节对齐,那么得到的结果就是与实际的内存大小一样。再比如设置为4,表示按4字节对齐。也就是内存的起始地址必须是4的整倍数

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:springboot多环境进行动态配置的方法
下一篇:手机上的小程序缓存该怎么清除(怎样清除小程序缓存)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~