]> git.sesse.net Git - vlc/blobdiff - modules/codec/dirac.c
Merge branch 'master' of git@git.videolan.org:vlc
[vlc] / modules / codec / dirac.c
index 74e2c1a14594262bab27496994f377c7ed4266a6..19168ccfc432460616f1792c3feba5f4e776cde1 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_codec.h>
 #include <vlc_sout.h>
@@ -81,7 +85,7 @@ vlc_module_begin();
     set_capability( "encoder", 100 );
     set_callbacks( OpenEncoder, CloseEncoder );
     add_float( ENC_CFG_PREFIX "quality", 7.0, NULL, ENC_QUALITY_TEXT,
-               ENC_QUALITY_LONGTEXT, VLC_FALSE );
+               ENC_QUALITY_LONGTEXT, false );
 
 vlc_module_end();
 
@@ -129,7 +133,7 @@ static void FreeFrameBuffer( dirac_decoder_t *p_dirac )
         int i;
         for( i = 0; i < 3; i++ )
         {
-            if( p_dirac->fbuf->buf[i] ) free( p_dirac->fbuf->buf[i] );
+            free( p_dirac->fbuf->buf[i] );
             p_dirac->fbuf->buf[i] = 0;
         }
     }
@@ -144,20 +148,20 @@ static picture_t *GetNewPicture( decoder_t *p_dec )
     picture_t *p_pic;
     int i_plane;
 
-    switch( p_sys->p_dirac->seq_params.chroma )
+    switch( p_sys->p_dirac->src_params.chroma )
     {
     case format420: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0'); break;
     case format422: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','2'); break;
     case format444: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','4','4'); break;    // XXX 0.6 ?
-    default:        
+    default:
         p_dec->fmt_out.i_codec = 0;
         break;
     }
 
     p_dec->fmt_out.video.i_visible_width =
-    p_dec->fmt_out.video.i_width = p_sys->p_dirac->seq_params.width;
+    p_dec->fmt_out.video.i_width = p_sys->p_dirac->src_params.width;
     p_dec->fmt_out.video.i_visible_height =
-    p_dec->fmt_out.video.i_height = p_sys->p_dirac->seq_params.height;
+    p_dec->fmt_out.video.i_height = p_sys->p_dirac->src_params.height;
     p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * 4 / 3;
 
     p_dec->fmt_out.video.i_frame_rate =
@@ -169,7 +173,7 @@ static picture_t *GetNewPicture( decoder_t *p_dec )
     p_pic = p_dec->pf_vout_buffer_new( p_dec );
 
     if( p_pic == NULL ) return NULL;
-    p_pic->b_progressive = !p_sys->p_dirac->src_params.interlace;
+    p_pic->b_progressive = !p_sys->p_dirac->src_params.source_sampling;
     p_pic->b_top_field_first = p_sys->p_dirac->src_params.topfieldfirst;
 
     p_pic->i_nb_fields = 2;
@@ -250,19 +254,19 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             uint8_t *buf[3];
 
             msg_Dbg( p_dec, "%dx%d, chroma %i, %f fps",
-                     p_sys->p_dirac->seq_params.width,
-                     p_sys->p_dirac->seq_params.height,
-                     p_sys->p_dirac->seq_params.chroma,
+                     p_sys->p_dirac->src_params.width,
+                     p_sys->p_dirac->src_params.height,
+                     p_sys->p_dirac->src_params.chroma,
                      (float)p_sys->p_dirac->src_params.frame_rate.numerator/
                      p_sys->p_dirac->src_params.frame_rate.denominator );
 
             FreeFrameBuffer( p_sys->p_dirac );
-            buf[0] = malloc( p_sys->p_dirac->seq_params.width *
-                             p_sys->p_dirac->seq_params.height );
-            buf[1] = malloc( p_sys->p_dirac->seq_params.chroma_width *
-                             p_sys->p_dirac->seq_params.chroma_height );
-            buf[2] = malloc( p_sys->p_dirac->seq_params.chroma_width *
-                             p_sys->p_dirac->seq_params.chroma_height );
+            buf[0] = malloc( p_sys->p_dirac->src_params.width *
+                             p_sys->p_dirac->src_params.height );
+            buf[1] = malloc( p_sys->p_dirac->src_params.chroma_width *
+                             p_sys->p_dirac->src_params.chroma_height );
+            buf[2] = malloc( p_sys->p_dirac->src_params.chroma_width *
+                             p_sys->p_dirac->src_params.chroma_height );
 
             dirac_set_buf( p_sys->p_dirac, buf, NULL );
             break;
@@ -356,15 +360,15 @@ static int OpenEncoder( vlc_object_t *p_this )
 
     dirac_encoder_context_init( &p_sys->ctx, VIDEO_FORMAT_CUSTOM );
     /* */
-    p_sys->ctx.seq_params.width = p_enc->fmt_in.video.i_width;
-    p_sys->ctx.seq_params.height = p_enc->fmt_in.video.i_height;
-    p_sys->ctx.seq_params.chroma = format420;
+    p_sys->ctx.src_params.width = p_enc->fmt_in.video.i_width;
+    p_sys->ctx.src_params.height = p_enc->fmt_in.video.i_height;
+    p_sys->ctx.src_params.chroma = format420;
     /* */
     p_sys->ctx.src_params.frame_rate.numerator =
         p_enc->fmt_in.video.i_frame_rate;
     p_sys->ctx.src_params.frame_rate.denominator =
         p_enc->fmt_in.video.i_frame_rate_base;
-    p_sys->ctx.src_params.interlace = 0;
+    p_sys->ctx.src_params.source_sampling = 0;
     p_sys->ctx.src_params.topfieldfirst = 0;
 
     var_Get( p_enc, ENC_CFG_PREFIX "quality", &val );
@@ -448,7 +452,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
             }
             if( p_sys->p_dirac->decoded_frame_avail )
             {
-                //locally decoded frame is available in 
+                //locally decoded frame is available in
                 //encoder->dec_buf
                 //locally decoded frame parameters available
                 //in encoder->dec_fparams