91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-14
  • 語言: C/C++
  • 標簽: PSNR,YUV??

資源簡介

計算兩個視頻YUV序列的PSNR,可用于壓縮后得到的視頻與原始視頻進行質(zhì)量對比。

資源截圖

代碼片段和文件信息

/**?
*?Calculate?PSNR?between?2?YUV420P?file?
*?@param?url1?????Location?of?first?Input?YUV?file.?
*?@param?url2?????Location?of?another?Input?YUV?file.?
*?@param?w????????Width?of?Input?YUV?file.?
*?@param?h????????Height?of?Input?YUV?file.?
*?@param?num??????Number?of?frames?to?process.?
*/??
#include
using?namespace?std;
int?simplest_yuv420_psnr(char?*url1char?*url2int?wint?hint?num){??
????FILE?*fp1=fopen(url1“rb+“);??
????FILE?*fp2=fopen(url2“rb+“);??
FILE?*fp=fopen(“Video_PSNR.txt““w“);?????????//創(chuàng)建存取PSNR值信息的txt文件

????unsigned?char?*pic1=(unsigned?char?*)malloc(w*h);??
????unsigned?char?*pic2=(unsigned?char?*)malloc(w*h);??
????
float?Sum_PSNR=0;????//定義所有幀的PSNR和
float?average_PSNR;??//定義平均PSNR
????for(int?i=0;i????????fread(pic11w*hfp1);??
????????fread(pic21w*hfp2);??

????????double?mse_sum=0mse=0psnr=0;??
????????for(int?j

評論

共有 條評論

相關(guān)資源