├── CU Partition.PNG └── README.md /CU Partition.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pinchieh/VVC-CU-TU-partition-visualization/HEAD/CU Partition.PNG -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VVC-CU/TU-partition-visualization 2 | ### Visualization 3 | ![image](https://github.com/pinchieh/VVC-CU-TU-partition-visualize/blob/master/CU%20Partition.PNG) 4 | ### Visualize CU/TU partition 5 | Add the following code in EncCU.cpp at the end of compressCTU function 6 | ### CU 7 | 8 | ``` 9 | string filename = to_string(ctuindex); 10 | ofstream myfile; 11 | myfile.open("./CTU_" + filename + ".txt"); 12 | for (auto &currCU : cs.traverseCUs(area, CH_L)) 13 | { 14 | const CompArea& lumaArea = currCU.block(COMPONENT_Y); 15 | int cuX = lumaArea.x; 16 | int cuY = lumaArea.y; 17 | int cuH = lumaArea.height; 18 | int cuW = lumaArea.width; 19 | string info = ""; 20 | 21 | 22 | info = to_string(cuX) + " " + to_string(cuY) + " " + to_string(cuH) +" "+ to_string(cuW) +"\n"; 23 | myfile << info; 24 | 25 | 26 | } 27 | 28 | myfile.close(); 29 | ``` 30 | 31 | ### TU 32 | 33 | ``` 34 | ofstream TUmyfile; 35 | TUmyfile.open("./TU_" + filename + ".txt"); 36 | for (auto &currCU : cs.traverseCUs(area, CH_L)) 37 | { 38 | for (auto &currTU : CU::traverseTUs(currCU)) 39 | { 40 | 41 | const CompArea& lumaArea = currTU.block(COMPONENT_Y); 42 | int cuX = lumaArea.x; 43 | int cuY = lumaArea.y; 44 | int cuH = lumaArea.height; 45 | int cuW = lumaArea.width; 46 | int mtsidx = currTU.mtsIdx; 47 | string info = ""; 48 | info = to_string(cuX) + " " + to_string(cuY) + " " + to_string(cuH) + " " + to_string(cuW) + " " + to_string(mtsidx) + "\n"; 49 | TUmyfile << info; 50 | 51 | } 52 | 53 | } 54 | 55 | TUmyfile.close(); 56 | ``` 57 | --------------------------------------------------------------------------------