Projects
Essentials
libx264
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
libx264.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Sun Mar 1 09:33:42 UTC 2015 - i@margueirte.su + +- update version 20141218 + +------------------------------------------------------------------- Wed Nov 5 12:33:30 UTC 2014 - i@margueirte.su - update version 20141104
View file
libx264.spec
Changed
@@ -1,7 +1,7 @@ # # spec file for package libx264 # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ %define soname 142 -%define svn 20141104 +%define svn 20141218 Name: libx264 Version: 0.%{soname}svn%{svn} Release: 0
View file
x264-use-shared-library.patch
Changed
@@ -1,17 +1,17 @@ -Index: x264-snapshot-20130723-2245/Makefile +Index: x264-snapshot-20141218-2245/Makefile =================================================================== ---- x264-snapshot-20130723-2245.orig/Makefile -+++ x264-snapshot-20130723-2245/Makefile -@@ -171,6 +171,7 @@ $(LIBX264): $(GENERATED) .depend $(OBJS) +--- x264-snapshot-20141218-2245.orig/Makefile ++++ x264-snapshot-20141218-2245/Makefile +@@ -176,6 +176,7 @@ $(LIBX264): $(GENERATED) .depend $(OBJS) $(SONAME): $(GENERATED) .depend $(OBJS) $(OBJASM) $(OBJSO) $(LD)$@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS) + ln -s $(SONAME) libx264.so ifneq ($(EXE),) - .PHONY: x264 checkasm -@@ -178,8 +179,8 @@ x264: x264$(EXE) - checkasm: checkasm$(EXE) + .PHONY: x264 checkasm example +@@ -184,8 +185,8 @@ checkasm: checkasm$(EXE) + example: example$(EXE) endif -x264$(EXE): $(GENERATED) .depend $(OBJCLI) $(CLI_LIBX264)
View file
x264-snapshot-20141104-2245.tar.bz2/Makefile -> x264-snapshot-20141218-2245.tar.bz2/Makefile
Changed
@@ -36,6 +36,8 @@ OBJCHK = tools/checkasm.o +OBJEXAMPLE = example.o + CONFIG := $(shell cat config.h) # GPL-only files @@ -176,9 +178,10 @@ $(LD)$@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS) ifneq ($(EXE),) -.PHONY: x264 checkasm +.PHONY: x264 checkasm example x264: x264$(EXE) checkasm: checkasm$(EXE) +example: example$(EXE) endif x264$(EXE): $(GENERATED) .depend $(OBJCLI) $(CLI_LIBX264) @@ -187,7 +190,10 @@ checkasm$(EXE): $(GENERATED) .depend $(OBJCHK) $(LIBX264) $(LD)$@ $(OBJCHK) $(LIBX264) $(LDFLAGS) -$(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK): .depend +example$(EXE): $(GENERATED) .depend $(OBJEXAMPLE) $(LIBX264) + $(LD)$@ $(OBJEXAMPLE) $(LIBX264) $(LDFLAGS) + +$(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK) $(OBJEXAMPLE): .depend %.o: %.asm common/x86/x86inc.asm common/x86/x86util.asm $(AS) $(ASFLAGS) -o $@ $< @@ -254,6 +260,7 @@ clean: rm -f $(OBJS) $(OBJASM) $(OBJCLI) $(OBJSO) $(SONAME) *.a *.lib *.exp *.pdb x264 x264.exe .depend TAGS rm -f checkasm checkasm.exe $(OBJCHK) $(GENERATED) x264_lookahead.clbin + rm -f example example.exe $(OBJEXAMPLE) rm -f $(SRC2:%.c=%.gcda) $(SRC2:%.c=%.gcno) *.dyn pgopti.dpi pgopti.dpi.lock *.pgd *.pgc distclean: clean
View file
x264-snapshot-20141104-2245.tar.bz2/common/common.c -> x264-snapshot-20141218-2245.tar.bz2/common/common.c
Changed
@@ -517,7 +517,7 @@ static int parse_enum( const char *arg, const char * const *names, int *dst ) { for( int i = 0; names[i]; i++ ) - if( !strcmp( arg, names[i] ) ) + if( !strcasecmp( arg, names[i] ) ) { *dst = i; return 0; @@ -540,12 +540,12 @@ static int x264_atobool( const char *str, int *b_error ) { if( !strcmp(str, "1") || - !strcmp(str, "true") || - !strcmp(str, "yes") ) + !strcasecmp(str, "true") || + !strcasecmp(str, "yes") ) return 1; if( !strcmp(str, "0") || - !strcmp(str, "false") || - !strcmp(str, "no") ) + !strcasecmp(str, "false") || + !strcasecmp(str, "no") ) return 0; *b_error = 1; return 0; @@ -614,7 +614,7 @@ OPT("asm") { p->cpu = isdigit(value[0]) ? atoi(value) : - !strcmp(value, "auto") || atobool(value) ? x264_cpu_detect() : 0; + !strcasecmp(value, "auto") || atobool(value) ? x264_cpu_detect() : 0; if( b_error ) { char *buf = strdup(value); @@ -635,14 +635,14 @@ } OPT("threads") { - if( !strcmp(value, "auto") ) + if( !strcasecmp(value, "auto") ) p->i_threads = X264_THREADS_AUTO; else p->i_threads = atoi(value); } OPT("lookahead-threads") { - if( !strcmp(value, "auto") ) + if( !strcasecmp(value, "auto") ) p->i_lookahead_threads = X264_THREADS_AUTO; else p->i_lookahead_threads = atoi(value); @@ -651,7 +651,7 @@ p->b_sliced_threads = atobool(value); OPT("sync-lookahead") { - if( !strcmp(value, "auto") ) + if( !strcasecmp(value, "auto") ) p->i_sync_lookahead = X264_SYNC_LOOKAHEAD_AUTO; else p->i_sync_lookahead = atoi(value);
View file
x264-snapshot-20141104-2245.tar.bz2/common/dct.c -> x264-snapshot-20141218-2245.tar.bz2/common/dct.c
Changed
@@ -611,7 +611,6 @@ { dctf->sub4x4_dct = x264_sub4x4_dct_mmx; dctf->add4x4_idct = x264_add4x4_idct_mmx; - dctf->dct4x4dc = x264_dct4x4dc_mmx; dctf->idct4x4dc = x264_idct4x4dc_mmx; dctf->sub8x8_dct_dc = x264_sub8x8_dct_dc_mmx2; @@ -630,6 +629,7 @@ if( cpu&X264_CPU_MMX2 ) { + dctf->dct4x4dc = x264_dct4x4dc_mmx2; dctf->add8x8_idct_dc = x264_add8x8_idct_dc_mmx2; dctf->add16x16_idct_dc = x264_add16x16_idct_dc_mmx2; }
View file
x264-snapshot-20141104-2245.tar.bz2/common/osdep.h -> x264-snapshot-20141218-2245.tar.bz2/common/osdep.h
Changed
@@ -142,8 +142,6 @@ #define ALIGNED_ARRAY_N ALIGNED_ARRAY_16 #endif -#define UNINIT(x) x=x - #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) #define UNUSED __attribute__((unused)) #define ALWAYS_INLINE __attribute__((always_inline)) inline
View file
x264-snapshot-20141104-2245.tar.bz2/common/pixel.c -> x264-snapshot-20141218-2245.tar.bz2/common/pixel.c
Changed
@@ -1040,6 +1040,7 @@ INIT2_NAME( sad_aligned, sad, _avx2 ); INIT2( sad_x3, _avx2 ); INIT2( sad_x4, _avx2 ); + pixf->var[PIXEL_16x16] = x264_pixel_var_16x16_avx2; pixf->vsad = x264_pixel_vsad_avx2; pixf->ssd_nv12_core = x264_pixel_ssd_nv12_core_avx2; pixf->intra_sad_x3_8x8 = x264_intra_sad_x3_8x8_avx2;
View file
x264-snapshot-20141104-2245.tar.bz2/common/quant.c -> x264-snapshot-20141218-2245.tar.bz2/common/quant.c
Changed
@@ -558,8 +558,6 @@ if( cpu&X264_CPU_MMX ) { #if ARCH_X86 - pf->quant_4x4 = x264_quant_4x4_mmx; - pf->quant_8x8 = x264_quant_8x8_mmx; pf->dequant_4x4 = x264_dequant_4x4_mmx; pf->dequant_4x4_dc = x264_dequant_4x4dc_mmx2; pf->dequant_8x8 = x264_dequant_8x8_mmx; @@ -576,6 +574,8 @@ { pf->quant_2x2_dc = x264_quant_2x2_dc_mmx2; #if ARCH_X86 + pf->quant_4x4 = x264_quant_4x4_mmx2; + pf->quant_8x8 = x264_quant_8x8_mmx2; pf->quant_4x4_dc = x264_quant_4x4_dc_mmx2; pf->decimate_score15 = x264_decimate_score15_mmx2; pf->decimate_score16 = x264_decimate_score16_mmx2;
View file
x264-snapshot-20141104-2245.tar.bz2/common/x86/dct-a.asm -> x264-snapshot-20141218-2245.tar.bz2/common/x86/dct-a.asm
Changed
@@ -143,7 +143,7 @@ DCT4x4_DC %else -INIT_MMX mmx +INIT_MMX mmx2 cglobal dct4x4dc, 1,1 movq m3, [r0+24] movq m2, [r0+16]
View file
x264-snapshot-20141104-2245.tar.bz2/common/x86/dct.h -> x264-snapshot-20141218-2245.tar.bz2/common/x86/dct.h
Changed
@@ -70,7 +70,7 @@ void x264_add16x16_idct_dc_avx ( pixel *p_dst, dctcoef dct [16] ); void x264_add16x16_idct_dc_avx2 ( uint8_t *p_dst, int16_t dct [16] ); -void x264_dct4x4dc_mmx ( int16_t d[16] ); +void x264_dct4x4dc_mmx2 ( int16_t d[16] ); void x264_dct4x4dc_sse2 ( int32_t d[16] ); void x264_dct4x4dc_avx ( int32_t d[16] ); void x264_idct4x4dc_mmx ( int16_t d[16] );
View file
x264-snapshot-20141104-2245.tar.bz2/common/x86/pixel-a.asm -> x264-snapshot-20141218-2245.tar.bz2/common/x86/pixel-a.asm
Changed
@@ -727,15 +727,11 @@ %endmacro %macro VAR_END 2 -%if HIGH_BIT_DEPTH -%if mmsize == 8 && %1*%2 == 256 +%if HIGH_BIT_DEPTH && mmsize == 8 && %1*%2 == 256 HADDUW m5, m2 %else HADDW m5, m2 %endif -%else ; !HIGH_BIT_DEPTH - HADDW m5, m2 -%endif ; HIGH_BIT_DEPTH HADDD m6, m1 %if ARCH_X86_64 punpckldq m5, m6 @@ -772,20 +768,17 @@ mova m4, [r0+%1+mmsize] %else ; !HIGH_BIT_DEPTH mova m0, [r0] - punpckhbw m1, m0, m7 mova m3, [r0+%1] - mova m4, m3 + punpckhbw m1, m0, m7 punpcklbw m0, m7 + punpckhbw m4, m3, m7 + punpcklbw m3, m7 %endif ; HIGH_BIT_DEPTH %ifidn %1, r1 lea r0, [r0+%1*2] %else add r0, r1 %endif -%if HIGH_BIT_DEPTH == 0 - punpcklbw m3, m7 - punpckhbw m4, m7 -%endif ; !HIGH_BIT_DEPTH VAR_CORE dec r2d jg .loop @@ -900,17 +893,26 @@ VAR INIT_XMM xop VAR +%endif ; !HIGH_BIT_DEPTH INIT_YMM avx2 cglobal pixel_var_16x16, 2,4,7 + FIX_STRIDES r1 VAR_START 0 mov r2d, 4 lea r3, [r1*3] .loop: +%if HIGH_BIT_DEPTH + mova m0, [r0] + mova m3, [r0+r1] + mova m1, [r0+r1*2] + mova m4, [r0+r3] +%else pmovzxbw m0, [r0] pmovzxbw m3, [r0+r1] pmovzxbw m1, [r0+r1*2] pmovzxbw m4, [r0+r3] +%endif lea r0, [r0+r1*4] VAR_CORE dec r2d @@ -929,7 +931,6 @@ movd edx, xm6 %endif RET -%endif ; !HIGH_BIT_DEPTH %macro VAR2_END 3 HADDW %2, xm1 @@ -1600,7 +1601,7 @@ %macro SATDS_SSE2 0 %define vertical ((notcpuflag(ssse3) || cpuflag(atom)) || HIGH_BIT_DEPTH) -%if vertical==0 || HIGH_BIT_DEPTH +%if cpuflag(ssse3) && (vertical==0 || HIGH_BIT_DEPTH) cglobal pixel_satd_4x4, 4, 6, 6 SATD_START_MMX mova m4, [hmul_4p]
View file
x264-snapshot-20141104-2245.tar.bz2/common/x86/predict-c.c -> x264-snapshot-20141218-2245.tar.bz2/common/x86/predict-c.c
Changed
@@ -65,12 +65,17 @@ H += i * ( src[j+i - FDEC_STRIDE ] - src[j-i - FDEC_STRIDE ] );\ V += i * ( src[(j+i)*FDEC_STRIDE -1] - src[(j-i)*FDEC_STRIDE -1] ); +#if HAVE_X86_INLINE_ASM +#if HIGH_BIT_DEPTH ALIGNED_16( static const int16_t pw_12345678[8] ) = {1,2,3,4,5,6,7,8}; ALIGNED_16( static const int16_t pw_m87654321[8] ) = {-8,-7,-6,-5,-4,-3,-2,-1}; ALIGNED_16( static const int16_t pw_m32101234[8] ) = {-3,-2,-1,0,1,2,3,4}; +#else // !HIGH_BIT_DEPTH ALIGNED_8( static const int8_t pb_12345678[8] ) = {1,2,3,4,5,6,7,8}; ALIGNED_8( static const int8_t pb_m87654321[8] ) = {-8,-7,-6,-5,-4,-3,-2,-1}; ALIGNED_8( static const int8_t pb_m32101234[8] ) = {-3,-2,-1,0,1,2,3,4}; +#endif // HIGH_BIT_DEPTH +#endif // HAVE_X86_INLINE_ASM #define PREDICT_16x16_P_CORE\ int H = 0;\
View file
x264-snapshot-20141104-2245.tar.bz2/common/x86/quant-a.asm -> x264-snapshot-20141218-2245.tar.bz2/common/x86/quant-a.asm
Changed
@@ -453,7 +453,7 @@ QUANT_DC quant_2x2_dc, 1 %if ARCH_X86_64 == 0 ; not needed because sse2 is faster QUANT_DC quant_4x4_dc, 4 -INIT_MMX mmx +INIT_MMX mmx2 QUANT_AC quant_4x4, 4 QUANT_AC quant_8x8, 16 %endif
View file
x264-snapshot-20141104-2245.tar.bz2/common/x86/quant.h -> x264-snapshot-20141218-2245.tar.bz2/common/x86/quant.h
Changed
@@ -30,8 +30,8 @@ int x264_quant_2x2_dc_mmx2( dctcoef dct[4], int mf, int bias ); int x264_quant_4x4_dc_mmx2( dctcoef dct[16], int mf, int bias ); -int x264_quant_4x4_mmx( dctcoef dct[16], udctcoef mf[16], udctcoef bias[16] ); -int x264_quant_8x8_mmx( dctcoef dct[64], udctcoef mf[64], udctcoef bias[64] ); +int x264_quant_4x4_mmx2( dctcoef dct[16], udctcoef mf[16], udctcoef bias[16] ); +int x264_quant_8x8_mmx2( dctcoef dct[64], udctcoef mf[64], udctcoef bias[64] ); int x264_quant_2x2_dc_sse2( dctcoef dct[16], int mf, int bias ); int x264_quant_4x4_dc_sse2( dctcoef dct[16], int mf, int bias ); int x264_quant_4x4_sse2( dctcoef dct[16], udctcoef mf[16], udctcoef bias[16] );
View file
x264-snapshot-20141104-2245.tar.bz2/common/x86/x86inc.asm -> x264-snapshot-20141218-2245.tar.bz2/common/x86/x86inc.asm
Changed
@@ -1044,15 +1044,16 @@ %endmacro ;%1 == instruction -;%2 == 1 if float, 0 if int -;%3 == 1 if non-destructive or 4-operand (xmm, xmm, xmm, imm), 0 otherwise -;%4 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not -;%5+: operands -%macro RUN_AVX_INSTR 5-8+ - %ifnum sizeof%6 +;%2 == minimal instruction set +;%3 == 1 if float, 0 if int +;%4 == 1 if non-destructive or 4-operand (xmm, xmm, xmm, imm), 0 otherwise +;%5 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not +;%6+: operands +%macro RUN_AVX_INSTR 6-9+ + %ifnum sizeof%7 + %assign __sizeofreg sizeof%7 + %elifnum sizeof%6 %assign __sizeofreg sizeof%6 - %elifnum sizeof%5 - %assign __sizeofreg sizeof%5 %else %assign __sizeofreg mmsize %endif @@ -1061,325 +1062,333 @@ %xdefine __instr v%1 %else %xdefine __instr %1 - %if %0 >= 7+%3 + %if %0 >= 8+%4 %assign __emulate_avx 1 %endif %endif + %ifnidn %2, fnord + %ifdef cpuname + %if notcpuflag(%2) + %error use of ``%1'' %2 instruction in cpuname function: current_function + %endif + %endif + %endif %if __emulate_avx - %xdefine __src1 %6 - %xdefine __src2 %7 - %ifnidn %5, %6 - %if %0 >= 8 - CHECK_AVX_INSTR_EMU {%1 %5, %6, %7, %8}, %5, %7, %8 + %xdefine __src1 %7 + %xdefine __src2 %8 + %ifnidn %6, %7 + %if %0 >= 9 + CHECK_AVX_INSTR_EMU {%1 %6, %7, %8, %9}, %6, %8, %9 %else - CHECK_AVX_INSTR_EMU {%1 %5, %6, %7}, %5, %7 + CHECK_AVX_INSTR_EMU {%1 %6, %7, %8}, %6, %8 %endif - %if %4 && %3 == 0 - %ifnid %7 + %if %5 && %4 == 0 + %ifnid %8 ; 3-operand AVX instructions with a memory arg can only have it in src2, ; whereas SSE emulation prefers to have it in src1 (i.e. the mov). ; So, if the instruction is commutative with a memory arg, swap them. - %xdefine __src1 %7 - %xdefine __src2 %6 + %xdefine __src1 %8 + %xdefine __src2 %7 %endif %endif %if __sizeofreg == 8 - MOVQ %5, __src1 - %elif %2 - MOVAPS %5, __src1 + MOVQ %6, __src1 + %elif %3 + MOVAPS %6, __src1 %else - MOVDQA %5, __src1 + MOVDQA %6, __src1 %endif %endif - %if %0 >= 8 - %1 %5, __src2, %8 + %if %0 >= 9 + %1 %6, __src2, %9 %else - %1 %5, __src2 + %1 %6, __src2 %endif - %elif %0 >= 8 - __instr %5, %6, %7, %8 + %elif %0 >= 9 + __instr %6, %7, %8, %9 + %elif %0 == 8 + __instr %6, %7, %8 %elif %0 == 7 - __instr %5, %6, %7 - %elif %0 == 6 - __instr %5, %6 + __instr %6, %7 %else - __instr %5 + __instr %6 %endif %endmacro ;%1 == instruction -;%2 == 1 if float, 0 if int -;%3 == 1 if non-destructive or 4-operand (xmm, xmm, xmm, imm), 0 otherwise -;%4 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not -%macro AVX_INSTR 1-4 0, 1, 0 - %macro %1 1-9 fnord, fnord, fnord, fnord, %1, %2, %3, %4 +;%2 == minimal instruction set +;%3 == 1 if float, 0 if int +;%4 == 1 if non-destructive or 4-operand (xmm, xmm, xmm, imm), 0 otherwise +;%5 == 1 if commutative (i.e. doesn't matter which src arg is which), 0 if not +%macro AVX_INSTR 1-5 fnord, 0, 1, 0 + %macro %1 1-10 fnord, fnord, fnord, fnord, %1, %2, %3, %4, %5 %ifidn %2, fnord - RUN_AVX_INSTR %6, %7, %8, %9, %1 + RUN_AVX_INSTR %6, %7, %8, %9, %10, %1 %elifidn %3, fnord - RUN_AVX_INSTR %6, %7, %8, %9, %1, %2 + RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2 %elifidn %4, fnord - RUN_AVX_INSTR %6, %7, %8, %9, %1, %2, %3 + RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2, %3 %elifidn %5, fnord - RUN_AVX_INSTR %6, %7, %8, %9, %1, %2, %3, %4 + RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2, %3, %4 %else - RUN_AVX_INSTR %6, %7, %8, %9, %1, %2, %3, %4, %5 + RUN_AVX_INSTR %6, %7, %8, %9, %10, %1, %2, %3, %4, %5 %endif %endmacro %endmacro ; Instructions with both VEX and non-VEX encodings ; Non-destructive instructions are written without parameters -AVX_INSTR addpd, 1, 0, 1 -AVX_INSTR addps, 1, 0, 1 -AVX_INSTR addsd, 1, 0, 1 -AVX_INSTR addss, 1, 0, 1 -AVX_INSTR addsubpd, 1, 0, 0 -AVX_INSTR addsubps, 1, 0, 0 -AVX_INSTR aesdec, 0, 0, 0 -AVX_INSTR aesdeclast, 0, 0, 0 -AVX_INSTR aesenc, 0, 0, 0 -AVX_INSTR aesenclast, 0, 0, 0 +AVX_INSTR addpd, sse2, 1, 0, 1 +AVX_INSTR addps, sse, 1, 0, 1 +AVX_INSTR addsd, sse2, 1, 0, 1 +AVX_INSTR addss, sse, 1, 0, 1 +AVX_INSTR addsubpd, sse3, 1, 0, 0 +AVX_INSTR addsubps, sse3, 1, 0, 0 +AVX_INSTR aesdec, fnord, 0, 0, 0 +AVX_INSTR aesdeclast, fnord, 0, 0, 0 +AVX_INSTR aesenc, fnord, 0, 0, 0 +AVX_INSTR aesenclast, fnord, 0, 0, 0 AVX_INSTR aesimc AVX_INSTR aeskeygenassist -AVX_INSTR andnpd, 1, 0, 0 -AVX_INSTR andnps, 1, 0, 0 -AVX_INSTR andpd, 1, 0, 1 -AVX_INSTR andps, 1, 0, 1 -AVX_INSTR blendpd, 1, 0, 0 -AVX_INSTR blendps, 1, 0, 0 -AVX_INSTR blendvpd, 1, 0, 0 -AVX_INSTR blendvps, 1, 0, 0 -AVX_INSTR cmppd, 1, 1, 0 -AVX_INSTR cmpps, 1, 1, 0 -AVX_INSTR cmpsd, 1, 1, 0 -AVX_INSTR cmpss, 1, 1, 0 -AVX_INSTR comisd -AVX_INSTR comiss -AVX_INSTR cvtdq2pd -AVX_INSTR cvtdq2ps -AVX_INSTR cvtpd2dq -AVX_INSTR cvtpd2ps -AVX_INSTR cvtps2dq -AVX_INSTR cvtps2pd -AVX_INSTR cvtsd2si -AVX_INSTR cvtsd2ss -AVX_INSTR cvtsi2sd -AVX_INSTR cvtsi2ss -AVX_INSTR cvtss2sd -AVX_INSTR cvtss2si -AVX_INSTR cvttpd2dq -AVX_INSTR cvttps2dq -AVX_INSTR cvttsd2si -AVX_INSTR cvttss2si -AVX_INSTR divpd, 1, 0, 0 -AVX_INSTR divps, 1, 0, 0 -AVX_INSTR divsd, 1, 0, 0 -AVX_INSTR divss, 1, 0, 0 -AVX_INSTR dppd, 1, 1, 0 -AVX_INSTR dpps, 1, 1, 0 -AVX_INSTR extractps -AVX_INSTR haddpd, 1, 0, 0
View file
x264-snapshot-20141104-2245.tar.bz2/encoder/cavlc.c -> x264-snapshot-20141218-2245.tar.bz2/encoder/cavlc.c
Changed
@@ -289,6 +289,7 @@ x264_cavlc_block_residual( h, DCT_LUMA_4x4, i4+i8*4+p*16, h->dct.luma4x4[i4+i8*4+p*16] ); } +#if RDO_SKIP_BS static ALWAYS_INLINE void x264_cavlc_partition_luma_residual( x264_t *h, int i8, int p ) { if( h->mb.b_transform_8x8 && h->mb.cache.non_zero_count[x264_scan8[i8*4]] ) @@ -299,6 +300,7 @@ for( int i4 = 0; i4 < 4; i4++ ) x264_cavlc_block_residual( h, DCT_LUMA_4x4, i4+i8*4+p*16, h->dct.luma4x4[i4+i8*4+p*16] ); } +#endif static void x264_cavlc_mb_header_i( x264_t *h, int i_mb_type, int i_mb_i_offset, int chroma ) {
View file
x264-snapshot-20141104-2245.tar.bz2/encoder/ratecontrol.c -> x264-snapshot-20141218-2245.tar.bz2/encoder/ratecontrol.c
Changed
@@ -2191,6 +2191,8 @@ if( rcc->b_vbv && rcc->last_satd > 0 ) { + double fenc_cpb_duration = (double)h->fenc->i_cpb_duration * + h->sps->vui.i_num_units_in_tick / h->sps->vui.i_time_scale; /* Lookahead VBV: raise the quantizer as necessary such that no frames in * the lookahead overflow and such that the buffer is in a reasonable state * by the end of the lookahead. */ @@ -2206,6 +2208,7 @@ double buffer_fill_cur = rcc->buffer_fill - cur_bits; double target_fill; double total_duration = 0; + double last_duration = fenc_cpb_duration; frame_q[0] = h->sh.i_type == SLICE_TYPE_I ? q * h->param.rc.f_ip_factor : q; frame_q[1] = frame_q[0] * h->param.rc.f_pb_factor; frame_q[2] = frame_q[0] / h->param.rc.f_ip_factor; @@ -2213,8 +2216,8 @@ /* Loop over the planned future frames. */ for( int j = 0; buffer_fill_cur >= 0 && buffer_fill_cur <= rcc->buffer_size; j++ ) { - total_duration += h->fenc->f_planned_cpb_duration[j]; - buffer_fill_cur += rcc->vbv_max_rate * h->fenc->f_planned_cpb_duration[j]; + total_duration += last_duration; + buffer_fill_cur += rcc->vbv_max_rate * last_duration; int i_type = h->fenc->i_planned_type[j]; int i_satd = h->fenc->i_planned_satd[j]; if( i_type == X264_TYPE_AUTO ) @@ -2222,6 +2225,7 @@ i_type = IS_X264_TYPE_I( i_type ) ? SLICE_TYPE_I : IS_X264_TYPE_B( i_type ) ? SLICE_TYPE_B : SLICE_TYPE_P; cur_bits = predict_size( &rcc->pred[i_type], frame_q[i_type], i_satd ); buffer_fill_cur -= cur_bits; + last_duration = h->fenc->f_planned_cpb_duration[j]; } /* Try to get to get the buffer at least 50% filled, but don't set an impossible goal. */ target_fill = X264_MIN( rcc->buffer_fill + total_duration * rcc->vbv_max_rate * 0.5, rcc->buffer_size * 0.5 ); @@ -2255,45 +2259,44 @@ /* Now a hard threshold to make sure the frame fits in VBV. * This one is mostly for I-frames. */ double bits = predict_size( &rcc->pred[h->sh.i_type], q, rcc->last_satd ); - double qf = 1.0; /* For small VBVs, allow the frame to use up the entire VBV. */ double max_fill_factor = h->param.rc.i_vbv_buffer_size >= 5*h->param.rc.i_vbv_max_bitrate / rcc->fps ? 2 : 1; /* For single-frame VBVs, request that the frame use up the entire VBV. */ double min_fill_factor = rcc->single_frame_vbv ? 1 : 2; if( bits > rcc->buffer_fill/max_fill_factor ) - qf = x264_clip3f( rcc->buffer_fill/(max_fill_factor*bits), 0.2, 1.0 ); - q /= qf; - bits *= qf; + { + double qf = x264_clip3f( rcc->buffer_fill/(max_fill_factor*bits), 0.2, 1.0 ); + q /= qf; + bits *= qf; + } if( bits < rcc->buffer_rate/min_fill_factor ) - q *= bits*min_fill_factor/rcc->buffer_rate; + { + double qf = x264_clip3f( bits*min_fill_factor/rcc->buffer_rate, 0.001, 1.0 ); + q *= qf; + } q = X264_MAX( q0, q ); } - /* Apply MinCR restrictions */ - double bits = predict_size( &rcc->pred[h->sh.i_type], q, rcc->last_satd ); - if( bits > rcc->frame_size_maximum ) - q *= bits / rcc->frame_size_maximum; - bits = predict_size( &rcc->pred[h->sh.i_type], q, rcc->last_satd ); - /* Check B-frame complexity, and use up any bits that would * overflow before the next P-frame. */ if( h->sh.i_type == SLICE_TYPE_P && !rcc->single_frame_vbv ) { int nb = rcc->bframes; + double bits = predict_size( &rcc->pred[h->sh.i_type], q, rcc->last_satd ); double pbbits = bits; double bbits = predict_size( rcc->pred_b_from_p, q * h->param.rc.f_pb_factor, rcc->last_satd ); double space; double bframe_cpb_duration = 0; double minigop_cpb_duration; for( int i = 0; i < nb; i++ ) - bframe_cpb_duration += h->fenc->f_planned_cpb_duration[1+i]; + bframe_cpb_duration += h->fenc->f_planned_cpb_duration[i]; if( bbits * nb > bframe_cpb_duration * rcc->vbv_max_rate ) nb = 0; pbbits += nb * bbits; - minigop_cpb_duration = bframe_cpb_duration + h->fenc->f_planned_cpb_duration[0]; + minigop_cpb_duration = bframe_cpb_duration + fenc_cpb_duration; space = rcc->buffer_fill + minigop_cpb_duration*rcc->vbv_max_rate - rcc->buffer_size; if( pbbits < space ) { @@ -2302,6 +2305,12 @@ q = X264_MAX( q0/2, q ); } + /* Apply MinCR and buffer fill restrictions */ + double bits = predict_size( &rcc->pred[h->sh.i_type], q, rcc->last_satd ); + double frame_size_maximum = X264_MIN( rcc->frame_size_maximum, X264_MAX( rcc->buffer_fill, 0.001 ) ); + if( bits > frame_size_maximum ) + q *= bits / frame_size_maximum; + if( !rcc->b_vbv_min_rate ) q = X264_MAX( q0, q ); } @@ -2326,7 +2335,7 @@ { float q; x264_ratecontrol_t *rcc = h->rc; - ratecontrol_entry_t UNINIT(rce); + ratecontrol_entry_t rce = {0}; int pict_type = h->sh.i_type; int64_t total_bits = 8*(h->stat.i_frame_size[SLICE_TYPE_I] + h->stat.i_frame_size[SLICE_TYPE_P]
View file
x264-snapshot-20141104-2245.tar.bz2/encoder/rdo.c -> x264-snapshot-20141218-2245.tar.bz2/encoder/rdo.c
Changed
@@ -186,7 +186,7 @@ h->mb.b_transform_8x8 = b_transform_bak; h->mb.i_type = type_bak; - return i_ssd + i_bits; + return X264_MIN( i_ssd + i_bits, COST_MAX ); } /* partition RD functions use 8 bits more precision to avoid large rounding errors at low QPs */
View file
x264-snapshot-20141104-2245.tar.bz2/encoder/set.c -> x264-snapshot-20141218-2245.tar.bz2/encoder/set.c
Changed
@@ -543,7 +543,8 @@ void x264_sei_recovery_point_write( x264_t *h, bs_t *s, int recovery_frame_cnt ) { bs_t q; - uint8_t tmp_buf[100]; + ALIGNED_4( uint8_t tmp_buf[100] ); + M32( tmp_buf ) = 0; // shut up gcc bs_init( &q, tmp_buf, 100 ); bs_realign( &q ); @@ -595,7 +596,8 @@ { x264_sps_t *sps = h->sps; bs_t q; - uint8_t tmp_buf[100]; + ALIGNED_4( uint8_t tmp_buf[100] ); + M32( tmp_buf ) = 0; // shut up gcc bs_init( &q, tmp_buf, 100 ); bs_realign( &q ); @@ -617,7 +619,8 @@ { x264_sps_t *sps = h->sps; bs_t q; - uint8_t tmp_buf[100]; + ALIGNED_4( uint8_t tmp_buf[100] ); + M32( tmp_buf ) = 0; // shut up gcc bs_init( &q, tmp_buf, 100 ); bs_realign( &q ); @@ -648,7 +651,8 @@ { int quincunx_sampling_flag = h->param.i_frame_packing == 0; bs_t q; - uint8_t tmp_buf[100]; + ALIGNED_4( uint8_t tmp_buf[100] ); + M32( tmp_buf ) = 0; // shut up gcc bs_init( &q, tmp_buf, 100 ); bs_realign( &q ); @@ -701,7 +705,8 @@ { x264_slice_header_t *sh = &h->sh_backup; bs_t q; - uint8_t tmp_buf[100]; + ALIGNED_4( uint8_t tmp_buf[100] ); + M32( tmp_buf ) = 0; // shut up gcc bs_init( &q, tmp_buf, 100 ); bs_realign( &q );
View file
x264-snapshot-20141104-2245.tar.bz2/encoder/slicetype.c -> x264-snapshot-20141218-2245.tar.bz2/encoder/slicetype.c
Changed
@@ -1853,14 +1853,11 @@ if( i ) { x264_calculate_durations( h, h->lookahead->next.list[i], h->lookahead->next.list[i-1], &h->i_cpb_delay, &h->i_coded_fields ); - h->lookahead->next.list[0]->f_planned_cpb_duration[i-1] = (double)h->lookahead->next.list[i-1]->i_cpb_duration * + h->lookahead->next.list[0]->f_planned_cpb_duration[i-1] = (double)h->lookahead->next.list[i]->i_cpb_duration * h->sps->vui.i_num_units_in_tick / h->sps->vui.i_time_scale; } else x264_calculate_durations( h, h->lookahead->next.list[i], NULL, &h->i_cpb_delay, &h->i_coded_fields ); - - h->lookahead->next.list[0]->f_planned_cpb_duration[i] = (double)h->lookahead->next.list[i]->i_cpb_duration * - h->sps->vui.i_num_units_in_tick / h->sps->vui.i_time_scale; } }
View file
x264-snapshot-20141218-2245.tar.bz2/example.c
Added
@@ -0,0 +1,155 @@ +/***************************************************************************** + * example.c: libx264 API usage example + ***************************************************************************** + * Copyright (C) 2014 x264 project + * + * Authors: Anton Mitrofanov <BugMaster@narod.ru> + * + * 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. + *****************************************************************************/ + +#ifdef _WIN32 +/* The following two defines must be located before the inclusion of any system header files. */ +#define WINVER 0x0500 +#define _WIN32_WINNT 0x0500 +#include <windows.h> +#include <io.h> /* _setmode() */ +#include <fcntl.h> /* _O_BINARY */ +#endif + +#include <stdint.h> +#include <stdio.h> +#include <signal.h> +#include <x264.h> + +/* Ctrl-C handler */ +static volatile int b_ctrl_c = 0; +static void sigint_handler( int a ) +{ + b_ctrl_c = 1; +} + +#define FAIL_IF_ERROR( cond, ... )\ +do\ +{\ + if( cond )\ + {\ + fprintf( stderr, __VA_ARGS__ );\ + goto fail;\ + }\ +} while( 0 ) + +int main( int argc, char **argv ) +{ + int width, height; + x264_param_t param; + x264_picture_t pic; + x264_picture_t pic_out; + x264_t *h; + int i_frame = 0; + int i_frame_size; + x264_nal_t *nal; + int i_nal; + +#ifdef _WIN32 + _setmode( _fileno( stdin ), _O_BINARY ); + _setmode( _fileno( stdout ), _O_BINARY ); + _setmode( _fileno( stderr ), _O_BINARY ); +#endif + + /* Control-C handler */ + signal( SIGINT, sigint_handler ); + + FAIL_IF_ERROR( !(argc > 1), "Example usage: example 352x288 <input.yuv >output.h264\n" ); + FAIL_IF_ERROR( 2 != sscanf( argv[1], "%dx%d", &width, &height ), "resolution not specified or incorrect\n" ); + + /* Get default params for preset/tuning */ + if( x264_param_default_preset( ¶m, "medium", NULL ) < 0 ) + goto fail; + + /* Configure non-default params */ + param.i_csp = X264_CSP_I420; + param.i_width = width; + param.i_height = height; + param.b_vfr_input = 0; + param.b_repeat_headers = 1; + param.b_annexb = 1; + + /* Apply profile restrictions. */ + if( x264_param_apply_profile( ¶m, "high" ) < 0 ) + goto fail; + + if( x264_picture_alloc( &pic, param.i_csp, param.i_width, param.i_height ) < 0 ) + goto fail; +#undef fail +#define fail fail2 + + h = x264_encoder_open( ¶m ); + if( !h ) + goto fail; +#undef fail +#define fail fail3 + + /* Encode frames */ + for( ; !b_ctrl_c; i_frame++ ) + { + /* Read input frame */ + int plane_size = width * height; + if( fread( pic.img.plane[0], 1, plane_size, stdin ) != plane_size ) + break; + plane_size = ((width + 1) >> 1) * ((height + 1) >> 1); + if( fread( pic.img.plane[1], 1, plane_size, stdin ) != plane_size ) + break; + if( fread( pic.img.plane[2], 1, plane_size, stdin ) != plane_size ) + break; + + pic.i_pts = i_frame; + i_frame_size = x264_encoder_encode( h, &nal, &i_nal, &pic, &pic_out ); + if( i_frame_size < 0 ) + goto fail; + else if( i_frame_size ) + { + if( !fwrite( nal->p_payload, i_frame_size, 1, stdout ) ) + goto fail; + } + } + /* Flush delayed frames */ + while( !b_ctrl_c && x264_encoder_delayed_frames( h ) ) + { + i_frame_size = x264_encoder_encode( h, &nal, &i_nal, NULL, &pic_out ); + if( i_frame_size < 0 ) + goto fail; + else if( i_frame_size ) + { + if( !fwrite( nal->p_payload, i_frame_size, 1, stdout ) ) + goto fail; + } + } + + x264_encoder_close( h ); + x264_picture_clean( &pic ); + return 0; + +#undef fail +fail3: + x264_encoder_close( h ); +fail2: + x264_picture_clean( &pic ); +fail: + return -1; +}
View file
x264-snapshot-20141104-2245.tar.bz2/tools/checkasm.c -> x264-snapshot-20141218-2245.tar.bz2/tools/checkasm.c
Changed
@@ -90,7 +90,9 @@ { uint32_t a = 0; #if HAVE_X86_INLINE_ASM - asm volatile( "rdtsc" : "=a"(a) :: "edx", "memory" ); + asm volatile( "lfence \n" + "rdtsc \n" + : "=a"(a) :: "edx", "memory" ); #elif ARCH_PPC asm volatile( "mftb %0" : "=r"(a) :: "memory" ); #elif ARCH_ARM // ARMv7 only
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.