read data from file to an array - c++

I have the following data written on a file. I want to neglect all the zeros in the beginning and the but the starting from 181 in an array each number in a cell so I could use it easily.
I know how to put data in an array but how could I neglect all these zeros ??
0 177 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 181 98 1 2 28 0 104 93 165 3 7 110 239 5 172 164 176 29 56 147 4 0 234 215 3 0 166 6 0 0 78 5 0 0 164 145 181 98 1 2 28 0 80 97 165 3 7 110 239 5 172 164 176 29 56 147 4 0 234 215 3 0 169 6 0 0 78 5 0 0 147 117 181 98 1 2 28 0 56 101 165 3 7 110 239 5 172 164 176 29 56 147 4 0 234 215 3 0 173 6 0 0 81 5 0 0 134 109 181 98 1 2 28 0 32 105 165 3 7 110 239 5 172 164 176 29 56 147 4 0 234 215 3 0 181 6 0 0 85 5 0 0 126 137 181 98 1 2 28 0 8 109 165 3 7 110 239 5 172 164 176 29 56 147 4 0 234 215 3 0 182 6 0 0 87 5 0 0 109 101

I am not sure I understand your question, so I will post multiple answers. Choose the one that fits with your problem's description.
Case 1: ignore everything before(or before and including) 181:
#include <iostream>
#include <fstream>
#include <vector>
int main() {
std::ifstream in("input.txt");
std::vector<int> vec;
int reached_181 = 0, x;
while(in >> x) {
if(x == 181) reached_181 = 1;
if(reached_181) vec.push_back(x);
// if you also want to neglect 181 then just change the order of the two commands
// if(reached_181) vec.push_back(x);
// if(x == 181) reached_181 = 1;
}
for(std::vector<int>::size_type i=0; i<vec.size(); ++i) {
std::cout << vec[i] << " ";
}
return 0;
}
Case 2: ignore every zero before 181
#include <iostream>
#include <fstream>
#include <vector>
int main() {
std::ifstream in("input.txt");
std::vector<int> vec;
int reached_181 = 0, x;
while(in >> x) {
if(x == 181) reached_181 = 1;
if(reached_181 || x) vec.push_back(x);
}
for(std::vector<int>::size_type i=0; i<vec.size(); ++i) {
std::cout << vec[i] << " ";
}
return 0;
}
Case 3: ignore all the zeroes in the input file
#include <iostream>
#include <fstream>
#include <vector>
int main() {
std::ifstream in("input.txt");
std::vector<int> vec;
int x;
while(in >> x) {
if(x) vec.push_back(x);
}
for(std::vector<int>::size_type i=0; i<vec.size(); ++i) {
std::cout << vec[i] << " ";
}
return 0;
}

Try this:
#include <fstream>
#include <vector>
#include <iostream>
int main()
{
std::vector<int> v;
std::fstream out("out.txt"); // name of your file
bool hit;
for (int n; (out >> n);)
{
if (n == 181 && !hit)
hit = true;
if (!hit)
if (n)
v.push_back(n);
if (hit)
v.push_back(n);
}
typedef std::vector<int>::const_iterator iter_type;
for (iter_type it = v.begin(); it != v.end(); ++it)
std::cout << *it << std::endl;
}

Related

Printing an array with a symbol next to it

I would like to print a '>' sign next to an array which is able to move up and down when different things are inputted.
I am able to print a 12x12 array of 0s but when I try to print a '>' in line 7, the '>' is inputted into the array and the row itself is shifted over instead of the array being kept uniform (i.e. the '>' must be independent to the array).
I have tried creating two arrays of the '>' and the 0s but I am not able to print two things horizontally next to each other.
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int row = 0;
while (row < 12){
int col = 0;
while (col < 12){
printf(" 0");
col = col + 1;
}
printf("\n");
row = row + 1;
if (row == 7) {
printf(">");
}
}
return 0;
}
output:
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
intended output:
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
thank you !
To display a ">" sign before your matrix you can use a conditional statement specifically for the required line number.
#include <stdio.h>
#include <stdlib.h>
int main(void) {
for (int i = 0; i < 12; i++)
{
if(i == 7) // conditional statement
printf("> "); // for ">" followed by
else // a space to maintain
printf(" "); // the structure of matrix
for (int j = 0; j < 12; j++)
{
printf("0 ");
}
printf("\n");
}
return 0;
}
Hope it helps!!!

matrix filling, but it is skipping an element each row, why? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have these vectors as follows
vector< vector< Arc * > * > _adjacences;
vector <int> list[_adjacences.size()];
vector <int> listD[_adjacences.size()];
vector < vector <int> > matrix( _adjacences.size(), vector<int>(_adjacences.size(),0 ));
vector < vector <int> > shortPath( _adjacences.size(), vector<int>(_adjacences.size(),0 ));
I want to make the adjacency list to an adjacency matrix
Arc contains these:
int sommetArrive;
int longueur;
string nom;
I tried to make two vectors one for the distance and the other for the peeks
for (unsigned i = 0; i < _adjacences.size(); i++){
for (auto j : *_adjacences[i]){
list[i].push_back(j->sommetArrive);
listD[i].push_back(j->longueur);
}
}
Then I make the adjacency matrix, THIS IS WHERE I'M DOING THINGS WRONG
for (int i = 0; i < _adjacences.size(); i++) {
for (auto j : list[i]){
for (auto k : listD[i]){
matrix[i][j] = k;
}
}
}
Instead of getting this:
0 0 0 0 0 0 0 0 0 0 0 0 0 120 0 62
0 0 253 0 0 0 0 0 0 0 204 0 0 0 0 0
0 53 0 12 0 0 105 0 0 0 0 0 0 0 0 0
0 0 15 0 38 0 0 108 0 0 0 0 0 0 0 0
0 0 0 93 0 123 0 0 113 0 0 0 0 0 0 0
0 0 0 0 158 0 0 0 0 118 0 0 0 0 0 0
0 0 97 0 0 0 0 17 0 0 0 87 0 0 0 0
0 0 0 103 0 0 3 0 53 0 0 0 73 0 0 0
0 0 0 0 153 0 0 33 0 113 0 0 0 0 0 0
0 0 0 0 0 55 0 0 91 0 0 0 0 72 0 0
I end up with this
0 0 0 0 0 0 0 0 0 0 0 0 0 62 0 62
0 0 204 0 0 0 0 0 0 0 204 0 0 0 0 0
0 105 0 105 0 0 105 0 0 0 0 0 0 0 0 0
0 0 108 0 108 0 0 108 0 0 0 0 0 0 0 0
0 0 0 113 0 113 0 0 113 0 0 0 0 0 0 0
0 0 0 0 118 0 0 0 0 118 0 0 0 0 0 0
0 0 87 0 0 0 0 87 0 0 0 87 0 0 0 0
0 0 0 73 0 0 73 0 73 0 0 0 73 0 0 0
0 0 0 0 113 0 0 113 0 113 0 0 0 0 0 0
0 0 0 0 0 72 0 0 72 0 0 0 0 72 0 0
Where the same number is being repeated instead of passing to the next element k
What did I do wrong ?
Notice that for every i you use the same list listD[i]. The inner loop:
for (auto k : listD[i]){
matrix[i][j] = k;
}
will assign all values in listD[i], one by one, to matrix[i][j], until the final value remains. This is the same as writing matrix[i][j] = listD[i].back().
You probably need to replace the inner loop with matrix[i][j] = listD[i][j].

QImage: how to convert a gray image to a RGB heatmap

I am trying to convert a Format_Grayscale8 image to Format_ARGB32 (or any other 8bpp RGB format). I tried to use QImage::convertToFormat and a color table but I can't make it work. The input is a small 8bit gray image (PGM format text string).
QImage img;
img.loadFromData(gray_map.toLatin1());
QImage heatmap = img.convertToFormat(QImage::Format_Indexed8, color_gradient.getColorMap());
Doing it manually works fine (pixel per pixel):
// gray_img format is QImage::Format_Grayscale8
QImage createHeatMap(QImage gray_img)
{
QImage heatmap(gray_img.width(), gray_img.height(), QImage::Format_ARGB32);
// custom heatmap, size() is 256
const QVector<QRgb> color_map = color_gradient.getColorMap();
// Default color
heatmap.fill(color_map[0]);
for (int y = 0; y < gray_img.height(); y++)
{
for (int x = 0; x < gray_img.width(); x++)
{
const uchar* img_ptr = gray_img.bits();
int offset = x + y*gray_img.bytesPerLine();
uchar gray_pix = *(img_ptr + offset);
// just in case
if (gray_pix < color_map.size())
heatmap.setPixel(x, y, color_map[gray_pix]);
}
}
return heatmap;
}
QImage img;
img.loadFromData(doppler_map.toLatin1());
QImage heatmap = createHeatMap(img);
I am interested in a simpler and more efficient solution. Thanks!
EDIT
Here is the code to generate the color gradient:
// Heatmap color lookup table generator, inspired from:
// http://www.andrewnoske.com/wiki/Code_-_heatmaps_and_color_gradients
#include <QColor>
class ColorGradient
{
private:
struct ColorPoint
{
float r, g, b;
float val; // Position of our color along the gradient (between 0 and 1).
ColorPoint(float red, float green, float blue, float value)
: r(red), g(green), b(blue), val(value)
{
}
};
std::vector<ColorPoint> mColors; // An array of color points in ascending value.
uint mTableSize = 0;
QVector<QRgb> mColorMap;
// hidden
ColorGradient();
public:
inline auto getColorMap()
{
return mColorMap;
}
ColorGradient(uint table_size)
{
createDefaultHeatMapGradient(table_size);
}
//-- Places a 6 color heapmap gradient into the "color" vector
#define CF64(val) ((float)(val) / 64.0)
#define CF256(val) ((float)(val) / 256.0)
void createDefaultHeatMapGradient(uint table_size)
{
mTableSize = table_size;
mColorMap.clear();
mColors.clear();
// ascending order
mColors.push_back(ColorPoint(0, 0, CF256(96), CF64(00))); // Dark Blue
mColors.push_back(ColorPoint(0, 0, 1, CF64(06))); // Blue
mColors.push_back(ColorPoint(0, 1, 1, CF64(22))); // Cyan
mColors.push_back(ColorPoint(1, 1, 0, CF64(39))); // Yellow
mColors.push_back(ColorPoint(1, 0, 0, CF64(55))); // Red
mColors.push_back(ColorPoint(CF256(159),0, 0, CF64(63))); // Dark Red
QColor color;
// Generate the color table
for (uint n = 0; n < table_size; n++)
{
float value = (float)n / (float)table_size;
bool found = false;
for (int i = 0; i < mColors.size(); i++)
{
ColorPoint &currC = mColors[i];
if (value < currC.val)
{
ColorPoint &prevC = mColors[std::max(0, i - 1)];
float valueDiff = (prevC.val - currC.val);
float fractBetween = (valueDiff == 0) ? 0 : (value - currC.val) / valueDiff;
float r = (prevC.r - currC.r)*fractBetween + currC.r;
float g = (prevC.g - currC.g)*fractBetween + currC.g;
float b = (prevC.b - currC.b)*fractBetween + currC.b;
color.setRgbF(r, g, b);
mColorMap.append(color.rgb());
found = true;
break;
}
}
if (!found)
{
color.setRgbF(mColors.back().r, mColors.back().g, mColors.back().b);
mColorMap.append(color.rgb());
}
}
}
};
And a sample text image file:
P2
40 17
64
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 7 7 7 7 7 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 13 13 13 13 13 13 13 13 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 10 10 10 10 10 10 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 14 14 14 14 14 14 14 14 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 23 23 23 23 23 23 23 23 23 23 23 23 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 13 13 13 13 13 13 13 13 13 13 13 13 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The trick is to first convert to QImage::Format_Indexed8 without any color map, and set it in a separate call:
QImage heatmap = img.convertToFormat(QImage::Format_Indexed8);
heatmap.setColorTable(color_gradient.getColorMap());
After this, you can make a second conversion to QImage::Format_RGB888 or whatever you need.

PEM certificate changes after reading from file in C++

I have a PEM Certificate generated using OpenSSL. The certificate is read using fopen call in C++. The X509 object is then copied into an unsigned char array using memcpy, and the ascii values of the array are displayed.
When I repeat the same process (reading the file, and displaying the ascii values), the results differ. Results differ across executions, as well as in the same execution.
This is how I am reading the certificate
FILE* f_cert = fopen(filename.str().c_str(), "r");
X509 *tempCert = NULL;
PEM_read_X509(f_cert, &tempCert, NULL, NULL);
This is how I display the certificate
memcpy (temp, tempCert, sizeof(Certi));
for (int a=0; a<sizeof(X509); a++){
cout << (int)temp[a] << " ";
}
Output-1:
16 216 64 1 0 0 0 0 128 223 64 1 0 0 0 0 160 223 64 1 0 0 0 0 0 0 0 0
1 0 0 0 208 232 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255
255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Output-2:
16 216 212 0 0 0 0 0 128 223 212 0 0 0 0 0 160 223 212 0 0 0 0 0 0 0 0
0 1 0 0 0 208 232 212 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255
255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
But when I read the certificate's MD5, it stays the same. What could be an explanation for this?
I need to insert this certificate into a Bloom Filter.
Thanks in advance.

HM encoder 16.4 predMode is 2

I want to determine if a CU has been intra or inter encoded with the HEVC reference software HM 16.4 encoder.
In TEncSlice.cpp, after a CTU has been compressed (m_pcCuEncoder->compressCtu( pCtu );), I should be able to tell if a CU is intra or inter encoded.
Therefore, I check the m_pePredMode array of TComDataCU* pCtu:
Char* predMode = pCtu->getPredictionMode();
for (int i = 0; i < pCtu->getTotalNumPart(); i++)
{
std::cout << (int)predMode[i] << " ";
}
std::cout << std::endl;
PredMode is defined in TypeDef.h as:
enum PredMode
{
MODE_INTER = 0, ///< inter-prediction mode
MODE_INTRA = 1, ///< intra-prediction mode
NUMBER_OF_PREDICTION_MODES = 2,
};
The output of my code first gives me the expected result. For the first intra frame, I first only get ones (MODE_INTRA). But for certain CTUs, I also get "twos", which doesn't really make sense to me, as 2 is not supposed to describe a prediction mode.
Similarly, in the inter frames (P frames), I mostly get zeros (MODE_INTER), a few ones (MODE_INTRA), which is ok. But then I also get some "twos". A part of an example output looks like this (each row corresponds to a 64x64 CTU):
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Does anyone know what these mean? I checked if this would correspond to skip mode, but there was no correlation between the skip flag and the 2s.
Well, I got the answer to this question:
If a CU has predMode 2, this means that the CU is not coded. This happens in this case because the CUs are outside the boundaries of the picture.
The sequence that was coded had a resolution of 416x240 and the CTU size was 64x64. So there are 6.5 CTUs in a row.
This explain why every 7 CTUs, I get 2s as predMode.