//将BasketballPass_416x240_50.yuv序列的前50帧和BlowingBubbles_416x240_50.yuv序列的前250帧合并成out.yuv
//参数配置416 240 50 BasketballPass_416x240_50.yuv 416 240 250 BlowingBubbles_416x240_50.yuv out.yuv
#include <iostream> #include <fstream> using namespace std; //参数配置416 240 50 BasketballPass_416x240_50.yuv 416 240 250 BlowingBubbles_416x240_50.yuv out.yuv int main(int argc, char *argv[]) { ifstream fin; fin.open(argv[4], std::ifstream::binary); int width = atoi(argv[1]); int height = atoi(argv[2]); int frames = atoi(argv[3]); int num = width * height * frames * 1.5; ofstream fout; fout.open(argv[9], std::ofstream::binary); char* buf = new char[num]; fin.read(buf, num); fout.write(buf, num); fin.close(); delete []buf; fin.open(argv[8], std::ifstream::binary); width = atoi(argv[5]); height = atoi(argv[6]); frames = atoi(argv[7]); num = width * height * frames * 1.5; buf = new char[num]; fin.read(buf, num); fout.write(buf, num); fin.close(); delete []buf; fout.close(); cout << "Done!" << endl; getchar(); return 0; }