📄 x264.c
字号:
/*****************************************************************************
* x264: h264 encoder/decoder testing program.
*****************************************************************************
* Copyright (C) 2003 Laurent Aimar
* $Id: x264.c,v 1.1 2004/06/03 19:24:12 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define _LARGEFILE_SOURCE
#define _FILE_OFFSET_BITS 64
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
//#include <signal.h>
#define _GNU_SOURCE
#include "getopt.h"
#ifdef _MSC_VER
#include <io.h> /* _setmode() */
#include <fcntl.h> /* _O_BINARY */
#endif
//#ifndef _MSC_VER
//#include "config.h"
//#endif
// BIOS headers
#include "common.h"
#include "x264.h"
#include "muxers.h"
unsigned int C64P_getltime(); // get current timer value
#define DATA_MAX 3000000
uint8_t data[DATA_MAX];
/* Ctrl-C handler */
static int b_ctrl_c = 0;
static int b_exit_on_ctrl_c = 0;
static void SigIntHandler( int a )
{
if( b_exit_on_ctrl_c )
exit(0);
b_ctrl_c = 1;
}
typedef struct {
int b_progress;
int i_seek;
hnd_t hin;
hnd_t hout;
FILE *qpfile;
} cli_opt_t;
/* input file operation function pointers */
int (*p_open_infile)( char *psz_filename, hnd_t *p_handle, x264_param_t *p_param );
int (*p_get_frame_total)( hnd_t handle );
int (*p_read_frame)( x264_picture_t *p_pic, hnd_t handle, int i_frame );
int (*p_close_infile)( hnd_t handle );
/* output file operation function pointers */
static int (*p_open_outfile)( char *psz_filename, hnd_t *p_handle );
static int (*p_set_outfile_param)( hnd_t handle, x264_param_t *p_param );
static int (*p_write_nalu)( hnd_t handle, uint8_t *p_nal, int i_size );
static int (*p_set_eop)( hnd_t handle, x264_picture_t *p_picture );
static int (*p_close_outfile)( hnd_t handle );
static void Help( x264_param_t *defaults, int b_longhelp );
static int Parse( int argc, char **argv, x264_param_t *param, cli_opt_t *opt );
static int Encode( x264_param_t *param, cli_opt_t *opt );
/****************************************************************************
* main:
****************************************************************************/
int main( int argc, char **argv )
{
x264_param_t param;
cli_opt_t opt;
#ifdef _MSC_VER
_setmode(_fileno(stdin), _O_BINARY);
_setmode(_fileno(stdout), _O_BINARY);
#endif
x264_param_default( ¶m );//癸絪絏竟秈︽把计砞﹚
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -