当前位置: 首页 > news >正文

css3做的网站百度指数总结

css3做的网站,百度指数总结,个人如何制作网站,合肥网站建设哪家公司好一、简介:libyuv 最初是由Google开发的,主要是为了支持WebRTC项目中的视频处理需求。用于处理YUV格式图像数据的开源库。它提供了一系列的函数,用于转换、缩放、旋转和其他操作YUV图像数据。 二、执行下面的命令下载和安装libyuv。 git clo…

一、简介:libyuv 最初是由Google开发的,主要是为了支持WebRTC项目中的视频处理需求。用于处理YUV格式图像数据的开源库。它提供了一系列的函数,用于转换、缩放、旋转和其他操作YUV图像数据。

二、执行下面的命令下载和安装libyuv。

git clone https://github.com/lemenkov/libyuv.git
cd libyuv
mkdir build && cd build
cmake ..
make
sudo make install

三、测试实例convert_yuv_to_rgb.cpp,使用c编译的时候,I420ToRGB24前面就不要有libyuv::。

#include <stdio.h>
#include <stdlib.h>
#include "libyuv/convert_from.h"
#include "libyuv/convert.h"int main() {FILE *input_file = fopen("cowboy_girl_1024X1280_yuv420p_i420.yuv", "rb");if (!input_file) {printf("Error opening input file.\n");return 1;}int width = 1024;int height = 1280;size_t uv_size = (width * height) / 2;uint8_t *yuv_data = (uint8_t *)malloc(width * height * 3 / 2);if (!yuv_data) {printf("Memory allocation error.\n");fclose(input_file);return 1;}fread(yuv_data, sizeof(uint8_t), width * height * 3 / 2, input_file);fclose(input_file);// Convert YUV to RGB24uint8_t *rgb_data = (uint8_t *)malloc(width * height * 3);if (!rgb_data) {printf("Memory allocation error.\n");free(yuv_data);return 1;}libyuv::I420ToRGB24(yuv_data, width, yuv_data + width * height, width / 2,yuv_data + width * height * 5 / 4, width / 2,rgb_data, width * 3, width, height);
/*libyuv::I420ToRAW(yuv_data, width, yuv_data + width * height, width / 2,yuv_data + width * height * 5 / 4, width / 2,rgb_data, width * 3, width, height);
*/// Save RGB image to fileFILE *output_file = fopen("output.rgb", "wb");if (!output_file) {printf("Error opening output file.\n");free(yuv_data);free(rgb_data);return 1;}fwrite(rgb_data, sizeof(uint8_t), width * height * 3, output_file);fclose(output_file);free(yuv_data);free(rgb_data);printf("Conversion complete.\n");return 0;
}

四、测试运行结果

g++ -o convert_yuv_to_rgb convert_yuv_to_rgb.cpp -lyuv
./convert_yuv_to_rgb

五、上面的测试得出的yuv文件显示出来的效果有点异常,R和B对换了,为啥呢?这个问题困扰了我许久。直到我看到我看到libyuv/include/libyuv/convert.h里面有这一段才豁然开朗,因为RGB24ToI420也是存在这个问题,解决方法是使用I420ToRAW、RAWToI420对换。

// RGB little endian (bgr in memory) to I420.
LIBYUV_API
int RGB24ToI420(const uint8_t* src_rgb24,int src_stride_rgb24,uint8_t* dst_y,int dst_stride_y,uint8_t* dst_u,int dst_stride_u,uint8_t* dst_v,int dst_stride_v,int width,int height);

六、如果运行的时候提示找不到libyuv.so库,按照下面的方法运行sudo ldconfig更新动态链接库缓存。也可以直接用gcc -o yuv yuv.c  /usr/local/lib/libyuv.so这种编译形式。

编辑配置文件并使新安装的库生效:
sudo vi /etc/ld.so.conf
在末尾加入如下行:
include /usr/local/libsudo ldconfig

http://www.yidumall.com/news/97642.html

相关文章:

  • 深圳市网络seo推广平台品牌seo主要做什么
  • 网站建设与管理的未来规划方案百度后台登录
  • 想建书画网站怎么做的百度做免费推广的步骤
  • 绍兴网站设计做网站的软件有哪些
  • 有免费做网站的吗如何去做网络营销
  • b2b的典型网站快推广app下载
  • 淄博安监局网站两体系建设餐饮营销引流都有什么方法
  • 怎么应聘淘宝客服在家兼职百度seo价格查询系统
  • 网站滚动效果怎么做的网站怎么让百度收录
  • 阿里云 建设网站营销软文
  • 建设银行指定网站网站收录提交入口大全
  • 义乌市网站建设代理情感营销经典案例
  • 做网站怎么别人搜不出来网络营销软件大全
  • 网站内容为王世界杯排名
  • 最好的wordpress网站本网站三天换一次域名
  • 喀什做网站长沙网络营销外包哪家好
  • 做网站需要什么语言网络营销企业是什么
  • 深圳网站制作易捷网络怎么做app推广和宣传
  • php做网站后台有哪些框架知乎营销推广
  • 凡科网站内容怎么做效果好seo快速建站
  • 网站开发商城实例网上教育培训机构哪家好
  • 网站备案人授权黄页88网
  • 做网站的是什么工种打开百度浏览器
  • 投注类网站怎么做自动软件爱用建站
  • wordpress插入广告重庆seo优化效果好
  • 山西网站制作平台非企户百度推广
  • 做网站去除视频广告交换链接
  • 福州做网站建设服务商最新疫情19个城市封城
  • 做网站通常用的软件杭州seo网站建设靠谱
  • 潍坊高端网站开发软文广告范例大全