Advertisement
Guest User

Untitled

a guest
May 10th, 2017
548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.89 KB | None | 0 0
  1. From 9f8b2eb163ea7a7b9810cb1e3c189eac9abbdcf9 Mon Sep 17 00:00:00 2001
  2. From: Alexander Strange <astrange@ithinksw.com>
  3. Date: Mon, 10 Nov 2008 00:55:20 -0500
  4. Subject: [PATCH 1/8] Allow | as a separator between psy-rd and psy-trellis values.
  5.  
  6. [,:/] are all taken when setting psy-trellis in a zone in an mencoder option.
  7. ---
  8. common/common.c | 3 ++-
  9. 1 files changed, 2 insertions(+), 1 deletions(-)
  10.  
  11. diff --git a/common/common.c b/common/common.c
  12. index 6d1d7f0..bf47223 100644
  13. --- a/common/common.c
  14. +++ b/common/common.c
  15. -515,7 +515,8 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
  16. OPT("psy-rd")
  17. {
  18. if( 2 == sscanf( value, "%f:%f", &p->analyse.f_psy_rd, &p->analyse.f_psy_trellis ) ||
  19. - 2 == sscanf( value, "%f,%f", &p->analyse.f_psy_rd, &p->analyse.f_psy_trellis ) )
  20. + 2 == sscanf( value, "%f,%f", &p->analyse.f_psy_rd, &p->analyse.f_psy_trellis ) ||
  21. + 2 == sscanf( value, "%f|%f", &p->analyse.f_psy_rd, &p->analyse.f_psy_trellis ))
  22. { }
  23. else if( sscanf( value, "%f", &p->analyse.f_psy_rd ) )
  24. {
  25. --
  26. 1.6.6
  27.  
  28. From f044100562365fec2fe443dfa44ec44199108f58 Mon Sep 17 00:00:00 2001
  29. From: Alexander Strange <astrange@ithinksw.com>
  30. Date: Thu, 29 Oct 2009 01:55:46 -0400
  31. Subject: [PATCH 2/8] B-direct SSD tie-breaker
  32.  
  33. by Gabriel
  34. ---
  35. common/common.h | 1 +
  36. encoder/analyse.c | 4 ++++
  37. encoder/ratecontrol.c | 13 ++++++++++++-
  38. 3 files changed, 17 insertions(+), 1 deletions(-)
  39.  
  40. diff --git a/common/common.h b/common/common.h
  41. index 950f48f..a5a0726 100644
  42. --- a/common/common.h
  43. +++ b/common/common.h
  44. -689,6 +689,7 @@ struct x264_t
  45. int i_mb_pred_mode[3][13];
  46. /* Adaptive direct mv pred */
  47. int i_direct_score[2];
  48. + int64_t i_direct_score_SSD[2];
  49. /* Metrics */
  50. int64_t i_ssd[3];
  51. double f_ssim;
  52. diff --git a/encoder/analyse.c b/encoder/analyse.c
  53. index 666596b..cdae26d 100644
  54. --- a/encoder/analyse.c
  55. +++ b/encoder/analyse.c
  56. -2698,12 +2698,16 @@ intra_analysis:
  57. analysis.b_direct_available = x264_mb_predict_mv_direct16x16( h, i && analysis.b_direct_available ? &b_changed : NULL );
  58. if( analysis.b_direct_available )
  59. {
  60. + int i_bskip_local_cost = 0;
  61. if( b_changed )
  62. {
  63. x264_mb_mc( h );
  64. b_skip = x264_macroblock_probe_bskip( h );
  65. + if (b_skip)
  66. + i_bskip_local_cost = ssd_mb( h );
  67. }
  68. h->stat.frame.i_direct_score[ h->sh.b_direct_spatial_mv_pred ] += b_skip;
  69. + h->stat.frame.i_direct_score_SSD[ h->sh.b_direct_spatial_mv_pred ] += i_bskip_local_cost;
  70. }
  71. else
  72. b_skip = 0;
  73. diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
  74. index 63b3be6..beba2c3 100644
  75. --- a/encoder/ratecontrol.c
  76. +++ b/encoder/ratecontrol.c
  77. -1336,7 +1336,18 @@ int x264_ratecontrol_end( x264_t *h, int bits )
  78. char c_type = h->sh.i_type==SLICE_TYPE_I ? (h->fenc->i_poc==0 ? 'I' : 'i')
  79. : h->sh.i_type==SLICE_TYPE_P ? 'P'
  80. : h->fenc->b_kept_as_ref ? 'B' : 'b';
  81. - int dir_frame = h->stat.frame.i_direct_score[1] - h->stat.frame.i_direct_score[0];
  82. + /* if number of skip blocs in spatial and temporal modes are close, use SSD as a selecting criterion*/
  83. + int i_direct_score_0 = h->stat.frame.i_direct_score[0];
  84. + int i_direct_score_1 = h->stat.frame.i_direct_score[1];
  85. + int b_tied_skip_nums = X264_MIN(i_direct_score_1, i_direct_score_0) > (X264_MAX(i_direct_score_1, i_direct_score_0)*95/100)
  86. + && i_direct_score_0 && i_direct_score_1;
  87. + int b_skip_SSD_dif = X264_MIN(h->stat.frame.i_direct_score_SSD[1], h->stat.frame.i_direct_score_SSD[0]) <
  88. + (X264_MAX(h->stat.frame.i_direct_score_SSD[1], h->stat.frame.i_direct_score_SSD[0])*80/100);
  89. +
  90. + int dir_frame = (b_tied_skip_nums && b_skip_SSD_dif) ?
  91. + h->stat.frame.i_direct_score_SSD[0] - h->stat.frame.i_direct_score_SSD[1] :
  92. + i_direct_score_1 - i_direct_score_0;
  93. +
  94. int dir_avg = h->stat.i_direct_score[1] - h->stat.i_direct_score[0];
  95. char c_direct = h->mb.b_direct_auto_write ?
  96. ( dir_frame>0 ? 's' : dir_frame<0 ? 't' :
  97. --
  98. 1.6.6
  99.  
  100. From 081a40f1c777d023607c8f4a8e6cc0ac1417aa73 Mon Sep 17 00:00:00 2001
  101. From: Alexander Strange <astrange@ithinksw.com>
  102. Date: Mon, 9 Nov 2009 00:11:57 -0500
  103. Subject: [PATCH 3/8] todo comment about qp deltas
  104.  
  105. ---
  106. encoder/analyse.c | 1 +
  107. 1 files changed, 1 insertions(+), 0 deletions(-)
  108.  
  109. diff --git a/encoder/analyse.c b/encoder/analyse.c
  110. index cdae26d..037e00a 100644
  111. --- a/encoder/analyse.c
  112. +++ b/encoder/analyse.c
  113. -2357,6 +2357,7 @@ void x264_macroblock_analyse( x264_t *h )
  114. x264_adaptive_quant( h );
  115. /* If the QP of this MB is within 1 of the previous MB, code the same QP as the previous MB,
  116. * to lower the bit cost of the qp_delta. Don't do this if QPRD is enabled. */
  117. + //FIXME try also allowing +/- 1 qp_delta if it was +/- 2 two MBs ago
  118. if( h->param.analyse.i_subpel_refine < 10 && abs(h->mb.i_qp - h->mb.i_last_qp) == 1 )
  119. h->mb.i_qp = h->mb.i_last_qp;
  120. }
  121. --
  122. 1.6.6
  123.  
  124. From 6225fc42c74f5a8fcf5af2c5b99d1734a39ca91a Mon Sep 17 00:00:00 2001
  125. From: Alexander Strange <astrange@ithinksw.com>
  126. Date: Sun, 7 Feb 2010 04:09:25 -0500
  127. Subject: [PATCH 4/8] Fix a comment typo.
  128.  
  129. ---
  130. encoder/encoder.c | 2 +-
  131. 1 files changed, 1 insertions(+), 1 deletions(-)
  132.  
  133. diff --git a/encoder/encoder.c b/encoder/encoder.c
  134. index d873cd0..7bd55d2 100644
  135. --- a/encoder/encoder.c
  136. +++ b/encoder/encoder.c
  137. -84,7 +84,7 @@ static void x264_slice_header_init( x264_t *h, x264_slice_header_t *sh,
  138. x264_param_t *param = &h->param;
  139. int i;
  140.  
  141. - /* First we fill all field */
  142. + /* First we fill all fields */
  143. sh->sps = sps;
  144. sh->pps = pps;
  145.  
  146. --
  147. 1.6.6
  148.  
  149. From 9e6831ffb32c336d42d547514c40c110a2362a12 Mon Sep 17 00:00:00 2001
  150. From: Alexander Strange <astrange@ithinksw.com>
  151. Date: Sat, 13 Feb 2010 01:40:44 -0500
  152. Subject: [PATCH 5/8] Remove useless variable assignment.
  153.  
  154. ---
  155. encoder/encoder.c | 2 --
  156. 1 files changed, 0 insertions(+), 2 deletions(-)
  157.  
  158. diff --git a/encoder/encoder.c b/encoder/encoder.c
  159. index 7bd55d2..5161e66 100644
  160. --- a/encoder/encoder.c
  161. +++ b/encoder/encoder.c
  162. -659,8 +659,6 @@ static int x264_validate_parameters( x264_t *h )
  163. /* Psy trellis has a similar effect. */
  164. if( h->mb.i_psy_trellis )
  165. h->param.analyse.i_chroma_qp_offset -= h->param.analyse.f_psy_trellis < 0.25 ? 1 : 2;
  166. - else
  167. - h->mb.i_psy_trellis = 0;
  168. h->param.analyse.i_chroma_qp_offset = x264_clip3(h->param.analyse.i_chroma_qp_offset, -12, 12);
  169. h->param.rc.i_aq_mode = x264_clip3( h->param.rc.i_aq_mode, 0, 2 );
  170. h->param.rc.f_aq_strength = x264_clip3f( h->param.rc.f_aq_strength, 0, 3 );
  171. --
  172. 1.6.6
  173.  
  174. From 5e8946747d2d906abb01e768b759e3f6b814e4a0 Mon Sep 17 00:00:00 2001
  175. From: Alexander Strange <astrange@ithinksw.com>
  176. Date: Sat, 13 Feb 2010 01:41:41 -0500
  177. Subject: [PATCH 6/8] mkv: Write SimpleBlock instead of Block for frame headers.
  178.  
  179. mkvtoolnix writes these by default since 2009/04/13.
  180. Slightly simplifies muxer and allows 'mkvinfo -s' to show B-frames
  181. as 'B' (but not B-ref frames).
  182. ---
  183. output/matroska.c | 2 +-
  184. output/matroska_ebml.c | 72 ++++++------------------------------------------
  185. output/matroska_ebml.h | 2 +-
  186. 3 files changed, 11 insertions(+), 65 deletions(-)
  187.  
  188. diff --git a/output/matroska.c b/output/matroska.c
  189. index 8e84f52..db7639c 100644
  190. --- a/output/matroska.c
  191. +++ b/output/matroska.c
  192. @@ -185,7 +185,7 @@ static int write_frame( hnd_t handle, uint8_t *p_nalu, int i_size, x264_picture_
  193.  
  194. p_mkv->b_writing_frame = 0;
  195.  
  196. - if( mk_set_frame_flags( p_mkv->w, i_stamp, p_picture->b_keyframe ) < 0 )
  197. + if( mk_set_frame_flags( p_mkv->w, i_stamp, p_picture->b_keyframe, p_picture->i_type == X264_TYPE_B ) < 0 )
  198. return -1;
  199.  
  200. return i_size;
  201. diff --git a/output/matroska_ebml.c b/output/matroska_ebml.c
  202. index d1c6e13..6aa42bd 100644
  203. --- a/output/matroska_ebml.c
  204. +++ b/output/matroska_ebml.c
  205. @@ -53,9 +53,9 @@ struct mk_writer
  206. int64_t def_duration;
  207. int64_t timescale;
  208. int64_t cluster_tc_scaled;
  209. - int64_t frame_tc, prev_frame_tc_scaled, max_frame_tc;
  210. + int64_t frame_tc, max_frame_tc;
  211.  
  212. - char wrote_header, in_frame, keyframe;
  213. + char wrote_header, in_frame, keyframe, skippable;
  214. };
  215.  
  216. static mk_context *mk_create_context( mk_writer *w, mk_context *parent, unsigned id )
  217. @@ -258,23 +258,6 @@ static int mk_write_uint( mk_context *c, unsigned id, int64_t ui )
  218. return 0;
  219. }
  220.  
  221. -static int mk_write_sint( mk_context *c, unsigned id, int64_t si )
  222. -{
  223. - unsigned char c_si[8] = { si >> 56, si >> 48, si >> 40, si >> 32, si >> 24, si >> 16, si >> 8, si };
  224. - unsigned i = 0;
  225. -
  226. - CHECK( mk_write_id( c, id ) );
  227. - if( si < 0 )
  228. - while( i < 7 && c_si[i] == 0xff && c_si[i+1] & 0x80 )
  229. - ++i;
  230. - else
  231. - while( i < 7 && c_si[i] == 0 && !(c_si[i+1] & 0x80 ) )
  232. - ++i;
  233. - CHECK( mk_write_size( c, 8 - i ) );
  234. - CHECK( mk_append_context_data( c, c_si+i, 8 - i ) );
  235. - return 0;
  236. -}
  237. -
  238. static int mk_write_float_raw( mk_context *c, float f )
  239. {
  240. union
  241. @@ -301,34 +284,6 @@ static int mk_write_float( mk_context *c, unsigned id, float f )
  242. return 0;
  243. }
  244.  
  245. -static unsigned mk_ebml_size_size( unsigned s )
  246. -{
  247. - if( s < 0x7f )
  248. - return 1;
  249. - if( s < 0x3fff )
  250. - return 2;
  251. - if( s < 0x1fffff )
  252. - return 3;
  253. - if( s < 0x0fffffff )
  254. - return 4;
  255. - return 5;
  256. -}
  257. -
  258. -static unsigned mk_ebml_sint_size( int64_t si )
  259. -{
  260. - unsigned char c_si[8] = { si >> 56, si >> 48, si >> 40, si >> 32, si >> 24, si >> 16, si >> 8, si };
  261. - unsigned i = 0;
  262. -
  263. - if( si < 0 )
  264. - while( i < 7 && c_si[i] == 0xff && c_si[i+1] & 0x80 )
  265. - ++i;
  266. - else
  267. - while( i < 7 && c_si[i] == 0 && !(c_si[i+1] & 0x80) )
  268. - ++i;
  269. -
  270. - return 8 - i;
  271. -}
  272. -
  273. mk_writer *mk_create_writer( const char *filename )
  274. {
  275. mk_writer *w = malloc( sizeof(*w) );
  276. @@ -446,8 +401,8 @@ static int mk_close_cluster( mk_writer *w )
  277.  
  278. static int mk_flush_frame( mk_writer *w )
  279. {
  280. - int64_t delta, ref = 0;
  281. - unsigned fsize, bgsize;
  282. + int64_t delta;
  283. + unsigned fsize;
  284. unsigned char c_delta_flags[3];
  285.  
  286. if( !w->in_frame )
  287. @@ -470,33 +425,22 @@ static int mk_flush_frame( mk_writer *w )
  288. }
  289.  
  290. fsize = w->frame ? w->frame->d_cur : 0;
  291. - bgsize = fsize + 4 + mk_ebml_size_size( fsize + 4 ) + 1;
  292. - if( !w->keyframe )
  293. - {
  294. - ref = w->prev_frame_tc_scaled - w->cluster_tc_scaled - delta;
  295. - bgsize += 1 + 1 + mk_ebml_sint_size( ref );
  296. - }
  297.  
  298. - CHECK( mk_write_id( w->cluster, 0xa0 ) ); // BlockGroup
  299. - CHECK( mk_write_size( w->cluster, bgsize ) );
  300. - CHECK( mk_write_id( w->cluster, 0xa1 ) ); // Block
  301. + CHECK( mk_write_id( w->cluster, 0xa3 ) ); // SimpleBlock
  302. CHECK( mk_write_size( w->cluster, fsize + 4 ) );
  303. CHECK( mk_write_size( w->cluster, 1 ) ); // track number
  304.  
  305. c_delta_flags[0] = delta >> 8;
  306. c_delta_flags[1] = delta;
  307. - c_delta_flags[2] = 0;
  308. + c_delta_flags[2] = (w->keyframe << 7) | w->skippable;
  309. CHECK( mk_append_context_data( w->cluster, c_delta_flags, 3 ) );
  310. if( w->frame )
  311. {
  312. CHECK( mk_append_context_data( w->cluster, w->frame->data, w->frame->d_cur ) );
  313. w->frame->d_cur = 0;
  314. }
  315. - if( !w->keyframe )
  316. - CHECK( mk_write_sint( w->cluster, 0xfb, ref ) ); // ReferenceBlock
  317.  
  318. w->in_frame = 0;
  319. - w->prev_frame_tc_scaled = w->cluster_tc_scaled + delta;
  320.  
  321. if( w->cluster->d_cur > CLSIZE )
  322. CHECK( mk_close_cluster( w ) );
  323. @@ -511,17 +455,19 @@ int mk_start_frame( mk_writer *w )
  324.  
  325. w->in_frame = 1;
  326. w->keyframe = 0;
  327. + w->skippable= 0;
  328.  
  329. return 0;
  330. }
  331.  
  332. -int mk_set_frame_flags( mk_writer *w, int64_t timestamp, int keyframe )
  333. +int mk_set_frame_flags( mk_writer *w, int64_t timestamp, int keyframe, int skippable )
  334. {
  335. if( !w->in_frame )
  336. return -1;
  337.  
  338. w->frame_tc = timestamp;
  339. w->keyframe = keyframe != 0;
  340. + w->skippable= skippable!= 0;
  341.  
  342. if( w->max_frame_tc < timestamp )
  343. w->max_frame_tc = timestamp;
  344. diff --git a/output/matroska_ebml.h b/output/matroska_ebml.h
  345. index 252e781..56eb8cc 100644
  346. --- a/output/matroska_ebml.h
  347. +++ b/output/matroska_ebml.h
  348. @@ -35,7 +35,7 @@ int mk_writeHeader( mk_writer *w, const char *writing_app,
  349.  
  350. int mk_start_frame( mk_writer *w );
  351. int mk_add_frame_data( mk_writer *w, const void *data, unsigned size );
  352. -int mk_set_frame_flags( mk_writer *w, int64_t timestamp, int keyframe );
  353. +int mk_set_frame_flags( mk_writer *w, int64_t timestamp, int keyframe, int skippable );
  354. int mk_close( mk_writer *w, int64_t last_delta );
  355.  
  356. #endif
  357. --
  358. 1.6.6
  359.  
  360. From cde64a308c2766b59fa34945eb0985b52bf774f5 Mon Sep 17 00:00:00 2001
  361. From: Alexander Strange <astrange@ithinksw.com>
  362. Date: Sat, 13 Feb 2010 02:00:57 -0500
  363. Subject: [PATCH 7/8] mkv: Write the x264 version into the file header.
  364.  
  365. This only updates the "writing application"; matroska_ebml.c is the
  366. "muxing application", but the version string for that is still hardcoded.
  367. ---
  368. output/matroska.c | 2 +-
  369. 1 files changed, 1 insertions(+), 1 deletions(-)
  370.  
  371. diff --git a/output/matroska.c b/output/matroska.c
  372. index db7639c..b1805e4 100644
  373. --- a/output/matroska.c
  374. +++ b/output/matroska.c
  375. -146,7 +146,7 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal )
  376.  
  377. memcpy( avcC+11+sps_size, pps, pps_size );
  378.  
  379. - ret = mk_writeHeader( p_mkv->w, "x264", "V_MPEG4/ISO/AVC",
  380. + ret = mk_writeHeader( p_mkv->w, "x264" X264_VERSION, "V_MPEG4/ISO/AVC",
  381. avcC, avcC_len, p_mkv->frame_duration, 50000,
  382. p_mkv->width, p_mkv->height,
  383. p_mkv->d_width, p_mkv->d_height );
  384. --
  385. 1.6.6
  386.  
  387. From efc3c57a0eb4c74bd31fd616078aa0077033af92 Mon Sep 17 00:00:00 2001
  388. From: Alexander Strange <astrange@ithinksw.com>
  389. Date: Sat, 13 Feb 2010 02:22:04 -0500
  390. Subject: [PATCH 8/8] Mark cli_input/output_t variables as const when possible.
  391.  
  392. ---
  393. input/avs.c | 2 +-
  394. input/ffms.c | 2 +-
  395. input/input.h | 10 +++++-----
  396. input/lavf.c | 2 +-
  397. input/y4m.c | 2 +-
  398. input/yuv.c | 2 +-
  399. output/flv.c | 2 +-
  400. output/matroska.c | 2 +-
  401. output/mp4.c | 2 +-
  402. output/output.h | 8 ++++----
  403. output/raw.c | 2 +-
  404. 11 files changed, 18 insertions(+), 18 deletions(-)
  405.  
  406. diff --git a/input/avs.c b/input/avs.c
  407. index 522f8fe..79b5c80 100644
  408. --- a/input/avs.c
  409. +++ b/input/avs.c
  410. -313,4 +313,4 @@ static int close_file( hnd_t handle )
  411. return 0;
  412. }
  413.  
  414. -cli_input_t avs_input = { open_file, get_frame_total, picture_alloc, read_frame, release_frame, picture_clean, close_file };
  415. +const cli_input_t avs_input = { open_file, get_frame_total, picture_alloc, read_frame, release_frame, picture_clean, close_file };
  416. diff --git a/input/ffms.c b/input/ffms.c
  417. index b680967..14962c7 100644
  418. --- a/input/ffms.c
  419. +++ b/input/ffms.c
  420. -244,4 +244,4 @@ static int close_file( hnd_t handle )
  421. return 0;
  422. }
  423.  
  424. -cli_input_t ffms_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
  425. +const cli_input_t ffms_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
  426. diff --git a/input/input.h b/input/input.h
  427. index 9fb425c..6e386f4 100644
  428. --- a/input/input.h
  429. +++ b/input/input.h
  430. -60,11 +60,11 @@ typedef struct
  431. int (*close_file)( hnd_t handle );
  432. } cli_input_t;
  433.  
  434. -extern cli_input_t yuv_input;
  435. -extern cli_input_t y4m_input;
  436. -extern cli_input_t avs_input;
  437. +extern const cli_input_t yuv_input;
  438. +extern const cli_input_t y4m_input;
  439. +extern const cli_input_t avs_input;
  440. extern cli_input_t thread_input;
  441. -extern cli_input_t lavf_input;
  442. -extern cli_input_t ffms_input;
  443. +extern const cli_input_t lavf_input;
  444. +extern const cli_input_t ffms_input;
  445.  
  446. #endif
  447. diff --git a/input/lavf.c b/input/lavf.c
  448. index 180e509..6ecc6b0 100644
  449. --- a/input/lavf.c
  450. +++ b/input/lavf.c
  451. -269,4 +269,4 @@ static int close_file( hnd_t handle )
  452. return 0;
  453. }
  454.  
  455. -cli_input_t lavf_input = { open_file, get_frame_total, picture_alloc, read_frame, NULL, picture_clean, close_file };
  456. +const cli_input_t lavf_input = { open_file, get_frame_total, picture_alloc, read_frame, NULL, picture_clean, close_file };
  457. diff --git a/input/y4m.c b/input/y4m.c
  458. index 1619f74..8645ff7 100644
  459. --- a/input/y4m.c
  460. +++ b/input/y4m.c
  461. -242,4 +242,4 @@ static int close_file( hnd_t handle )
  462. return 0;
  463. }
  464.  
  465. -cli_input_t y4m_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
  466. +const cli_input_t y4m_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
  467. diff --git a/input/yuv.c b/input/yuv.c
  468. index dbd0317..3e39e07 100644
  469. --- a/input/yuv.c
  470. +++ b/input/yuv.c
  471. -125,4 +125,4 @@ static int close_file( hnd_t handle )
  472. return 0;
  473. }
  474.  
  475. -cli_input_t yuv_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
  476. +const cli_input_t yuv_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
  477. diff --git a/output/flv.c b/output/flv.c
  478. index b3e5d16..2e0a0e4 100644
  479. --- a/output/flv.c
  480. +++ b/output/flv.c
  481. -305,4 +305,4 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
  482. return 0;
  483. }
  484.  
  485. -cli_output_t flv_output = { open_file, set_param, write_headers, write_frame, close_file };
  486. +const cli_output_t flv_output = { open_file, set_param, write_headers, write_frame, close_file };
  487. diff --git a/output/matroska.c b/output/matroska.c
  488. index b1805e4..fb39ced 100644
  489. --- a/output/matroska.c
  490. +++ b/output/matroska.c
  491. -206,4 +206,4 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
  492. return ret;
  493. }
  494.  
  495. -cli_output_t mkv_output = { open_file, set_param, write_headers, write_frame, close_file };
  496. +const cli_output_t mkv_output = { open_file, set_param, write_headers, write_frame, close_file };
  497. diff --git a/output/mp4.c b/output/mp4.c
  498. index e3ad9c6..02c0b7d 100644
  499. --- a/output/mp4.c
  500. +++ b/output/mp4.c
  501. -297,4 +297,4 @@ static int write_frame( hnd_t handle, uint8_t *p_nalu, int i_size, x264_picture_
  502. return i_size;
  503. }
  504.  
  505. -cli_output_t mp4_output = { open_file, set_param, write_headers, write_frame, close_file };
  506. +const cli_output_t mp4_output = { open_file, set_param, write_headers, write_frame, close_file };
  507. diff --git a/output/output.h b/output/output.h
  508. index 851b819..c79b48e 100644
  509. --- a/output/output.h
  510. +++ b/output/output.h
  511. -33,9 +33,9 @@ typedef struct
  512. int (*close_file)( hnd_t handle, int64_t largest_pts, int64_t second_largest_pts );
  513. } cli_output_t;
  514.  
  515. -extern cli_output_t raw_output;
  516. -extern cli_output_t mkv_output;
  517. -extern cli_output_t mp4_output;
  518. -extern cli_output_t flv_output;
  519. +extern const cli_output_t raw_output;
  520. +extern const cli_output_t mkv_output;
  521. +extern const cli_output_t mp4_output;
  522. +extern const cli_output_t flv_output;
  523.  
  524. #endif
  525. diff --git a/output/raw.c b/output/raw.c
  526. index a4d1175..02e4c56 100644
  527. --- a/output/raw.c
  528. +++ b/output/raw.c
  529. -62,5 +62,5 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
  530. return fclose( (FILE*)handle );
  531. }
  532.  
  533. -cli_output_t raw_output = { open_file, set_param, write_headers, write_frame, close_file };
  534. +const cli_output_t raw_output = { open_file, set_param, write_headers, write_frame, close_file };
  535.  
  536. --
  537. 1.6.6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement