Commit 94ad5d01 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_readeia608: factor some constants out

parent 94682555
...@@ -37,8 +37,10 @@ ...@@ -37,8 +37,10 @@
#include "video.h" #include "video.h"
#define LAG 25 #define LAG 25
#define SYNC_MIN 12.f #define CLOCK_BITSIZE_MIN 0.2f
#define SYNC_MAX 15.f #define CLOCK_BITSIZE_MAX 1.5f
#define SYNC_BITSIZE_MIN 12.f
#define SYNC_BITSIZE_MAX 15.f
typedef struct LineItem { typedef struct LineItem {
int input; int input;
...@@ -314,8 +316,8 @@ static void extract_line(AVFilterContext *ctx, AVFrame *in, int w, int nb_line) ...@@ -314,8 +316,8 @@ static void extract_line(AVFilterContext *ctx, AVFrame *in, int w, int nb_line)
dump_code(ctx, len, nb_line); dump_code(ctx, len, nb_line);
if (len < 15 || if (len < 15 ||
s->code[14].bit != 0 || s->code[14].bit != 0 ||
w / (float)s->code[14].size < SYNC_MIN || w / (float)s->code[14].size < SYNC_BITSIZE_MIN ||
w / (float)s->code[14].size > SYNC_MAX) { w / (float)s->code[14].size > SYNC_BITSIZE_MAX) {
return; return;
} }
...@@ -325,8 +327,8 @@ static void extract_line(AVFilterContext *ctx, AVFrame *in, int w, int nb_line) ...@@ -325,8 +327,8 @@ static void extract_line(AVFilterContext *ctx, AVFrame *in, int w, int nb_line)
bit_size /= 19.f; bit_size /= 19.f;
for (i = 1; i < 14; i++) { for (i = 1; i < 14; i++) {
if (s->code[i].size > bit_size * 1.5f || if (s->code[i].size / bit_size > CLOCK_BITSIZE_MAX ||
s->code[i].size < bit_size * 0.2f) { s->code[i].size / bit_size < CLOCK_BITSIZE_MIN) {
return; return;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment