aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiguelfreitas <devnull@localhost>2005-05-16 01:33:33 (GMT)
committermiguelfreitas <devnull@localhost>2005-05-16 01:33:33 (GMT)
commitcf6c60fad22baae33ee51c5b1277f7046dba58de (patch)
treef7147c4713554f0b04ca232e36217f213804e561
parent87b00be2f34483f5e553e2f149da61f2cd3761e8 (diff)
- add second_field and delaysfield (parameters used in xine)
- some small suggestions in tvtime.c, but commented out.
-rw-r--r--plugins/greedy.c1
-rw-r--r--plugins/kdetv_greedyh.c4
-rw-r--r--plugins/kdetv_tomsmocomp.c4
-rw-r--r--plugins/linear.c1
-rw-r--r--plugins/linearblend.c1
-rw-r--r--plugins/scalerbob.c1
-rw-r--r--plugins/vfir.c1
-rw-r--r--plugins/weave.c1
-rw-r--r--plugins/weavebff.c1
-rw-r--r--plugins/weavetff.c1
-rw-r--r--src/deinterlace.h7
-rw-r--r--src/tvtime.c25
12 files changed, 37 insertions, 11 deletions
diff --git a/plugins/greedy.c b/plugins/greedy.c
index 2c087d0..9896a8b 100644
--- a/plugins/greedy.c
+++ b/plugins/greedy.c
@@ -182,6 +182,7 @@ static deinterlace_method_t greedymethod =
copy_scanline,
deinterlace_greedy_packed422_scanline_mmxext,
0,
+ 1,
{ "Uses heuristics to detect motion in the input",
"frames and reconstruct image detail where",
"possible. Use this for high quality output",
diff --git a/plugins/kdetv_greedyh.c b/plugins/kdetv_greedyh.c
index 1aec8da..c567767 100644
--- a/plugins/kdetv_greedyh.c
+++ b/plugins/kdetv_greedyh.c
@@ -36,7 +36,8 @@
static void deinterlace_frame_di_greedyh( uint8_t *output, int outstride,
deinterlace_frame_data_t *data,
- int bottom_field, int width, int height )
+ int bottom_field, int second_field,
+ int width, int height )
{
TDeinterlaceInfo Info;
TPicture Picture[ 8 ];
@@ -111,6 +112,7 @@ static deinterlace_method_t greedymethod =
0,
0,
deinterlace_frame_di_greedyh,
+ 0,
{ "Uses heuristics to detect motion in the input",
"frames and reconstruct image detail where",
"possible. Use this for high quality output",
diff --git a/plugins/kdetv_tomsmocomp.c b/plugins/kdetv_tomsmocomp.c
index 0239b90..4f78f3e 100644
--- a/plugins/kdetv_tomsmocomp.c
+++ b/plugins/kdetv_tomsmocomp.c
@@ -35,7 +35,8 @@
static void deinterlace_frame_di_tomsmocomp( uint8_t *output, int outstride,
deinterlace_frame_data_t *data,
- int bottom_field, int width, int height )
+ int bottom_field, int second_field,
+ int width, int height )
{
TDeinterlaceInfo Info;
TPicture Picture[ 8 ];
@@ -110,6 +111,7 @@ static deinterlace_method_t tomsmocompmethod =
0,
0,
deinterlace_frame_di_tomsmocomp,
+ 0,
{ "Uses heuristics to detect motion in the input",
"frames and reconstruct image detail where",
"possible. Use this for high quality output",
diff --git a/plugins/linear.c b/plugins/linear.c
index 303e7af..5e8c7c6 100644
--- a/plugins/linear.c
+++ b/plugins/linear.c
@@ -52,6 +52,7 @@ static deinterlace_method_t linearmethod =
deinterlace_scanline_linear,
copy_scanline,
0,
+ 0,
{ "Expands each field independently without",
"blurring or copying in time. Use this if you",
"want TV-quality with low CPU, and you have",
diff --git a/plugins/linearblend.c b/plugins/linearblend.c
index d6cb87b..70a877e 100644
--- a/plugins/linearblend.c
+++ b/plugins/linearblend.c
@@ -179,6 +179,7 @@ static deinterlace_method_t linearblendmethod =
deinterlace_scanline_linear_blend,
deinterlace_scanline_linear_blend2,
0,
+ 0,
{ "Avoids flicker by blurring consecutive frames",
"of input. Use this if you want to run your",
"monitor at an arbitrary refresh rate and not",
diff --git a/plugins/scalerbob.c b/plugins/scalerbob.c
index 5a32579..0b80084 100644
--- a/plugins/scalerbob.c
+++ b/plugins/scalerbob.c
@@ -34,6 +34,7 @@ static deinterlace_method_t scalerbobmethod =
0,
0,
0,
+ 0,
{ "Expands each field independently without",
"blurring or copying in time. Use this if you",
"want TV-quality with low CPU, and you have",
diff --git a/plugins/vfir.c b/plugins/vfir.c
index 55bfe0e..21acc0e 100644
--- a/plugins/vfir.c
+++ b/plugins/vfir.c
@@ -142,6 +142,7 @@ static deinterlace_method_t vfirmethod =
deinterlace_scanline_vfir,
copy_scanline,
0,
+ 0,
{ "Avoids flicker by blurring consecutive frames",
"of input. Use this if you want to run your",
"monitor at an arbitrary refresh rate and not",
diff --git a/plugins/weave.c b/plugins/weave.c
index a3e20f4..7050781 100644
--- a/plugins/weave.c
+++ b/plugins/weave.c
@@ -54,6 +54,7 @@ static deinterlace_method_t weavemethod =
deinterlace_scanline_weave,
copy_scanline,
0,
+ 0,
{ "Only updates the most recent field",
"",
"",
diff --git a/plugins/weavebff.c b/plugins/weavebff.c
index 54f8774..8c1f997 100644
--- a/plugins/weavebff.c
+++ b/plugins/weavebff.c
@@ -57,6 +57,7 @@ static deinterlace_method_t weavemethod =
deinterlace_scanline_weave,
copy_scanline,
0,
+ 0,
{ "Constructs frames from pairs of fields. Use",
"this if you are watching a film broadcast or",
"DVD in a PAL area, or if you are using a",
diff --git a/plugins/weavetff.c b/plugins/weavetff.c
index 7875c61..17bc3c7 100644
--- a/plugins/weavetff.c
+++ b/plugins/weavetff.c
@@ -57,6 +57,7 @@ static deinterlace_method_t weavemethod =
deinterlace_scanline_weave,
copy_scanline,
0,
+ 0,
{ "Constructs frames from pairs of fields. Use",
"this if you are watching a film broadcast or",
"DVD in a PAL area, or if you are using a",
diff --git a/src/deinterlace.h b/src/deinterlace.h
index ff10741..6d4d168 100644
--- a/src/deinterlace.h
+++ b/src/deinterlace.h
@@ -106,9 +106,13 @@ struct deinterlace_frame_data_s
uint8_t *f3;
};
+/**
+ * Note: second_field is used in xine. For tvtime it should be the same as bottom_field.
+ */
typedef void (*deinterlace_frame_t)( uint8_t *output, int outstride,
deinterlace_frame_data_t *data,
- int bottom_field, int width, int height );
+ int bottom_field, int second_field,
+ int width, int height );
/**
@@ -125,6 +129,7 @@ struct deinterlace_method_s
deinterlace_interp_scanline_t interpolate_scanline;
deinterlace_copy_scanline_t copy_scanline;
deinterlace_frame_t deinterlace_frame;
+ int delaysfield; /* xine: this method delays output by one field relative to input */
const char *description[ 10 ];
};
diff --git a/src/tvtime.c b/src/tvtime.c
index f4b0703..fe0eb12 100644
--- a/src/tvtime.c
+++ b/src/tvtime.c
@@ -387,7 +387,7 @@ static void tvtime_build_deinterlaced_frame( tvtime_t *tvtime,
uint8_t *curframe,
uint8_t *lastframe,
uint8_t *secondlastframe,
- int bottom_field,
+ int bottom_field, int second_field,
int width,
int frame_height,
int instride,
@@ -485,7 +485,7 @@ static void tvtime_build_deinterlaced_frame( tvtime_t *tvtime,
data.f1 = lastframe;
data.f2 = secondlastframe;
- tvtime->curmethod->deinterlace_frame( output, outstride, &data, bottom_field, width, frame_height );
+ tvtime->curmethod->deinterlace_frame( output, outstride, &data, bottom_field, bottom_field, width, frame_height );
if( tvtime->outputfilter ) {
for( i = 0; i < frame_height; i++ ) {
@@ -526,6 +526,9 @@ static void tvtime_build_deinterlaced_frame( tvtime_t *tvtime,
scanline++;
/* Something is wrong here. -Billy */
+ /* xine's suggestion:
+ loop_size = ((frame_height - 2) / 2);
+ */
loop_size = ((frame_height - 2) / 2) - bottom_field;
for( i = loop_size; i; --i ) {
deinterlace_scanline_data_t data;
@@ -540,7 +543,7 @@ static void tvtime_build_deinterlaced_frame( tvtime_t *tvtime,
videofilter_packed422_scanline( tvtime->inputfilter, curframe + (instride*2), width, 0, scanline + 1 );
}
- if( bottom_field ) {
+ if( second_field ) {
data.tt1 = (i < loop_size) ? (curframe - instride) : (curframe + instride);
data.m1 = curframe + instride;
data.bb1 = (i > 1) ? (curframe + (instride*3)) : (curframe + instride);
@@ -553,7 +556,7 @@ static void tvtime_build_deinterlaced_frame( tvtime_t *tvtime,
data.t2 = lastframe;
data.b2 = lastframe + (instride*2);
- if( bottom_field ) {
+ if( second_field ) {
data.tt3 = (i < loop_size) ? (lastframe - instride) : (lastframe + instride);
data.m3 = lastframe + instride;
data.bb3 = (i > 1) ? (lastframe + (instride*3)) : (lastframe + instride);
@@ -575,7 +578,7 @@ static void tvtime_build_deinterlaced_frame( tvtime_t *tvtime,
data.m0 = curframe + (instride*2);
data.bb0 = (i > 1) ? (curframe + (instride*4)) : (curframe + (instride*2));
- if( bottom_field ) {
+ if( second_field ) {
data.t1 = curframe + instride;
data.b1 = (i > 1) ? (curframe + (instride*3)) : (curframe + instride);
} else {
@@ -587,11 +590,17 @@ static void tvtime_build_deinterlaced_frame( tvtime_t *tvtime,
data.m2 = lastframe + (instride*2);
data.bb2 = (i > 1) ? (lastframe + (instride*4)) : (lastframe + (instride*2));
- if( bottom_field ) {
+ if( second_field ) {
data.t2 = lastframe + instride;
+ /* xine's suggestion:
+ data.b2 = (i > 1) ? (lastframe + (instride*3)) : (lastframe + instride);
+ */
data.b2 = lastframe + (instride*3);
} else {
data.t2 = secondlastframe + instride;
+ /* xine's suggestion:
+ data.b2 = (i > 1) ? (secondlastframe + (instride*3)) : (secondlastframe + instride);
+ */
data.b2 = secondlastframe + (instride*3);
}
@@ -2253,7 +2262,7 @@ int tvtime_main( rtctimer_t *rtctimer, int read_stdin, int realtime,
tvtime_build_deinterlaced_frame( tvtime,
output->get_output_buffer(),
curframe, lastframe, secondlastframe,
- 0, width, height, width * 2,
+ 0, 0, width, height, width * 2,
output->get_output_stride() );
}
}
@@ -2399,7 +2408,7 @@ int tvtime_main( rtctimer_t *rtctimer, int read_stdin, int realtime,
} else {
tvtime_build_deinterlaced_frame( tvtime,
output->get_output_buffer(),
- curframe, lastframe, secondlastframe, 1,
+ curframe, lastframe, secondlastframe, 1, 1,
width, height, width * 2,
output->get_output_stride() );
}

Privacy Policy