Skip to content
Commits on Source (35)
stages:
- build
- test
- release
.variables-debian-amd64: &variables-debian-amd64
_TRIPLET: ""
_PLATFORMSUFFIX: ""
_PATH: "debian-x86_64"
_WRAPPER: ""
.variables-debian-aarch64: &variables-debian-aarch64
_TRIPLET: ""
_PLATFORMSUFFIX: ""
_PATH: "debian-aarch64"
_WRAPPER: ""
.variables-win32: &variables-win32
_TRIPLET: "i686-w64-mingw32"
_PLATFORMSUFFIX: ".exe"
_PATH: "win32"
_WRAPPER: "wine"
.variables-win64: &variables-win64
_TRIPLET: "x86_64-w64-mingw32"
_PLATFORMSUFFIX: ".exe"
_PATH: "win64"
_WRAPPER: "wine64"
.variables-macos: &variables-macos
_TRIPLET: "x86_64-apple-darwin18"
_PLATFORMSUFFIX: ""
_PATH: "macos-x86_64"
_WRAPPER: ""
.build:
stage: build
script: |
set -x
curl -L -- https://download.videolan.org/videolan/x264/av.tar.gz > av.tar.gz && tar xfzv av.tar.gz
cd av
./bootstrap
make -j$(getconf _NPROCESSORS_ONLN)
cd ..
export PKG_CONFIG_PATH=`/bin/ls -d $PWD/av/*/lib/pkgconfig`
./configure --enable-pic --enable-strip --extra-ldflags="-static"
make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm
artifacts:
name: "$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- x264${_PLATFORMSUFFIX}
- checkasm8${_PLATFORMSUFFIX}
- checkasm10${_PLATFORMSUFFIX}
expire_in: 1 week
build-debian-amd64:
extends: .build
image: registry.videolan.org/x264-debian-unstable:20190404162201
tags:
- docker
- amd64
variables: *variables-debian-amd64
build-debian-aarch64:
extends: .build
image: registry.videolan.org/x264-debian-unstable-aarch64:20190716192245
tags:
- docker
- aarch64
variables: *variables-debian-aarch64
.build-win:
extends: build-debian-amd64
script: |
set -x
curl -f -o vlc-contrib-${_TRIPLET}-latest.tar.bz2 https://nightlies.videolan.org/build/${_PATH}/last/vlc-contrib-${_TRIPLET}-`date +%Y%m%d`.tar.bz2 || curl -f -o vlc-contrib-${_TRIPLET}-latest.tar.bz2 https://nightlies.videolan.org/build/${_PATH}/last/vlc-contrib-${_TRIPLET}-`date --date=yesterday +%Y%m%d`.tar.bz2
bunzip2 vlc-contrib-${_TRIPLET}-latest.tar.bz2
tar xvf vlc-contrib-${_TRIPLET}-latest.tar
sed -i "s#@@CONTRIB_PREFIX@@#`pwd`/${_TRIPLET}#g" ${_TRIPLET}/lib/pkgconfig/*.pc
export PKG_CONFIG_LIBDIR=`pwd`/${_TRIPLET}/lib/pkgconfig
./configure --host=${_TRIPLET} --cross-prefix=${_TRIPLET}- --enable-pic --enable-strip
make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm
build-win32:
extends: .build-win
variables: *variables-win32
build-win64:
extends: .build-win
variables: *variables-win64
build-macos:
extends: .build
tags:
- macos
script: |
set -x
curl -O https://nightlies.videolan.org/build/contribs/vlc-contrib-${_TRIPLET}-latest.tar.bz2
bunzip2 vlc-contrib-${_TRIPLET}-latest.tar.bz2
tar xvf vlc-contrib-${_TRIPLET}-latest.tar
sed -i.bak "s#@@CONTRIB_PREFIX@@#`pwd`/${_TRIPLET}#g" ${_TRIPLET}/lib/pkgconfig/*.pc
export PKG_CONFIG_LIBDIR=`pwd`/${_TRIPLET}/lib/pkgconfig
./configure --enable-strip
make -j$(getconf _NPROCESSORS_ONLN) x264 checkasm
variables: *variables-macos
.test: &test
stage: test
script: |
set -x
${_WRAPPER} ./checkasm8${_PLATFORMSUFFIX}
${_WRAPPER} ./checkasm10${_PLATFORMSUFFIX}
artifacts:
expire_in: 10 minutes
test-debian-amd64:
<<: *test
extends: build-debian-amd64
dependencies:
- build-debian-amd64
variables: *variables-debian-amd64
test-debian-aarch64:
<<: *test
extends: build-debian-aarch64
dependencies:
- build-debian-aarch64
variables: *variables-debian-aarch64
test-win32:
<<: *test
extends: build-win32
dependencies:
- build-win32
variables: *variables-win32
test-win64:
<<: *test
extends: build-win64
dependencies:
- build-win64
variables: *variables-win64
test-macos:
<<: *test
extends: build-macos
dependencies:
- build-macos
variables: *variables-macos
.release: &release
stage: release
script: |
set -x
_VERSION=$(./version.sh | grep _VERSION -| cut -d\ -f4-| sed 's, ,-,g' | sed 's,",,')
mv x264${_PLATFORMSUFFIX} x264-${_VERSION}${_PLATFORMSUFFIX}
when: manual
only:
- master@videolan/x264
- stable@videolan/x264
artifacts:
name: "$CI_PROJECT_PATH_SLUG-$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- x264-*${_PLATFORMSUFFIX}
expire_in: '10 minutes'
release-debian-amd64:
<<: *release
extends: build-debian-amd64
dependencies:
- build-debian-amd64
variables: *variables-debian-amd64
release-debian-aarch64:
<<: *release
extends: build-debian-aarch64
dependencies:
- build-debian-aarch64
variables: *variables-debian-aarch64
release-win32:
<<: *release
extends: build-win32
dependencies:
- build-win32
variables: *variables-win32
release-win64:
<<: *release
extends: build-win64
dependencies:
- build-win64
variables: *variables-win64
release-macos:
<<: *release
extends: build-macos
dependencies:
- build-macos
variables: *variables-macos
......@@ -27,8 +27,8 @@ SRCS_X = common/mc.c common/predict.c common/pixel.c common/macroblock.c \
SRCS_8 =
SRCCLI = x264.c input/input.c input/timecode.c input/raw.c input/y4m.c \
output/raw.c output/matroska.c output/matroska_ebml.c \
SRCCLI = x264.c autocomplete.c input/input.c input/timecode.c input/raw.c \
input/y4m.c output/raw.c output/matroska.c output/matroska_ebml.c \
output/flv.c output/flv_bytestream.c filters/filters.c \
filters/video/video.c filters/video/source.c filters/video/internal.c \
filters/video/resize.c filters/video/fix_vfr_pts.c \
......
/*****************************************************************************
* autocomplete: x264cli shell autocomplete
*****************************************************************************
* Copyright (C) 2018-2019 x264 project
*
* Authors: Henrik Gramner <henrik@gramner.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
*
* This program is also available under a commercial proprietary license.
* For more information, contact us at licensing@x264.com.
*****************************************************************************/
#include "x264cli.h"
#include "input/input.h"
#if HAVE_LAVF
#undef DECLARE_ALIGNED
#include <libavformat/avformat.h>
#include <libavutil/pixdesc.h>
#endif
static const char * const level_names[] =
{
"1", "1.1", "1.2", "1.3", "1b",
"2", "2.1", "2.2",
"3", "3.1", "3.2",
"4", "4.1", "4.2",
"5", "5.1", "5.2",
"6", "6.1", "6.2",
NULL
};
/* Options requiring a value for which we provide suggestions. */
static const char * const opts_suggest[] =
{
"--alternative-transfer",
"--aq-mode",
"--asm",
"--avcintra-class",
"--avcintra-flavor",
"--b-adapt",
"--b-pyramid",
"--colormatrix",
"--colorprim",
"--cqm",
"--demuxer",
"--direct",
"--frame-packing",
"--input-csp",
"--input-fmt",
"--input-range",
"--level",
"--log-level",
"--me",
"--muxer",
"--nal-hrd",
"--output-csp",
"--overscan",
"--pass", "-p",
"--preset",
"--profile",
"--pulldown",
"--range",
"--subme", "-m",
"--transfer",
"--trellis", "-t",
"--tune",
"--videoformat",
"--weightp",
NULL
};
/* Options requiring a value for which we don't provide suggestions. */
static const char * const opts_nosuggest[] =
{
"--b-bias",
"--bframes", "-b",
"--deblock", "-f",
"--bitrate", "-B",
"--chroma-qp-offset",
"--chromaloc",
"--cplxblur",
"--cqm4",
"--cqm4i",
"--cqm4ic",
"--cqm4iy",
"--cqm4p",
"--cqm4pc",
"--cqm4py",
"--cqm8",
"--cqm8i",
"--cqm8p",
"--crf",
"--crf-max",
"--crop-rect",
"--deadzone-inter",
"--deadzone-intra",
"--fps",
"--frames",
"--input-depth",
"--input-res",
"--ipratio",
"--keyint", "-I",
"--lookahead-threads",
"--merange",
"--min-keyint", "-i",
"--mvrange",
"--mvrange-thread",
"--nr",
"--opencl-device",
"--output-depth",
"--partitions", "-A",
"--pbratio",
"--psy-rd",
"--qblur",
"--qcomp",
"--qp", "-q",
"--qpmax",
"--qpmin",
"--qpstep",
"--ratetol",
"--ref", "-r",
"--rc-lookahead",
"--sar",
"--scenecut",
"--seek",
"--slices",
"--slices-max",
"--slice-max-size",
"--slice-max-mbs",
"--slice-min-mbs",
"--sps-id",
"--sync-lookahead",
"--threads",
"--timebase",
"--vbv-bufsize",
"--vbv-init",
"--vbv-maxrate",
"--video-filter", "--vf",
"--zones",
NULL
};
/* Options requiring a filename. */
static const char * const opts_filename[] =
{
"--cqmfile",
"--dump-yuv",
"--index",
"--opencl-clbin",
"--output", "-o",
"--qpfile",
"--stats",
"--tcfile-in",
"--tcfile-out",
NULL
};
/* Options without an associated value. */
static const char * const opts_standalone[] =
{
"--8x8dct",
"--aud",
"--bff",
"--bluray-compat",
"--cabac",
"--constrained-intra",
"--cpu-independent",
"--dts-compress",
"--fake-interlaced",
"--fast-pskip",
"--filler",
"--force-cfr",
"--mbtree",
"--mixed-refs",
"--no-8x8dct",
"--no-asm",
"--no-cabac",
"--no-chroma-me",
"--no-dct-decimate",
"--no-deblock",
"--no-fast-pskip",
"--no-mbtree",
"--no-mixed-refs",
"--no-progress",
"--no-psy",
"--no-scenecut",
"--no-weightb",
"--non-deterministic",
"--open-gop",
"--opencl",
"--pic-struct",
"--psnr",
"--quiet",
"--sliced-threads",
"--slow-firstpass",
"--ssim",
"--stitchable",
"--tff",
"--thread-input",
"--verbose", "-v",
"--weightb",
NULL
};
/* Options which shouldn't be suggested in combination with other options. */
static const char * const opts_special[] =
{
"--fullhelp",
"--help", "-h",
"--longhelp",
"--version",
NULL
};
static int list_contains( const char * const *list, const char *s )
{
if( *s )
for( ; *list; list++ )
if( !strcmp( *list, s ) )
return 1;
return 0;
}
static void suggest( const char *s, const char *cur, int cur_len )
{
if( s && *s && !strncmp( s, cur, cur_len ) )
printf( "%s\n", s );
}
static void suggest_lower( const char *s, const char *cur, int cur_len )
{
if( s && *s && !strncasecmp( s, cur, cur_len ) )
{
for( ; *s; s++ )
putchar( *s < 'A' || *s > 'Z' ? *s : *s | 0x20 );
putchar( '\n' );
}
}
static void suggest_num_range( int start, int end, const char *cur, int cur_len )
{
char buf[16];
for( int i = start; i <= end; i++ )
{
snprintf( buf, sizeof( buf ), "%d", i );
suggest( buf, cur, cur_len );
}
}
#if HAVE_LAVF
/* Suggest each token in a string separated by delimiters. */
static void suggest_token( const char *s, int delim, const char *cur, int cur_len )
{
if( s && *s )
{
for( const char *tok_end; (tok_end = strchr( s, delim )); s = tok_end + 1 )
{
int tok_len = tok_end - s;
if( tok_len && tok_len >= cur_len && !strncmp( s, cur, cur_len ) )
printf( "%.*s\n", tok_len, s );
}
suggest( s, cur, cur_len );
}
}
#endif
#define OPT( opt ) else if( !strcmp( prev, opt ) )
#define OPT2( opt1, opt2 ) else if( !strcmp( prev, opt1 ) || !strcmp( prev, opt2 ) )
#define OPT_TYPE( type ) list_contains( opts_##type, prev )
#define suggest( s ) suggest( s, cur, cur_len )
#define suggest_lower( s ) suggest_lower( s, cur, cur_len )
#define suggest_list( list ) for( const char * const *s = list; *s; s++ ) suggest( *s )
#define suggest_num_range( start, end ) suggest_num_range( start, end, cur, cur_len )
#define suggest_token( s, delim ) suggest_token( s, delim, cur, cur_len )
int x264_cli_autocomplete( const char *prev, const char *cur )
{
int cur_len = strlen( cur );
if( 0 );
OPT( "--alternative-transfer" )
suggest_list( x264_transfer_names );
OPT( "--aq-mode" )
suggest_num_range( 0, 3 );
OPT( "--asm" )
for( const x264_cpu_name_t *cpu = x264_cpu_names; cpu->flags; cpu++ )
suggest_lower( cpu->name );
OPT( "--avcintra-class" )
suggest_list( x264_avcintra_class_names );
OPT( "--avcintra-flavor" )
suggest_list( x264_avcintra_flavor_names );
OPT( "--b-adapt" )
suggest_num_range( 0, 2 );
OPT( "--b-pyramid" )
suggest_list( x264_b_pyramid_names );
OPT( "--colormatrix" )
suggest_list( x264_colmatrix_names );
OPT( "--colorprim" )
suggest_list( x264_colorprim_names );
OPT( "--cqm" )
suggest_list( x264_cqm_names );
OPT( "--demuxer" )
suggest_list( x264_demuxer_names );
OPT( "--direct" )
suggest_list( x264_direct_pred_names );
OPT( "--frame-packing" )
suggest_num_range( 0, 7 );
OPT( "--input-csp" )
{
for( int i = X264_CSP_NONE+1; i < X264_CSP_CLI_MAX; i++ )
suggest( x264_cli_csps[i].name );
#if HAVE_LAVF
for( const AVPixFmtDescriptor *d = NULL; (d = av_pix_fmt_desc_next( d )); )
suggest( d->name );
#endif
}
OPT( "--input-fmt" )
{
#if HAVE_LAVF
av_register_all();
for( const AVInputFormat *f = NULL; (f = av_iformat_next( f )); )
suggest_token( f->name, ',' );
#endif
}
OPT( "--input-range" )
suggest_list( x264_range_names );
OPT( "--level" )
suggest_list( level_names );
OPT( "--log-level" )
suggest_list( x264_log_level_names );
OPT( "--me" )
suggest_list( x264_motion_est_names );
OPT( "--muxer" )
suggest_list( x264_muxer_names );
OPT( "--nal-hrd" )
suggest_list( x264_nal_hrd_names );
OPT( "--output-csp" )
suggest_list( x264_output_csp_names );
OPT( "--output-depth" )
{
#if HAVE_BITDEPTH8
suggest( "8" );
#endif
#if HAVE_BITDEPTH10
suggest( "10" );
#endif
}
OPT( "--overscan" )
suggest_list( x264_overscan_names );
OPT2( "--partitions", "-A" )
suggest_list( x264_partition_names );
OPT2( "--pass", "-p" )
suggest_num_range( 1, 3 );
OPT( "--preset" )
suggest_list( x264_preset_names );
OPT( "--profile" )
suggest_list( x264_valid_profile_names );
OPT( "--pulldown" )
suggest_list( x264_pulldown_names );
OPT( "--range" )
suggest_list( x264_range_names );
OPT2( "--subme", "-m" )
suggest_num_range( 0, 11 );
OPT( "--transfer" )
suggest_list( x264_transfer_names );
OPT2( "--trellis", "-t" )
suggest_num_range( 0, 2 );
OPT( "--tune" )
suggest_list( x264_tune_names );
OPT( "--videoformat" )
suggest_list( x264_vidformat_names );
OPT( "--weightp" )
suggest_num_range( 0, 2 );
else if( !OPT_TYPE( nosuggest ) && !OPT_TYPE( special ) )
{
if( OPT_TYPE( filename ) || strncmp( cur, "--", 2 ) )
return 1; /* Fall back to default shell filename autocomplete. */
/* Suggest options. */
suggest_list( opts_suggest );
suggest_list( opts_nosuggest );
suggest_list( opts_filename );
suggest_list( opts_standalone );
/* Only suggest special options if no other options have been specified. */
if( !*prev )
suggest_list( opts_special );
}
return 0;
}
/*****************************************************************************
* asm-offsets.c: check asm offsets for aarch64
*****************************************************************************
* Copyright (C) 2014-2018 x264 project
* Copyright (C) 2014-2019 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
......
/*****************************************************************************
* asm-offsets.h: asm offsets for aarch64
*****************************************************************************
* Copyright (C) 2014-2018 x264 project
* Copyright (C) 2014-2019 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
......
/*****************************************************************************
* asm.S: AArch64 utility macros
*****************************************************************************
* Copyright (C) 2008-2018 x264 project
* Copyright (C) 2008-2019 x264 project
*
* Authors: Mans Rullgard <mans@mansr.com>
* David Conrad <lessen42@gmail.com>
......
/*****************************************************************************
* bitstream-a.S: aarch64 bitstream functions
*****************************************************************************
* Copyright (C) 2014-2018 x264 project
* Copyright (C) 2014-2019 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
......
/*****************************************************************************
* bitstream.h: aarch64 bitstream functions
*****************************************************************************
* Copyright (C) 2017-2018 x264 project
* Copyright (C) 2017-2019 x264 project
*
* Authors: Anton Mitrofanov <BugMaster@narod.ru>
*
......
/*****************************************************************************
* cabac-a.S: aarch64 cabac
*****************************************************************************
* Copyright (C) 2014-2018 x264 project
* Copyright (C) 2014-2019 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
......
/****************************************************************************
* dct-a.S: aarch64 transform and zigzag
*****************************************************************************
* Copyright (C) 2009-2018 x264 project
* Copyright (C) 2009-2019 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
......
/*****************************************************************************
* dct.h: aarch64 transform and zigzag
*****************************************************************************
* Copyright (C) 2009-2018 x264 project
* Copyright (C) 2009-2019 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
......
/*****************************************************************************
* deblock.S: aarch64 deblocking
*****************************************************************************
* Copyright (C) 2009-2018 x264 project
* Copyright (C) 2009-2019 x264 project
*
* Authors: Mans Rullgard <mans@mansr.com>
* Janne Grunau <janne-x264@jannau.net>
......
/*****************************************************************************
* deblock.h: aarch64 deblocking
*****************************************************************************
* Copyright (C) 2017-2018 x264 project
* Copyright (C) 2017-2019 x264 project
*
* Authors: Anton Mitrofanov <BugMaster@narod.ru>
*
......
/*****************************************************************************
* mc.S: aarch64 motion compensation
*****************************************************************************
* Copyright (C) 2009-2018 x264 project
* Copyright (C) 2009-2019 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
......
/*****************************************************************************
* mc-c.c: aarch64 motion compensation
*****************************************************************************
* Copyright (C) 2009-2018 x264 project
* Copyright (C) 2009-2019 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
......
/*****************************************************************************
* mc.h: aarch64 motion compensation
*****************************************************************************
* Copyright (C) 2014-2018 x264 project
* Copyright (C) 2014-2019 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
......
/*****************************************************************************
* pixel.S: aarch64 pixel metrics
*****************************************************************************
* Copyright (C) 2009-2018 x264 project
* Copyright (C) 2009-2019 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
......
/*****************************************************************************
* pixel.h: aarch64 pixel metrics
*****************************************************************************
* Copyright (C) 2009-2018 x264 project
* Copyright (C) 2009-2019 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
......
/*****************************************************************************
* predict.S: aarch64 intra prediction
*****************************************************************************
* Copyright (C) 2009-2018 x264 project
* Copyright (C) 2009-2019 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Mans Rullgard <mans@mansr.com>
......
/*****************************************************************************
* predict.c: aarch64 intra prediction
*****************************************************************************
* Copyright (C) 2009-2018 x264 project
* Copyright (C) 2009-2019 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
......