Advertisement
Guest User

Untitled

a guest
Jun 30th, 2017
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 21.21 KB | None | 0 0
  1. From af1a7413afbea7b6a2159b644144b2dcac3482a3 Mon Sep 17 00:00:00 2001
  2. From: Anton Mitrofanov <BugMaster@narod.ru>
  3. Date: Mon, 22 Nov 2010 17:17:36 +0300
  4. Subject: [PATCH 1/8] Fix regression in chroma weightp
  5.  Missing cache calls could cause artifacts, encoder/decoder desync.
  6.  
  7. ---
  8. encoder/encoder.c   |    3 ++-
  9.  encoder/slicetype.c |    3 +++
  10.  2 files changed, 5 insertions(+), 1 deletions(-)
  11.  
  12. diff --git a/encoder/encoder.c b/encoder/encoder.c
  13. index 6cfef3c..8b14b41 100644
  14. --- a/encoder/encoder.c
  15. +++ b/encoder/encoder.c
  16. @@ -1537,7 +1537,8 @@ static void x264_weighted_pred_init( x264_t *h )
  17.      if( !weightplane[0] )
  18.          h->sh.weight[0][0].i_denom = 0;
  19.      if( !weightplane[1] )
  20. -        h->sh.weight[0][1].i_denom = h->sh.weight[0][2].i_denom = 0;
  21. +        h->sh.weight[0][1].i_denom = 0;
  22. +    h->sh.weight[0][2].i_denom = h->sh.weight[0][1].i_denom;
  23.  }
  24.  
  25.  static inline void x264_reference_build_list( x264_t *h, int i_poc )
  26. diff --git a/encoder/slicetype.c b/encoder/slicetype.c
  27. index 450cc5c..edf74c4 100644
  28. --- a/encoder/slicetype.c
  29. +++ b/encoder/slicetype.c
  30. @@ -262,6 +262,8 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
  31.          }
  32.          else
  33.              x264_weight_get_h264( round( guess_scale * 128 ), 0, &weights[plane] );
  34. +        if( weights[plane].weightfn )
  35. +            h->mc.weight_cache( h, &weights[plane] );
  36.  
  37.          found = 0;
  38.          mindenom = weights[plane].i_denom;
  39. @@ -333,6 +335,7 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
  40.          {
  41.              weights[i].i_scale = x264_clip3( weights[i].i_scale >> ( weights[i].i_denom - denom ), 0, 255 );
  42.              weights[i].i_denom = denom;
  43. +            h->mc.weight_cache( h, &weights[i] );
  44.          }
  45.      }
  46.  
  47. --
  48. 1.7.3.2.146.gca209
  49.  
  50.  
  51. From 976daed25a538be915e62f3c1da893153676979f Mon Sep 17 00:00:00 2001
  52. From: Sean McGovern <gseanmcg@gmail.com>
  53. Date: Sun, 10 Oct 2010 19:34:18 -0400
  54. Subject: [PATCH 2/8] Fix build on SPARC Solaris 10
  55.  
  56. ---
  57. Makefile       |    2 +-
  58.  common/pixel.c |    6 +++---
  59.  configure      |   27 ++++++++++++++++-----------
  60.  3 files changed, 20 insertions(+), 15 deletions(-)
  61.  
  62. diff --git a/Makefile b/Makefile
  63. index 8a3a327..9fa1735 100644
  64. --- a/Makefile
  65. +++ b/Makefile
  66. @@ -109,7 +109,7 @@ endif
  67.  endif
  68.  
  69.  # VIS optims
  70. -ifeq ($(ARCH),UltraSparc)
  71. +ifeq ($(ARCH),UltraSPARC)
  72.  ASMSRC += common/sparc/pixel.asm
  73.  OBJASM  = $(ASMSRC:%.asm=%.o)
  74.  endif
  75. diff --git a/common/pixel.c b/common/pixel.c
  76. index 1e21550..7fa497c 100644
  77. --- a/common/pixel.c
  78. +++ b/common/pixel.c
  79. @@ -36,7 +36,7 @@
  80.  #if ARCH_ARM
  81.  #   include "arm/pixel.h"
  82.  #endif
  83. -#if ARCH_UltraSparc
  84. +#if ARCH_UltraSPARC
  85.  #   include "sparc/pixel.h"
  86.  #endif
  87.  
  88. @@ -443,7 +443,7 @@ SAD_X( 4x8 )
  89.  SAD_X( 4x4 )
  90.  
  91.  #if !HIGH_BIT_DEPTH
  92. -#if ARCH_UltraSparc
  93. +#if ARCH_UltraSPARC
  94.  SAD_X( 16x16_vis )
  95.  SAD_X( 16x8_vis )
  96.  SAD_X( 8x16_vis )
  97. @@ -1063,7 +1063,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf )
  98.      }
  99.  #endif
  100.  #if !HIGH_BIT_DEPTH
  101. -#if ARCH_UltraSparc
  102. +#if ARCH_UltraSPARC
  103.      INIT4( sad, _vis );
  104.      INIT4( sad_x3, _vis );
  105.      INIT4( sad_x4, _vis );
  106. diff --git a/configure b/configure
  107. index 2f38154..28a5b60 100755
  108. --- a/configure
  109. +++ b/configure
  110. @@ -392,15 +392,20 @@ case $host_cpu in
  111.      fi
  112.      ;;
  113.    sparc)
  114. -    if [ $asm = auto ] && test "$(uname -m)" = "sun4u"; then
  115. -      ARCH="UltraSparc"
  116. -      CFLAGS="$CFLAGS -mcpu=ultrasparc"
  117. -      LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
  118. -      AS="${AS-${cross_prefix}as}"
  119. -      ASFLAGS="$ASFLAGS -xarch=v8plusa"
  120. -    else
  121. -      ARCH="Sparc"
  122. -    fi
  123. +    ARCH="SPARC"
  124. +    case $(uname -m) in
  125. +      sun4u|sun4v)
  126. +        if [ $asm = auto ]; then
  127. +          ARCH="UltraSPARC"
  128. +          if ! echo $CFLAGS | grep -Eq '\-mcpu' ; then
  129. +            CFLAGS="$CFLAGS -mcpu=ultrasparc"
  130. +            LDFLAGS="$LDFLAGS -mcpu=ultrasparc"
  131. +          fi
  132. +          AS="${AS-${cross_prefix}as}"
  133. +          ASFLAGS="$ASFLAGS -xarch=v8plusa"
  134. +        fi
  135. +        ;;
  136. +    esac
  137.      ;;
  138.    mips|mipsel|mips64|mips64el)
  139.      ARCH="MIPS"
  140. @@ -499,9 +504,9 @@ define SYS_$SYS
  141.  
  142.  echo "int i = 0x42494745; double f = 0x1.0656e6469616ep+102;" > conftest.c
  143.  $CC $CFLAGS conftest.c -c -o conftest.o 2>$DEVNULL || die "endian test failed"
  144. -if grep -q BIGE conftest.o && grep -q FPendian conftest.o ; then
  145. +if (strings -a conftest.o | grep -q BIGE) && (strings -a conftest.o | grep -q FPendian) ; then
  146.      define WORDS_BIGENDIAN
  147. -elif !(grep -q EGIB conftest.o && grep -q naidnePF conftest.o) ; then
  148. +elif !(strings -a conftest.o | grep -q EGIB && strings -a conftest.o | grep -q naidnePF) ; then
  149.      die "endian test failed"
  150.  fi
  151.  
  152. --
  153. 1.7.3.2.146.gca209
  154.  
  155.  
  156. From 629a6da7f9103ea9ef851fbd8c3acfcaf84fc338 Mon Sep 17 00:00:00 2001
  157. From: Sean McGovern <gseanmcg@gmail.com>
  158. Date: Sun, 21 Nov 2010 01:59:33 -0500
  159. Subject: [PATCH 3/8] Only build SPARC VIS asm if high bit-depth is disabled
  160.  
  161. ---
  162. Makefile |    2 ++
  163.  1 files changed, 2 insertions(+), 0 deletions(-)
  164.  
  165. diff --git a/Makefile b/Makefile
  166. index 9fa1735..687c534 100644
  167. --- a/Makefile
  168. +++ b/Makefile
  169. @@ -110,9 +110,11 @@ endif
  170.  
  171.  # VIS optims
  172.  ifeq ($(ARCH),UltraSPARC)
  173. +ifeq ($(findstring HIGH_BIT_DEPTH, $(CONFIG)),)
  174.  ASMSRC += common/sparc/pixel.asm
  175.  OBJASM  = $(ASMSRC:%.asm=%.o)
  176.  endif
  177. +endif
  178.  
  179.  ifneq ($(HAVE_GETOPT_LONG),1)
  180.  SRCCLI += extras/getopt.c
  181. --
  182. 1.7.3.2.146.gca209
  183.  
  184.  
  185. From 76c4b4b5a792e6409a8c4c1a6d86dcbe4630937e Mon Sep 17 00:00:00 2001
  186. From: James Darnley <james.darnley@gmail.com>
  187. Date: Sun, 21 Nov 2010 10:50:48 +0100
  188. Subject: [PATCH 4/8] Fix resize filter rounding code
  189.  
  190. ---
  191. filters/video/resize.c |    8 ++++----
  192.  1 files changed, 4 insertions(+), 4 deletions(-)
  193.  
  194. diff --git a/filters/video/resize.c b/filters/video/resize.c
  195. index 04b5e73..aec53e1 100644
  196. --- a/filters/video/resize.c
  197. +++ b/filters/video/resize.c
  198. @@ -205,10 +205,10 @@ static int pick_closest_supported_csp( int csp )
  199.  
  200.  static int round_dbl( double val, int precision, int b_truncate )
  201.  {
  202. -    int ret = (int)(val / precision) * precision;
  203. -    if( !b_truncate && (val - ret) >= (precision/2) ) // use the remainder if we're not truncating it
  204. -        ret += precision;
  205. -    return ret;
  206. +    if( b_truncate )
  207. +        return trunc(val / precision) * precision;
  208. +    else
  209. +        return round(val / precision) * precision;
  210.  }
  211.  
  212.  static int handle_opts( const char **optlist, char **opts, video_info_t *info, resizer_hnd_t *h )
  213. --
  214. 1.7.3.2.146.gca209
  215.  
  216.  
  217. From 794757c6ccba0c4dfd07642fd6e2c9d65a961663 Mon Sep 17 00:00:00 2001
  218. From: Yasuhiro Ikeda <wipple625@gmail.com>
  219. Date: Mon, 22 Nov 2010 10:31:05 +0900
  220. Subject: [PATCH 5/8] Fix configure so that boolean configuration options are 1/0
  221.  
  222. There are many cases of 1/undef, not 1/0.
  223. ---
  224. Makefile           |   10 ++--
  225.  common/arm/asm.S   |    2 +-
  226.  common/bitstream.c |    4 +-
  227.  configure          |  111 ++++++++++++++++++++++++++++++++++++++--------------
  228.  4 files changed, 89 insertions(+), 38 deletions(-)
  229.  
  230. diff --git a/Makefile b/Makefile
  231. index 687c534..61f95eb 100644
  232. --- a/Makefile
  233. +++ b/Makefile
  234. @@ -30,24 +30,24 @@ SRCCLI +=
  235.  endif
  236.  
  237.  # Optional module sources
  238. -ifneq ($(findstring HAVE_AVS, $(CONFIG)),)
  239. +ifeq ($(AVS), yes)
  240.  SRCCLI += input/avs.c
  241.  endif
  242.  
  243. -ifneq ($(findstring HAVE_PTHREAD, $(CONFIG)),)
  244. +ifeq ($(PTHREAD), yes)
  245.  SRCCLI += input/thread.c
  246.  SRCS   += common/threadpool.c
  247.  endif
  248.  
  249. -ifneq ($(findstring HAVE_LAVF, $(CONFIG)),)
  250. +ifeq ($(LAVF), yes)
  251.  SRCCLI += input/lavf.c
  252.  endif
  253.  
  254. -ifneq ($(findstring HAVE_FFMS, $(CONFIG)),)
  255. +ifeq ($(FFMS), yes)
  256.  SRCCLI += input/ffms.c
  257.  endif
  258.  
  259. -ifneq ($(findstring HAVE_GPAC, $(CONFIG)),)
  260. +ifeq ($(GPAC), yes)
  261.  SRCCLI += output/mp4.c
  262.  endif
  263.  
  264. diff --git a/common/arm/asm.S b/common/arm/asm.S
  265. index 7434262..92e3b14 100644
  266. --- a/common/arm/asm.S
  267. +++ b/common/arm/asm.S
  268. @@ -65,7 +65,7 @@ ELF     .type   \name, %function
  269.          .endm
  270.  
  271.  .macro movconst rd, val
  272. -#ifdef HAVE_ARMV6T2
  273. +#if HAVE_ARMV6T2
  274.      movw        \rd, #:lower16:\val
  275.  .if \val >> 16
  276.      movt        \rd, #:upper16:\val
  277. diff --git a/common/bitstream.c b/common/bitstream.c
  278. index 8350fb3..0f2bc9f 100644
  279. --- a/common/bitstream.c
  280. +++ b/common/bitstream.c
  281. @@ -39,7 +39,7 @@ static uint8_t *x264_nal_escape_c( uint8_t *dst, uint8_t *src, uint8_t *end )
  282.      return dst;
  283.  }
  284.  
  285. -#ifdef HAVE_MMX
  286. +#if HAVE_MMX
  287.  uint8_t *x264_nal_escape_mmxext( uint8_t *dst, uint8_t *src, uint8_t *end );
  288.  uint8_t *x264_nal_escape_sse2( uint8_t *dst, uint8_t *src, uint8_t *end );
  289.  #endif
  290. @@ -88,7 +88,7 @@ void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal )
  291.  void x264_bitstream_init( int cpu, x264_bitstream_function_t *pf )
  292.  {
  293.      pf->nal_escape = x264_nal_escape_c;
  294. -#ifdef HAVE_MMX
  295. +#if HAVE_MMX
  296.      if( cpu&X264_CPU_MMXEXT )
  297.          pf->nal_escape = x264_nal_escape_mmxext;
  298.      if( (cpu&X264_CPU_SSE2) && (cpu&X264_CPU_SSE2_IS_FAST) )
  299. diff --git a/configure b/configure
  300. index 28a5b60..e30832f 100755
  301. --- a/configure
  302. +++ b/configure
  303. @@ -147,6 +147,11 @@ libdir='${exec_prefix}/lib'
  304.  includedir='${prefix}/include'
  305.  DEVNULL='/dev/null'
  306.  
  307. +malloc_h="no"
  308. +altivec="no"
  309. +mmx="no"
  310. +armv6="no"
  311. +
  312.  avs="auto"
  313.  lavf="auto"
  314.  ffms="auto"
  315. @@ -285,7 +290,7 @@ host_os="${host#*-}"
  316.  case $host_os in
  317.    beos*)
  318.      SYS="BEOS"
  319. -    define HAVE_MALLOC_H
  320. +    malloc_h="yes"
  321.      ;;
  322.    darwin*)
  323.      SYS="MACOSX"
  324. @@ -301,7 +306,7 @@ case $host_os in
  325.      ;;
  326.    kfreebsd*-gnu)
  327.      SYS="FREEBSD"
  328. -    define HAVE_MALLOC_H
  329. +    malloc_h="yes"
  330.      LDFLAGS="$LDFLAGS -lm"
  331.      ;;
  332.    netbsd*)
  333. @@ -314,7 +319,7 @@ case $host_os in
  334.      ;;
  335.    *linux*)
  336.      SYS="LINUX"
  337. -    define HAVE_MALLOC_H
  338. +    malloc_h="yes"
  339.      LDFLAGS="$LDFLAGS -lm"
  340.      ;;
  341.    cygwin*)
  342. @@ -333,7 +338,7 @@ case $host_os in
  343.      ;;
  344.    sunos*|solaris*)
  345.      SYS="SunOS"
  346. -    define HAVE_MALLOC_H
  347. +    malloc_h="yes"
  348.      LDFLAGS="$LDFLAGS -lm"
  349.      HAVE_GETOPT_LONG=0
  350.      ;;
  351. @@ -341,6 +346,11 @@ case $host_os in
  352.      die "Unknown system $host, edit the configure"
  353.      ;;
  354.  esac
  355. +if [ "$malloc_h" = "yes" ]; then
  356. +    define HAVE_MALLOC_H 1
  357. +else
  358. +    define HAVE_MALLOC_H 0
  359. +fi
  360.  
  361.  case $host_cpu in
  362.    i*86)
  363. @@ -381,13 +391,14 @@ case $host_cpu in
  364.    powerpc|powerpc64)
  365.      ARCH="PPC"
  366.      if [ $asm = auto ] ; then
  367. -      define HAVE_ALTIVEC
  368. +      altivec="yes"
  369.        AS="${AS-${cross_prefix}gcc}"
  370.        if [ $SYS = MACOSX ] ; then
  371.          CFLAGS="$CFLAGS -faltivec -fastf -mcpu=G4"
  372. +        define HAVE_ALTIVEC_H 0
  373.        else
  374.          CFLAGS="$CFLAGS -maltivec -mabi=altivec"
  375. -        define HAVE_ALTIVEC_H
  376. +        define HAVE_ALTIVEC_H 1
  377.        fi
  378.      fi
  379.      ;;
  380. @@ -437,6 +448,11 @@ case $host_cpu in
  381.      ARCH="$(echo $host_cpu | tr a-z A-Z)"
  382.      ;;
  383.  esac
  384. +if [ "$altivec" = "yes" ]; then
  385. +    define HAVE_ALTIVEC 1
  386. +else
  387. +    define HAVE_ALTIVEC 0
  388. +fi
  389.  
  390.  log_msg "x264 configure script"
  391.  if [ -n "$*" ]; then
  392. @@ -478,16 +494,22 @@ if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
  393.          echo "If you really want to compile without asm, configure with --disable-asm."
  394.          exit 1
  395.      fi
  396. -    define HAVE_MMX
  397. +    mmx="yes"
  398. +fi
  399. +if [ "$mmx" = "yes" ]; then
  400. +    define HAVE_MMX 1
  401. +else
  402. +    define HAVE_MMX 0
  403.  fi
  404.  
  405.  if [ $asm = auto -a $ARCH = ARM ] ; then
  406.      # set flags so neon is built by default
  407.      echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-mfloat-abi)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
  408.  
  409. -    if  cc_check '' '' '__asm__("rev ip, ip");' ; then      define HAVE_ARMV6
  410. -        cc_check '' '' '__asm__("movt r0, #0");'         && define HAVE_ARMV6T2
  411. -        cc_check '' '' '__asm__("vadd.i16 q0, q0, q0");' && define HAVE_NEON
  412. +    if  cc_check '' '' '__asm__("rev ip, ip");' ; then
  413. +        armv6="yes"
  414. +        cc_check '' '' '__asm__("movt r0, #0");'         && define HAVE_ARMV6T2 1 || define HAVE_ARMV6T2 0
  415. +        cc_check '' '' '__asm__("vadd.i16 q0, q0, q0");' && define HAVE_NEON 1    || define HAVE_NEON 0
  416.          ASFLAGS="$ASFLAGS $CFLAGS -c"
  417.      else
  418.          echo "You specified a pre-ARMv6 or Thumb-1 CPU in your CFLAGS."
  419. @@ -495,6 +517,11 @@ if [ $asm = auto -a $ARCH = ARM ] ; then
  420.          exit 1
  421.      fi
  422.  fi
  423. +if [ "$armv6" = "yes" ]; then
  424. +    define HAVE_ARMV6 1
  425. +else
  426. +    define HAVE_ARMV6 0
  427. +fi
  428.  
  429.  [ $asm = no ] && AS=""
  430.  [ "x$AS" = x ] && asm="no" || asm="yes"
  431. @@ -513,7 +540,7 @@ fi
  432.  # autodetect options that weren't forced nor disabled
  433.  
  434.  libpthread=""
  435. -if test "$pthread" = "auto" ; then
  436. +if [ "$pthread" = "auto" ]; then
  437.      pthread="no"
  438.      case $SYS in
  439.          BEOS)
  440. @@ -544,13 +571,17 @@ if test "$pthread" = "auto" ; then
  441.              ;;
  442.      esac
  443.  fi
  444. -if test "$pthread" = "yes" ; then
  445. -    define HAVE_PTHREAD
  446. +if [ "$pthread" = "yes" ]; then
  447. +    define HAVE_PTHREAD 1
  448.      LDFLAGS="$LDFLAGS $libpthread"
  449. +else
  450. +    define HAVE_PTHREAD 0
  451.  fi
  452.  
  453.  if cc_check "math.h" "-Werror" "return log2f(2);" ; then
  454. -    define HAVE_LOG2F
  455. +    define HAVE_LOG2F 1
  456. +else
  457. +    define HAVE_LOG2F 0
  458.  fi
  459.  
  460.  if [ "$vis" = "yes" ] ; then
  461. @@ -558,10 +589,11 @@ if [ "$vis" = "yes" ] ; then
  462.      CFLAGS="$CFLAGS -I/usr/X11R6/include"
  463.      if cc_check "X11/Xlib.h" "-L/usr/X11R6/lib -lX11" "XOpenDisplay(0);" ; then
  464.          LDFLAGS="-L/usr/X11R6/lib -lX11 $LDFLAGS"
  465. -        define HAVE_VISUALIZE
  466. +        define HAVE_VISUALIZE 1
  467.      else
  468.          vis="no"
  469.          CFLAGS="$save_CFLAGS"
  470. +        define HAVE_VISUALIZE 0
  471.     fi
  472.  fi
  473.  
  474. @@ -578,7 +610,6 @@ if [ "$swscale" = "auto" ] ; then
  475.          if cpp_check "libswscale/swscale.h" "$SWSCALE_CFLAGS" "LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)" "$error"; then
  476.              # we use colorspaces that were defined in libavutil r19775
  477.              if cc_check "libavutil/pixfmt.h" "$SWSCALE_CFLAGS" "enum PixelFormat pixfmt = PIX_FMT_YUV422P16LE;" ; then
  478. -                define HAVE_SWSCALE
  479.                  swscale="yes"
  480.              else
  481.                  echo "Warning: libavutil is too old, update to ffmpeg r19775+"
  482. @@ -607,7 +638,6 @@ if [ "$lavf" = "auto" ] ; then
  483.          if cc_check libavutil/pixdesc.h "$LAVF_CFLAGS $LAVF_LIBS" ; then
  484.              if [ "$swscale" = "yes" ]; then
  485.                  lavf="yes"
  486. -                define HAVE_LAVF
  487.              else
  488.                  echo "Warning: libavformat is not supported without swscale support"
  489.              fi
  490. @@ -645,18 +675,28 @@ if [ "$ffms" = "auto" ] ; then
  491.      fi
  492.  fi
  493.  
  494. -if [ "$ffms" = "yes" ]; then
  495. -    LDFLAGSCLI="$FFMS2_LIBS $LDFLAGSCLI"
  496. -    CFLAGS="$CFLAGS $FFMS2_CFLAGS"
  497. -    define HAVE_FFMS
  498. -fi
  499. -
  500. -if [ "$lavf" = "yes" ]; then
  501. -    LDFLAGSCLI="$LAVF_LIBS $LDFLAGSCLI"
  502. -    CFLAGS="$CFLAGS $LAVF_CFLAGS"
  503. -elif [ "$swscale" = "yes" ]; then
  504. +if [ "$swscale" = "yes" ]; then
  505.      LDFLAGSCLI="$SWSCALE_LIBS $LDFLAGSCLI"
  506.      CFLAGS="$CFLAGS $SWSCALE_CFLAGS"
  507. +    define HAVE_SWSCALE 1
  508. +    if [ "$lavf" = "yes" ]; then
  509. +        LDFLAGSCLI="$LAVF_LIBS $LDFLAGSCLI"
  510. +        CFLAGS="$CFLAGS $LAVF_CFLAGS"
  511. +        define HAVE_LAVF 1
  512. +    else
  513. +        define HAVE_LAVF 0
  514. +    fi
  515. +    if [ "$ffms" = "yes" ]; then
  516. +        LDFLAGSCLI="$FFMS2_LIBS $LDFLAGSCLI"
  517. +        CFLAGS="$CFLAGS $FFMS2_CFLAGS"
  518. +        define HAVE_FFMS 1
  519. +    else
  520. +        define HAVE_FFMS 0
  521. +    fi
  522. +else
  523. +    define HAVE_SWSCALE 0
  524. +    define HAVE_LAVF 0
  525. +    define HAVE_FFMS 0
  526.  fi
  527.  
  528.  GPAC_LIBS="-lgpac_static"
  529. @@ -674,18 +714,24 @@ if [ "$gpac" = "auto" ] ; then
  530.      fi
  531.  fi
  532.  if [ "$gpac" = "yes" ] ; then
  533. -    define HAVE_GPAC
  534. +    define HAVE_GPAC 1
  535.      if cc_check gpac/isomedia.h "-Werror $GPAC_LIBS" "gf_malloc(1); gf_free(NULL);" ; then
  536. -        define HAVE_GF_MALLOC
  537. +        define HAVE_GF_MALLOC 1
  538. +    else
  539. +        define HAVE_GF_MALLOC 0
  540.      fi
  541.      LDFLAGSCLI="$GPAC_LIBS $LDFLAGSCLI"
  542. +else
  543. +    define HAVE_GPAC 0
  544.  fi
  545.  
  546.  if [ "$avs" = "auto" ] ; then
  547.      avs="no"
  548.      if [ $SYS = MINGW ] && cc_check extras/avisynth_c.h ; then
  549.          avs="yes"
  550. -        define HAVE_AVS
  551. +        define HAVE_AVS 1
  552. +    else
  553. +        define HAVE_AVS 0
  554.      fi
  555.  fi
  556.  
  557. @@ -767,6 +813,11 @@ VIS=$vis
  558.  HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
  559.  DEVNULL=$DEVNULL
  560.  GPL=$gpl
  561. +AVS=$avs
  562. +PTHREAD=$pthread
  563. +LAVF=$lavf
  564. +FFMS=$ffms
  565. +GPAC=$gpac
  566.  EOF
  567.  
  568.  if [ "$shared" = "yes" ]; then
  569. --
  570. 1.7.3.2.146.gca209
  571.  
  572.  
  573. From c2c8f88023d0ee8ca881acf6bfb18ac69c7f45f1 Mon Sep 17 00:00:00 2001
  574. From: Jason Garrett-Glaser <darkshikari@gmail.com>
  575. Date: Sat, 20 Nov 2010 23:30:42 -0800
  576. Subject: [PATCH 6/8] Change qpmin default to 0
  577.  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.
  578.  Might help on gradients at high quality levels.
  579.  (the previous value of 10 was arbitrary anyways)
  580.  
  581. ---
  582. common/common.c |    2 +-
  583.  1 files changed, 1 insertions(+), 1 deletions(-)
  584.  
  585. diff --git a/common/common.c b/common/common.c
  586. index 6c88556..1f99e9e 100644
  587. --- a/common/common.c
  588. +++ b/common/common.c
  589. @@ -98,7 +98,7 @@ void x264_param_default( x264_param_t *param )
  590.      param->rc.f_vbv_buffer_init = 0.9;
  591.      param->rc.i_qp_constant = 23 + QP_BD_OFFSET;
  592.      param->rc.f_rf_constant = 23;
  593. -    param->rc.i_qp_min = 10;
  594. +    param->rc.i_qp_min = 0;
  595.      param->rc.i_qp_max = QP_MAX;
  596.      param->rc.i_qp_step = 4;
  597.      param->rc.f_ip_factor = 1.4;
  598. --
  599. 1.7.3.2.146.gca209
  600.  
  601.  
  602. From a347dae118a7b1b90037da23f25835a421f0eacc Mon Sep 17 00:00:00 2001
  603. From: Yasuhiro Ikeda <wipple625@gmail.com>
  604. Date: Mon, 22 Nov 2010 11:01:57 +0900
  605. Subject: [PATCH 7/8] Add some more info to `x264 --version`
  606.  
  607. ---
  608. x264.c |   23 ++++++++++++++++++++---
  609.  1 files changed, 20 insertions(+), 3 deletions(-)
  610.  
  611. diff --git a/x264.c b/x264.c
  612. index bba17b8..f9a1c6a 100644
  613. --- a/x264.c
  614. +++ b/x264.c
  615. @@ -55,6 +55,14 @@
  616.  #include <libavutil/pixdesc.h>
  617.  #endif
  618.  
  619. +#if HAVE_SWSCALE
  620. +#include <libswscale/swscale.h>
  621. +#endif
  622. +
  623. +#if HAVE_FFMS
  624. +#include <ffms.h>
  625. +#endif
  626. +
  627.  /* Ctrl-C handler */
  628.  static volatile int b_ctrl_c = 0;
  629.  static int          b_exit_on_ctrl_c = 0;
  630. @@ -208,6 +216,15 @@ static void print_version_info()
  631.  #else
  632.      printf( "x264 0.%d.X\n", X264_BUILD );
  633.  #endif
  634. +#if HAVE_SWSCALE
  635. +    printf( "(libswscale %d.%d.%d)\n", LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO );
  636. +#endif
  637. +#if HAVE_LAVF
  638. +    printf( "(libavformat %d.%d.%d)\n", LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO );
  639. +#endif
  640. +#if HAVE_FFMS
  641. +    printf( "(ffmpegsource %d.%d.%d.%d)\n", FFMS_VERSION >> 24, (FFMS_VERSION & 0xff0000) >> 16, (FFMS_VERSION & 0xff00) >> 8, FFMS_VERSION & 0xff );
  642. +#endif
  643.      printf( "built on " __DATE__ ", " );
  644.  #ifdef __GNUC__
  645.      printf( "gcc: " __VERSION__ "\n" );
  646. @@ -221,9 +238,9 @@ static void print_version_info()
  647.  #else
  648.      printf( "Non-GPL commercial\n" );
  649.  #endif
  650. -#if HAVE_LAVF
  651. -    const char *license = avformat_license();
  652. -    printf( "libavformat license: %s\n", license );
  653. +#if HAVE_SWSCALE
  654. +    const char *license = swscale_license();
  655. +    printf( "libswscale%s%s license: %s\n",HAVE_LAVF ? "/libavformat" : "", HAVE_FFMS ? "/ffmpegsource" : "" , license );
  656.      if( !strcmp( license, "nonfree and unredistributable" ) ||
  657.         (!HAVE_GPL && (!strcmp( license, "GPL version 2 or later" )
  658.                    ||  !strcmp( license, "GPL version 3 or later" ))))
  659. --
  660. 1.7.3.2.146.gca209
  661.  
  662.  
  663. From 3171540b5223c2df25fe10b663613f3a56a70037 Mon Sep 17 00:00:00 2001
  664. From: Jason Garrett-Glaser <darkshikari@gmail.com>
  665. Date: Fri, 19 Nov 2010 16:58:38 -0800
  666. Subject: [PATCH 8/8] Add API function to return max number of delayed frames
  667.  
  668. ---
  669. encoder/encoder.c |    8 +++++---
  670.  x264.h            |    6 +++++-
  671.  2 files changed, 10 insertions(+), 4 deletions(-)
  672.  
  673. diff --git a/encoder/encoder.c b/encoder/encoder.c
  674. index 8b14b41..2d5c778 100644
  675. --- a/encoder/encoder.c
  676. +++ b/encoder/encoder.c
  677. @@ -3320,9 +3320,6 @@ void    x264_encoder_close  ( x264_t *h )
  678.      }
  679.  }
  680.  
  681. -/****************************************************************************
  682. - * x264_encoder_delayed_frames:
  683. - ****************************************************************************/
  684.  int x264_encoder_delayed_frames( x264_t *h )
  685.  {
  686.      int delayed_frames = 0;
  687. @@ -3343,3 +3340,8 @@ int x264_encoder_delayed_frames( x264_t *h )
  688.      x264_pthread_mutex_unlock( &h->lookahead->ofbuf.mutex );
  689.      return delayed_frames;
  690.  }
  691. +
  692. +int x264_encoder_maximum_delayed_frames( x264_t *h )
  693. +{
  694. +    return h->frames.i_delay;
  695. +}
  696. diff --git a/x264.h b/x264.h
  697. index ce79d40..e144e51 100644
  698. --- a/x264.h
  699. +++ b/x264.h
  700. @@ -39,7 +39,7 @@
  701.  
  702.  #include <stdarg.h>
  703.  
  704. -#define X264_BUILD 108
  705. +#define X264_BUILD 109
  706.  
  707.  /* x264_t:
  708.   *      opaque handler for encoder */
  709. @@ -766,6 +766,10 @@ void    x264_encoder_close  ( x264_t * );
  710.   *      return the number of currently delayed (buffered) frames
  711.   *      this should be used at the end of the stream, to know when you have all the encoded frames. */
  712.  int     x264_encoder_delayed_frames( x264_t * );
  713. +/* x264_encoder_maximum_delayed_frames( x264_t *h ):
  714. + *      return the maximum number of delayed (buffered) frames that can occur with the current
  715. + *      parameters. */
  716. +int     x264_encoder_maximum_delayed_frames( x264_t *h );
  717.  /* x264_encoder_intra_refresh:
  718.   *      If an intra refresh is not in progress, begin one with the next P-frame.
  719.   *      If an intra refresh is in progress, begin one as soon as the current one finishes.
  720. --
  721. 1.7.3.2.146.gca209
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement