Skip to content

Commit

Permalink
Merge branch 'master' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavriloaie Eugen-Andrei committed Dec 16, 2018
2 parents de9471b + 8964f76 commit 9636e7c
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 3 deletions.
4 changes: 4 additions & 0 deletions common/osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ int x264_vsnprintf( char *s, size_t n, const char *fmt, va_list arg );
#include <strings.h>
#endif

#ifdef __linux__
#include <sys/prctl.h>
#endif

#if !defined(va_copy) && defined(__INTEL_COMPILER)
#define va_copy(dst, src) ((dst) = (src))
#endif
Expand Down
12 changes: 12 additions & 0 deletions debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#/bin/sh

set -e

./configure \
--prefix=/Users/shiretu/work/evostream/builders/cmake/external_libs/libav \
--disable-cli \
--enable-static \
--extra-cflags="-mmacosx-version-min=10.11 -g"

make -j32 install

52 changes: 49 additions & 3 deletions encoder/encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,10 @@ static void set_aspect_ratio( x264_t *h, x264_param_t *param, int initial )
****************************************************************************/
x264_t *x264_encoder_open( x264_param_t *param )
{
//#define PRINT_DELAY_COMPUTATIONS
#ifdef PRINT_DELAY_COMPUTATIONS
int oldDelay = 0;
#endif /* PRINT_DELAY_COMPUTATIONS */
x264_t *h;
char buf[1000], *p;
int i_slicetype_length;
Expand Down Expand Up @@ -1531,16 +1535,58 @@ x264_t *x264_encoder_open( x264_param_t *param )
h->mb.b_adaptive_mbaff = PARAM_INTERLACED && h->param.analyse.i_subpel_refine;

/* Init frames. */
if( h->param.i_bframe_adaptive == X264_B_ADAPT_TRELLIS && !h->param.rc.b_stat_read )
if( h->param.i_bframe_adaptive == X264_B_ADAPT_TRELLIS && !h->param.rc.b_stat_read ) {
#ifdef PRINT_DELAY_COMPUTATIONS
oldDelay=h->frames.i_delay;
#endif /* PRINT_DELAY_COMPUTATIONS */
h->frames.i_delay = X264_MAX(h->param.i_bframe,3)*4;
else
#ifdef PRINT_DELAY_COMPUTATIONS
fprintf(stderr,"%s:%d - i_delay: %d -> %d\n",__FILE__,__LINE__,oldDelay,h->frames.i_delay);
#endif /* PRINT_DELAY_COMPUTATIONS */
} else {
#ifdef PRINT_DELAY_COMPUTATIONS
oldDelay=h->frames.i_delay;
#endif /* PRINT_DELAY_COMPUTATIONS */
h->frames.i_delay = h->param.i_bframe;
if( h->param.rc.b_mb_tree || h->param.rc.i_vbv_buffer_size )
#ifdef PRINT_DELAY_COMPUTATIONS
fprintf(stderr,"%s:%d - i_bframe: %d; i_delay: %d -> %d\n",__FILE__,__LINE__,h->param.i_bframe,oldDelay,h->frames.i_delay);
#endif /* PRINT_DELAY_COMPUTATIONS */
}
if( h->param.rc.b_mb_tree || h->param.rc.i_vbv_buffer_size ) {
#ifdef PRINT_DELAY_COMPUTATIONS
oldDelay=h->frames.i_delay;
#endif /* PRINT_DELAY_COMPUTATIONS */
h->frames.i_delay = X264_MAX( h->frames.i_delay, h->param.rc.i_lookahead );
#ifdef PRINT_DELAY_COMPUTATIONS
fprintf(stderr,"%s:%d - i_delay: %d -> %d\n",__FILE__,__LINE__,oldDelay,h->frames.i_delay); //encoder/encoder.c:1512 - i_delay: 0 -> 60
#endif /* PRINT_DELAY_COMPUTATIONS */
}
i_slicetype_length = h->frames.i_delay;

#ifdef PRINT_DELAY_COMPUTATIONS
oldDelay=h->frames.i_delay;
#endif /* PRINT_DELAY_COMPUTATIONS */
h->frames.i_delay += h->i_thread_frames - 1;
#ifdef PRINT_DELAY_COMPUTATIONS
fprintf(stderr,"%s:%d - i_delay: %d -> %d\n",__FILE__,__LINE__,oldDelay,h->frames.i_delay); //encoder/encoder.c:1518 - i_delay: 60 -> 70
#endif /* PRINT_DELAY_COMPUTATIONS */

#ifdef PRINT_DELAY_COMPUTATIONS
oldDelay=h->frames.i_delay;
#endif /* PRINT_DELAY_COMPUTATIONS */
h->frames.i_delay += h->param.i_sync_lookahead;
#ifdef PRINT_DELAY_COMPUTATIONS
fprintf(stderr,"%s:%d - i_delay: %d -> %d\n",__FILE__,__LINE__,oldDelay,h->frames.i_delay); //encoder/encoder.c:1522 - i_delay: 70 -> 71
#endif /* PRINT_DELAY_COMPUTATIONS */

#ifdef PRINT_DELAY_COMPUTATIONS
oldDelay=h->frames.i_delay;
#endif /* PRINT_DELAY_COMPUTATIONS */
h->frames.i_delay += h->param.b_vfr_input;
#ifdef PRINT_DELAY_COMPUTATIONS
fprintf(stderr,"%s:%d - i_delay: %d -> %d\n",__FILE__,__LINE__,oldDelay,h->frames.i_delay); //encoder/encoder.c:1526 - i_delay: 71 -> 72
#endif /* PRINT_DELAY_COMPUTATIONS */

h->frames.i_bframe_delay = h->param.i_bframe ? (h->param.i_bframe_pyramid ? 2 : 1) : 0;

h->frames.i_max_ref0 = h->param.i_frame_reference;
Expand Down
13 changes: 13 additions & 0 deletions install_everything.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

#!/bin/sh

set -e


./configure \
--prefix=${LOCAL_PREFIX} \
--enable-cli \
--enable-static

make -j32 install

0 comments on commit 9636e7c

Please sign in to comment.