[vlc-devel] commit: Fixed J42X support in deinterlace filter. (Laurent Aimar )

git version control git at videolan.org
Sat Oct 3 19:47:45 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Oct  3 19:04:05 2009 +0200| [3f01a84b8d8b30675457ce5a2e8f1a2eceb3249c] | committer: Laurent Aimar 

Fixed J42X support in deinterlace filter.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3f01a84b8d8b30675457ce5a2e8f1a2eceb3249c
---

 modules/video_filter/deinterlace.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/modules/video_filter/deinterlace.c b/modules/video_filter/deinterlace.c
index de49514..671d57f 100644
--- a/modules/video_filter/deinterlace.c
+++ b/modules/video_filter/deinterlace.c
@@ -321,7 +321,8 @@ static void SetFilterMethod( vout_thread_t *p_vout, const char *psz_method )
     }
     else
     {
-        const bool b_i422 = p_vout->render.i_chroma == VLC_CODEC_I422;
+        const bool b_i422 = p_vout->render.i_chroma == VLC_CODEC_I422 ||
+                            p_vout->render.i_chroma == VLC_CODEC_J422;
         if( strcmp( psz_method, "discard" ) )
             msg_Err( p_vout, "no valid deinterlace mode provided, "
                      "using \"discard\"" );
@@ -347,17 +348,19 @@ static void GetOutputFormat( vout_thread_t *p_vout,
         p_dst->i_sar_den *= 2;
     }
 
-    if( p_src->i_chroma == VLC_CODEC_I422 )
+    if( p_src->i_chroma == VLC_CODEC_I422 ||
+        p_src->i_chroma == VLC_CODEC_J422 )
     {
         switch( p_vout->p_sys->i_mode )
         {
         case DEINTERLACE_MEAN:
         case DEINTERLACE_LINEAR:
         case DEINTERLACE_X:
-            p_dst->i_chroma = VLC_CODEC_I422;
+            p_dst->i_chroma = p_src->i_chroma;
             break;
         default:
-            p_dst->i_chroma = VLC_CODEC_I420;
+            p_dst->i_chroma = p_src->i_chroma == VLC_CODEC_I422 ? VLC_CODEC_I420 :
+                                                                  VLC_CODEC_J420;
             break;
         }
     }
@@ -366,8 +369,10 @@ static void GetOutputFormat( vout_thread_t *p_vout,
 static bool IsChromaSupported( vlc_fourcc_t i_chroma )
 {
     return i_chroma == VLC_CODEC_I420 ||
+           i_chroma == VLC_CODEC_J420 ||
            i_chroma == VLC_CODEC_YV12 ||
-           i_chroma == VLC_CODEC_I422;
+           i_chroma == VLC_CODEC_I422 ||
+           i_chroma == VLC_CODEC_J422;
 }
 
 /*****************************************************************************
@@ -621,6 +626,7 @@ static void RenderDiscard( vout_thread_t *p_vout,
         switch( p_vout->render.i_chroma )
         {
         case VLC_CODEC_I420:
+        case VLC_CODEC_J420:
         case VLC_CODEC_YV12:
 
             for( ; p_out < p_out_end ; )
@@ -633,6 +639,7 @@ static void RenderDiscard( vout_thread_t *p_vout,
             break;
 
         case VLC_CODEC_I422:
+        case VLC_CODEC_J422:
 
             i_increment = 2 * p_pic->p[i_plane].i_pitch;
 
@@ -685,6 +692,7 @@ static void RenderBob( vout_thread_t *p_vout,
         switch( p_vout->render.i_chroma )
         {
             case VLC_CODEC_I420:
+            case VLC_CODEC_J420:
             case VLC_CODEC_YV12:
                 /* For BOTTOM field we need to add the first line */
                 if( i_field == 1 )
@@ -720,6 +728,7 @@ static void RenderBob( vout_thread_t *p_vout,
                 break;
 
             case VLC_CODEC_I422:
+            case VLC_CODEC_J422:
                 /* For BOTTOM field we need to add the first line */
                 if( i_field == 1 )
                 {
@@ -874,6 +883,7 @@ static void RenderBlend( vout_thread_t *p_vout,
         switch( p_vout->render.i_chroma )
         {
             case VLC_CODEC_I420:
+            case VLC_CODEC_J420:
             case VLC_CODEC_YV12:
                 /* First line: simple copy */
                 vlc_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch );
@@ -891,6 +901,7 @@ static void RenderBlend( vout_thread_t *p_vout,
                 break;
 
             case VLC_CODEC_I422:
+            case VLC_CODEC_J422:
                 /* First line: simple copy */
                 vlc_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch );
                 p_out += p_outpic->p[i_plane].i_pitch;




More information about the vlc-devel mailing list