MPlayer-1.3.0-x264_fix-1.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Submitted By: Bruce Dubbs <bdubbs@linuxfromscratch.org>
  2. Date: 2018-08-24
  3. Initial Package Version: 1.3.0
  4. Upstream Status: Applied
  5. Origin: Upstream commit log (http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=2a111c99a60fdf4fe5eea2b073901630190c6c93) + local changes
  6. Description: Fixes compilation with x264.
  7. --- ffmpeg/libavcodec/libx264.c.orig 2018-08-24 12:27:37.716498689 -0500
  8. +++ ffmpeg/libavcodec/libx264.c 2018-08-24 12:33:56.339997152 -0500
  9. @@ -268,7 +268,7 @@
  10. x264_picture_init( &x4->pic );
  11. x4->pic.img.i_csp = x4->params.i_csp;
  12. - if (x264_bit_depth > 8)
  13. + if (X264_BIT_DEPTH > 8)
  14. x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
  15. x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);
  16. @@ -745,6 +745,9 @@
  17. x4->params.i_width = avctx->width;
  18. x4->params.i_height = avctx->height;
  19. +#if X264_BUILD >= 153
  20. + x4->params.i_bitdepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth;
  21. +#endif
  22. av_reduce(&sw, &sh, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 4096);
  23. x4->params.vui.i_sar_width = sw;
  24. x4->params.vui.i_sar_height = sh;
  25. @@ -858,6 +861,28 @@
  26. return 0;
  27. }
  28. +static const enum AVPixelFormat pix_fmts[] = {
  29. + AV_PIX_FMT_YUV420P,
  30. + AV_PIX_FMT_YUVJ420P,
  31. + AV_PIX_FMT_YUV422P,
  32. + AV_PIX_FMT_YUVJ422P,
  33. + AV_PIX_FMT_YUV444P,
  34. + AV_PIX_FMT_YUVJ444P,
  35. + AV_PIX_FMT_YUV420P10,
  36. + AV_PIX_FMT_YUV422P10,
  37. + AV_PIX_FMT_YUV444P10,
  38. + AV_PIX_FMT_NV12,
  39. + AV_PIX_FMT_NV16,
  40. + AV_PIX_FMT_NV20,
  41. +#ifdef X264_CSP_NV21
  42. + AV_PIX_FMT_NV21,
  43. +#endif
  44. + AV_PIX_FMT_NONE
  45. +};
  46. +
  47. +
  48. +
  49. +
  50. static const enum AVPixelFormat pix_fmts_8bit[] = {
  51. AV_PIX_FMT_YUV420P,
  52. AV_PIX_FMT_YUVJ420P,
  53. @@ -895,12 +920,14 @@
  54. static av_cold void X264_init_static(AVCodec *codec)
  55. {
  56. - if (x264_bit_depth == 8)
  57. + if (X264_BIT_DEPTH == 8)
  58. codec->pix_fmts = pix_fmts_8bit;
  59. - else if (x264_bit_depth == 9)
  60. + else if (X264_BIT_DEPTH == 9)
  61. codec->pix_fmts = pix_fmts_9bit;
  62. - else if (x264_bit_depth == 10)
  63. + else if (X264_BIT_DEPTH == 10)
  64. codec->pix_fmts = pix_fmts_10bit;
  65. + else /* X264_BIT_DEPTH == 0 */
  66. + codec->pix_fmts = pix_fmts;
  67. }
  68. #define OFFSET(x) offsetof(X264Context, x)