我正在研究 HEVC,即 X265,在这里我正在尝试使用从文件中读取的值输入 QP 数组。我知道 qp 数组的值将从 0 到 100。
我创建了一个测试文件并输入 1 和 0 的组合直到 99。文件如下所示:
10101010110101010000000000000000000000000000000000000000000000000000000000000000000000000000000000
我为此目的编写的代码如下:
ifstream myfile;
myfile.open("/Users/Ahmedrik/Mine/Uni-Stuff/Test-FYP/roi.txt");
char input[100];
int qp_input[100];
while (!myfile.eof()) {
myfile >> input;
cout<< input<<endl;
}myfile.close();
for(int i=0;i<100;i++){
qp_input[i]=(int)input[i];
if(qp_input[i]==48){
qp_input[i]=1;
}
else
qp_input[i]=0;
cout<<i<<" : "<<qp_input[i]<<endl;
}
但我无法拥有正确的价值观。qp_input 保持为 0。我做错了什么?