From 737e4b71d551058f1a41665f83f94fcb83c1e78f Mon Sep 17 00:00:00 2001 From: odrling Date: Thu, 21 Mar 2024 22:26:44 +0100 Subject: [PATCH] */x264*: treeclean --- media-libs/x264/files/enc-time.patch | 83 ---------------- media-libs/x264/files/est-size.patch | 49 --------- media-libs/x264/files/fadecomp.patch | 99 ------------------- .../files/x264-0.0.20190903-STRINGS.patch | 37 ------- media-libs/x264/metadata.xml | 12 --- media-libs/x264/x264-9999.ebuild | 68 ------------- media-video/x264-encoder/files/enc-time.patch | 83 ---------------- media-video/x264-encoder/files/est-size.patch | 49 --------- media-video/x264-encoder/files/fadecomp.patch | 99 ------------------- media-video/x264-encoder/metadata.xml | 12 --- .../x264-encoder/x264-encoder-9999.ebuild | 82 --------------- 11 files changed, 673 deletions(-) delete mode 100644 media-libs/x264/files/enc-time.patch delete mode 100644 media-libs/x264/files/est-size.patch delete mode 100644 media-libs/x264/files/fadecomp.patch delete mode 100644 media-libs/x264/files/x264-0.0.20190903-STRINGS.patch delete mode 100644 media-libs/x264/metadata.xml delete mode 100644 media-libs/x264/x264-9999.ebuild delete mode 100644 media-video/x264-encoder/files/enc-time.patch delete mode 100644 media-video/x264-encoder/files/est-size.patch delete mode 100644 media-video/x264-encoder/files/fadecomp.patch delete mode 100644 media-video/x264-encoder/metadata.xml delete mode 100644 media-video/x264-encoder/x264-encoder-9999.ebuild diff --git a/media-libs/x264/files/enc-time.patch b/media-libs/x264/files/enc-time.patch deleted file mode 100644 index 142fa1f..0000000 --- a/media-libs/x264/files/enc-time.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 49d36068a4bf958b553c62fe6f47ef2d81cbf8f6 Mon Sep 17 00:00:00 2001 -From: DJATOM -Date: Tue, 26 Jan 2021 00:57:07 +0200 -Subject: [PATCH] Improve encoding status view Extend final stats - ---- - x264.c | 33 ++++++++++++++++++++++++++------- - 1 file changed, 26 insertions(+), 7 deletions(-) - -diff --git a/x264.c b/x264.c -index 11dd6c6e..bc2415c3 100644 ---- a/x264.c -+++ b/x264.c -@@ -1932,11 +1932,24 @@ static int encode_frame( x264_t *h, hnd_t hout, x264_picture_t *pic, int64_t *la - - static int64_t print_status( int64_t i_start, int64_t i_previous, int i_frame, int i_frame_total, int64_t i_file, x264_param_t *param, int64_t last_ts ) - { -+ static int print_progress_header = 1; - char buf[200]; - int64_t i_time = x264_mdate(); - if( i_previous && i_time - i_previous < UPDATE_INTERVAL ) - return i_previous; -+ -+ if( print_progress_header ) -+ { -+ if( i_frame_total ) -+ fprintf( stderr, " %6s %13s %5s %8s %9s %9s\n", -+ "", "frames ", "fps ", "kb/s ", "elapsed", "remain " ); -+ else -+ fprintf( stderr, "%6s %5s %8s %9s\n", "frames", "fps ", "kb/s ", "elapsed" ); -+ print_progress_header = 0; -+ } -+ - int64_t i_elapsed = i_time - i_start; -+ int secs = i_elapsed / 1000000; - double fps = i_elapsed > 0 ? i_frame * 1000000. / i_elapsed : 0; - double bitrate; - if( last_ts ) -@@ -1946,12 +1959,13 @@ static int64_t print_status( int64_t i_start, int64_t i_previous, int i_frame, i - if( i_frame_total ) - { - int eta = i_elapsed * (i_frame_total - i_frame) / ((int64_t)i_frame * 1000000); -- sprintf( buf, "x264 [%.1f%%] %d/%d frames, %.2f fps, %.2f kb/s, eta %d:%02d:%02d", -+ sprintf( buf, "x264 [%5.1f%%] %6d/%-6d %5.2f %8.2f %3d:%02d:%02d %3d:%02d:%02d", - 100. * i_frame / i_frame_total, i_frame, i_frame_total, fps, bitrate, -- eta/3600, (eta/60)%60, eta%60 ); -+ secs/3600, (secs/60)%60, secs%60, eta/3600, (eta/60)%60, eta%60 ); - } - else -- sprintf( buf, "x264 %d frames: %.2f fps, %.2f kb/s", i_frame, fps, bitrate ); -+ sprintf( buf, "x264 %6d %5.2f %8.2f %3d:%02d:%02d", -+ i_frame, fps, bitrate, secs/3600, (secs/60)%60, secs%60 ); - fprintf( stderr, "%s \r", buf+5 ); - x264_cli_set_console_title( buf ); - fflush( stderr ); // needed in windows -@@ -2138,8 +2152,11 @@ static int encode( x264_param_t *param, cli_opt_t *opt ) - - i_end = x264_mdate(); - /* Erase progress indicator before printing encoding stats. */ -- if( opt->b_progress ) -- fprintf( stderr, " \r" ); -+ if( opt->b_progress && i_frame_output ) -+ { -+ print_status( i_start, 0, i_frame_output, param->i_frame_total, i_file, param, 2 * last_dts - prev_dts - first_dts ); -+ fprintf( stderr, "\n" ); -+ } - if( h ) - x264_encoder_close( h ); - fprintf( stderr, "\n" ); -@@ -2154,9 +2171,11 @@ static int encode( x264_param_t *param, cli_opt_t *opt ) - { - double fps = (double)i_frame_output * (double)1000000 / - (double)( i_end - i_start ); -+ int secs = (i_end - i_start) / 1000000; - -- x264_cli_printf( X264_LOG_INFO, "encoded %d frames, %.2f fps, %.2f kb/s\n", i_frame_output, fps, -- (double) i_file * 8 / ( 1000 * duration ) ); -+ x264_cli_printf( X264_LOG_INFO, "encoded %d frames, %.2f fps, %.2f kb/s, duration %d:%02d:%02d.%02d\n", i_frame_output, fps, -+ (double) i_file * 8 / ( 1000 * duration ), -+ secs/3600, (secs/60)%60, secs%60, (int)((i_end - i_start)%1000000/10000) ); - } - - return retval; diff --git a/media-libs/x264/files/est-size.patch b/media-libs/x264/files/est-size.patch deleted file mode 100644 index 9580150..0000000 --- a/media-libs/x264/files/est-size.patch +++ /dev/null @@ -1,49 +0,0 @@ -From e920dd0c68231e77c2fbc811abc7eeea6a301fc0 Mon Sep 17 00:00:00 2001 -From: DJATOM -Date: Tue, 26 Jan 2021 00:59:38 +0200 -Subject: [PATCH] Calculate estimated file size - ---- - x264.c | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/x264.c b/x264.c -index bc2415c3..deac5e41 100644 ---- a/x264.c -+++ b/x264.c -@@ -1941,10 +1941,10 @@ static int64_t print_status( int64_t i_start, int64_t i_previous, int i_frame, i - if( print_progress_header ) - { - if( i_frame_total ) -- fprintf( stderr, " %6s %13s %5s %8s %9s %9s\n", -- "", "frames ", "fps ", "kb/s ", "elapsed", "remain " ); -+ fprintf( stderr, " %6s %13s %5s %8s %9s %9s %7s %7s\n", -+ "", "frames ", "fps ", "kb/s ", "elapsed", "remain ", "size", "est.size" ); - else -- fprintf( stderr, "%6s %5s %8s %9s\n", "frames", "fps ", "kb/s ", "elapsed" ); -+ fprintf( stderr, "%6s %5s %8s %9s %7s\n", "frames", "fps ", "kb/s ", "elapsed", "size" ); - print_progress_header = 0; - } - -@@ -1959,13 +1959,17 @@ static int64_t print_status( int64_t i_start, int64_t i_previous, int i_frame, i - if( i_frame_total ) - { - int eta = i_elapsed * (i_frame_total - i_frame) / ((int64_t)i_frame * 1000000); -- sprintf( buf, "x264 [%5.1f%%] %6d/%-6d %5.2f %8.2f %3d:%02d:%02d %3d:%02d:%02d", -+ double estsz = (double) i_file * i_frame_total / (i_frame * 1024.); -+ sprintf( buf, "x264 [%5.1f%%] %6d/%-6d %5.2f %8.2f %3d:%02d:%02d %3d:%02d:%02d %7.2f %1sB %7.2f %1sB", - 100. * i_frame / i_frame_total, i_frame, i_frame_total, fps, bitrate, -- secs/3600, (secs/60)%60, secs%60, eta/3600, (eta/60)%60, eta%60 ); -+ secs/3600, (secs/60)%60, secs%60, eta/3600, (eta/60)%60, eta%60, -+ i_file < 1048576 ? (double) i_file / 1024. : (double) i_file / 1048576., i_file < 1048576 ? "K":"M", -+ estsz < 1024 ? estsz : estsz / 1024, estsz < 1024 ? "K" : "M" ); - } - else -- sprintf( buf, "x264 %6d %5.2f %8.2f %3d:%02d:%02d", -- i_frame, fps, bitrate, secs/3600, (secs/60)%60, secs%60 ); -+ sprintf( buf, "x264 %6d %5.2f %8.2f %3d:%02d:%02d %7.2f %sB", -+ i_frame, fps, bitrate, secs/3600, (secs/60)%60, secs%60, -+ i_file < 1048576 ? (double) i_file / 1024. : (double) i_file / 1048576., i_file < 1048576 ? "K":"M" ); - fprintf( stderr, "%s \r", buf+5 ); - x264_cli_set_console_title( buf ); - fflush( stderr ); // needed in windows diff --git a/media-libs/x264/files/fadecomp.patch b/media-libs/x264/files/fadecomp.patch deleted file mode 100644 index d88a8bd..0000000 --- a/media-libs/x264/files/fadecomp.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff --git a/common/base.c b/common/base.c -index 5b35a2e3..9d572c90 100644 ---- a/common/base.c -+++ b/common/base.c -@@ -1334,6 +1334,8 @@ REALIGN_STACK int x264_param_parse( x264_param_t *p, const char *name, const cha - p->rc.i_aq_mode = atoi(value); - OPT("aq-strength") - p->rc.f_aq_strength = atof(value); -+ OPT("fade-compensate") -+ p->rc.f_fade_compensate = atof(value); - OPT("pass") - { - int pass = x264_clip3( atoi(value), 0, 3 ); -@@ -1442,7 +1444,10 @@ char *x264_param2string( x264_param_t *p, int b_res ) - s += sprintf( s, " subme=%d", p->analyse.i_subpel_refine ); - s += sprintf( s, " psy=%d", p->analyse.b_psy ); - if( p->analyse.b_psy ) -+ { -+ s += sprintf( s, " fade_compensate=%.2f", p->rc.f_fade_compensate ); - s += sprintf( s, " psy_rd=%.2f:%.2f", p->analyse.f_psy_rd, p->analyse.f_psy_trellis ); -+ } - s += sprintf( s, " mixed_ref=%d", p->analyse.b_mixed_references ); - s += sprintf( s, " me_range=%d", p->analyse.i_me_range ); - s += sprintf( s, " chroma_me=%d", p->analyse.b_chroma_me ); -diff --git a/encoder/encoder.c b/encoder/encoder.c -index b946cddf..9e43ad7c 100644 ---- a/encoder/encoder.c -+++ b/encoder/encoder.c -@@ -1189,10 +1189,15 @@ static int validate_parameters( x264_t *h, int b_open ) - x264_log( h, X264_LOG_WARNING, "--tune %s should be used if attempting to benchmark %s!\n", s, s ); - } - -+ if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_NONE ) -+ h->param.rc.f_fade_compensate += 0.1; -+ if( !h->param.rc.b_mb_tree ) -+ h->param.rc.f_fade_compensate = 0; - if( !h->param.analyse.b_psy ) - { - h->param.analyse.f_psy_rd = 0; - h->param.analyse.f_psy_trellis = 0; -+ h->param.rc.f_fade_compensate = 0; - } - h->param.analyse.f_psy_rd = x264_clip3f( h->param.analyse.f_psy_rd, 0, 10 ); - h->param.analyse.f_psy_trellis = x264_clip3f( h->param.analyse.f_psy_trellis, 0, 10 ); -diff --git a/encoder/slicetype.c b/encoder/slicetype.c -index 0315ba6b..527287a8 100644 ---- a/encoder/slicetype.c -+++ b/encoder/slicetype.c -@@ -459,7 +459,7 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int - else - SET_WEIGHT( weights[plane], 1, minscale, mindenom, minoff ); - -- if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_FAKE && weights[0].weightfn && !plane ) -+ if( weights[0].weightfn && !plane ) - fenc->f_weighted_cost_delta[i_delta_index] = (float)minscore / origscore; - } - -@@ -1031,7 +1031,7 @@ static void macroblock_tree_finish( x264_t *h, x264_frame_t *frame, float averag - int fps_factor = round( CLIP_DURATION(average_duration) / CLIP_DURATION(frame->f_duration) * 256 / MBTREE_PRECISION ); - float weightdelta = 0.0; - if( ref0_distance && frame->f_weighted_cost_delta[ref0_distance-1] > 0 ) -- weightdelta = (1.0 - frame->f_weighted_cost_delta[ref0_distance-1]); -+ weightdelta = (1.0 - frame->f_weighted_cost_delta[ref0_distance-1]) * 10.0f * h->param.rc.f_fade_compensate; - - /* Allow the strength to be adjusted via qcompress, since the two - * concepts are very similar. */ -diff --git a/x264.c b/x264.c -index 4765973a..e06d622d 100644 ---- a/x264.c -+++ b/x264.c -@@ -751,6 +751,8 @@ static void help( x264_param_t *defaults, int longhelp ) - " - 3: Auto-variance AQ with bias to dark scenes\n", defaults->rc.i_aq_mode ); - H1( " --aq-strength Reduces blocking and blurring in flat and\n" - " textured areas. [%.1f]\n", defaults->rc.f_aq_strength ); -+ H1( " --fade-compensate Allocate more bits to fades [%.1f]\n", defaults->rc.f_fade_compensate ); -+ H2( " Approximate sane range: 0.0 - 1.0\n" ); - H1( "\n" ); - H0( " -p, --pass Enable multipass ratecontrol\n" - " - 1: First pass, creates stats file\n" -@@ -1092,6 +1094,7 @@ static struct option long_options[] = - { "no-dct-decimate", no_argument, NULL, 0 }, - { "aq-strength", required_argument, NULL, 0 }, - { "aq-mode", required_argument, NULL, 0 }, -+ { "fade-compensate", required_argument, NULL, 0 }, - { "deadzone-inter", required_argument, NULL, 0 }, - { "deadzone-intra", required_argument, NULL, 0 }, - { "level", required_argument, NULL, 0 }, -diff --git a/x264.h b/x264.h -index d9644b6f..a2aeb769 100644 ---- a/x264.h -+++ b/x264.h -@@ -454,6 +454,7 @@ typedef struct x264_param_t - - int i_aq_mode; /* psy adaptive QP. (X264_AQ_*) */ - float f_aq_strength; -+ float f_fade_compensate; /* Give more bits to fades. */ - int b_mb_tree; /* Macroblock-tree ratecontrol. */ - int i_lookahead; - diff --git a/media-libs/x264/files/x264-0.0.20190903-STRINGS.patch b/media-libs/x264/files/x264-0.0.20190903-STRINGS.patch deleted file mode 100644 index 952fd26..0000000 --- a/media-libs/x264/files/x264-0.0.20190903-STRINGS.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 235ce6130168f4deee55c88ecda5ab84d81d125b Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich -Date: Fri, 5 Jun 2020 19:34:02 +0200 -Subject: [PATCH] configure: allow 'strings' override via STRINGS variable - -This allows building x264 on systems where 'strings' or -'${HOST}-strings' does not exist, but llvm-strings exists. ---- - configure | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/configure -+++ b/configure -@@ -541,6 +541,7 @@ done - - CC="${CC-${cross_prefix}gcc}" - STRIP="${STRIP-${cross_prefix}strip}" -+STRINGS="${STRINGS-${cross_prefix}strings}" - INSTALL="${INSTALL-install}" - PKGCONFIG="${PKGCONFIG-${cross_prefix}pkg-config}" - -@@ -1017,10 +1018,10 @@ CPU_ENDIAN="little-endian" - if [ $compiler = GNU ]; then - echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c - $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed" -- if (${cross_prefix}strings -a conftest.o | grep -q BIGE) && (${cross_prefix}strings -a conftest.o | grep -q FPendian) ; then -+ if (${STRINGS} -a conftest.o | grep -q BIGE) && (${STRINGS} -a conftest.o | grep -q FPendian) ; then - define WORDS_BIGENDIAN - CPU_ENDIAN="big-endian" -- elif !(${cross_prefix}strings -a conftest.o | grep -q EGIB && ${cross_prefix}strings -a conftest.o | grep -q naidnePF) ; then -+ elif !(${STRINGS} -a conftest.o | grep -q EGIB && ${STRINGS} -a conftest.o | grep -q naidnePF) ; then - die "endian test failed" - fi - fi --- -2.27.0 - diff --git a/media-libs/x264/metadata.xml b/media-libs/x264/metadata.xml deleted file mode 100644 index 300583e..0000000 --- a/media-libs/x264/metadata.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - florianbadie@odrling.xyz - - - enable interlaced encoding support, this can decrease encoding speed by up to 2% - Add support for OpenCL. - disable optimized assembly code that is not PIC friendly - - diff --git a/media-libs/x264/x264-9999.ebuild b/media-libs/x264/x264-9999.ebuild deleted file mode 100644 index 0bc7277..0000000 --- a/media-libs/x264/x264-9999.ebuild +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit multilib-minimal toolchain-funcs - -DESCRIPTION="A free library for encoding X264/AVC streams" -HOMEPAGE="https://www.videolan.org/developers/x264.html" -if [[ ${PV} == 9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://code.videolan.org/videolan/x264.git" -else - MY_P="x264-snapshot-$(ver_cut 3)-2245" - SRC_URI="https://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2" - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" - S="${WORKDIR}/${MY_P}" -fi - -SLOT="0/161" # SONAME - -LICENSE="GPL-2" -IUSE="cpu_flags_ppc_altivec +interlaced opencl pic static-libs cpu_flags_x86_sse +threads" - -ASM_DEP=">=dev-lang/nasm-2.13" -DEPEND="abi_x86_32? ( ${ASM_DEP} ) - abi_x86_64? ( ${ASM_DEP} ) - opencl? ( dev-lang/perl )" -RDEPEND="opencl? ( >=virtual/opencl-0-r3[${MULTILIB_USEDEP}] )" - -DOCS=( AUTHORS doc/{ratecontrol,regression_test,standards,threads,vui}.txt ) - -PATCHES=( "${FILESDIR}/fadecomp.patch" ) - -multilib_src_configure() { - tc-export CC - - if [[ ${ABI} == x86 || ${ABI} == amd64 ]]; then - export AS="nasm" - else - export AS="${CC}" - fi - - local asm_conf="" - - if [[ ${ABI} == x86* ]] && { use pic || use !cpu_flags_x86_sse ; } || [[ ${ABI} == "x32" ]] || [[ ${CHOST} == armv5* ]] || [[ ${ABI} == ppc* ]] && { use !cpu_flags_ppc_altivec ; }; then - asm_conf=" --disable-asm" - fi - - "${S}/configure" \ - --prefix="${EPREFIX}"/usr \ - --libdir="${EPREFIX}"/usr/$(get_libdir) \ - --disable-cli \ - --disable-avs \ - --disable-lavf \ - --disable-swscale \ - --disable-ffms \ - --disable-gpac \ - --enable-pic \ - --enable-shared \ - --host="${CHOST}" \ - --cross-prefix="${CHOST}-" \ - $(usex interlaced "" "--disable-interlaced") \ - $(usex opencl "" "--disable-opencl") \ - $(usex static-libs "--enable-static" "") \ - $(usex threads "" "--disable-thread") \ - ${asm_conf} || die -} diff --git a/media-video/x264-encoder/files/enc-time.patch b/media-video/x264-encoder/files/enc-time.patch deleted file mode 100644 index 142fa1f..0000000 --- a/media-video/x264-encoder/files/enc-time.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 49d36068a4bf958b553c62fe6f47ef2d81cbf8f6 Mon Sep 17 00:00:00 2001 -From: DJATOM -Date: Tue, 26 Jan 2021 00:57:07 +0200 -Subject: [PATCH] Improve encoding status view Extend final stats - ---- - x264.c | 33 ++++++++++++++++++++++++++------- - 1 file changed, 26 insertions(+), 7 deletions(-) - -diff --git a/x264.c b/x264.c -index 11dd6c6e..bc2415c3 100644 ---- a/x264.c -+++ b/x264.c -@@ -1932,11 +1932,24 @@ static int encode_frame( x264_t *h, hnd_t hout, x264_picture_t *pic, int64_t *la - - static int64_t print_status( int64_t i_start, int64_t i_previous, int i_frame, int i_frame_total, int64_t i_file, x264_param_t *param, int64_t last_ts ) - { -+ static int print_progress_header = 1; - char buf[200]; - int64_t i_time = x264_mdate(); - if( i_previous && i_time - i_previous < UPDATE_INTERVAL ) - return i_previous; -+ -+ if( print_progress_header ) -+ { -+ if( i_frame_total ) -+ fprintf( stderr, " %6s %13s %5s %8s %9s %9s\n", -+ "", "frames ", "fps ", "kb/s ", "elapsed", "remain " ); -+ else -+ fprintf( stderr, "%6s %5s %8s %9s\n", "frames", "fps ", "kb/s ", "elapsed" ); -+ print_progress_header = 0; -+ } -+ - int64_t i_elapsed = i_time - i_start; -+ int secs = i_elapsed / 1000000; - double fps = i_elapsed > 0 ? i_frame * 1000000. / i_elapsed : 0; - double bitrate; - if( last_ts ) -@@ -1946,12 +1959,13 @@ static int64_t print_status( int64_t i_start, int64_t i_previous, int i_frame, i - if( i_frame_total ) - { - int eta = i_elapsed * (i_frame_total - i_frame) / ((int64_t)i_frame * 1000000); -- sprintf( buf, "x264 [%.1f%%] %d/%d frames, %.2f fps, %.2f kb/s, eta %d:%02d:%02d", -+ sprintf( buf, "x264 [%5.1f%%] %6d/%-6d %5.2f %8.2f %3d:%02d:%02d %3d:%02d:%02d", - 100. * i_frame / i_frame_total, i_frame, i_frame_total, fps, bitrate, -- eta/3600, (eta/60)%60, eta%60 ); -+ secs/3600, (secs/60)%60, secs%60, eta/3600, (eta/60)%60, eta%60 ); - } - else -- sprintf( buf, "x264 %d frames: %.2f fps, %.2f kb/s", i_frame, fps, bitrate ); -+ sprintf( buf, "x264 %6d %5.2f %8.2f %3d:%02d:%02d", -+ i_frame, fps, bitrate, secs/3600, (secs/60)%60, secs%60 ); - fprintf( stderr, "%s \r", buf+5 ); - x264_cli_set_console_title( buf ); - fflush( stderr ); // needed in windows -@@ -2138,8 +2152,11 @@ static int encode( x264_param_t *param, cli_opt_t *opt ) - - i_end = x264_mdate(); - /* Erase progress indicator before printing encoding stats. */ -- if( opt->b_progress ) -- fprintf( stderr, " \r" ); -+ if( opt->b_progress && i_frame_output ) -+ { -+ print_status( i_start, 0, i_frame_output, param->i_frame_total, i_file, param, 2 * last_dts - prev_dts - first_dts ); -+ fprintf( stderr, "\n" ); -+ } - if( h ) - x264_encoder_close( h ); - fprintf( stderr, "\n" ); -@@ -2154,9 +2171,11 @@ static int encode( x264_param_t *param, cli_opt_t *opt ) - { - double fps = (double)i_frame_output * (double)1000000 / - (double)( i_end - i_start ); -+ int secs = (i_end - i_start) / 1000000; - -- x264_cli_printf( X264_LOG_INFO, "encoded %d frames, %.2f fps, %.2f kb/s\n", i_frame_output, fps, -- (double) i_file * 8 / ( 1000 * duration ) ); -+ x264_cli_printf( X264_LOG_INFO, "encoded %d frames, %.2f fps, %.2f kb/s, duration %d:%02d:%02d.%02d\n", i_frame_output, fps, -+ (double) i_file * 8 / ( 1000 * duration ), -+ secs/3600, (secs/60)%60, secs%60, (int)((i_end - i_start)%1000000/10000) ); - } - - return retval; diff --git a/media-video/x264-encoder/files/est-size.patch b/media-video/x264-encoder/files/est-size.patch deleted file mode 100644 index 9580150..0000000 --- a/media-video/x264-encoder/files/est-size.patch +++ /dev/null @@ -1,49 +0,0 @@ -From e920dd0c68231e77c2fbc811abc7eeea6a301fc0 Mon Sep 17 00:00:00 2001 -From: DJATOM -Date: Tue, 26 Jan 2021 00:59:38 +0200 -Subject: [PATCH] Calculate estimated file size - ---- - x264.c | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/x264.c b/x264.c -index bc2415c3..deac5e41 100644 ---- a/x264.c -+++ b/x264.c -@@ -1941,10 +1941,10 @@ static int64_t print_status( int64_t i_start, int64_t i_previous, int i_frame, i - if( print_progress_header ) - { - if( i_frame_total ) -- fprintf( stderr, " %6s %13s %5s %8s %9s %9s\n", -- "", "frames ", "fps ", "kb/s ", "elapsed", "remain " ); -+ fprintf( stderr, " %6s %13s %5s %8s %9s %9s %7s %7s\n", -+ "", "frames ", "fps ", "kb/s ", "elapsed", "remain ", "size", "est.size" ); - else -- fprintf( stderr, "%6s %5s %8s %9s\n", "frames", "fps ", "kb/s ", "elapsed" ); -+ fprintf( stderr, "%6s %5s %8s %9s %7s\n", "frames", "fps ", "kb/s ", "elapsed", "size" ); - print_progress_header = 0; - } - -@@ -1959,13 +1959,17 @@ static int64_t print_status( int64_t i_start, int64_t i_previous, int i_frame, i - if( i_frame_total ) - { - int eta = i_elapsed * (i_frame_total - i_frame) / ((int64_t)i_frame * 1000000); -- sprintf( buf, "x264 [%5.1f%%] %6d/%-6d %5.2f %8.2f %3d:%02d:%02d %3d:%02d:%02d", -+ double estsz = (double) i_file * i_frame_total / (i_frame * 1024.); -+ sprintf( buf, "x264 [%5.1f%%] %6d/%-6d %5.2f %8.2f %3d:%02d:%02d %3d:%02d:%02d %7.2f %1sB %7.2f %1sB", - 100. * i_frame / i_frame_total, i_frame, i_frame_total, fps, bitrate, -- secs/3600, (secs/60)%60, secs%60, eta/3600, (eta/60)%60, eta%60 ); -+ secs/3600, (secs/60)%60, secs%60, eta/3600, (eta/60)%60, eta%60, -+ i_file < 1048576 ? (double) i_file / 1024. : (double) i_file / 1048576., i_file < 1048576 ? "K":"M", -+ estsz < 1024 ? estsz : estsz / 1024, estsz < 1024 ? "K" : "M" ); - } - else -- sprintf( buf, "x264 %6d %5.2f %8.2f %3d:%02d:%02d", -- i_frame, fps, bitrate, secs/3600, (secs/60)%60, secs%60 ); -+ sprintf( buf, "x264 %6d %5.2f %8.2f %3d:%02d:%02d %7.2f %sB", -+ i_frame, fps, bitrate, secs/3600, (secs/60)%60, secs%60, -+ i_file < 1048576 ? (double) i_file / 1024. : (double) i_file / 1048576., i_file < 1048576 ? "K":"M" ); - fprintf( stderr, "%s \r", buf+5 ); - x264_cli_set_console_title( buf ); - fflush( stderr ); // needed in windows diff --git a/media-video/x264-encoder/files/fadecomp.patch b/media-video/x264-encoder/files/fadecomp.patch deleted file mode 100644 index d88a8bd..0000000 --- a/media-video/x264-encoder/files/fadecomp.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff --git a/common/base.c b/common/base.c -index 5b35a2e3..9d572c90 100644 ---- a/common/base.c -+++ b/common/base.c -@@ -1334,6 +1334,8 @@ REALIGN_STACK int x264_param_parse( x264_param_t *p, const char *name, const cha - p->rc.i_aq_mode = atoi(value); - OPT("aq-strength") - p->rc.f_aq_strength = atof(value); -+ OPT("fade-compensate") -+ p->rc.f_fade_compensate = atof(value); - OPT("pass") - { - int pass = x264_clip3( atoi(value), 0, 3 ); -@@ -1442,7 +1444,10 @@ char *x264_param2string( x264_param_t *p, int b_res ) - s += sprintf( s, " subme=%d", p->analyse.i_subpel_refine ); - s += sprintf( s, " psy=%d", p->analyse.b_psy ); - if( p->analyse.b_psy ) -+ { -+ s += sprintf( s, " fade_compensate=%.2f", p->rc.f_fade_compensate ); - s += sprintf( s, " psy_rd=%.2f:%.2f", p->analyse.f_psy_rd, p->analyse.f_psy_trellis ); -+ } - s += sprintf( s, " mixed_ref=%d", p->analyse.b_mixed_references ); - s += sprintf( s, " me_range=%d", p->analyse.i_me_range ); - s += sprintf( s, " chroma_me=%d", p->analyse.b_chroma_me ); -diff --git a/encoder/encoder.c b/encoder/encoder.c -index b946cddf..9e43ad7c 100644 ---- a/encoder/encoder.c -+++ b/encoder/encoder.c -@@ -1189,10 +1189,15 @@ static int validate_parameters( x264_t *h, int b_open ) - x264_log( h, X264_LOG_WARNING, "--tune %s should be used if attempting to benchmark %s!\n", s, s ); - } - -+ if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_NONE ) -+ h->param.rc.f_fade_compensate += 0.1; -+ if( !h->param.rc.b_mb_tree ) -+ h->param.rc.f_fade_compensate = 0; - if( !h->param.analyse.b_psy ) - { - h->param.analyse.f_psy_rd = 0; - h->param.analyse.f_psy_trellis = 0; -+ h->param.rc.f_fade_compensate = 0; - } - h->param.analyse.f_psy_rd = x264_clip3f( h->param.analyse.f_psy_rd, 0, 10 ); - h->param.analyse.f_psy_trellis = x264_clip3f( h->param.analyse.f_psy_trellis, 0, 10 ); -diff --git a/encoder/slicetype.c b/encoder/slicetype.c -index 0315ba6b..527287a8 100644 ---- a/encoder/slicetype.c -+++ b/encoder/slicetype.c -@@ -459,7 +459,7 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int - else - SET_WEIGHT( weights[plane], 1, minscale, mindenom, minoff ); - -- if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_FAKE && weights[0].weightfn && !plane ) -+ if( weights[0].weightfn && !plane ) - fenc->f_weighted_cost_delta[i_delta_index] = (float)minscore / origscore; - } - -@@ -1031,7 +1031,7 @@ static void macroblock_tree_finish( x264_t *h, x264_frame_t *frame, float averag - int fps_factor = round( CLIP_DURATION(average_duration) / CLIP_DURATION(frame->f_duration) * 256 / MBTREE_PRECISION ); - float weightdelta = 0.0; - if( ref0_distance && frame->f_weighted_cost_delta[ref0_distance-1] > 0 ) -- weightdelta = (1.0 - frame->f_weighted_cost_delta[ref0_distance-1]); -+ weightdelta = (1.0 - frame->f_weighted_cost_delta[ref0_distance-1]) * 10.0f * h->param.rc.f_fade_compensate; - - /* Allow the strength to be adjusted via qcompress, since the two - * concepts are very similar. */ -diff --git a/x264.c b/x264.c -index 4765973a..e06d622d 100644 ---- a/x264.c -+++ b/x264.c -@@ -751,6 +751,8 @@ static void help( x264_param_t *defaults, int longhelp ) - " - 3: Auto-variance AQ with bias to dark scenes\n", defaults->rc.i_aq_mode ); - H1( " --aq-strength Reduces blocking and blurring in flat and\n" - " textured areas. [%.1f]\n", defaults->rc.f_aq_strength ); -+ H1( " --fade-compensate Allocate more bits to fades [%.1f]\n", defaults->rc.f_fade_compensate ); -+ H2( " Approximate sane range: 0.0 - 1.0\n" ); - H1( "\n" ); - H0( " -p, --pass Enable multipass ratecontrol\n" - " - 1: First pass, creates stats file\n" -@@ -1092,6 +1094,7 @@ static struct option long_options[] = - { "no-dct-decimate", no_argument, NULL, 0 }, - { "aq-strength", required_argument, NULL, 0 }, - { "aq-mode", required_argument, NULL, 0 }, -+ { "fade-compensate", required_argument, NULL, 0 }, - { "deadzone-inter", required_argument, NULL, 0 }, - { "deadzone-intra", required_argument, NULL, 0 }, - { "level", required_argument, NULL, 0 }, -diff --git a/x264.h b/x264.h -index d9644b6f..a2aeb769 100644 ---- a/x264.h -+++ b/x264.h -@@ -454,6 +454,7 @@ typedef struct x264_param_t - - int i_aq_mode; /* psy adaptive QP. (X264_AQ_*) */ - float f_aq_strength; -+ float f_fade_compensate; /* Give more bits to fades. */ - int b_mb_tree; /* Macroblock-tree ratecontrol. */ - int i_lookahead; - diff --git a/media-video/x264-encoder/metadata.xml b/media-video/x264-encoder/metadata.xml deleted file mode 100644 index fe7bd1c..0000000 --- a/media-video/x264-encoder/metadata.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - florianbadie@odrling.xyz - - - enable AvxSynth support in the AviSynth input module - Enable ffmpegsource aka ffms support, disables lavf - Enable interlaced encoding support, this can decrease encoding speed by up to 2% - - diff --git a/media-video/x264-encoder/x264-encoder-9999.ebuild b/media-video/x264-encoder/x264-encoder-9999.ebuild deleted file mode 100644 index fdfe98c..0000000 --- a/media-video/x264-encoder/x264-encoder-9999.ebuild +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit flag-o-matic toolchain-funcs - -DESCRIPTION="A free commandline encoder for X264/AVC streams" -HOMEPAGE="https://www.videolan.org/developers/x264.html" -if [[ ${PV} == 9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://code.videolan.org/videolan/x264.git" - SRC_URI="" -else - MY_P="x264-snapshot-$(ver_cut 3)-2245" - SRC_URI="http://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2" - KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86" - S="${WORKDIR}/${MY_P}" -fi - -LICENSE="GPL-2" -SLOT="0" -IUSE="avs custom-cflags ffmpeg ffmpegsource +interlaced mp4 +threads" - -REQUIRED_USE="ffmpegsource? ( ffmpeg )" - -RDEPEND=" - ~media-libs/x264-${PV}[interlaced=,threads=] - ffmpeg? ( media-video/ffmpeg:= ) - ffmpegsource? ( media-libs/ffmpegsource ) - mp4? ( >=media-video/gpac-0.5.2:= )" - -ASM_DEP=">=dev-lang/nasm-2.13" -DEPEND="${RDEPEND} - amd64? ( ${ASM_DEP} ) - x86? ( ${ASM_DEP} ) " -BDEPEND="virtual/pkgconfig" - -PATCHES=( "${FILESDIR}/fadecomp.patch" ) - -src_prepare() { - default - - sed -i 's/-lgpac_static/-lgpac/' configure -} - -src_configure() { - tc-export CC - - if [[ ${ABI} == x86 || ${ABI} == amd64 ]]; then - export AS="nasm" - else - export AS="${CC}" - fi - - # let upstream pick the optimization level by default - use custom-cflags || filter-flags -O? - - ./configure \ - --prefix="${EPREFIX}"/usr \ - --libdir="${EPREFIX}"/usr/$(get_libdir) \ - --system-libx264 \ - --host="${CHOST}" \ - --disable-lsmash \ - $(usex avs "" "--disable-avs") \ - $(usex ffmpeg "" "--disable-lavf --disable-swscale") \ - $(usex ffmpegsource "" "--disable-ffms") \ - $(usex interlaced "" "--disable-interlaced") \ - $(usex mp4 "" "--disable-gpac") \ - $(usex threads "" "--disable-thread") || die - - # this is a nasty workaround for bug #376925 for x264 that also applies - # here, needed because as upstream doesn't like us fiddling with their CFLAGS - if use custom-cflags; then - local cflags - cflags="$(grep "^CFLAGS=" config.mak | sed 's/CFLAGS=//')" - cflags="${cflags//$(get-flag O)/}" - cflags="${cflags//-O? /$(get-flag O) }" - cflags="${cflags//-g /}" - sed -i "s:^CFLAGS=.*:CFLAGS=${cflags//:/\\:}:" config.mak - fi -}