Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From af1a7413afbea7b6a2159b644144b2dcac3482a3 Mon Sep 17 00:00:00 2001
- From: Anton Mitrofanov <BugMaster@narod.ru>
- Date: Mon, 22 Nov 2010 17:17:36 +0300
- Subject: [PATCH 1/8] Fix regression in chroma weightp
- Missing cache calls could cause artifacts, encoder/decoder desync.
- ---
- encoder/encoder.c | 3 ++-
- encoder/slicetype.c | 3 +++
- 2 files changed, 5 insertions(+), 1 deletions(-)
- diff --git a/encoder/encoder.c b/encoder/encoder.c
- index 6cfef3c..8b14b41 100644
- --- a/encoder/encoder.c
- +++ b/encoder/encoder.c
- @@ -1537,7 +1537,8 @@ static void x264_weighted_pred_init( x264_t *h )
- if( !weightplane[0] )
- h->sh.weight[0][0].i_denom = 0;
- if( !weightplane[1] )
- - h->sh.weight[0][1].i_denom = h->sh.weight[0][2].i_denom = 0;
- + h->sh.weight[0][1].i_denom = 0;
- + h->sh.weight[0][2].i_denom = h->sh.weight[0][1].i_denom;
- }
- static inline void x264_reference_build_list( x264_t *h, int i_poc )
- diff --git a/encoder/slicetype.c b/encoder/slicetype.c
- index 450cc5c..edf74c4 100644
- --- a/encoder/slicetype.c
- +++ b/encoder/slicetype.c
- @@ -262,6 +262,8 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
- }
- else
- x264_weight_get_h264( round( guess_scale * 128 ), 0, &weights[plane] );
- + if( weights[plane].weightfn )
- + h->mc.weight_cache( h, &weights[plane] );
- found = 0;
- mindenom = weights[plane].i_denom;
- @@ -333,6 +335,7 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
- {
- weights[i].i_scale = x264_clip3( weights[i].i_scale >> ( weights[i].i_denom - denom ), 0, 255 );
- weights[i].i_denom = denom;
- + h->mc.weight_cache( h, &weights[i] );
- }
- }
- --
- 1.7.3.2.146.gca209
- From 976daed25a538be915e62f3c1da893153676979f Mon Sep 17 00:00:00 2001
- From: Sean McGovern <gseanmcg@gmail.com>
- Date: Sun, 10 Oct 2010 19:34:18 -0400
- Subject: [PATCH 2/8] Fix build on SPARC Solaris 10
- ---
- Makefile | 2 +-
- common/pixel.c | 6 +++---
- configure | 27 ++++++++++++++++-----------
- 3 files changed, 20 insertions(+), 15 deletions(-)
- diff --git a/Makefile b/Makefile
- index 8a3a327..9fa1735 100644
- --- a/Makefile
- +++ b/Makefile
- @@ -109,7 +109,7 @@ endif
- endif
- # VIS optims
- -ifeq ($(ARCH),UltraSparc)
- +ifeq ($(ARCH),UltraSPARC)
- ASMSRC += common/sparc/pixel.asm
- OBJASM = $(ASMSRC:%.asm=%.o)
- endif
- diff --git a/common/pixel.c b/common/pixel.c
- index 1e21550..7fa497c 100644
- --- a/common/pixel.c
- +++ b/common/pixel.c
- @@ -36,7 +36,7 @@
- #if ARCH_ARM
- # include "arm/pixel.h"
- #endif
- -#if ARCH_UltraSparc
- +#if ARCH_UltraSPARC
- # include "sparc/pixel.h"
- #endif
- @@ -443,7 +443,7 @@ SAD_X( 4x8 )
- SAD_X( 4x4 )
- #if !HIGH_BIT_DEPTH
- -#if ARCH_UltraSparc
- +#if ARCH_UltraSPARC
- SAD_X( 16x16_vis )
- SAD_X( 16x8_vis )
- SAD_X( 8x16_vis )
- @@ -1063,7 +1063,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
- }
- #endif
- #if !HIGH_BIT_DEPTH
- -#if ARCH_UltraSparc
- +#if ARCH_UltraSPARC
- INIT4( sad, _vis );
- INIT4( sad_x3, _vis );
- INIT4( sad_x4, _vis );
- diff --git a/configure b/configure
- index 2f38154..28a5b60 100755
- --- a/configure
- +++ b/configure
- @@ -392,15 +392,20 @@ case $host_cpu in
- fi
- ;;
- sparc)
- - if [ $asm = auto ] && test "$(uname -m)" = "sun4u"; then
- - ARCH="UltraSparc"
- - CFLAGS="$CFLAGS -mcpu=ultrasparc"
- - LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
- - AS="${AS-${cross_prefix}as}"
- - ASFLAGS="$ASFLAGS -xarch=v8plusa"
- - else
- - ARCH="Sparc"
- - fi
- + ARCH="SPARC"
- + case $(uname -m) in
- + sun4u|sun4v)
- + if [ $asm = auto ]; then
- + ARCH="UltraSPARC"
- + if ! echo $CFLAGS | grep -Eq '\-mcpu' ; then
- + CFLAGS="$CFLAGS -mcpu=ultrasparc"
- + LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
- + fi
- + AS="${AS-${cross_prefix}as}"
- + ASFLAGS="$ASFLAGS -xarch=v8plusa"
- + fi
- + ;;
- + esac
- ;;
- mips|mipsel|mips64|mips64el)
- ARCH="MIPS"
- @@ -499,9 +504,9 @@ define SYS_$SYS
- echo "int i = 0x42494745; double f = 0x1.0656e6469616ep+102;" > conftest.c
- $CC $CFLAGS conftest.c -c -o conftest.o 2>$DEVNULL || die "endian test failed"
- -if grep -q BIGE conftest.o && grep -q FPendian conftest.o ; then
- +if (strings -a conftest.o | grep -q BIGE) && (strings -a conftest.o | grep -q FPendian) ; then
- define WORDS_BIGENDIAN
- -elif !(grep -q EGIB conftest.o && grep -q naidnePF conftest.o) ; then
- +elif !(strings -a conftest.o | grep -q EGIB && strings -a conftest.o | grep -q naidnePF) ; then
- die "endian test failed"
- fi
- --
- 1.7.3.2.146.gca209
- From 629a6da7f9103ea9ef851fbd8c3acfcaf84fc338 Mon Sep 17 00:00:00 2001
- From: Sean McGovern <gseanmcg@gmail.com>
- Date: Sun, 21 Nov 2010 01:59:33 -0500
- Subject: [PATCH 3/8] Only build SPARC VIS asm if high bit-depth is disabled
- ---
- Makefile | 2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
- diff --git a/Makefile b/Makefile
- index 9fa1735..687c534 100644
- --- a/Makefile
- +++ b/Makefile
- @@ -110,9 +110,11 @@ endif
- # VIS optims
- ifeq ($(ARCH),UltraSPARC)
- +ifeq ($(findstring HIGH_BIT_DEPTH, $(CONFIG)),)
- ASMSRC += common/sparc/pixel.asm
- OBJASM = $(ASMSRC:%.asm=%.o)
- endif
- +endif
- ifneq ($(HAVE_GETOPT_LONG),1)
- SRCCLI += extras/getopt.c
- --
- 1.7.3.2.146.gca209
- From 76c4b4b5a792e6409a8c4c1a6d86dcbe4630937e Mon Sep 17 00:00:00 2001
- From: James Darnley <james.darnley@gmail.com>
- Date: Sun, 21 Nov 2010 10:50:48 +0100
- Subject: [PATCH 4/8] Fix resize filter rounding code
- ---
- filters/video/resize.c | 8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
- diff --git a/filters/video/resize.c b/filters/video/resize.c
- index 04b5e73..aec53e1 100644
- --- a/filters/video/resize.c
- +++ b/filters/video/resize.c
- @@ -205,10 +205,10 @@ static int pick_closest_supported_csp( int csp )
- static int round_dbl( double val, int precision, int b_truncate )
- {
- - int ret = (int)(val / precision) * precision;
- - if( !b_truncate && (val - ret) >= (precision/2) ) // use the remainder if we're not truncating it
- - ret += precision;
- - return ret;
- + if( b_truncate )
- + return trunc(val / precision) * precision;
- + else
- + return round(val / precision) * precision;
- }
- static int handle_opts( const char **optlist, char **opts, video_info_t *info, resizer_hnd_t *h )
- --
- 1.7.3.2.146.gca209
- From 794757c6ccba0c4dfd07642fd6e2c9d65a961663 Mon Sep 17 00:00:00 2001
- From: Yasuhiro Ikeda <wipple625@gmail.com>
- Date: Mon, 22 Nov 2010 10:31:05 +0900
- Subject: [PATCH 5/8] Fix configure so that boolean configuration options are 1/0
- There are many cases of 1/undef, not 1/0.
- ---
- Makefile | 10 ++--
- common/arm/asm.S | 2 +-
- common/bitstream.c | 4 +-
- configure | 111 ++++++++++++++++++++++++++++++++++++++--------------
- 4 files changed, 89 insertions(+), 38 deletions(-)
- diff --git a/Makefile b/Makefile
- index 687c534..61f95eb 100644
- --- a/Makefile
- +++ b/Makefile
- @@ -30,24 +30,24 @@ SRCCLI +=
- endif
- # Optional module sources
- -ifneq ($(findstring HAVE_AVS, $(CONFIG)),)
- +ifeq ($(AVS), yes)
- SRCCLI += input/avs.c
- endif
- -ifneq ($(findstring HAVE_PTHREAD, $(CONFIG)),)
- +ifeq ($(PTHREAD), yes)
- SRCCLI += input/thread.c
- SRCS += common/threadpool.c
- endif
- -ifneq ($(findstring HAVE_LAVF, $(CONFIG)),)
- +ifeq ($(LAVF), yes)
- SRCCLI += input/lavf.c
- endif
- -ifneq ($(findstring HAVE_FFMS, $(CONFIG)),)
- +ifeq ($(FFMS), yes)
- SRCCLI += input/ffms.c
- endif
- -ifneq ($(findstring HAVE_GPAC, $(CONFIG)),)
- +ifeq ($(GPAC), yes)
- SRCCLI += output/mp4.c
- endif
- diff --git a/common/arm/asm.S b/common/arm/asm.S
- index 7434262..92e3b14 100644
- --- a/common/arm/asm.S
- +++ b/common/arm/asm.S
- @@ -65,7 +65,7 @@ ELF .type \name, %function
- .endm
- .macro movconst rd, val
- -#ifdef HAVE_ARMV6T2
- +#if HAVE_ARMV6T2
- movw \rd, #:lower16:\val
- .if \val >> 16
- movt \rd, #:upper16:\val
- diff --git a/common/bitstream.c b/common/bitstream.c
- index 8350fb3..0f2bc9f 100644
- --- a/common/bitstream.c
- +++ b/common/bitstream.c
- @@ -39,7 +39,7 @@ static uint8_t *x264_nal_escape_c( uint8_t *dst, uint8_t *src, uint8_t *end )
- return dst;
- }
- -#ifdef HAVE_MMX
- +#if HAVE_MMX
- uint8_t *x264_nal_escape_mmxext( uint8_t *dst, uint8_t *src, uint8_t *end );
- uint8_t *x264_nal_escape_sse2( uint8_t *dst, uint8_t *src, uint8_t *end );
- #endif
- @@ -88,7 +88,7 @@ void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal )
- void x264_bitstream_init( int cpu, x264_bitstream_function_t *pf )
- {
- pf->nal_escape = x264_nal_escape_c;
- -#ifdef HAVE_MMX
- +#if HAVE_MMX
- if( cpu&X264_CPU_MMXEXT )
- pf->nal_escape = x264_nal_escape_mmxext;
- if( (cpu&X264_CPU_SSE2) && (cpu&X264_CPU_SSE2_IS_FAST) )
- diff --git a/configure b/configure
- index 28a5b60..e30832f 100755
- --- a/configure
- +++ b/configure
- @@ -147,6 +147,11 @@ libdir='${exec_prefix}/lib'
- includedir='${prefix}/include'
- DEVNULL='/dev/null'
- +malloc_h="no"
- +altivec="no"
- +mmx="no"
- +armv6="no"
- +
- avs="auto"
- lavf="auto"
- ffms="auto"
- @@ -285,7 +290,7 @@ host_os="${host#*-}"
- case $host_os in
- beos*)
- SYS="BEOS"
- - define HAVE_MALLOC_H
- + malloc_h="yes"
- ;;
- darwin*)
- SYS="MACOSX"
- @@ -301,7 +306,7 @@ case $host_os in
- ;;
- kfreebsd*-gnu)
- SYS="FREEBSD"
- - define HAVE_MALLOC_H
- + malloc_h="yes"
- LDFLAGS="$LDFLAGS -lm"
- ;;
- netbsd*)
- @@ -314,7 +319,7 @@ case $host_os in
- ;;
- *linux*)
- SYS="LINUX"
- - define HAVE_MALLOC_H
- + malloc_h="yes"
- LDFLAGS="$LDFLAGS -lm"
- ;;
- cygwin*)
- @@ -333,7 +338,7 @@ case $host_os in
- ;;
- sunos*|solaris*)
- SYS="SunOS"
- - define HAVE_MALLOC_H
- + malloc_h="yes"
- LDFLAGS="$LDFLAGS -lm"
- HAVE_GETOPT_LONG=0
- ;;
- @@ -341,6 +346,11 @@ case $host_os in
- die "Unknown system $host, edit the configure"
- ;;
- esac
- +if [ "$malloc_h" = "yes" ]; then
- + define HAVE_MALLOC_H 1
- +else
- + define HAVE_MALLOC_H 0
- +fi
- case $host_cpu in
- i*86)
- @@ -381,13 +391,14 @@ case $host_cpu in
- powerpc|powerpc64)
- ARCH="PPC"
- if [ $asm = auto ] ; then
- - define HAVE_ALTIVEC
- + altivec="yes"
- AS="${AS-${cross_prefix}gcc}"
- if [ $SYS = MACOSX ] ; then
- CFLAGS="$CFLAGS -faltivec -fastf -mcpu=G4"
- + define HAVE_ALTIVEC_H 0
- else
- CFLAGS="$CFLAGS -maltivec -mabi=altivec"
- - define HAVE_ALTIVEC_H
- + define HAVE_ALTIVEC_H 1
- fi
- fi
- ;;
- @@ -437,6 +448,11 @@ case $host_cpu in
- ARCH="$(echo $host_cpu | tr a-z A-Z)"
- ;;
- esac
- +if [ "$altivec" = "yes" ]; then
- + define HAVE_ALTIVEC 1
- +else
- + define HAVE_ALTIVEC 0
- +fi
- log_msg "x264 configure script"
- if [ -n "$*" ]; then
- @@ -478,16 +494,22 @@ if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
- echo "If you really want to compile without asm, configure with --disable-asm."
- exit 1
- fi
- - define HAVE_MMX
- + mmx="yes"
- +fi
- +if [ "$mmx" = "yes" ]; then
- + define HAVE_MMX 1
- +else
- + define HAVE_MMX 0
- fi
- if [ $asm = auto -a $ARCH = ARM ] ; then
- # set flags so neon is built by default
- echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-mfloat-abi)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
- - if cc_check '' '' '__asm__("rev ip, ip");' ; then define HAVE_ARMV6
- - cc_check '' '' '__asm__("movt r0, #0");' && define HAVE_ARMV6T2
- - cc_check '' '' '__asm__("vadd.i16 q0, q0, q0");' && define HAVE_NEON
- + if cc_check '' '' '__asm__("rev ip, ip");' ; then
- + armv6="yes"
- + cc_check '' '' '__asm__("movt r0, #0");' && define HAVE_ARMV6T2 1 || define HAVE_ARMV6T2 0
- + cc_check '' '' '__asm__("vadd.i16 q0, q0, q0");' && define HAVE_NEON 1 || define HAVE_NEON 0
- ASFLAGS="$ASFLAGS $CFLAGS -c"
- else
- echo "You specified a pre-ARMv6 or Thumb-1 CPU in your CFLAGS."
- @@ -495,6 +517,11 @@ if [ $asm = auto -a $ARCH = ARM ] ; then
- exit 1
- fi
- fi
- +if [ "$armv6" = "yes" ]; then
- + define HAVE_ARMV6 1
- +else
- + define HAVE_ARMV6 0
- +fi
- [ $asm = no ] && AS=""
- [ "x$AS" = x ] && asm="no" || asm="yes"
- @@ -513,7 +540,7 @@ fi
- # autodetect options that weren't forced nor disabled
- libpthread=""
- -if test "$pthread" = "auto" ; then
- +if [ "$pthread" = "auto" ]; then
- pthread="no"
- case $SYS in
- BEOS)
- @@ -544,13 +571,17 @@ if test "$pthread" = "auto" ; then
- ;;
- esac
- fi
- -if test "$pthread" = "yes" ; then
- - define HAVE_PTHREAD
- +if [ "$pthread" = "yes" ]; then
- + define HAVE_PTHREAD 1
- LDFLAGS="$LDFLAGS $libpthread"
- +else
- + define HAVE_PTHREAD 0
- fi
- if cc_check "math.h" "-Werror" "return log2f(2);" ; then
- - define HAVE_LOG2F
- + define HAVE_LOG2F 1
- +else
- + define HAVE_LOG2F 0
- fi
- if [ "$vis" = "yes" ] ; then
- @@ -558,10 +589,11 @@ if [ "$vis" = "yes" ] ; then
- CFLAGS="$CFLAGS -I/usr/X11R6/include"
- if cc_check "X11/Xlib.h" "-L/usr/X11R6/lib -lX11" "XOpenDisplay(0);" ; then
- LDFLAGS="-L/usr/X11R6/lib -lX11 $LDFLAGS"
- - define HAVE_VISUALIZE
- + define HAVE_VISUALIZE 1
- else
- vis="no"
- CFLAGS="$save_CFLAGS"
- + define HAVE_VISUALIZE 0
- fi
- fi
- @@ -578,7 +610,6 @@ if [ "$swscale" = "auto" ] ; then
- if cpp_check "libswscale/swscale.h" "$SWSCALE_CFLAGS" "LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)" "$error"; then
- # we use colorspaces that were defined in libavutil r19775
- if cc_check "libavutil/pixfmt.h" "$SWSCALE_CFLAGS" "enum PixelFormat pixfmt = PIX_FMT_YUV422P16LE;" ; then
- - define HAVE_SWSCALE
- swscale="yes"
- else
- echo "Warning: libavutil is too old, update to ffmpeg r19775+"
- @@ -607,7 +638,6 @@ if [ "$lavf" = "auto" ] ; then
- if cc_check libavutil/pixdesc.h "$LAVF_CFLAGS $LAVF_LIBS" ; then
- if [ "$swscale" = "yes" ]; then
- lavf="yes"
- - define HAVE_LAVF
- else
- echo "Warning: libavformat is not supported without swscale support"
- fi
- @@ -645,18 +675,28 @@ if [ "$ffms" = "auto" ] ; then
- fi
- fi
- -if [ "$ffms" = "yes" ]; then
- - LDFLAGSCLI="$FFMS2_LIBS $LDFLAGSCLI"
- - CFLAGS="$CFLAGS $FFMS2_CFLAGS"
- - define HAVE_FFMS
- -fi
- -
- -if [ "$lavf" = "yes" ]; then
- - LDFLAGSCLI="$LAVF_LIBS $LDFLAGSCLI"
- - CFLAGS="$CFLAGS $LAVF_CFLAGS"
- -elif [ "$swscale" = "yes" ]; then
- +if [ "$swscale" = "yes" ]; then
- LDFLAGSCLI="$SWSCALE_LIBS $LDFLAGSCLI"
- CFLAGS="$CFLAGS $SWSCALE_CFLAGS"
- + define HAVE_SWSCALE 1
- + if [ "$lavf" = "yes" ]; then
- + LDFLAGSCLI="$LAVF_LIBS $LDFLAGSCLI"
- + CFLAGS="$CFLAGS $LAVF_CFLAGS"
- + define HAVE_LAVF 1
- + else
- + define HAVE_LAVF 0
- + fi
- + if [ "$ffms" = "yes" ]; then
- + LDFLAGSCLI="$FFMS2_LIBS $LDFLAGSCLI"
- + CFLAGS="$CFLAGS $FFMS2_CFLAGS"
- + define HAVE_FFMS 1
- + else
- + define HAVE_FFMS 0
- + fi
- +else
- + define HAVE_SWSCALE 0
- + define HAVE_LAVF 0
- + define HAVE_FFMS 0
- fi
- GPAC_LIBS="-lgpac_static"
- @@ -674,18 +714,24 @@ if [ "$gpac" = "auto" ] ; then
- fi
- fi
- if [ "$gpac" = "yes" ] ; then
- - define HAVE_GPAC
- + define HAVE_GPAC 1
- if cc_check gpac/isomedia.h "-Werror $GPAC_LIBS" "gf_malloc(1); gf_free(NULL);" ; then
- - define HAVE_GF_MALLOC
- + define HAVE_GF_MALLOC 1
- + else
- + define HAVE_GF_MALLOC 0
- fi
- LDFLAGSCLI="$GPAC_LIBS $LDFLAGSCLI"
- +else
- + define HAVE_GPAC 0
- fi
- if [ "$avs" = "auto" ] ; then
- avs="no"
- if [ $SYS = MINGW ] && cc_check extras/avisynth_c.h ; then
- avs="yes"
- - define HAVE_AVS
- + define HAVE_AVS 1
- + else
- + define HAVE_AVS 0
- fi
- fi
- @@ -767,6 +813,11 @@ VIS=$vis
- HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
- DEVNULL=$DEVNULL
- GPL=$gpl
- +AVS=$avs
- +PTHREAD=$pthread
- +LAVF=$lavf
- +FFMS=$ffms
- +GPAC=$gpac
- EOF
- if [ "$shared" = "yes" ]; then
- --
- 1.7.3.2.146.gca209
- From c2c8f88023d0ee8ca881acf6bfb18ac69c7f45f1 Mon Sep 17 00:00:00 2001
- From: Jason Garrett-Glaser <darkshikari@gmail.com>
- Date: Sat, 20 Nov 2010 23:30:42 -0800
- Subject: [PATCH 6/8] Change qpmin default to 0
- There's probably no real reason to keep it at 10 anymore, and lowering it allows AQ to pick lower quantizers in really flat areas.
- Might help on gradients at high quality levels.
- (the previous value of 10 was arbitrary anyways)
- ---
- common/common.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
- diff --git a/common/common.c b/common/common.c
- index 6c88556..1f99e9e 100644
- --- a/common/common.c
- +++ b/common/common.c
- @@ -98,7 +98,7 @@ void x264_param_default( x264_param_t *param )
- param->rc.f_vbv_buffer_init = 0.9;
- param->rc.i_qp_constant = 23 + QP_BD_OFFSET;
- param->rc.f_rf_constant = 23;
- - param->rc.i_qp_min = 10;
- + param->rc.i_qp_min = 0;
- param->rc.i_qp_max = QP_MAX;
- param->rc.i_qp_step = 4;
- param->rc.f_ip_factor = 1.4;
- --
- 1.7.3.2.146.gca209
- From a347dae118a7b1b90037da23f25835a421f0eacc Mon Sep 17 00:00:00 2001
- From: Yasuhiro Ikeda <wipple625@gmail.com>
- Date: Mon, 22 Nov 2010 11:01:57 +0900
- Subject: [PATCH 7/8] Add some more info to `x264 --version`
- ---
- x264.c | 23 ++++++++++++++++++++---
- 1 files changed, 20 insertions(+), 3 deletions(-)
- diff --git a/x264.c b/x264.c
- index bba17b8..f9a1c6a 100644
- --- a/x264.c
- +++ b/x264.c
- @@ -55,6 +55,14 @@
- #include <libavutil/pixdesc.h>
- #endif
- +#if HAVE_SWSCALE
- +#include <libswscale/swscale.h>
- +#endif
- +
- +#if HAVE_FFMS
- +#include <ffms.h>
- +#endif
- +
- /* Ctrl-C handler */
- static volatile int b_ctrl_c = 0;
- static int b_exit_on_ctrl_c = 0;
- @@ -208,6 +216,15 @@ static void print_version_info()
- #else
- printf( "x264 0.%d.X\n", X264_BUILD );
- #endif
- +#if HAVE_SWSCALE
- + printf( "(libswscale %d.%d.%d)\n", LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO );
- +#endif
- +#if HAVE_LAVF
- + printf( "(libavformat %d.%d.%d)\n", LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO );
- +#endif
- +#if HAVE_FFMS
- + printf( "(ffmpegsource %d.%d.%d.%d)\n", FFMS_VERSION >> 24, (FFMS_VERSION & 0xff0000) >> 16, (FFMS_VERSION & 0xff00) >> 8, FFMS_VERSION & 0xff );
- +#endif
- printf( "built on " __DATE__ ", " );
- #ifdef __GNUC__
- printf( "gcc: " __VERSION__ "\n" );
- @@ -221,9 +238,9 @@ static void print_version_info()
- #else
- printf( "Non-GPL commercial\n" );
- #endif
- -#if HAVE_LAVF
- - const char *license = avformat_license();
- - printf( "libavformat license: %s\n", license );
- +#if HAVE_SWSCALE
- + const char *license = swscale_license();
- + printf( "libswscale%s%s license: %s\n",HAVE_LAVF ? "/libavformat" : "", HAVE_FFMS ? "/ffmpegsource" : "" , license );
- if( !strcmp( license, "nonfree and unredistributable" ) ||
- (!HAVE_GPL && (!strcmp( license, "GPL version 2 or later" )
- || !strcmp( license, "GPL version 3 or later" ))))
- --
- 1.7.3.2.146.gca209
- From 3171540b5223c2df25fe10b663613f3a56a70037 Mon Sep 17 00:00:00 2001
- From: Jason Garrett-Glaser <darkshikari@gmail.com>
- Date: Fri, 19 Nov 2010 16:58:38 -0800
- Subject: [PATCH 8/8] Add API function to return max number of delayed frames
- ---
- encoder/encoder.c | 8 +++++---
- x264.h | 6 +++++-
- 2 files changed, 10 insertions(+), 4 deletions(-)
- diff --git a/encoder/encoder.c b/encoder/encoder.c
- index 8b14b41..2d5c778 100644
- --- a/encoder/encoder.c
- +++ b/encoder/encoder.c
- @@ -3320,9 +3320,6 @@ void x264_encoder_close ( x264_t *h )
- }
- }
- -/****************************************************************************
- - * x264_encoder_delayed_frames:
- - ****************************************************************************/
- int x264_encoder_delayed_frames( x264_t *h )
- {
- int delayed_frames = 0;
- @@ -3343,3 +3340,8 @@ int x264_encoder_delayed_frames( x264_t *h )
- x264_pthread_mutex_unlock( &h->lookahead->ofbuf.mutex );
- return delayed_frames;
- }
- +
- +int x264_encoder_maximum_delayed_frames( x264_t *h )
- +{
- + return h->frames.i_delay;
- +}
- diff --git a/x264.h b/x264.h
- index ce79d40..e144e51 100644
- --- a/x264.h
- +++ b/x264.h
- @@ -39,7 +39,7 @@
- #include <stdarg.h>
- -#define X264_BUILD 108
- +#define X264_BUILD 109
- /* x264_t:
- * opaque handler for encoder */
- @@ -766,6 +766,10 @@ void x264_encoder_close ( x264_t * );
- * return the number of currently delayed (buffered) frames
- * this should be used at the end of the stream, to know when you have all the encoded frames. */
- int x264_encoder_delayed_frames( x264_t * );
- +/* x264_encoder_maximum_delayed_frames( x264_t *h ):
- + * return the maximum number of delayed (buffered) frames that can occur with the current
- + * parameters. */
- +int x264_encoder_maximum_delayed_frames( x264_t *h );
- /* x264_encoder_intra_refresh:
- * If an intra refresh is not in progress, begin one with the next P-frame.
- * If an intra refresh is in progress, begin one as soon as the current one finishes.
- --
- 1.7.3.2.146.gca209
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement