mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Merge commit '792a5a5dd1946a327f22b2daba05c6645dfa8037'
This commit is contained in:
commit
6a72f87028
23
src/Makefile
23
src/Makefile
|
@ -9,15 +9,20 @@ DFLAGS = -O2 -g -Werror -march=native
|
|||
|
||||
# ARCH related flags
|
||||
ifeq ($(ARCH), x86_64)
|
||||
ASMFLAGS += -DARCH_X86_64=1
|
||||
DFLAGS += -m64
|
||||
LDFLAGS += -m64
|
||||
TARGET_CPU_BITS := 64
|
||||
TARGET_CPU_ARCH := x86
|
||||
else ifeq ($(ARCH), ppc64)
|
||||
TARGET_CPU_BITS := 64
|
||||
TARGET_CPU_ARCH := ppc
|
||||
else
|
||||
ASMFLAGS += -DARCH_X86_64=0
|
||||
DFLAGS += -m32
|
||||
LDFLAGS += -m32
|
||||
#safe (?) defaults
|
||||
TARGET_CPU_BITS := 32
|
||||
TARGET_CPU_ARCH := x86
|
||||
endif
|
||||
|
||||
DFLAGS += -m$(TARGET_CPU_BITS)
|
||||
LDFLAGS += -m$(TARGET_CPU_BITS)
|
||||
|
||||
# Windows (cygwin/mingw) specific flags
|
||||
ifneq ( ,$(findstring Windows, $(OS)))
|
||||
ifeq ($(ARCH), x86_64)
|
||||
|
@ -48,8 +53,6 @@ CC = gcc
|
|||
CCFLAGS = $(DFLAGS) -I. -Wall -Wtype-limits
|
||||
LDFLAGS += -lm
|
||||
LD = gcc -pthread -lrt
|
||||
YASM = yasm
|
||||
ASMOBJS = cpu.o
|
||||
OBJS = interface_main.o encmain.o bitstream.o cabac.o config.o context.o encoder.o filter.o inter.o intra.o nal.o picture.o rdo.o sao.o scalinglist.o search.o strategyselector.o tables.o threadqueue.o transform.o
|
||||
PROG = ./kvazaar
|
||||
PROGS = $(PROG)
|
||||
|
@ -62,9 +65,6 @@ all: $(PROGS)
|
|||
$(PROG): $(OBJS) $(ASMOBJS)
|
||||
$(LD) $^ $(LDFLAGS) -o $@
|
||||
|
||||
cpu.o: x86/cpu.asm
|
||||
$(YASM) $(ASMFLAGS) x86/cpu.asm -o cpu.o
|
||||
|
||||
%.o: %.c Makefile
|
||||
$(CC) $(CCFLAGS) -c $< -o $@
|
||||
|
||||
|
@ -73,6 +73,7 @@ cpu.o: x86/cpu.asm
|
|||
|
||||
|
||||
clean:
|
||||
echo $(ARCH)
|
||||
rm -f $(OBJS) $(PROGS) $(ASMOBJS) $(DEPS)
|
||||
|
||||
-include $(DEPS)
|
||||
|
|
|
@ -135,7 +135,7 @@ typedef int16_t coefficient;
|
|||
#define SIZE_NxN 3
|
||||
#define SIZE_NONE 15
|
||||
|
||||
#define MAX_TILES_PER_DIM 16
|
||||
#define MAX_TILES_PER_DIM 48
|
||||
#define MAX_SLICES 16
|
||||
|
||||
/* Inlining functions */
|
||||
|
|
|
@ -718,7 +718,6 @@ void intra_recon_lcu_chroma(encoder_state * const encoder_state, int x, int y, i
|
|||
cu_info *cur_cu = &lcu->cu[LCU_CU_OFFSET + (lcu_px.x>>3) + (lcu_px.y>>3)*LCU_T_CU_WIDTH];
|
||||
const int8_t width = LCU_WIDTH >> depth;
|
||||
const int8_t width_c = (depth == MAX_PU_DEPTH ? width : width / 2);
|
||||
const int pu_index = PU_INDEX(x >> 2, y >> 2);
|
||||
|
||||
if (depth == 0 || cur_cu->tr_depth > depth) {
|
||||
int offset = width / 2;
|
||||
|
|
|
@ -155,7 +155,28 @@ static void* strategyselector_choose_for(const strategy_list * const strategies,
|
|||
}
|
||||
|
||||
#if COMPILE_INTEL
|
||||
#include "x86/cpu.h"
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#include <cpuid.h>
|
||||
#else
|
||||
#include <intrin.h>
|
||||
//Adapter from __cpuid (VS) to __get_cpuid (GNU C).
|
||||
__inline int __get_cpuid(unsigned int __level, unsigned int *__eax, unsigned int *__ebx, unsigned int *__ecx, unsigned int *__edx) {
|
||||
int CPUInfo[4] = {*__eax, *__ebx, *__ecx, *__edx};
|
||||
__cpuid(CPUInfo, 0);
|
||||
// check if the CPU supports the cpuid instruction.
|
||||
if (CPUInfo[0] != 0) {
|
||||
__cpuid(CPUInfo, __level);
|
||||
*__eax = CPUInfo[0];
|
||||
*__ebx = CPUInfo[1];
|
||||
*__ecx = CPUInfo[2];
|
||||
*__edx = CPUInfo[3];
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif //defined(__GNUC__)
|
||||
|
||||
#endif
|
||||
|
||||
static void set_hardware_flags() {
|
||||
|
@ -167,12 +188,12 @@ static void set_hardware_flags() {
|
|||
|
||||
#if COMPILE_INTEL
|
||||
{
|
||||
int ecx = 0,edx =0;
|
||||
unsigned int eax = 0, ebx = 0, ecx = 0, edx =0;
|
||||
/* CPU feature bits */
|
||||
enum { BIT_SSE3 = 0,BIT_SSSE3 = 9, BIT_SSE41 = 19, BIT_SSE42 = 20, BIT_MMX = 24, BIT_SSE = 25, BIT_SSE2 = 26, BIT_AVX = 28};
|
||||
|
||||
// Dig CPU features with cpuid
|
||||
kvz_cpu_cpuid(&ecx,&edx);
|
||||
__get_cpuid(1, &eax, &ebx, &ecx, &edx);
|
||||
|
||||
// EDX
|
||||
if (edx & (1<<BIT_MMX)) g_hardware_flags.intel_flags.mmx = 1;
|
||||
|
|
|
@ -106,7 +106,7 @@ class LogParser:
|
|||
else:
|
||||
return float(value)
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, filename):
|
||||
re_thread = re.compile(r'^\t([0-9]+)\t-\t([0-9\.]+)\t(\+?)([0-9\.]+)\t-\tthread$')
|
||||
re_job = re.compile(r'^([^\t]+)\t([0-9]+)\t([0-9\.]+)\t(\+?)([0-9\.]+)\t(\+?)([0-9\.]+)\t(\+?)([0-9\.]+)\t(.*)$')
|
||||
re_dep = re.compile(r'^(.+)->(.+)$')
|
||||
|
@ -118,7 +118,7 @@ class LogParser:
|
|||
objects = []
|
||||
threads = {}
|
||||
|
||||
for line in open('threadqueue.log','r').readlines():
|
||||
for line in open(filename,'r').readlines():
|
||||
m = re_thread.match(line)
|
||||
if m:
|
||||
g = m.groups()
|
||||
|
@ -281,6 +281,10 @@ class LogParser:
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
l = LogParser()
|
||||
import sys
|
||||
if len(sys.argv) > 1:
|
||||
l = LogParser(sys.argv[1])
|
||||
else:
|
||||
l = LogParser('threadqueue.log')
|
||||
l.plot_picture_wise_wpp()
|
||||
#l.plot_threads()
|
||||
|
|
Loading…
Reference in a new issue