]> git.sesse.net Git - vlc/commitdiff
* faad : adapt to newer version.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 10 Nov 2002 02:47:27 +0000 (02:47 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 10 Nov 2002 02:47:27 +0000 (02:47 +0000)
 * ffmpeg : adapt postprocessing for latest libavcodec version, add an
option to disable direct rendering as postprocessing is currently broken
with it, and with some files I have bad pictures.

modules/codec/faad/decoder.c
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/postprocessing/postprocessing.h
modules/codec/ffmpeg/video.c

index 016be4211885dd2f1f6162afe0e6d38284fdb77c..87988ae1f73a15cdfbc487229f3b022f97289494 100644 (file)
@@ -2,7 +2,7 @@
  * decoder.c: AAC decoder using libfaad2
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: decoder.c,v 1.10 2002/10/27 18:06:33 fenrir Exp $
+ * $Id: decoder.c,v 1.11 2002/11/10 02:47:27 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *      
@@ -252,6 +252,7 @@ static int InitThread( adec_thread_t * p_adec )
 
         i_status = faacDecInit( p_adec->p_handle,
                                 p_adec->p_buffer,
+                                i_frame_size,
                                 &i_rate,
                                 &i_channels );
     }
@@ -343,7 +344,8 @@ static void DecodeThread( adec_thread_t *p_adec )
     /* **** decode this frame **** */
     p_faad_buffer = faacDecDecode( p_adec->p_handle,
                                    &faad_frame,
-                                   p_adec->p_buffer );
+                                   p_adec->p_buffer,
+                                   i_frame_size );
 
     /* **** some sanity checks to see if we have samples to out **** */
     if( faad_frame.error > 0 )
index 725a667e0c666b8d25cc3078cdd200788bd706e4..64816076e6bac77917844bc45486d8d1b00e022c 100644 (file)
@@ -2,7 +2,7 @@
  * ffmpeg.c: video decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: ffmpeg.c,v 1.14 2002/11/05 10:07:56 gbazin Exp $
+ * $Id: ffmpeg.c,v 1.15 2002/11/10 02:47:27 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -97,6 +97,11 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t, int *, int *, char ** );
 
 vlc_module_begin();
     add_category_hint( N_("Ffmpeg"), NULL );
+#if LIBAVCODEC_BUILD >= 4615
+    add_bool( "ffmpeg-dr", 1, NULL,
+              "direct rendering", 
+              "direct rendering" );
+#endif
 #if LIBAVCODEC_BUILD >= 4611
     add_integer ( "ffmpeg-error-resilience", -1, NULL, 
                   "error resilience", ERROR_RESILIENCE_LONGTEXT );
index a0de690f5f4d23686197c34ab4f15a132a0cf2aa..cc6a72adc28af7130bc91072d4a95549a3ade7d0 100644 (file)
@@ -2,7 +2,7 @@
  * postprocessing.h
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: postprocessing.h,v 1.1 2002/08/04 22:13:06 fenrir Exp $
+ * $Id: postprocessing.h,v 1.2 2002/11/10 02:47:27 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
@@ -21,7 +21,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
-#define QT_STORE_T int
+#define QT_STORE_T int8_t
 
 /* postprocessing available using to create i_mode */
 #define PP_DEBLOCK_Y_H 0x00000001
index 068214a1e3efb125bfc8ef939e31236224c74ce0..6719473d6e4d1d9340e4cb2d4ce7d71512ccbec4 100644 (file)
@@ -2,7 +2,7 @@
  * video.c: video decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: video.c,v 1.3 2002/11/06 21:48:24 gbazin Exp $
+ * $Id: video.c,v 1.4 2002/11/10 02:47:27 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -354,7 +354,8 @@ int E_( InitThread_Video )( vdec_thread_t *p_vdec )
     p_vdec->b_direct_rendering = 0;
 #if LIBAVCODEC_BUILD > 4615
     if( (p_vdec->p_codec->capabilities & CODEC_CAP_DR1)
-        && (p_vdec->p_context->pix_fmt != PIX_FMT_YUV410P) )
+        && (p_vdec->p_context->pix_fmt != PIX_FMT_YUV410P) && 
+        config_GetInt( p_vdec->p_fifo, "ffmpeg-dr" ) )
     {
         msg_Dbg( p_vdec->p_fifo, "using direct rendering" );
         p_vdec->b_direct_rendering = 1;
@@ -448,7 +449,7 @@ int E_( InitThread_Video )( vdec_thread_t *p_vdec )
             case( CODEC_ID_H263I ):
                 /* Ok we can make postprocessing :)) */
                 /* first try to get a postprocess module */
-#if LIBAVCODEC_BUILD > 4613
+#if LIBAVCODEC_BUILD >= 4633
                 p_vdec->p_pp = vlc_object_create( p_vdec->p_fifo,
                                                   sizeof( postprocessing_t ) );
                 p_vdec->p_pp->psz_object_name = "postprocessing";
@@ -473,9 +474,9 @@ int E_( InitThread_Video )( vdec_thread_t *p_vdec )
                                                 );
 
                     /* allocate table for postprocess */
-                    p_vdec->p_context->quant_store = 
-                        malloc( sizeof( int ) * ( MBR + 1 ) * ( MBC + 1 ) );
-                    p_vdec->p_context->qstride = MBC + 1;
+//                    p_vdec->p_context->quant_store = 
+//                        malloc( sizeof( int ) * ( MBR + 1 ) * ( MBC + 1 ) );
+//                    p_vdec->p_context->qstride = MBC + 1;
                 }
 #else
                 p_vdec->i_pp_mode = 0;
@@ -756,7 +757,8 @@ static void ffmpeg_PostProcPicture( vdec_thread_t *p_vdec, picture_t *p_pic )
     {
         /* Make postproc */
         p_vdec->p_pp->pf_postprocess( p_pic,
-                                      p_vdec->p_context->quant_store, 
+                                      p_vdec->p_context->display_qscale_table,
+//                                      p_vdec->p_context->current_qscale_table,
                                       p_vdec->p_context->qstride,
                                       p_vdec->i_pp_mode );
     }