From 76091f6c3bcfacf003ee38d3a8673d1848565298 Mon Sep 17 00:00:00 2001 From: kili Date: Tue, 14 Apr 2009 19:52:08 +0000 Subject: [PATCH] Some fixes after the x264 update. From Brad. "theoretically ok" ajacoutot@ --- graphics/ffmpeg/Makefile | 6 +- .../ffmpeg/patches/patch-libavcodec_libx264_c | 29 +++++ .../gstreamer-0.10/plugins-bad/Makefile | 4 +- .../patches/patch-ext_x264_gstx264enc_c | 15 +++ .../patches/patch-ext_x264_gstx264enc_h | 11 ++ x11/mplayer/Makefile | 4 +- .../patches/patch-libavcodec_libx264_c | 29 +++++ x11/vlc/Makefile | 4 +- x11/vlc/patches/patch-modules_codec_x264_c | 118 ++++++++++++++++++ 9 files changed, 211 insertions(+), 9 deletions(-) create mode 100644 graphics/ffmpeg/patches/patch-libavcodec_libx264_c create mode 100644 multimedia/gstreamer-0.10/plugins-bad/patches/patch-ext_x264_gstx264enc_c create mode 100644 multimedia/gstreamer-0.10/plugins-bad/patches/patch-ext_x264_gstx264enc_h create mode 100644 x11/mplayer/patches/patch-libavcodec_libx264_c create mode 100644 x11/vlc/patches/patch-modules_codec_x264_c diff --git a/graphics/ffmpeg/Makefile b/graphics/ffmpeg/Makefile index 4c335c71dad..07fc5e9e877 100644 --- a/graphics/ffmpeg/Makefile +++ b/graphics/ffmpeg/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.45 2009/01/29 11:30:27 sthen Exp $ +# $OpenBSD: Makefile,v 1.46 2009/04/14 19:52:08 kili Exp $ COMMENT= audio/video converter and streamer with bktr(4) support V= 20080620 DISTNAME= ffmpeg-svn-${V} -PKGNAME= ffmpeg-${V}p7 +PKGNAME= ffmpeg-${V}p8 SHARED_LIBS= avutil 6.0 \ avcodec 13.0 \ avformat 12.0 \ @@ -32,7 +32,7 @@ LIB_DEPENDS= SDL.>=4::devel/sdl \ mp3lame.>=0.1::audio/lame \ vorbis.>=4.0,vorbisenc.>=2.0::audio/libvorbis \ a52::audio/liba52 \ - x264.>=1::multimedia/x264 \ + x264.>=3::multimedia/x264 \ theora::multimedia/libtheora \ Imlib2::graphics/imlib2 \ bz2.>=10::archivers/bzip2 diff --git a/graphics/ffmpeg/patches/patch-libavcodec_libx264_c b/graphics/ffmpeg/patches/patch-libavcodec_libx264_c new file mode 100644 index 00000000000..aaebc4c009c --- /dev/null +++ b/graphics/ffmpeg/patches/patch-libavcodec_libx264_c @@ -0,0 +1,29 @@ +$OpenBSD: patch-libavcodec_libx264_c,v 1.3 2009/04/14 19:52:08 kili Exp $ +--- libavcodec/libx264.c.orig Sun Jan 4 00:08:43 2009 ++++ libavcodec/libx264.c Sun Jan 4 00:10:43 2009 +@@ -162,7 +162,7 @@ X264_init(AVCodecContext *avctx) + + x4->params.i_bframe = avctx->max_b_frames; + x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC; +- x4->params.b_bframe_adaptive = avctx->b_frame_strategy; ++ x4->params.i_bframe_adaptive = avctx->b_frame_strategy; + x4->params.i_bframe_bias = avctx->bframebias; + x4->params.b_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID; + avctx->has_b_frames= avctx->flags2 & CODEC_FLAG2_BPYRAMID ? 2 : !!avctx->max_b_frames; +@@ -227,8 +227,6 @@ X264_init(AVCodecContext *avctx) + x4->params.analyse.i_me_range = avctx->me_range; + x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality; + +- x4->params.analyse.b_bidir_me = avctx->bidir_refine > 0; +- x4->params.analyse.b_bframe_rdo = avctx->flags2 & CODEC_FLAG2_BRDO; + x4->params.analyse.b_mixed_references = + avctx->flags2 & CODEC_FLAG2_MIXED_REFS; + x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA; +@@ -253,7 +251,6 @@ X264_init(AVCodecContext *avctx) + x4->params.rc.f_ip_factor = 1/fabs(avctx->i_quant_factor); + x4->params.rc.f_pb_factor = avctx->b_quant_factor; + x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset; +- x4->params.rc.psz_rc_eq = avctx->rc_eq; + + x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR; + x4->params.i_log_level = X264_LOG_DEBUG; diff --git a/multimedia/gstreamer-0.10/plugins-bad/Makefile b/multimedia/gstreamer-0.10/plugins-bad/Makefile index e8df6daebe0..ce54c201fa7 100644 --- a/multimedia/gstreamer-0.10/plugins-bad/Makefile +++ b/multimedia/gstreamer-0.10/plugins-bad/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.15 2009/04/11 14:37:21 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.16 2009/04/14 19:52:08 kili Exp $ COMMENT-main = multimedia framework - plugins bad COMMENT-tremor = multimedia framework - tremor plugin @@ -35,7 +35,7 @@ PKGNAME-swf = gstreamer-flash-$Vp2 PKGNAME-meta = gstreamer-meta-$Vp3 PKGNAME-sndfile = gstreamer-sndfile-$Vp3 PKGNAME-real = gstreamer-real-$Vp3 -PKGNAME-x264 = gstreamer-x264-$Vp1 +PKGNAME-x264 = gstreamer-x264-$Vp2 PKGNAME-mplex = gstreamer-mplex-$Vp1 MULTI_PACKAGES = -main -tremor -musepack -faac -faad -xvid -sdl -bz2 \ diff --git a/multimedia/gstreamer-0.10/plugins-bad/patches/patch-ext_x264_gstx264enc_c b/multimedia/gstreamer-0.10/plugins-bad/patches/patch-ext_x264_gstx264enc_c new file mode 100644 index 00000000000..4f6784bcc75 --- /dev/null +++ b/multimedia/gstreamer-0.10/plugins-bad/patches/patch-ext_x264_gstx264enc_c @@ -0,0 +1,15 @@ +$OpenBSD: patch-ext_x264_gstx264enc_c,v 1.1 2009/04/14 19:52:08 kili Exp $ +--- ext/x264/gstx264enc.c.orig Sun Jan 4 01:07:03 2009 ++++ ext/x264/gstx264enc.c Sun Jan 4 01:08:50 2009 +@@ -594,7 +594,11 @@ gst_x264_enc_init_encoder (GstX264Enc * encoder) + encoder->x264param.i_frame_reference = encoder->ref; + encoder->x264param.i_bframe = encoder->bframes; + encoder->x264param.b_bframe_pyramid = encoder->b_pyramid; ++#if X264_BUILD < 63 + encoder->x264param.b_bframe_adaptive = 0; ++#else ++ encoder->x264param.i_bframe_adaptive = 0; ++#endif + encoder->x264param.b_deblocking_filter = 1; + encoder->x264param.i_deblocking_filter_alphac0 = 0; + encoder->x264param.i_deblocking_filter_beta = 0; diff --git a/multimedia/gstreamer-0.10/plugins-bad/patches/patch-ext_x264_gstx264enc_h b/multimedia/gstreamer-0.10/plugins-bad/patches/patch-ext_x264_gstx264enc_h new file mode 100644 index 00000000000..d5f337f8427 --- /dev/null +++ b/multimedia/gstreamer-0.10/plugins-bad/patches/patch-ext_x264_gstx264enc_h @@ -0,0 +1,11 @@ +$OpenBSD: patch-ext_x264_gstx264enc_h,v 1.1 2009/04/14 19:52:08 kili Exp $ +--- ext/x264/gstx264enc.h.orig Mon Mar 9 12:30:00 2009 ++++ ext/x264/gstx264enc.h Mon Mar 9 12:30:12 2009 +@@ -23,6 +23,7 @@ + + #include + #include <_stdint.h> ++#include + #include + + G_BEGIN_DECLS diff --git a/x11/mplayer/Makefile b/x11/mplayer/Makefile index ed0eab67a4b..c80abd52e4b 100644 --- a/x11/mplayer/Makefile +++ b/x11/mplayer/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.147 2009/03/17 08:24:33 sthen Exp $ +# $OpenBSD: Makefile,v 1.148 2009/04/14 19:52:08 kili Exp $ # May not be hard to add more. ONLY_FOR_ARCHS= amd64 i386 powerpc sparc64 arm @@ -9,7 +9,7 @@ V= 1.0rc2 N= mplayer DISTNAME= MPlayer-${V} DIST_SUBDIR= ${N} -PKGNAME= ${N}-${V}p21 +PKGNAME= ${N}-${V}p22 CATEGORIES= x11 multimedia EXTRACT_SUFX= .tar.bz2 diff --git a/x11/mplayer/patches/patch-libavcodec_libx264_c b/x11/mplayer/patches/patch-libavcodec_libx264_c new file mode 100644 index 00000000000..e6571037cd7 --- /dev/null +++ b/x11/mplayer/patches/patch-libavcodec_libx264_c @@ -0,0 +1,29 @@ +$OpenBSD: patch-libavcodec_libx264_c,v 1.1 2009/04/14 19:52:08 kili Exp $ +--- libavcodec/libx264.c.orig Sun Jan 4 00:43:21 2009 ++++ libavcodec/libx264.c Sun Jan 4 00:44:24 2009 +@@ -162,7 +162,7 @@ X264_init(AVCodecContext *avctx) + + x4->params.i_bframe = avctx->max_b_frames; + x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC; +- x4->params.b_bframe_adaptive = avctx->b_frame_strategy; ++ x4->params.i_bframe_adaptive = avctx->b_frame_strategy; + x4->params.i_bframe_bias = avctx->bframebias; + x4->params.b_bframe_pyramid = (avctx->flags2 & CODEC_FLAG2_BPYRAMID); + avctx->has_b_frames= (avctx->flags2 & CODEC_FLAG2_BPYRAMID) ? 2 : !!avctx->max_b_frames; +@@ -225,8 +225,6 @@ X264_init(AVCodecContext *avctx) + x4->params.analyse.i_me_range = avctx->me_range; + x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality; + +- x4->params.analyse.b_bidir_me = (avctx->bidir_refine > 0); +- x4->params.analyse.b_bframe_rdo = (avctx->flags2 & CODEC_FLAG2_BRDO); + x4->params.analyse.b_mixed_references = + (avctx->flags2 & CODEC_FLAG2_MIXED_REFS); + x4->params.analyse.b_chroma_me = (avctx->me_cmp & FF_CMP_CHROMA); +@@ -251,7 +249,6 @@ X264_init(AVCodecContext *avctx) + x4->params.rc.f_ip_factor = 1/fabs(avctx->i_quant_factor); + x4->params.rc.f_pb_factor = avctx->b_quant_factor; + x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset; +- x4->params.rc.psz_rc_eq = avctx->rc_eq; + + x4->params.analyse.b_psnr = (avctx->flags & CODEC_FLAG_PSNR); + x4->params.i_log_level = X264_LOG_DEBUG; diff --git a/x11/vlc/Makefile b/x11/vlc/Makefile index b60b35c8c9d..a3e478f265f 100644 --- a/x11/vlc/Makefile +++ b/x11/vlc/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.78 2009/01/16 04:11:18 jakemsr Exp $ +# $OpenBSD: Makefile,v 1.79 2009/04/14 19:52:08 kili Exp $ SHARED_ONLY= Yes @@ -6,7 +6,7 @@ COMMENT-main= videolan client; multimedia player V= 0.8.6i DISTNAME= vlc-${V} -PKGNAME-main= ${DISTNAME}p3 +PKGNAME-main= ${DISTNAME}p4 CATEGORIES= x11 MASTER_SITES= http://download.videolan.org/pub/videolan/vlc/${V}/ diff --git a/x11/vlc/patches/patch-modules_codec_x264_c b/x11/vlc/patches/patch-modules_codec_x264_c new file mode 100644 index 00000000000..fce0beb720b --- /dev/null +++ b/x11/vlc/patches/patch-modules_codec_x264_c @@ -0,0 +1,118 @@ +$OpenBSD: patch-modules_codec_x264_c,v 1.1 2009/04/14 19:52:08 kili Exp $ +--- modules/codec/x264.c.orig Tue Jul 8 16:59:23 2008 ++++ modules/codec/x264.c Sun Mar 8 23:36:34 2009 +@@ -29,6 +29,7 @@ + #include + #include + ++#include + #include + + #define SOUT_CFG_PREFIX "sout-x264-" +@@ -72,8 +73,14 @@ static void Close( vlc_object_t * ); + "P-frames. Range 1 to 16." ) + + #define B_ADAPT_TEXT N_("Adaptive B-frame decision") ++#if X264_BUILD >= 63 + #define B_ADAPT_LONGTEXT N_( "Force the specified number of " \ ++ "consecutive B-frames to be used, except possibly before an I-frame." \ ++ "Range 0 to 2." ) ++#else ++#define B_ADAPT_LONGTEXT N_( "Force the specified number of " \ + "consecutive B-frames to be used, except possibly before an I-frame." ) ++#endif + + #define B_BIAS_TEXT N_("Influence (bias) B-frames usage") + #define B_BIAS_LONGTEXT N_( "Bias the choice to use B-frames. Positive values " \ +@@ -214,7 +221,12 @@ static void Close( vlc_object_t * ); + + #define SUBME_TEXT N_("Subpixel motion estimation and partition decision " \ + "quality") +-#if X264_BUILD >= 46 /* r477 */ ++#if X264_BUILD >= 65 ++#define SUBME_MAX 9 ++#define SUBME_LONGTEXT N_( "This parameter controls quality versus speed " \ ++ "tradeoffs involved in the motion estimation decision process " \ ++ "(lower = quicker and higher = better quality). Range 1 to 9." ) ++#elif X264_BUILD >= 46 /* r477 */ + #define SUBME_MAX 7 + #define SUBME_LONGTEXT N_( "This parameter controls quality versus speed " \ + "tradeoffs involved in the motion estimation decision process " \ +@@ -356,10 +368,16 @@ vlc_module_begin(); + BFRAMES_LONGTEXT, VLC_FALSE ); + change_integer_range( 0, 16 ); + +-#if X264_BUILD >= 0x0013 /* r137 */ ++#if X264_BUILD >= 63 ++ add_integer( SOUT_CFG_PREFIX "b-adapt", 1, NULL, B_ADAPT_TEXT, ++ B_ADAPT_LONGTEXT, VLC_FALSE ); ++ change_integer_range( 0, 2 ); ++#elif X264_BUILD >= 0x0013 /* r137 */ + add_bool( SOUT_CFG_PREFIX "b-adapt", 1, NULL, B_ADAPT_TEXT, + B_ADAPT_LONGTEXT, VLC_FALSE ); ++#endif + ++#if X264_BUILD >= 0x0013 /* r137 */ + add_integer( SOUT_CFG_PREFIX "b-bias", 0, NULL, B_BIAS_TEXT, + B_BIAS_LONGTEXT, VLC_FALSE ); + change_integer_range( -100, 100 ); +@@ -494,7 +512,7 @@ vlc_module_begin(); + change_integer_range( 1, SUBME_MAX ); + add_deprecated( SOUT_CFG_PREFIX "subpel", VLC_FALSE ); /* Deprecated since 0.8.5 */ + +-#if X264_BUILD >= 41 /* r368 */ ++#if X264_BUILD >= 41 && X264_BUILD < 65 /* r368 */ + add_bool( SOUT_CFG_PREFIX "b-rdo", 0, NULL, B_RDO_TEXT, + B_RDO_LONGTEXT, VLC_FALSE ); + #endif +@@ -509,7 +527,7 @@ vlc_module_begin(); + CHROMA_ME_LONGTEXT, VLC_FALSE ); + #endif + +-#if X264_BUILD >= 43 /* r390 */ ++#if X264_BUILD >= 43 && X264_BUILD < 65 /* r390 */ + add_bool( SOUT_CFG_PREFIX "bime", 0, NULL, BIME_TEXT, + BIME_LONGTEXT, VLC_FALSE ); + #endif +@@ -890,7 +908,11 @@ static int Open ( vlc_object_t *p_this ) + + #if X264_BUILD >= 0x0013 + var_Get( p_enc, SOUT_CFG_PREFIX "b-adapt", &val ); ++#if X264_BUILD >= 63 ++ p_sys->param.i_bframe_adaptive = val.i_int; ++#else + p_sys->param.b_bframe_adaptive = val.b_bool; ++#endif + + var_Get( p_enc, SOUT_CFG_PREFIX "b-bias", &val ); + if( val.i_int >= -100 && val.i_int <= 100 ) +@@ -930,7 +952,7 @@ static int Open ( vlc_object_t *p_this ) + p_sys->param.analyse.i_trellis = val.i_int; + #endif + +-#if X264_BUILD >= 41 ++#if X264_BUILD >= 41 && X264_BUILD < 65 + var_Get( p_enc, SOUT_CFG_PREFIX "b-rdo", &val ); + p_sys->param.analyse.b_bframe_rdo = val.b_bool; + #endif +@@ -940,7 +962,7 @@ static int Open ( vlc_object_t *p_this ) + p_sys->param.analyse.b_fast_pskip = val.b_bool; + #endif + +-#if X264_BUILD >= 43 ++#if X264_BUILD >= 43 && X264_BUILD < 65 + var_Get( p_enc, SOUT_CFG_PREFIX "bime", &val ); + p_sys->param.analyse.b_bidir_me = val.b_bool; + #endif +@@ -965,9 +987,11 @@ static int Open ( vlc_object_t *p_this ) + if( val.i_int >= 0 && val.i_int <= 32 ) + p_sys->param.analyse.i_luma_deadzone[1] = val.i_int; + ++#if X264_BUILD <= 65 + var_Get( p_enc, SOUT_CFG_PREFIX "direct-8x8", &val ); + if( val.i_int >= -1 && val.i_int <= 1 ) + p_sys->param.analyse.i_direct_8x8_inference = val.i_int; ++#endif + #endif + + var_Get( p_enc, SOUT_CFG_PREFIX "asm", &val );