ffmpeg_libx24_svn.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Index: libx264.c
  2. ===================================================================
  3. --- libx264.c (revision 24652)
  4. +++ libx264.c (working copy)
  5. @@ -100,7 +100,14 @@
  6. }
  7. x4->pic.i_pts = frame->pts;
  8. - x4->pic.i_type = X264_TYPE_AUTO;
  9. +
  10. + // by MDI
  11. + if(frame->pict_type == FF_I_TYPE){
  12. + x4->pic.i_type = X264_TYPE_IDR;
  13. + }
  14. + else{
  15. + x4->pic.i_type = X264_TYPE_AUTO;
  16. + }
  17. }
  18. do {
  19. @@ -153,7 +160,8 @@
  20. X264Context *x4 = avctx->priv_data;
  21. x4->sei_size = 0;
  22. - x264_param_default(&x4->params);
  23. + x264_param_default_preset(&x4->params, "veryfast", "zerolatency"); // By MDI
  24. + //x264_param_default(&x4->params);
  25. x4->params.pf_log = X264_log;
  26. x4->params.p_log_private = avctx;
  27. @@ -164,6 +172,12 @@
  28. x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
  29. x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000;
  30. x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1;
  31. +
  32. + // --by MDI begin
  33. + //x4->params.i_slice_max_size = 1350;
  34. + //x4->params.rc.i_lookahead = 0;
  35. + // --by MDI end
  36. +
  37. if (avctx->flags & CODEC_FLAG_PASS2) {
  38. x4->params.rc.b_stat_read = 1;
  39. } else {