summaryrefslogtreecommitdiffstats
path: root/vlc/build/vlc_dirac-0.8.0-api.patch
blob: a474b557a9ef983d2620cc3c07456774d98e63ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
diff -up vlc-0.8.6c/configure.ac.dirac vlc-0.8.6c/configure.ac
--- vlc-0.8.6c/configure.ac.dirac	2007-10-19 23:15:49.000000000 +0200
+++ vlc-0.8.6c/configure.ac	2007-10-19 23:16:55.000000000 +0200
@@ -3342,7 +3346,7 @@ dnl
 AC_ARG_ENABLE(dirac,
 [  --enable-dirac          experimental dirac codec (default disabled)])
 if test "${enable_dirac}" = "yes"; then
-  PKG_CHECK_MODULES(DIRAC,dirac, [
+  PKG_CHECK_MODULES(DIRAC,[dirac >= 0.8.0], [
       VLC_ADD_PLUGINS([dirac])
       VLC_ADD_CFLAGS([dirac],[$DIRAC_CFLAGS])
       VLC_ADD_LDFLAGS([dirac],[$DIRAC_LIBS -lstdc++]) ],[
diff -up vlc-0.8.6c/modules/codec/dirac.c.dirac6 vlc-0.8.6c/modules/codec/dirac.c
--- vlc-0.8.6c/modules/codec/dirac.c.dirac6	2007-06-16 16:25:12.000000000 +0200
+++ vlc-0.8.6c/modules/codec/dirac.c	2007-10-19 23:17:15.000000000 +0200
@@ -144,32 +144,34 @@ static picture_t *GetNewPicture( decoder
     picture_t *p_pic;
     int i_plane;
 
-    p_dec->fmt_out.i_codec =
-        p_sys->p_dirac->seq_params.chroma == format411 ?
-        VLC_FOURCC('I','4','1','1') :
-        p_sys->p_dirac->seq_params.chroma == format420 ?
-        VLC_FOURCC('I','4','2','0') :
-        p_sys->p_dirac->seq_params.chroma == format422 ?
-        VLC_FOURCC('I','4','2','2') : 0;
+    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:        
+        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 =
-        p_sys->p_dirac->seq_params.frame_rate.numerator;
+        p_sys->p_dirac->src_params.frame_rate.numerator;
     p_dec->fmt_out.video.i_frame_rate_base =
-        p_sys->p_dirac->seq_params.frame_rate.denominator;
+        p_sys->p_dirac->src_params.frame_rate.denominator;
 
     /* Get a new picture */
     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_top_field_first = p_sys->p_dirac->src_params.topfieldfirst;
 
-    p_pic->b_progressive = !p_sys->p_dirac->seq_params.interlace;
-    p_pic->b_top_field_first = p_sys->p_dirac->seq_params.topfieldfirst;
     p_pic->i_nb_fields = 2;
 
     /* Copy picture stride by stride */
@@ -248,19 +250,19 @@ static picture_t *DecodeBlock( decoder_t
             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,
-                     (float)p_sys->p_dirac->seq_params.frame_rate.numerator/
-                     p_sys->p_dirac->seq_params.frame_rate.denominator );
+                     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;
@@ -352,20 +354,18 @@ static int OpenEncoder( vlc_object_t *p_
 
     sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
 
-    /* Initialse the encoder context with the presets for SD576 - Standard
-     * Definition Digital (some parameters will be overwritten later on) */
-    dirac_encoder_context_init( &p_sys->ctx, SD576 );
-
-    /* Override parameters if required */
-    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.seq_params.frame_rate.numerator =
+    dirac_encoder_context_init( &p_sys->ctx, VIDEO_FORMAT_CUSTOM );
+    /* */
+    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.seq_params.frame_rate.denominator =
+    p_sys->ctx.src_params.frame_rate.denominator =
         p_enc->fmt_in.video.i_frame_rate_base;
-    p_sys->ctx.seq_params.interlace = 0;
-    p_sys->ctx.seq_params.topfieldfirst = 0;
+    p_sys->ctx.src_params.interlace = 0;
+    p_sys->ctx.src_params.topfieldfirst = 0;
 
     var_Get( p_enc, ENC_CFG_PREFIX "quality", &val );
     f_quality = val.f_float;