annotate libmpcodecs/ve_divx4.c @ 6064:55b2b5da9bd2

small cleanup, new flag in -fsmode to avoid unmapping window for unknown wm
author arpi
date Sun, 12 May 2002 22:16:31 +0000
parents 3a961eaf45b9
children 1e47c2e7aa8e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
1 #include <stdio.h>
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
2 #include <stdlib.h>
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
3 #include <string.h>
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
4
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
5 #include "../config.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
6 #include "../mp_msg.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
7
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
8 #ifdef HAVE_DIVX4ENCORE
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
9
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
10 #include "codec-cfg.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
11 #include "stream.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
12 #include "demuxer.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
13 #include "stheader.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
14
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
15 #include "aviwrite.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
16
5607
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5551
diff changeset
17 #include "img_format.h"
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5551
diff changeset
18 #include "mp_image.h"
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
19 #include "vf.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
20
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
21 //===========================================================================//
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
22
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
23 #include "divx4_vbr.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
24
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
25 extern int pass;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
26 extern char* passtmpfile;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
27
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
28 #include <encore2.h>
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
29
5854
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
30 #ifndef ENCORE_MAJOR_VERSION
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
31 #define ENCORE_MAJOR_VERSION 4000
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
32 #endif
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
33
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
34 ENC_PARAM divx4_param;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
35 int divx4_crispness;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
36
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
37 #include "cfgparser.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
38
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
39 struct config divx4opts_conf[]={
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
40 {"br", &divx4_param.bitrate, CONF_TYPE_INT, CONF_RANGE, 4, 24000000, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
41 {"rc_period", &divx4_param.rc_period, CONF_TYPE_INT, 0,0,0, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
42 {"rc_reaction_period", &divx4_param.rc_reaction_period, CONF_TYPE_INT, 0,0,0, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
43 {"rc_reaction_ratio", &divx4_param.rc_reaction_ratio, CONF_TYPE_INT, 0,0,0, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
44 {"min_quant", &divx4_param.min_quantizer, CONF_TYPE_INT, CONF_RANGE,0,32, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
45 {"max_quant", &divx4_param.max_quantizer, CONF_TYPE_INT, CONF_RANGE,0,32, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
46 {"key", &divx4_param.max_key_interval, CONF_TYPE_INT, CONF_MIN,0,0, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
47 {"deinterlace", &divx4_param.deinterlace, CONF_TYPE_FLAG, 0,0,1, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
48 {"q", &divx4_param.quality, CONF_TYPE_INT, CONF_RANGE, 1, 5, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
49 {"crispness", &divx4_crispness, CONF_TYPE_INT, CONF_RANGE,0,100, NULL},
5854
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
50 #if ENCORE_MAJOR_VERSION >= 5010
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
51 {"bidirect", &divx4_param.extensions.use_bidirect, CONF_TYPE_FLAG, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
52 {"obmc", &divx4_param.extensions.obmc, CONF_TYPE_FLAG, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
53 {"data_partitioning", &divx4_param.extensions.data_partitioning, CONF_TYPE_FLAG, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
54 {"qpel", &divx4_param.extensions.quarter_pel, CONF_TYPE_FLAG, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
55 {"intra_frame_threshold", &divx4_param.extensions.intra_frame_threshold, CONF_TYPE_INT, CONF_RANGE,1,100, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
56 {"psychovisual", &divx4_param.extensions.psychovisual, CONF_TYPE_FLAG, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
57 {"testing_param", &divx4_param.extensions.testing_param, CONF_TYPE_FLAG, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
58 {"gmc", &divx4_param.extensions.use_gmc, CONF_TYPE_FLAG, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
59 {"interlace_mode", &divx4_param.extensions.interlace_mode, CONF_TYPE_INT, CONF_RANGE,0,2, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
60 {"temporal", &divx4_param.extensions.temporal_enable, CONF_TYPE_FLAG, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
61 {"spatial", &divx4_param.extensions.spatial_passes, CONF_TYPE_INT, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
62 {"mv_file", &divx4_param.extensions.mv_file, CONF_TYPE_STRING, 0,0,1, NULL},
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
63 #endif
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
64 {"help", "TODO: divx4opts help!\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
65 {NULL, NULL, 0, 0, 0, 0, NULL}
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
66 };
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
67
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
68 struct vf_priv_s {
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
69 aviwrite_stream_t* mux;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
70 ENC_RESULT enc_result;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
71 ENC_FRAME enc_frame;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
72 void* enc_handle;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
73 };
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
74
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
75 #define mux_v (vf->priv->mux)
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
76
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
77 static int config(struct vf_instance_s* vf,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
78 int width, int height, int d_width, int d_height,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
79 unsigned int flags, unsigned int outfmt){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
80
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
81 mux_v->bih->biWidth=width;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
82 mux_v->bih->biHeight=height;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
83
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
84 divx4_param.x_dim=width;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
85 divx4_param.y_dim=height;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
86 divx4_param.framerate=(float)mux_v->h.dwRate/mux_v->h.dwScale;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
87 mux_v->bih->biSizeImage=mux_v->bih->biWidth*mux_v->bih->biHeight*3;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
88
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
89 if(!divx4_param.bitrate) divx4_param.bitrate=800000;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
90 else if(divx4_param.bitrate<=16000) divx4_param.bitrate*=1000;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
91 if(!divx4_param.quality) divx4_param.quality=5; // the quality of compression ( 1 - fastest, 5 - best )
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
92
5551
73978162b6a1 soem fixes
arpi
parents: 5550
diff changeset
93 // set some usefull defaults:
73978162b6a1 soem fixes
arpi
parents: 5550
diff changeset
94 if(!divx4_param.min_quantizer) divx4_param.min_quantizer=2;
73978162b6a1 soem fixes
arpi
parents: 5550
diff changeset
95 if(!divx4_param.max_quantizer) divx4_param.max_quantizer=31;
73978162b6a1 soem fixes
arpi
parents: 5550
diff changeset
96 if(!divx4_param.rc_period) divx4_param.rc_period=2000;
73978162b6a1 soem fixes
arpi
parents: 5550
diff changeset
97 if(!divx4_param.rc_reaction_period) divx4_param.rc_reaction_period=10;
73978162b6a1 soem fixes
arpi
parents: 5550
diff changeset
98 if(!divx4_param.rc_reaction_ratio) divx4_param.rc_reaction_ratio=20;
73978162b6a1 soem fixes
arpi
parents: 5550
diff changeset
99
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
100 divx4_param.handle=NULL;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
101 encore(NULL,ENC_OPT_INIT,&divx4_param,NULL);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
102 vf->priv->enc_handle=divx4_param.handle;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
103 switch(outfmt){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
104 case IMGFMT_YV12: vf->priv->enc_frame.colorspace=ENC_CSP_YV12; break;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
105 case IMGFMT_IYUV:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
106 case IMGFMT_I420: vf->priv->enc_frame.colorspace=ENC_CSP_I420; break;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
107 case IMGFMT_YUY2: vf->priv->enc_frame.colorspace=ENC_CSP_YUY2; break;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
108 case IMGFMT_UYVY: vf->priv->enc_frame.colorspace=ENC_CSP_UYVY; break;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
109 case IMGFMT_RGB24:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
110 case IMGFMT_BGR24:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
111 vf->priv->enc_frame.colorspace=ENC_CSP_RGB24; break;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
112 default:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
113 mp_msg(MSGT_MENCODER,MSGL_ERR,"divx4: unsupported picture format (%s)!\n",
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
114 vo_format_name(outfmt));
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
115 return 0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
116 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
117
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
118 switch(pass){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
119 case 1:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
120 if (VbrControl_init_2pass_vbr_analysis(passtmpfile, divx4_param.quality) == -1){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
121 mp_msg(MSGT_MENCODER,MSGL_ERR,"2pass failed: filename=%s\n", passtmpfile);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
122 pass=0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
123 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
124 break;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
125 case 2:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
126 if (VbrControl_init_2pass_vbr_encoding(passtmpfile,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
127 divx4_param.bitrate,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
128 divx4_param.framerate,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
129 divx4_crispness,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
130 divx4_param.quality) == -1){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
131 mp_msg(MSGT_MENCODER,MSGL_ERR,"2pass failed: filename=%s\n", passtmpfile);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
132 pass=0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
133 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
134 break;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
135 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
136
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
137 return 1;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
138 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
139
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
140 static int control(struct vf_instance_s* vf, int request, void* data){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
141
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
142 return CONTROL_UNKNOWN;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
143 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
144
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
145 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
146 switch(fmt){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
147 case IMGFMT_YV12:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
148 case IMGFMT_IYUV:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
149 case IMGFMT_I420:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
150 return 3; // no conversion
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
151 case IMGFMT_YUY2:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
152 case IMGFMT_UYVY:
5706
26c89aadf6f8 flipped rgb fixed
arpi
parents: 5607
diff changeset
153 return 1; // conversion
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
154 case IMGFMT_RGB24:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
155 case IMGFMT_BGR24:
5706
26c89aadf6f8 flipped rgb fixed
arpi
parents: 5607
diff changeset
156 return 1 | VFCAP_FLIPPED; // conversion+flipped
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
157 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
158 return 0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
159 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
160
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
161 static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
162 ENC_RESULT enc_result;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
163 vf->priv->enc_frame.image=mpi->planes[0];
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
164 vf->priv->enc_frame.bitstream=mux_v->buffer;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
165 vf->priv->enc_frame.length=mux_v->buffer_size;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
166 vf->priv->enc_frame.mvs=NULL;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
167 if(pass==2){ // handle 2-pass:
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
168 vf->priv->enc_frame.quant = VbrControl_get_quant();
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
169 vf->priv->enc_frame.intra = VbrControl_get_intra();
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
170 encore(vf->priv->enc_handle,ENC_OPT_ENCODE_VBR,&vf->priv->enc_frame,&enc_result);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
171 VbrControl_update_2pass_vbr_encoding(enc_result.motion_bits,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
172 enc_result.texture_bits,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
173 enc_result.total_bits);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
174 } else {
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
175 vf->priv->enc_frame.quant=0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
176 vf->priv->enc_frame.intra=0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
177 encore(vf->priv->enc_handle,ENC_OPT_ENCODE,&vf->priv->enc_frame,&enc_result);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
178 if(pass==1){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
179 VbrControl_update_2pass_vbr_analysis(enc_result.is_key_frame,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
180 enc_result.motion_bits,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
181 enc_result.texture_bits,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
182 enc_result.total_bits,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
183 enc_result.quantizer);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
184 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
185 }
5551
73978162b6a1 soem fixes
arpi
parents: 5550
diff changeset
186 mencoder_write_chunk(mux_v,vf->priv->enc_frame.length,enc_result.is_key_frame?0x10:0);
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
187 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
188
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
189 //===========================================================================//
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
190
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
191 static int vf_open(vf_instance_t *vf, char* args){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
192 vf->config=config;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
193 vf->control=control;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
194 vf->query_format=query_format;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
195 vf->put_image=put_image;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
196 vf->priv=malloc(sizeof(struct vf_priv_s));
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
197 memset(vf->priv,0,sizeof(struct vf_priv_s));
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
198 vf->priv->mux=args;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
199
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
200 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
201 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
202 mux_v->bih->biWidth=0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
203 mux_v->bih->biHeight=0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
204 mux_v->bih->biPlanes=1;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
205 mux_v->bih->biBitCount=24;
5854
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
206 #if ENCORE_MAJOR_VERSION >= 5010
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
207 mux_v->bih->biCompression=mmioFOURCC('D','X','5','0');
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
208 #else
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
209 mux_v->bih->biCompression=mmioFOURCC('d','i','v','x');
5854
3a961eaf45b9 divx5.1 features added
arpi
parents: 5706
diff changeset
210 #endif
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
211
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
212 return 1;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
213 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
214
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
215 vf_info_t ve_info_divx4 = {
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
216 "divx4 encoder",
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
217 "divx4",
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
218 "A'rpi",
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
219 "for internal use by mencoder",
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
220 vf_open
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
221 };
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
222
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
223 //===========================================================================//
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
224 #endif