Skip to content

Commit

Permalink
enable 3d comb filtering at the end, shift frame slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
happycube committed Oct 24, 2018
1 parent bea37dc commit 429d525
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions comb-ntsc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class Comb

void Split2D(int f)
{
for (int l = 40; l < in_y; l++) {
for (int l = 36; l < in_y; l++) {
uint16_t *pline = &Frame[f].rawbuffer[(l - 2) * in_x];
uint16_t *line = &Frame[f].rawbuffer[l * in_x];
uint16_t *nline = &Frame[f].rawbuffer[(l + 2) * in_x];
Expand Down Expand Up @@ -368,7 +368,7 @@ class Comb

void Split3D(int f, bool opt_flow = false)
{
for (int l = 40; l < in_y; l++) {
for (int l = 36; l < in_y; l++) {
uint16_t *line = &Frame[f].rawbuffer[l * in_x];

// shortcuts for previous/next 1D/pixel lines
Expand Down Expand Up @@ -417,7 +417,7 @@ class Comb

memset(Frame[f].cbuf, 0, sizeof(cline_t) * in_y);

for (int l = 44; l < in_y; l++) {
for (int l = 36; l < in_y; l++) {
double msel = 0.0, sel = 0.0;
uint16_t *line = &Frame[f].rawbuffer[l * in_x];
bool invertphase = (line[0] == 16384);
Expand Down Expand Up @@ -483,7 +483,7 @@ class Comb
}

void DoCNR(int f, cline_t cbuf[in_y], double min = -1.0) {
int firstline = (linesout == in_y) ? 20 : 42;
int firstline = (linesout == in_y) ? 20 : 38;

if (nr_c < min) nr_c = min;
if (nr_c <= 0) return;
Expand Down Expand Up @@ -521,7 +521,7 @@ class Comb
}

void DoYNR(int f, cline_t cbuf[in_y], double min = -1.0) {
int firstline = (linesout == in_y) ? 20 : 42;
int firstline = (linesout == in_y) ? 20 : 38;

if (nr_y < min) nr_y = min;

Expand Down Expand Up @@ -603,7 +603,7 @@ class Comb
static int fcount = 0;
//int fnum = 0;

const int cysize = 242;
const int cysize = 252;
const int cxsize = in_x - 70;

uint16_t fieldbuf[in_x * cysize];
Expand All @@ -622,7 +622,7 @@ class Comb
fieldbuf[(y * cxsize) + x] = cbuf[23 + field + (y * 2)].p[70 + x].y;
}
}
pic = Mat(242, cxsize, CV_16UC1, fieldbuf);
pic = Mat(252, cxsize, CV_16UC1, fieldbuf);
if (fcount) calcOpticalFlowFarneback(pic, prev[field], flow[field], 0.5, 4, 60, 3, 7, 1.5, (fcount > 1) ? OPTFLOW_USE_INITIAL_FLOW : 0);
prev[field] = pic.clone();
}
Expand Down Expand Up @@ -733,7 +733,7 @@ class Comb
}

void AdjustY(int f, cline_t cbuf[in_y]) {
int firstline = (linesout == in_y) ? 20 : 42;
int firstline = (linesout == in_y) ? 20 : 38;
// remove color data from baseband (Y)
for (int l = firstline; l < in_y; l++) {
bool invertphase = (Frame[f].rawbuffer[l * in_x] == 16384);
Expand Down Expand Up @@ -833,7 +833,7 @@ class Comb
// buffer: in_xxin_y uint16_t array
void Process(uint16_t *buffer, int dim = 2)
{
int firstline = (linesout == in_y) ? 20 : 42;
int firstline = (linesout == in_y) ? 20 : 38;
int f = (dim == 3) ? 1 : 0;

cerr << "P " << f << ' ' << dim << endl;
Expand Down

0 comments on commit 429d525

Please sign in to comment.