diff options
Diffstat (limited to 'src/post/deinterlace')
-rw-r--r-- | src/post/deinterlace/Makefile.am | 2 | ||||
-rw-r--r-- | src/post/deinterlace/plugins/Makefile.am | 4 | ||||
-rw-r--r-- | src/post/deinterlace/plugins/greedy.c | 6 | ||||
-rw-r--r-- | src/post/deinterlace/plugins/greedy2frame_template.c | 32 | ||||
-rw-r--r-- | src/post/deinterlace/plugins/greedyhmacros.h | 26 | ||||
-rw-r--r-- | src/post/deinterlace/plugins/linearblend.c | 2 | ||||
-rw-r--r-- | src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h | 26 | ||||
-rw-r--r-- | src/post/deinterlace/pulldown.c | 10 | ||||
-rw-r--r-- | src/post/deinterlace/speedy.c | 26 | ||||
-rw-r--r-- | src/post/deinterlace/speedy.h | 4 | ||||
-rw-r--r-- | src/post/deinterlace/tvtime.h | 2 | ||||
-rw-r--r-- | src/post/deinterlace/xine_plugin.c | 200 |
12 files changed, 170 insertions, 170 deletions
diff --git a/src/post/deinterlace/Makefile.am b/src/post/deinterlace/Makefile.am index 54ab83572..fa2ad85fd 100644 --- a/src/post/deinterlace/Makefile.am +++ b/src/post/deinterlace/Makefile.am @@ -9,7 +9,7 @@ SUBDIRS = plugins xinepost_LTLIBRARIES = xineplug_post_tvtime.la xineplug_post_tvtime_la_SOURCES = xine_plugin.c \ - deinterlace.c pulldown.c speedy.c tvtime.c + deinterlace.c pulldown.c speedy.c tvtime.c xineplug_post_tvtime_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(PTHREAD_LIBS) \ $(top_builddir)/src/post/deinterlace/plugins/libdeinterlaceplugins.la diff --git a/src/post/deinterlace/plugins/Makefile.am b/src/post/deinterlace/plugins/Makefile.am index 7e3548643..cf6981881 100644 --- a/src/post/deinterlace/plugins/Makefile.am +++ b/src/post/deinterlace/plugins/Makefile.am @@ -37,9 +37,9 @@ noinst_HEADERS = plugins.h greedyhmacros.h if DEBUG_BUILD debug_sources = greedy2frame.c -nodebug_sources = +nodebug_sources = else -debug_sources = +debug_sources = nodebug_sources = greedy2frame.c endif diff --git a/src/post/deinterlace/plugins/greedy.c b/src/post/deinterlace/plugins/greedy.c index 1742f7515..ee401dba6 100644 --- a/src/post/deinterlace/plugins/greedy.c +++ b/src/post/deinterlace/plugins/greedy.c @@ -49,7 +49,7 @@ // upon which give the smaller comb factor, and then clip to avoid large damage // when wrong. // -// I'd intended this to be part of a larger more elaborate method added to +// I'd intended this to be part of a larger more elaborate method added to // Blended Clip but this give too good results for the CPU to ignore here. static void copy_scanline( uint8_t *output, @@ -135,7 +135,7 @@ static void deinterlace_greedy_packed422_scanline_mmxext( uint8_t *output, paddusb_r2r( mm3, mm2 ); // now = Max(L1,L3) pcmpeqb_r2r( mm7, mm7 ); // all ffffffff - psubusb_r2r( mm1, mm7 ); // - L1 + psubusb_r2r( mm1, mm7 ); // - L1 paddusb_r2r( mm7, mm3 ); // add, may sat at fff.. psubusb_r2r( mm7, mm3 ); // now = Min(L1,L3) @@ -147,7 +147,7 @@ static void deinterlace_greedy_packed422_scanline_mmxext( uint8_t *output, paddusb_r2r( mm3, mm4 ); // now = Max(best,Min(L1,L3) pcmpeqb_r2r( mm7, mm7 ); // all ffffffff - psubusb_r2r( mm4, mm7 ); // - Max(best,Min(best,L3) + psubusb_r2r( mm4, mm7 ); // - Max(best,Min(best,L3) paddusb_r2r( mm7, mm2 ); // add may sat at FFF.. psubusb_r2r( mm7, mm2 ); // now = Min( Max(best, Min(L1,L3), L2 )=L2 clipped diff --git a/src/post/deinterlace/plugins/greedy2frame_template.c b/src/post/deinterlace/plugins/greedy2frame_template.c index 0d9ab6769..1f4df9161 100644 --- a/src/post/deinterlace/plugins/greedy2frame_template.c +++ b/src/post/deinterlace/plugins/greedy2frame_template.c @@ -79,9 +79,9 @@ /**************************************************************************** ** Field 1 | Field 2 | Field 3 | Field 4 | -** T0 | | T1 | | -** | M0 | | M1 | -** B0 | | B1 | | +** T0 | | T1 | | +** | M0 | | M1 | +** B0 | | B1 | | */ @@ -95,13 +95,13 @@ #define MASKS_DEFINED static const int64_t __attribute__((__used__)) YMask = 0x00ff00ff00ff00ffll; static const int64_t __attribute__((__used__)) Mask = 0x7f7f7f7f7f7f7f7fll; - static const int64_t __attribute__((__used__)) DwordOne = 0x0000000100000001ll; - static const int64_t __attribute__((__used__)) DwordTwo = 0x0000000200000002ll; + static const int64_t __attribute__((__used__)) DwordOne = 0x0000000100000001ll; + static const int64_t __attribute__((__used__)) DwordTwo = 0x0000000200000002ll; static int64_t qwGreedyTwoFrameThreshold; #endif #if defined(IS_SSE) -static void DeinterlaceGreedy2Frame_SSE(uint8_t *output, int outstride, +static void DeinterlaceGreedy2Frame_SSE(uint8_t *output, int outstride, deinterlace_frame_data_t *data, int bottom_field, int second_field, int width, int height ) #elif defined(IS_3DNOW) @@ -133,7 +133,7 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, qwGreedyTwoFrameThreshold = GreedyTwoFrameThreshold; qwGreedyTwoFrameThreshold += (GreedyTwoFrameThreshold2 << 8); qwGreedyTwoFrameThreshold += (qwGreedyTwoFrameThreshold << 48) + - (qwGreedyTwoFrameThreshold << 32) + + (qwGreedyTwoFrameThreshold << 32) + (qwGreedyTwoFrameThreshold << 16); @@ -148,7 +148,7 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, M0 = data->f1; T0 = data->f2; } - + if( bottom_field ) { M1 += stride; T1 += 0; @@ -192,9 +192,9 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, "movq %2, %%mm3 \n\t" // B1 "movq %3, %%mm2 \n\t" // M0 : /* no output */ - : "m" (*T1), "m" (*M1), + : "m" (*T1), "m" (*M1), "m" (*B1), "m" (*M0), "m" (Mask) ); - + asm volatile( /* Figure out what to do with the scanline above the one we just copied. @@ -269,7 +269,7 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, "pcmpgtb %3, %%mm5 \n\t" "pand %%mm6, %%mm5 \n\t" /* get rid of sign bit */ - "pcmpgtd %5, %%mm5 \n\t" + "pcmpgtd %5, %%mm5 \n\t" "pandn %5, %%mm5 \n\t" "paddd %%mm5, %%mm4 \n\t" @@ -305,9 +305,9 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, "movq %%mm4, %%mm5 \n\t" /* mm4 now is 1 where we want to weave and 0 where we want to bob */ - "pand %%mm0, %%mm4 \n\t" - "pandn %%mm7, %%mm5 \n\t" - "por %%mm5, %%mm4 \n\t" + "pand %%mm0, %%mm4 \n\t" + "pandn %%mm7, %%mm5 \n\t" + "por %%mm5, %%mm4 \n\t" #ifdef IS_SSE "movntq %%mm4, %0 \n\t" #else @@ -351,9 +351,9 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, } else { - xine_fast_memcpy(Dest, T1, stride); + xine_fast_memcpy(Dest, T1, stride); } - + /* clear out the MMX registers ready for doing floating point again */ asm("emms\n\t"); #endif diff --git a/src/post/deinterlace/plugins/greedyhmacros.h b/src/post/deinterlace/plugins/greedyhmacros.h index 5f65959c3..fd1eb2068 100644 --- a/src/post/deinterlace/plugins/greedyhmacros.h +++ b/src/post/deinterlace/plugins/greedyhmacros.h @@ -15,7 +15,7 @@ // ///////////////////////////////////////////////////////////////////////////// -// Define a few macros for CPU dependent instructions. +// Define a few macros for CPU dependent instructions. // I suspect I don't really understand how the C macro preprocessor works but // this seems to get the job done. // TRB 7/01 @@ -35,9 +35,9 @@ "paddusb "mmrw", "mmr1"\n\t" #define V_PAVGB_SSE(mmr1, mmr2, mmrw, smask) "pavgb "mmr2", "mmr1"\n\t" #define V_PAVGB_3DNOW(mmr1, mmr2, mmrw, smask) "pavgusb "mmr2", "mmr1"\n\t" -#define V_PAVGB(mmr1, mmr2, mmrw, smask) V_PAVGB2(mmr1, mmr2, mmrw, smask, SSE_TYPE) -#define V_PAVGB2(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) -#define V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB_##ssetyp(mmr1, mmr2, mmrw, smask) +#define V_PAVGB(mmr1, mmr2, mmrw, smask) V_PAVGB2(mmr1, mmr2, mmrw, smask, SSE_TYPE) +#define V_PAVGB2(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) +#define V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB_##ssetyp(mmr1, mmr2, mmrw, smask) // some macros for pmaxub instruction #define V_PMAXUB_MMX(mmr1, mmr2) \ @@ -45,9 +45,9 @@ "paddusb "mmr2", "mmr1"\n\t" #define V_PMAXUB_SSE(mmr1, mmr2) "pmaxub "mmr2", "mmr1"\n\t" #define V_PMAXUB_3DNOW(mmr1, mmr2) V_PMAXUB_MMX(mmr1, mmr2) // use MMX version -#define V_PMAXUB(mmr1, mmr2) V_PMAXUB2(mmr1, mmr2, SSE_TYPE) -#define V_PMAXUB2(mmr1, mmr2, ssetyp) V_PMAXUB3(mmr1, mmr2, ssetyp) -#define V_PMAXUB3(mmr1, mmr2, ssetyp) V_PMAXUB_##ssetyp(mmr1, mmr2) +#define V_PMAXUB(mmr1, mmr2) V_PMAXUB2(mmr1, mmr2, SSE_TYPE) +#define V_PMAXUB2(mmr1, mmr2, ssetyp) V_PMAXUB3(mmr1, mmr2, ssetyp) +#define V_PMAXUB3(mmr1, mmr2, ssetyp) V_PMAXUB_##ssetyp(mmr1, mmr2) // some macros for pminub instruction // V_PMINUB(mmr1, mmr2, mmr work register) mmr2 may NOT = mmrw @@ -58,17 +58,17 @@ "psubusb "mmrw", "mmr1"\n\t" #define V_PMINUB_SSE(mmr1, mmr2, mmrw) "pminub "mmr2", "mmr1"\n\t" #define V_PMINUB_3DNOW(mmr1, mmr2, mmrw) V_PMINUB_MMX(mmr1, mmr2, mmrw) // use MMX version -#define V_PMINUB(mmr1, mmr2, mmrw) V_PMINUB2(mmr1, mmr2, mmrw, SSE_TYPE) -#define V_PMINUB2(mmr1, mmr2, mmrw, ssetyp) V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) -#define V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) V_PMINUB_##ssetyp(mmr1, mmr2, mmrw) +#define V_PMINUB(mmr1, mmr2, mmrw) V_PMINUB2(mmr1, mmr2, mmrw, SSE_TYPE) +#define V_PMINUB2(mmr1, mmr2, mmrw, ssetyp) V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) +#define V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) V_PMINUB_##ssetyp(mmr1, mmr2, mmrw) // some macros for movntq instruction -// V_MOVNTQ(mmr1, mmr2) +// V_MOVNTQ(mmr1, mmr2) #define V_MOVNTQ_MMX(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t" #define V_MOVNTQ_3DNOW(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t" #define V_MOVNTQ_SSE(mmr1, mmr2) "movntq "mmr2", "mmr1"\n\t" -#define V_MOVNTQ(mmr1, mmr2) V_MOVNTQ2(mmr1, mmr2, SSE_TYPE) -#define V_MOVNTQ2(mmr1, mmr2, ssetyp) V_MOVNTQ3(mmr1, mmr2, ssetyp) +#define V_MOVNTQ(mmr1, mmr2) V_MOVNTQ2(mmr1, mmr2, SSE_TYPE) +#define V_MOVNTQ2(mmr1, mmr2, ssetyp) V_MOVNTQ3(mmr1, mmr2, ssetyp) #define V_MOVNTQ3(mmr1, mmr2, ssetyp) V_MOVNTQ_##ssetyp(mmr1, mmr2) // end of macros diff --git a/src/post/deinterlace/plugins/linearblend.c b/src/post/deinterlace/plugins/linearblend.c index 2c60f112f..fe230685b 100644 --- a/src/post/deinterlace/plugins/linearblend.c +++ b/src/post/deinterlace/plugins/linearblend.c @@ -255,7 +255,7 @@ static void deinterlace_scanline_linear_blend2_mmxext( uint8_t *output, uint8_t *b1 = data->b1; int i; - + READ_PREFETCH_2048( t1 ); READ_PREFETCH_2048( b1 ); READ_PREFETCH_2048( m0 ); diff --git a/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h b/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h index a0136fd44..875ed7055 100644 --- a/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h +++ b/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h @@ -8,7 +8,7 @@ #define MyMemCopy xine_fast_memcpy -// Define a few macros for CPU dependent instructions. +// Define a few macros for CPU dependent instructions. // I suspect I don't really understand how the C macro preprocessor works but // this seems to get the job done. // TRB 7/01 @@ -28,9 +28,9 @@ "paddusb "mmrw", "mmr1"\n\t" #define V_PAVGB_SSE(mmr1, mmr2, mmrw, smask) "pavgb "mmr2", "mmr1"\n\t" #define V_PAVGB_3DNOW(mmr1, mmr2, mmrw, smask) "pavgusb "mmr2", "mmr1"\n\t" -#define V_PAVGB(mmr1, mmr2, mmrw, smask) V_PAVGB2(mmr1, mmr2, mmrw, smask, SSE_TYPE) -#define V_PAVGB2(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) -#define V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB_##ssetyp(mmr1, mmr2, mmrw, smask) +#define V_PAVGB(mmr1, mmr2, mmrw, smask) V_PAVGB2(mmr1, mmr2, mmrw, smask, SSE_TYPE) +#define V_PAVGB2(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) +#define V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB_##ssetyp(mmr1, mmr2, mmrw, smask) // some macros for pmaxub instruction #define V_PMAXUB_MMX(mmr1, mmr2) \ @@ -38,9 +38,9 @@ "paddusb "mmr2", "mmr1"\n\t" #define V_PMAXUB_SSE(mmr1, mmr2) "pmaxub "mmr2", "mmr1"\n\t" #define V_PMAXUB_3DNOW(mmr1, mmr2) V_PMAXUB_MMX(mmr1, mmr2) // use MMX version -#define V_PMAXUB(mmr1, mmr2) V_PMAXUB2(mmr1, mmr2, SSE_TYPE) -#define V_PMAXUB2(mmr1, mmr2, ssetyp) V_PMAXUB3(mmr1, mmr2, ssetyp) -#define V_PMAXUB3(mmr1, mmr2, ssetyp) V_PMAXUB_##ssetyp(mmr1, mmr2) +#define V_PMAXUB(mmr1, mmr2) V_PMAXUB2(mmr1, mmr2, SSE_TYPE) +#define V_PMAXUB2(mmr1, mmr2, ssetyp) V_PMAXUB3(mmr1, mmr2, ssetyp) +#define V_PMAXUB3(mmr1, mmr2, ssetyp) V_PMAXUB_##ssetyp(mmr1, mmr2) // some macros for pminub instruction // V_PMINUB(mmr1, mmr2, mmr work register) mmr2 may NOT = mmrw @@ -51,17 +51,17 @@ "psubusb "mmrw", "mmr1"\n\t" #define V_PMINUB_SSE(mmr1, mmr2, mmrw) "pminub "mmr2", "mmr1"\n\t" #define V_PMINUB_3DNOW(mmr1, mmr2, mmrw) V_PMINUB_MMX(mmr1, mmr2, mmrw) // use MMX version -#define V_PMINUB(mmr1, mmr2, mmrw) V_PMINUB2(mmr1, mmr2, mmrw, SSE_TYPE) -#define V_PMINUB2(mmr1, mmr2, mmrw, ssetyp) V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) -#define V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) V_PMINUB_##ssetyp(mmr1, mmr2, mmrw) +#define V_PMINUB(mmr1, mmr2, mmrw) V_PMINUB2(mmr1, mmr2, mmrw, SSE_TYPE) +#define V_PMINUB2(mmr1, mmr2, mmrw, ssetyp) V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) +#define V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) V_PMINUB_##ssetyp(mmr1, mmr2, mmrw) // some macros for movntq instruction -// V_MOVNTQ(mmr1, mmr2) +// V_MOVNTQ(mmr1, mmr2) #define V_MOVNTQ_MMX(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t" #define V_MOVNTQ_3DNOW(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t" #define V_MOVNTQ_SSE(mmr1, mmr2) "movntq "mmr2", "mmr1"\n\t" -#define V_MOVNTQ(mmr1, mmr2) V_MOVNTQ2(mmr1, mmr2, SSE_TYPE) -#define V_MOVNTQ2(mmr1, mmr2, ssetyp) V_MOVNTQ3(mmr1, mmr2, ssetyp) +#define V_MOVNTQ(mmr1, mmr2) V_MOVNTQ2(mmr1, mmr2, SSE_TYPE) +#define V_MOVNTQ2(mmr1, mmr2, ssetyp) V_MOVNTQ3(mmr1, mmr2, ssetyp) #define V_MOVNTQ3(mmr1, mmr2, ssetyp) V_MOVNTQ_##ssetyp(mmr1, mmr2) // end of macros diff --git a/src/post/deinterlace/pulldown.c b/src/post/deinterlace/pulldown.c index 4f6247444..2218855f0 100644 --- a/src/post/deinterlace/pulldown.c +++ b/src/post/deinterlace/pulldown.c @@ -47,7 +47,7 @@ * Bot 2 : Drop * Top 3 : Merge * Bot 3 : Drop - * Top 4 : Show + * Top 4 : Show * Bot 4 : Drop * Top 5 : Drop * Bot 5 : Show @@ -69,15 +69,15 @@ * * [ ] * [ * *] | 0 top BC - * [* * ] | 1 BC bottom BC + * [* * ] | 1 BC bottom BC * * [ ] * [ * *] | 0 top CC - * [ * *] | 0 CC bottom CC + * [ * *] | 0 CC bottom CC * * [ ] * [* * ] | 1 top DD - * [ * *] | 0 DD bottom DD + * [ * *] | 0 DD bottom DD * * * [* * ] | 1 top AA @@ -608,7 +608,7 @@ int pulldown_drop( int action, int bottom_field ) if( action == PULLDOWN_SEQ_CC && !bottom_field ) ret = 0; if( action == PULLDOWN_SEQ_DD && bottom_field ) - ret = 0; + ret = 0; return ret; } diff --git a/src/post/deinterlace/speedy.c b/src/post/deinterlace/speedy.c index 5dc564b26..6af2c3b88 100644 --- a/src/post/deinterlace/speedy.c +++ b/src/post/deinterlace/speedy.c @@ -117,11 +117,11 @@ void (*composite_bars_packed4444_scanline)( uint8_t *output, uint8_t *background, int width, int a, int luma, int cb, int cr, int percentage ); -void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *output, +void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *output, uint8_t *input, int width, int alpha ); void (*aspect_adjust_packed4444_scanline)( uint8_t *output, - uint8_t *input, + uint8_t *input, int width, double pixel_aspect ); void (*packed444_to_packed422_scanline)( uint8_t *output, @@ -623,7 +623,7 @@ static void vfilter_chroma_121_packed422_scanline_mmx( uint8_t *output, int widt paddw_r2r( mm1, mm2 ); psllw_i2r( 6, mm2 ); - pand_r2r( mm6, mm2 ); + pand_r2r( mm6, mm2 ); por_r2r ( mm3, mm2 ); @@ -638,7 +638,7 @@ static void vfilter_chroma_121_packed422_scanline_mmx( uint8_t *output, int widt *output = (*t + *b + (*m << 1)) >> 2; output+=2; t+=2; b+=2; m+=2; } - + emms(); } #endif @@ -662,7 +662,7 @@ static void vfilter_chroma_332_packed422_scanline_mmx( uint8_t *output, int widt const mmx_t cmask = { 0xff00ff00ff00ff00ULL }; // Get width in bytes. - width *= 2; + width *= 2; i = width / 8; width -= i * 8; @@ -1940,7 +1940,7 @@ static int conv_YR_inited = 0; static int myround(double n) { - if (n >= 0) + if (n >= 0) return (int)(n + 0.5); else return (int)(n - 0.5); @@ -1957,7 +1957,7 @@ static void init_RGB_to_YCbCr_tables(void) * to one of each, add the following: * + (fixed-point-factor / 2) --- for rounding later * + (Q-offset * fixed-point-factor) --- to add the offset - * + * */ for (i = 0; i < 256; i++) { Y_R[i] = myround(0.299 * (double)i * 219.0 / 255.0 * (double)(1<<FP_BITS)); @@ -1989,7 +1989,7 @@ static void init_YCbCr_to_RGB_tables(void) * to one of each, add the following: * + (fixed-point-factor / 2) --- for rounding later * + (Q-offset * fixed-point-factor) --- to add the offset - * + * */ /* clip Y values under 16 */ @@ -2006,7 +2006,7 @@ static void init_YCbCr_to_RGB_tables(void) RGB_Y[i] = myround((1.0 * (double)(235) * 255.0 / 219.0 * (double)(1<<FP_BITS)) + (double)(1<<(FP_BITS-1))); } - + /* clip Cb/Cr values below 16 */ for (i = 0; i < 16; i++) { R_Cr[i] = myround(1.402 * (double)(-112) * 255.0 / 224.0 * (double)(1<<FP_BITS)); @@ -2056,7 +2056,7 @@ static void rgba32_to_packed4444_rec601_scanline_c( uint8_t *output, uint8_t *in int g = input[ 1 ]; int b = input[ 2 ]; int a = input[ 3 ]; - + output[ 0 ] = a; output[ 1 ] = (Y_R[ r ] + Y_G[ g ] + Y_B[ b ]) >> FP_BITS; output[ 2 ] = (Cb_R[ r ] + Cb_G[ g ] + Cb_B[ b ]) >> FP_BITS; @@ -2129,7 +2129,7 @@ static void packed444_to_rgb24_rec601_reference_scanline( uint8_t *output, uint8 } */ -static void packed444_to_nonpremultiplied_packed4444_scanline_c( uint8_t *output, +static void packed444_to_nonpremultiplied_packed4444_scanline_c( uint8_t *output, uint8_t *input, int width, int alpha ) { @@ -2147,7 +2147,7 @@ static void packed444_to_nonpremultiplied_packed4444_scanline_c( uint8_t *output } static void aspect_adjust_packed4444_scanline_c( uint8_t *output, - uint8_t *input, + uint8_t *input, int width, double pixel_aspect ) { @@ -2260,7 +2260,7 @@ static void chroma_422_to_444_mpeg2_plane_c( uint8_t *dst, uint8_t *src, int wid /* odd samples (21 -52 159 159 -52 21) */ dst[ i2 + 1 ] = clip255( ( 21*(src[im2]+src[ip3]) - - 52*(src[im1]+src[ip2]) + - 52*(src[im1]+src[ip2]) + 159*(src[i]+src[ip1]) + 128 ) >> 8 ); } src += w; diff --git a/src/post/deinterlace/speedy.h b/src/post/deinterlace/speedy.h index b4ad56393..55a2a1d5b 100644 --- a/src/post/deinterlace/speedy.h +++ b/src/post/deinterlace/speedy.h @@ -237,7 +237,7 @@ extern void (*subpix_blit_vertical_packed422_scanline)( uint8_t *output, uint8_t * Simple function to convert a 4:4:4 scanline to a 4:4:4:4 scanline by * adding an alpha channel. Result is non-premultiplied. */ -extern void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *output, +extern void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *output, uint8_t *input, int width, int alpha ); @@ -248,7 +248,7 @@ extern void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *outpu * aspect ratio. */ extern void (*aspect_adjust_packed4444_scanline)( uint8_t *output, - uint8_t *input, + uint8_t *input, int width, double pixel_aspect ); diff --git a/src/post/deinterlace/tvtime.h b/src/post/deinterlace/tvtime.h index 2253f264e..22d863a56 100644 --- a/src/post/deinterlace/tvtime.h +++ b/src/post/deinterlace/tvtime.h @@ -98,4 +98,4 @@ tvtime_t *tvtime_new_context(void); void tvtime_reset_context( tvtime_t *this ); -#endif +#endif diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c index 9dffb255d..5615e4ba1 100644 --- a/src/post/deinterlace/xine_plugin.c +++ b/src/post/deinterlace/xine_plugin.c @@ -1,18 +1,18 @@ /* * Copyright (C) 2000-2004 the xine project - * + * * This file is part of xine, a free video player. - * + * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * xine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA @@ -50,7 +50,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *); static const post_info_t deinterlace_special_info = { XINE_POST_TYPE_VIDEO_FILTER }; const plugin_info_t xine_plugin_info[] EXPORTED = { - /* type, API, "name", version, special_info, init_function */ + /* type, API, "name", version, special_info, init_function */ { PLUGIN_POST | PLUGIN_MUST_PRELOAD, 10, "tvtime", XINE_VERSION_CODE, &deinterlace_special_info, &deinterlace_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; @@ -66,7 +66,7 @@ static const char *const enum_framerate[] = { "full", "half_top", "half_bottom", static void *help_string; /* - * this is the struct used by "parameters api" + * this is the struct used by "parameters api" */ typedef struct deinterlace_parameters_s { @@ -86,15 +86,15 @@ typedef struct deinterlace_parameters_s { * description of params struct */ START_PARAM_DESCR( deinterlace_parameters_t ) -PARAM_ITEM( POST_PARAM_TYPE_INT, method, enum_methods, 0, 0, 0, +PARAM_ITEM( POST_PARAM_TYPE_INT, method, enum_methods, 0, 0, 0, "deinterlace method" ) PARAM_ITEM( POST_PARAM_TYPE_BOOL, enabled, NULL, 0, 1, 0, "enable/disable" ) -PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown, enum_pulldown, 0, 0, 0, +PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown, enum_pulldown, 0, 0, 0, "pulldown algorithm" ) -PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown_error_wait, NULL, 0, 0, 0, +PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown_error_wait, NULL, 0, 0, 0, "number of frames of telecine pattern sync required before mode change" ) -PARAM_ITEM( POST_PARAM_TYPE_INT, framerate_mode, enum_framerate, 0, 0, 0, +PARAM_ITEM( POST_PARAM_TYPE_INT, framerate_mode, enum_framerate, 0, 0, 0, "framerate output mode" ) PARAM_ITEM( POST_PARAM_TYPE_BOOL, judder_correction, NULL, 0, 1, 0, "make frames evenly spaced for film mode (24 fps)" ) @@ -129,7 +129,7 @@ struct post_plugin_deinterlace_s { int tvtime_changed; int tvtime_last_filmmode; int vo_deinterlace_enabled; - + int framecounter; uint8_t rff_pattern; @@ -144,10 +144,10 @@ typedef struct post_class_deinterlace_s { deinterlace_parameters_t init_param; } post_class_deinterlace_t; -static void _flush_frames(post_plugin_deinterlace_t *this) +static void _flush_frames(post_plugin_deinterlace_t *this) { int i; - + for( i = 0; i < NUM_RECENT_FRAMES; i++ ) { if( this->recent_frame[i] ) { this->recent_frame[i]->free(this->recent_frame[i]); @@ -189,7 +189,7 @@ static int set_parameters (xine_post_t *this_gen, void *param_gen) { static int get_parameters (xine_post_t *this_gen, void *param_gen) { post_plugin_deinterlace_t *this = (post_plugin_deinterlace_t *)this_gen; deinterlace_parameters_t *param = (deinterlace_parameters_t *)param_gen; - + param->method = this->cur_method; param->enabled = this->enabled; param->pulldown = this->pulldown; @@ -202,7 +202,7 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen) { return 1; } - + static xine_post_api_descr_t * get_param_descr (void) { return ¶m_descr; } @@ -307,7 +307,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data) if (!class) return NULL; - + class->class.open_plugin = deinterlace_open_plugin; class->class.identifier = "tvtime"; class->class.description = N_("advanced deinterlacer plugin with pulldown detection"); @@ -329,7 +329,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data) filter_deinterlace_methods( config_flags, 5 /*fieldsavailable*/ ); if( !get_num_deinterlace_methods() ) { - xprintf(xine, XINE_VERBOSITY_LOG, + xprintf(xine, XINE_VERBOSITY_LOG, _("tvtime: No deinterlacing methods available, exiting.\n")); return NULL; } @@ -342,7 +342,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data) deinterlace_method_t *method; method = get_deinterlace_method(i); - + enum_methods[i+1] = method->short_name; xine_buffer_strcat( help_string, "[" ); xine_buffer_strcat( help_string, method->short_name ); @@ -354,7 +354,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data) xine_buffer_strcat( help_string, "\n---\n" ); } enum_methods[i+1] = NULL; - + /* Some default values */ class->init_param.method = 1; /* First (plugin) method available */ @@ -362,7 +362,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data) class->init_param.pulldown = 1; /* vektor */ class->init_param.pulldown_error_wait = 60; /* about one second */ class->init_param.framerate_mode = 0; /* full */ - class->init_param.judder_correction = 1; + class->init_param.judder_correction = 1; class->init_param.use_progressive_frame_flag = 1; class->init_param.chroma_filter = 0; class->init_param.cheap_mode = 0; @@ -381,12 +381,12 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input post_out_t *output; post_class_deinterlace_t *class = (post_class_deinterlace_t *)class_gen; post_video_port_t *port; - + if (!this || !video_target || !video_target[0]) { free(this); return NULL; } - + _x_post_init(&this->post, 0, 1); this->tvtime = tvtime_new_context(); @@ -396,7 +396,7 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input pthread_mutex_init (&this->lock, NULL); set_parameters ((xine_post_t *)&this->post, &class->init_param); - + port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output); /* replace with our own get_frame function */ port->new_port.open = deinterlace_open; @@ -406,7 +406,7 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input port->new_port.flush = deinterlace_flush; port->intercept_frame = deinterlace_intercept_frame; port->new_frame->draw = deinterlace_draw; - + input_api = &this->parameter_input; input_api->name = "parameters"; input_api->type = XINE_POST_DATA_PARAMETERS; @@ -415,11 +415,11 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input input->xine_in.name = "video"; output->xine_out.name = "deinterlaced video"; - + this->post.xine_post.video_input[0] = &port->new_port; - + this->post.dispose = deinterlace_dispose; - + return &this->post; } @@ -465,9 +465,9 @@ static int deinterlace_set_property(xine_video_port_t *port_gen, int property, i pthread_mutex_unlock (&this->lock); this->vo_deinterlace_enabled = this->enabled && (!this->cur_method); - - port->original_port->set_property(port->original_port, - XINE_PARAM_VO_DEINTERLACE, + + port->original_port->set_property(port->original_port, + XINE_PARAM_VO_DEINTERLACE, this->vo_deinterlace_enabled); return this->enabled; @@ -488,14 +488,14 @@ static void deinterlace_open(xine_video_port_t *port_gen, xine_stream_t *stream) { post_video_port_t *port = (post_video_port_t *)port_gen; post_plugin_deinterlace_t *this = (post_plugin_deinterlace_t *)port->post; - + _x_post_rewire(&this->post); _x_post_inc_usage(port); port->stream = stream; (port->original_port->open) (port->original_port, stream); this->vo_deinterlace_enabled = !this->cur_method; - port->original_port->set_property(port->original_port, - XINE_PARAM_VO_DEINTERLACE, + port->original_port->set_property(port->original_port, + XINE_PARAM_VO_DEINTERLACE, this->vo_deinterlace_enabled); } @@ -506,8 +506,8 @@ static void deinterlace_close(xine_video_port_t *port_gen, xine_stream_t *stream port->stream = NULL; _flush_frames(this); - port->original_port->set_property(port->original_port, - XINE_PARAM_VO_DEINTERLACE, + port->original_port->set_property(port->original_port, + XINE_PARAM_VO_DEINTERLACE, 0); port->original_port->close(port->original_port, stream); _x_post_dec_usage(port); @@ -518,21 +518,21 @@ static int deinterlace_intercept_frame(post_video_port_t *port, vo_frame_t *fram { post_plugin_deinterlace_t *this = (post_plugin_deinterlace_t *)port->post; int vo_deinterlace_enabled = 0; - + vo_deinterlace_enabled = ( frame->format != XINE_IMGFMT_YV12 && frame->format != XINE_IMGFMT_YUY2 && this->enabled ); - + if( this->cur_method && this->vo_deinterlace_enabled != vo_deinterlace_enabled ) { this->vo_deinterlace_enabled = vo_deinterlace_enabled; - port->original_port->set_property(port->original_port, - XINE_PARAM_VO_DEINTERLACE, + port->original_port->set_property(port->original_port, + XINE_PARAM_VO_DEINTERLACE, this->vo_deinterlace_enabled); } - + return (this->enabled && this->cur_method && - (frame->flags & VO_INTERLACED_FLAG) && + (frame->flags & VO_INTERLACED_FLAG) && (frame->format == XINE_IMGFMT_YV12 || frame->format == XINE_IMGFMT_YUY2) ); } @@ -547,7 +547,7 @@ static void apply_chroma_filter( uint8_t *data, int stride, int width, int heigh */ for( i = 0; i < height; i++, data += stride ) { vfilter_chroma_332_packed422_scanline( data, width, - data, + data, (i) ? (data - stride) : data, (i < height-1) ? (data + stride) : data ); } @@ -555,7 +555,7 @@ static void apply_chroma_filter( uint8_t *data, int stride, int width, int heigh /* Build the output frame from the specified field. */ static int deinterlace_build_output_field( - post_plugin_deinterlace_t *this, post_video_port_t *port, + post_plugin_deinterlace_t *this, post_video_port_t *port, xine_stream_t *stream, vo_frame_t *frame, vo_frame_t *yuy2_frame, int bottom_field, int second_field, @@ -564,14 +564,14 @@ static int deinterlace_build_output_field( vo_frame_t *deinterlaced_frame; int scaler = 1; int force24fps; - + force24fps = this->judder_correction && !this->cheap_mode && ( this->pulldown == PULLDOWN_VEKTOR && this->tvtime->filmmode ); - + if( this->tvtime->curmethod->doscalerbob ) { scaler = 2; } - + pthread_mutex_unlock (&this->lock); deinterlaced_frame = port->original_port->get_frame(port->original_port, frame->width, frame->height / scaler, frame->ratio, yuy2_frame->format, @@ -584,7 +584,7 @@ static int deinterlace_build_output_field( deinterlaced_frame->crop_bottom = frame->crop_bottom; _x_extra_info_merge(deinterlaced_frame->extra_info, frame->extra_info); - + if( skip > 0 && !this->pulldown ) { deinterlaced_frame->bad_frame = 1; } else { @@ -593,60 +593,60 @@ static int deinterlace_build_output_field( deinterlaced_frame->bad_frame = !tvtime_build_copied_field(this->tvtime, deinterlaced_frame->base[0], yuy2_frame->base[0], bottom_field, - frame->width, frame->height, + frame->width, frame->height, yuy2_frame->pitches[0], deinterlaced_frame->pitches[0] ); } else { deinterlaced_frame->bad_frame = !tvtime_build_copied_field(this->tvtime, deinterlaced_frame->base[0], yuy2_frame->base[0], bottom_field, - frame->width/2, frame->height, + frame->width/2, frame->height, yuy2_frame->pitches[0], deinterlaced_frame->pitches[0] ); deinterlaced_frame->bad_frame += !tvtime_build_copied_field(this->tvtime, deinterlaced_frame->base[1], yuy2_frame->base[1], bottom_field, - frame->width/4, frame->height/2, + frame->width/4, frame->height/2, yuy2_frame->pitches[1], deinterlaced_frame->pitches[1] ); deinterlaced_frame->bad_frame += !tvtime_build_copied_field(this->tvtime, deinterlaced_frame->base[2], yuy2_frame->base[2], bottom_field, - frame->width/4, frame->height/2, + frame->width/4, frame->height/2, yuy2_frame->pitches[2], deinterlaced_frame->pitches[2] ); } } else { if( yuy2_frame->format == XINE_IMGFMT_YUY2 ) { deinterlaced_frame->bad_frame = !tvtime_build_deinterlaced_frame(this->tvtime, deinterlaced_frame->base[0], - yuy2_frame->base[0], - (this->recent_frame[0])?this->recent_frame[0]->base[0]:yuy2_frame->base[0], + yuy2_frame->base[0], + (this->recent_frame[0])?this->recent_frame[0]->base[0]:yuy2_frame->base[0], (this->recent_frame[1])?this->recent_frame[1]->base[0]:yuy2_frame->base[0], - bottom_field, second_field, frame->width, frame->height, + bottom_field, second_field, frame->width, frame->height, yuy2_frame->pitches[0], deinterlaced_frame->pitches[0]); } else { deinterlaced_frame->bad_frame = !tvtime_build_deinterlaced_frame(this->tvtime, deinterlaced_frame->base[0], - yuy2_frame->base[0], - (this->recent_frame[0])?this->recent_frame[0]->base[0]:yuy2_frame->base[0], + yuy2_frame->base[0], + (this->recent_frame[0])?this->recent_frame[0]->base[0]:yuy2_frame->base[0], (this->recent_frame[1])?this->recent_frame[1]->base[0]:yuy2_frame->base[0], - bottom_field, second_field, frame->width/2, frame->height, + bottom_field, second_field, frame->width/2, frame->height, yuy2_frame->pitches[0], deinterlaced_frame->pitches[0]); deinterlaced_frame->bad_frame += !tvtime_build_deinterlaced_frame(this->tvtime, deinterlaced_frame->base[1], - yuy2_frame->base[1], - (this->recent_frame[0])?this->recent_frame[0]->base[1]:yuy2_frame->base[1], + yuy2_frame->base[1], + (this->recent_frame[0])?this->recent_frame[0]->base[1]:yuy2_frame->base[1], (this->recent_frame[1])?this->recent_frame[1]->base[1]:yuy2_frame->base[1], bottom_field, second_field, frame->width/4, frame->height/2, yuy2_frame->pitches[1], deinterlaced_frame->pitches[1]); deinterlaced_frame->bad_frame += !tvtime_build_deinterlaced_frame(this->tvtime, deinterlaced_frame->base[2], - yuy2_frame->base[2], - (this->recent_frame[0])?this->recent_frame[0]->base[2]:yuy2_frame->base[2], + yuy2_frame->base[2], + (this->recent_frame[0])?this->recent_frame[0]->base[2]:yuy2_frame->base[2], (this->recent_frame[1])?this->recent_frame[1]->base[2]:yuy2_frame->base[2], - bottom_field, second_field, frame->width/4, frame->height/2, + bottom_field, second_field, frame->width/4, frame->height/2, yuy2_frame->pitches[2], deinterlaced_frame->pitches[2]); } } } - + pthread_mutex_unlock (&this->lock); if( force24fps ) { if( !deinterlaced_frame->bad_frame ) { @@ -658,7 +658,7 @@ static int deinterlace_build_output_field( deinterlaced_frame->pts = 0; deinterlaced_frame->duration = FPS_24_DURATION; if( this->chroma_filter && !this->cheap_mode ) - apply_chroma_filter( deinterlaced_frame->base[0], deinterlaced_frame->pitches[0], + apply_chroma_filter( deinterlaced_frame->base[0], deinterlaced_frame->pitches[0], frame->width, frame->height / scaler ); skip = deinterlaced_frame->draw(deinterlaced_frame, stream); } else { @@ -668,15 +668,15 @@ static int deinterlace_build_output_field( deinterlaced_frame->pts = pts; deinterlaced_frame->duration = duration; if( this->chroma_filter && !this->cheap_mode && !deinterlaced_frame->bad_frame ) - apply_chroma_filter( deinterlaced_frame->base[0], deinterlaced_frame->pitches[0], + apply_chroma_filter( deinterlaced_frame->base[0], deinterlaced_frame->pitches[0], frame->width, frame->height / scaler ); skip = deinterlaced_frame->draw(deinterlaced_frame, stream); } - + /* _x_post_frame_copy_up(frame, deinterlaced_frame); */ deinterlaced_frame->free(deinterlaced_frame); pthread_mutex_lock (&this->lock); - + return skip; } @@ -693,7 +693,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) orig_frame = frame; _x_post_frame_copy_down(frame, frame->next); frame = frame->next; - + /* update tvtime context and method */ pthread_mutex_lock (&this->lock); if( this->tvtime_changed ) { @@ -704,8 +704,8 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) else this->tvtime->curmethod = NULL; - port->original_port->set_property(port->original_port, - XINE_PARAM_VO_DEINTERLACE, + port->original_port->set_property(port->original_port, + XINE_PARAM_VO_DEINTERLACE, !this->cur_method); this->tvtime_changed = 0; @@ -724,11 +724,11 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) lprintf("frame flags pf: %d rff: %d tff: %d duration: %d\n", frame->progressive_frame, frame->repeat_first_field, frame->top_field_first, frame->duration); - + /* detect special rff patterns */ this->rff_pattern = this->rff_pattern << 1; this->rff_pattern |= !!frame->repeat_first_field; - + if( ((this->rff_pattern & 0xff) == 0xaa || (this->rff_pattern & 0xff) == 0x55) ) { /* @@ -740,7 +740,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) /* using frame->progressive_frame may help displaying still menus. * however, it is known that some rare material set it wrong. - * + * * we also assume that repeat_first_field is progressive (it doesn't * make much sense to display interlaced fields out of order) */ @@ -748,8 +748,8 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) (frame->repeat_first_field || frame->progressive_frame) ) { progressive = 1; } - - if( !frame->bad_frame && + + if( !frame->bad_frame && (frame->flags & VO_INTERLACED_FLAG) && this->tvtime->curmethod ) { @@ -761,17 +761,17 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) yuy2_frame = port->original_port->get_frame(port->original_port, frame->width, frame->height, frame->ratio, XINE_IMGFMT_YUY2, frame->flags | VO_BOTH_FIELDS); _x_post_frame_copy_down(frame, yuy2_frame); - + /* the logic for deciding upsampling to use comes from: * http://www.hometheaterhifi.com/volume_8_2/dvd-benchmark-special-report-chroma-bug-4-2001.html */ - yv12_to_yuy2(frame->base[0], frame->pitches[0], - frame->base[1], frame->pitches[1], - frame->base[2], frame->pitches[2], + yv12_to_yuy2(frame->base[0], frame->pitches[0], + frame->base[1], frame->pitches[1], + frame->base[2], frame->pitches[2], yuy2_frame->base[0], yuy2_frame->pitches[0], - frame->width, frame->height, + frame->width, frame->height, frame->progressive_frame || progressive ); - + } else { yuy2_frame = frame; yuy2_frame->lock(yuy2_frame); @@ -781,10 +781,10 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) pthread_mutex_lock (&this->lock); /* check if frame format changed */ for(i = 0; i < NUM_RECENT_FRAMES; i++ ) { - if( this->recent_frame[i] && - (this->recent_frame[i]->width != frame->width || - this->recent_frame[i]->height != frame->height || - this->recent_frame[i]->format != yuy2_frame->format ) ) { + if( this->recent_frame[i] && + (this->recent_frame[i]->width != frame->width || + this->recent_frame[i]->height != frame->height || + this->recent_frame[i]->format != yuy2_frame->format ) ) { this->recent_frame[i]->free(this->recent_frame[i]); this->recent_frame[i] = NULL; } @@ -797,10 +797,10 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) framerate_mode = FRAMERATE_HALF_TFF; this->tvtime->pulldown_alg = PULLDOWN_NONE; } - + if( framerate_mode == FRAMERATE_FULL ) { int top_field_first = frame->top_field_first; - + /* if i understood mpeg2 specs correctly, top_field_first * shall be zero for field pictures and the output order * is the same that the fields are decoded. @@ -812,7 +812,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) if ( (frame->flags & VO_BOTH_FIELDS) != VO_BOTH_FIELDS ) { top_field_first = (frame->flags & VO_TOP_FIELD) ? 1 : 0; } - + if ( top_field_first ) { fields[0] = 0; fields[1] = 1; @@ -825,8 +825,8 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) } else if ( framerate_mode == FRAMERATE_HALF_BFF ) { fields[0] = 1; } - - + + if( progressive ) { /* If the previous field was interlaced and this one is progressive @@ -838,10 +838,10 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) * duration is used in the calculation because the generated frame * represents the second half of the previous frame. */ - if (this->recent_frame[0] && !this->recent_frame[0]->progressive_frame && + if (this->recent_frame[0] && !this->recent_frame[0]->progressive_frame && this->tvtime->curmethod->delaysfield) { - skip = deinterlace_build_output_field( + skip = deinterlace_build_output_field( this, port, stream, frame, yuy2_frame, fields[0], 0, @@ -867,19 +867,19 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) /* Build the output from the first field. */ if ( !(this->recent_frame[0] && this->recent_frame[0]->progressive_frame && this->tvtime->curmethod->delaysfield) ) { - skip = deinterlace_build_output_field( + skip = deinterlace_build_output_field( this, port, stream, frame, yuy2_frame, fields[0], 0, frame->pts, (framerate_mode == FRAMERATE_FULL) ? frame->duration/2 : frame->duration, 0); - } + } if( framerate_mode == FRAMERATE_FULL ) { - + /* Build the output from the second field. */ - skip = deinterlace_build_output_field( + skip = deinterlace_build_output_field( this, port, stream, frame, yuy2_frame, fields[1], 1, @@ -889,7 +889,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) } } - /* don't drop frames when pulldown mode is enabled. otherwise + /* don't drop frames when pulldown mode is enabled. otherwise * pulldown detection fails (yo-yo effect has also been seen) */ if( this->pulldown ) @@ -897,7 +897,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) /* store back progressive flag for frame history */ yuy2_frame->progressive_frame = progressive; - + /* keep track of recent frames */ i = NUM_RECENT_FRAMES-1; if( this->recent_frame[i] ) @@ -918,8 +918,8 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) } else { skip = frame->draw(frame, stream); } - + _x_post_frame_copy_up(orig_frame, frame); - + return skip; } |