comparison libmpcodecs/ve_x264.c @ 13496:0bdcb3eea569

better default parameter,added counterpart option, better names for few options, 3-pass support and improved documentation. patch by Loren Merritt
author iive
date Mon, 27 Sep 2004 21:04:42 +0000
parents 15efa8ab93e3
children 17cb9c6a99f6
comparison
equal deleted inserted replaced
13495:2074e959b32c 13496:0bdcb3eea569
59 extern char* passtmpfile; 59 extern char* passtmpfile;
60 60
61 static int bitrate = -1; 61 static int bitrate = -1;
62 static int qp_constant = 26; 62 static int qp_constant = 26;
63 static int frame_ref = 1; 63 static int frame_ref = 1;
64 static int iframe = 60; 64 static int iframe = 250;
65 static int idrframe = 2; 65 static int idrframe = 2;
66 static int bframe = 0; 66 static int bframe = 0;
67 static int deblock = 1; 67 static int deblock = 1;
68 static int deblockalpha = 0; 68 static int deblockalpha = 0;
69 static int deblockbeta = 0; 69 static int deblockbeta = 0;
70 static int cabac = 0; 70 static int cabac = 1;
71 static int cabacidc = -1; 71 static int cabacidc = -1;
72 static int fullinter = 0; 72 static int fullinter = 0;
73 static float ip_factor = 2.0; 73 static float ip_factor = 2.0;
74 static float pb_factor = 2.0; 74 static float pb_factor = 2.0;
75 static int rc_buffer_size = -1; 75 static int rc_buffer_size = -1;
87 static int log_level = 2; 87 static int log_level = 2;
88 88
89 m_option_t x264encopts_conf[] = { 89 m_option_t x264encopts_conf[] = {
90 {"bitrate", &bitrate, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL}, 90 {"bitrate", &bitrate, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
91 {"qp_constant", &qp_constant, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL}, 91 {"qp_constant", &qp_constant, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL},
92 {"frameref", &frame_ref, CONF_TYPE_INT, CONF_RANGE, 1, 100, NULL}, 92 {"frameref", &frame_ref, CONF_TYPE_INT, CONF_RANGE, 1, 15, NULL},
93 {"iframe", &iframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL}, 93 {"keyint", &iframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
94 {"idrframe", &idrframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL}, 94 {"idrint", &idrframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
95 {"bframe", &bframe, CONF_TYPE_INT, CONF_RANGE, 0, 10, NULL}, 95 {"bframes", &bframe, CONF_TYPE_INT, CONF_RANGE, 0, 16, NULL},
96 {"deblock", &deblock, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL}, 96 {"deblock", &deblock, CONF_TYPE_FLAG, 0, 0, 1, NULL},
97 {"nodeblock", &deblock, CONF_TYPE_FLAG, 0, 1, 0, NULL},
97 {"deblockalpha", &deblockalpha, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL}, 98 {"deblockalpha", &deblockalpha, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL},
98 {"deblockbeta", &deblockbeta, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL}, 99 {"deblockbeta", &deblockbeta, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL},
99 {"cabac", &cabac, CONF_TYPE_FLAG, 0, 0, 1, NULL}, 100 {"cabac", &cabac, CONF_TYPE_FLAG, 0, 0, 1, NULL},
101 {"nocabac", &cabac, CONF_TYPE_FLAG, 0, 1, 0, NULL},
100 {"cabacidc", &cabacidc, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL}, 102 {"cabacidc", &cabacidc, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL},
101 {"fullinter", &fullinter, CONF_TYPE_FLAG, 0, 0, 1, NULL}, 103 {"fullinter", &fullinter, CONF_TYPE_FLAG, 0, 0, 1, NULL},
104 {"nofullinter", &fullinter, CONF_TYPE_FLAG, 0, 1, 0, NULL},
102 {"ip_factor", &ip_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL}, 105 {"ip_factor", &ip_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL},
103 {"pb_factor", &pb_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL}, 106 {"pb_factor", &pb_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL},
104 {"rc_buffer_size", &rc_buffer_size, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL}, 107 {"rc_buffer_size", &rc_buffer_size, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
105 {"rc_init_buffer", &rc_init_buffer, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL}, 108 {"rc_init_buffer", &rc_init_buffer, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
106 {"rc_sens", &rc_sens, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, 109 {"rc_sens", &rc_sens, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
111 {"rc_eq", &rc_eq, CONF_TYPE_STRING, 0, 0, 0, NULL}, 114 {"rc_eq", &rc_eq, CONF_TYPE_STRING, 0, 0, 0, NULL},
112 {"qcomp", &qcomp, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL}, 115 {"qcomp", &qcomp, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL},
113 {"qblur", &qblur, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL}, 116 {"qblur", &qblur, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL},
114 {"subq", &subq, CONF_TYPE_INT, CONF_RANGE, 0, 5, NULL}, 117 {"subq", &subq, CONF_TYPE_INT, CONF_RANGE, 0, 5, NULL},
115 {"psnr", &psnr, CONF_TYPE_FLAG, 0, 0, 1, NULL}, 118 {"psnr", &psnr, CONF_TYPE_FLAG, 0, 0, 1, NULL},
119 {"nopsnr", &psnr, CONF_TYPE_FLAG, 0, 1, 0, NULL},
116 {"log", &log_level, CONF_TYPE_INT, CONF_RANGE, -1, 3, NULL}, 120 {"log", &log_level, CONF_TYPE_INT, CONF_RANGE, -1, 3, NULL},
117 {NULL, NULL, 0, 0, 0, 0, NULL} 121 {NULL, NULL, 0, 0, 0, 0, NULL}
118 }; 122 };
119 123
120 124
166 break; 170 break;
167 case 2: 171 case 2:
168 mod->param.rc.b_stat_write = 0; 172 mod->param.rc.b_stat_write = 0;
169 mod->param.rc.b_stat_read = 1; 173 mod->param.rc.b_stat_read = 1;
170 break; 174 break;
175 case 3:
176 mod->param.rc.b_stat_write = 1;
177 mod->param.rc.b_stat_read = 1;
178 break;
171 } 179 }
172 if(bitrate > 0) { 180 if(bitrate > 0) {
173 if(rc_buffer_size <= 0) 181 if(rc_buffer_size <= 0)
174 rc_buffer_size = bitrate; 182 rc_buffer_size = bitrate;
175 if(rc_init_buffer < 0) 183 if(rc_init_buffer < 0)