MCPcopy Create free account
hub / github.com/TASEmulators/fceux / init

Function init

src/drivers/Qt/AviRecord.cpp:277–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275static int i_frame = 0;
276
277static int init( int width, int height )
278{
279 /* Get default params for preset/tuning */
280 if( x264_param_default_preset( &param, "medium", NULL ) < 0 )
281 {
282 goto x264_init_fail;
283 }
284
285 /* Configure non-default params */
286 param.i_bitdepth = 8;
287 param.i_csp = X264_CSP_I420;
288 param.i_width = width;
289 param.i_height = height;
290 param.b_vfr_input = 0;
291 param.b_repeat_headers = 1;
292 param.b_annexb = 1;
293
294 /* Apply profile restrictions. */
295 if( x264_param_apply_profile( &param, "high" ) < 0 )
296 {
297 goto x264_init_fail;
298 }
299
300 if( x264_picture_alloc( &pic, param.i_csp, param.i_width, param.i_height ) < 0 )
301 {
302 goto x264_init_fail;
303 }
304
305 hdl = x264_encoder_open( &param );
306 if ( hdl == NULL )
307 {
308 goto x264_init_fail;
309 }
310 i_frame = 0;
311
312 return 0;
313
314x264_init_fail:
315 return -1;
316}
317
318static int encode_frame( unsigned char *inBuf, int width, int height )
319{

Callers 5

reAllocMethod · 0.70
runMethod · 0.70
resetMethod · 0.70
resetMethod · 0.70
runMethod · 0.70

Calls 1

getBaseFrameRateFunction · 0.85

Tested by

no test coverage detected