I am working on HEVC i.e. X265 and over here I am trying input the QP array with the values I read from file.I know that values of qp array would be from 0 to 100.
I have created a testing file and input a combination of 1's and 0's till 99. The files looks like this:
10101010110101010000000000000000000000000000000000000000000000000000000000000000000000000000000000
the code i have written for this purpose is as follows:
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;
}
But I am unable to have correct values. The qp_input stays 0. What is it that I am doing wrong?