From 681fb007ff012b7e7be2dcf297c5da09403c409f Mon Sep 17 00:00:00 2001
From: Lawrence Rust <lvr@softsystem.co.uk>
Date: Thu, 17 May 2012 17:07:00 +0200
Subject: [PATCH] ffmpeg: Allow building with libx264 >= 0.85
Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
---
mythtv/configure | 4 ++--
mythtv/external/FFmpeg/libavcodec/libx264.c | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/mythtv/configure b/mythtv/configure
index 9547f00..e208de1 100755
a
|
b
|
enabled libvpx && { |
3934 | 3934 | enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_enc_init_ver -lvpx || |
3935 | 3935 | die "ERROR: libvpx encoder version must be >=0.9.1"; } } |
3936 | 3936 | enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 && |
3937 | | { check_cpp_condition x264.h "X264_BUILD >= 118" || |
3938 | | die "ERROR: libx264 version must be >= 0.118."; } |
| 3937 | { check_cpp_condition x264.h "X264_BUILD >= 85" || |
| 3938 | die "ERROR: libx264 version must be >= 0.85."; } |
3939 | 3939 | enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs |
3940 | 3940 | enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore |
3941 | 3941 | enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib |
diff --git a/mythtv/external/FFmpeg/libavcodec/libx264.c b/mythtv/external/FFmpeg/libavcodec/libx264.c
index d8200d3..ad01c39 100644
a
|
b
|
static int convert_pix_fmt(enum PixelFormat pix_fmt) |
251 | 251 | case PIX_FMT_YUVJ420P: |
252 | 252 | case PIX_FMT_YUV420P9: |
253 | 253 | case PIX_FMT_YUV420P10: return X264_CSP_I420; |
| 254 | #ifdef X264_CSP_I422 |
254 | 255 | case PIX_FMT_YUV422P: |
255 | 256 | case PIX_FMT_YUV422P10: return X264_CSP_I422; |
| 257 | #endif |
| 258 | #ifdef X264_CSP_I444 |
256 | 259 | case PIX_FMT_YUV444P: |
257 | 260 | case PIX_FMT_YUV444P9: |
258 | 261 | case PIX_FMT_YUV444P10: return X264_CSP_I444; |
| 262 | #endif |
259 | 263 | #ifdef X264_CSP_BGR |
260 | 264 | case PIX_FMT_BGR24: |
261 | 265 | return X264_CSP_BGR; |
… |
… |
static const AVOption options[] = { |
568 | 572 | { "weightb", "Weighted prediction for B-frames.", OFFSET(weightb), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE }, |
569 | 573 | { "weightp", "Weighted prediction analysis method.", OFFSET(weightp), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "weightp" }, |
570 | 574 | { "none", NULL, 0, AV_OPT_TYPE_CONST, {X264_WEIGHTP_NONE}, INT_MIN, INT_MAX, VE, "weightp" }, |
| 575 | #ifdef X264_WEIGHTP_SIMPLE |
571 | 576 | { "simple", NULL, 0, AV_OPT_TYPE_CONST, {X264_WEIGHTP_SIMPLE}, INT_MIN, INT_MAX, VE, "weightp" }, |
| 577 | #endif |
572 | 578 | { "smart", NULL, 0, AV_OPT_TYPE_CONST, {X264_WEIGHTP_SMART}, INT_MIN, INT_MAX, VE, "weightp" }, |
573 | 579 | { "ssim", "Calculate and print SSIM stats.", OFFSET(ssim), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE }, |
574 | 580 | { "intra-refresh", "Use Periodic Intra Refresh instead of IDR frames.",OFFSET(intra_refresh),AV_OPT_TYPE_INT, {-1 }, -1, 1, VE }, |