mirror of https://git.wownero.com/dsc/mxe.git
x265: update, add patch and test
This commit is contained in:
parent
bfdb83d725
commit
a6731b8527
|
@ -0,0 +1,36 @@
|
||||||
|
This file is part of MXE. See LICENSE.md for licensing information.
|
||||||
|
|
||||||
|
Contains ad hoc patches for cross building.
|
||||||
|
|
||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: darealshinji <djcj@gmx.de>
|
||||||
|
Date: Sat, 1 Jul 2017 17:09:40 +0200
|
||||||
|
Subject: [PATCH] Use C++14 so we can build with dynamicHDR
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
|
||||||
|
index 1111111..2222222 100644
|
||||||
|
--- a/source/CMakeLists.txt
|
||||||
|
+++ b/source/CMakeLists.txt
|
||||||
|
@@ -187,7 +187,7 @@ endif()
|
||||||
|
if(GCC)
|
||||||
|
add_definitions(-Wall -Wextra -Wshadow)
|
||||||
|
add_definitions(-D__STDC_LIMIT_MACROS=1)
|
||||||
|
- add_definitions(-std=gnu++98)
|
||||||
|
+ add_definitions(-std=gnu++14)
|
||||||
|
if(ENABLE_PIC)
|
||||||
|
add_definitions(-fPIC)
|
||||||
|
endif(ENABLE_PIC)
|
||||||
|
diff --git a/source/encoder/encoder.h b/source/encoder/encoder.h
|
||||||
|
index 1111111..2222222 100644
|
||||||
|
--- a/source/encoder/encoder.h
|
||||||
|
+++ b/source/encoder/encoder.h
|
||||||
|
@@ -33,7 +33,7 @@
|
||||||
|
#include "framedata.h"
|
||||||
|
|
||||||
|
#ifdef ENABLE_DYNAMIC_HDR10
|
||||||
|
- #include "dynamicHDR10\hdr10plus.h"
|
||||||
|
+ #include "dynamicHDR10/hdr10plus.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct x265_encoder {};
|
|
@ -0,0 +1,21 @@
|
||||||
|
// This file is part of MXE. See LICENSE.md for licensing information.
|
||||||
|
|
||||||
|
#include <x265.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
int rv = 0;
|
||||||
|
|
||||||
|
x265_param *param = x265_param_alloc();
|
||||||
|
x265_param_default(param);
|
||||||
|
x265_encoder *encoder = x265_encoder_open(param);
|
||||||
|
|
||||||
|
if (x265_param_apply_profile(param, "main444-12-intra") != 0)
|
||||||
|
rv = 1;
|
||||||
|
|
||||||
|
x265_encoder_close(encoder);
|
||||||
|
x265_param_free(param);
|
||||||
|
x265_cleanup();
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
69
src/x265.mk
69
src/x265.mk
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
PKG := x265
|
PKG := x265
|
||||||
$(PKG)_IGNORE :=
|
$(PKG)_IGNORE :=
|
||||||
$(PKG)_VERSION := 1.8
|
$(PKG)_VERSION := 2.4
|
||||||
$(PKG)_CHECKSUM := d41a3f0cc06dfc3967f6c47f458cb30b6aaa518f86c56c147946395bfe22b6f2
|
$(PKG)_CHECKSUM := 9c2aa718d78f6fecdd783f08ab83b98d3169e5f670404da4c16439306907d729
|
||||||
$(PKG)_SUBDIR := x265_$($(PKG)_VERSION)
|
$(PKG)_SUBDIR := x265_$($(PKG)_VERSION)
|
||||||
$(PKG)_FILE := x265_$($(PKG)_VERSION).tar.gz
|
$(PKG)_FILE := x265_$($(PKG)_VERSION).tar.gz
|
||||||
$(PKG)_URL := https://ftp.videolan.org/pub/videolan/$(PKG)/$($(PKG)_FILE)
|
$(PKG)_URL := https://ftp.videolan.org/pub/videolan/$(PKG)/$($(PKG)_FILE)
|
||||||
$(PKG)_DEPS := gcc cmake yasm
|
$(PKG)_DEPS := gcc yasm
|
||||||
|
|
||||||
define $(PKG)_UPDATE
|
define $(PKG)_UPDATE
|
||||||
$(WGET) -q -O- https://ftp.videolan.org/pub/videolan/x265/ | \
|
$(WGET) -q -O- https://ftp.videolan.org/pub/videolan/x265/ | \
|
||||||
|
@ -16,50 +16,59 @@ define $(PKG)_UPDATE
|
||||||
tail -1
|
tail -1
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# note: assembly for i686 targets is not officially supported
|
||||||
define $(PKG)_BUILD
|
define $(PKG)_BUILD
|
||||||
cd '$(1)' && mkdir -p 8bit 10bit 12bit
|
cd '$(BUILD_DIR)' && mkdir -p 10bit 12bit
|
||||||
|
|
||||||
# 12 bit
|
# 12 bit
|
||||||
test '$(TARGET)' = 'x86_64-w64-mingw32.static' && X265_ASM=ON || X265_ASM=OFF; \
|
cd '$(BUILD_DIR)/12bit' && $(TARGET)-cmake '$(SOURCE_DIR)/source' \
|
||||||
cd '$(1)/12bit' && cmake ../source \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
|
|
||||||
-DHIGH_BIT_DEPTH=ON \
|
-DHIGH_BIT_DEPTH=ON \
|
||||||
-DEXPORT_C_API=OFF \
|
-DEXPORT_C_API=OFF \
|
||||||
-DENABLE_SHARED=OFF \
|
-DENABLE_SHARED=OFF \
|
||||||
-DENABLE_ASSEMBLY=$$X265_ASM \
|
-DENABLE_ASSEMBLY=$(if $(findstring x86_64,$(TARGET)),ON,OFF) \
|
||||||
-DENABLE_CLI=OFF \
|
-DENABLE_CLI=OFF \
|
||||||
|
-DWINXP_SUPPORT=ON \
|
||||||
|
-DENABLE_DYNAMIC_HDR10=ON \
|
||||||
-DMAIN12=ON
|
-DMAIN12=ON
|
||||||
$(MAKE) -C '$(1)/12bit' -j '$(JOBS)'
|
$(MAKE) -C '$(BUILD_DIR)/12bit' -j '$(JOBS)'
|
||||||
cp '$(1)/12bit/libx265.a' '$(1)/8bit/libx265_main12.a'
|
cp '$(BUILD_DIR)/12bit/libx265.a' '$(BUILD_DIR)/libx265_main12.a'
|
||||||
|
|
||||||
# 10 bit
|
# 10 bit
|
||||||
test '$(TARGET)' = 'x86_64-w64-mingw32.static' && X265_ASM=ON || X265_ASM=OFF; \
|
cd '$(BUILD_DIR)/10bit' && $(TARGET)-cmake '$(SOURCE_DIR)/source' \
|
||||||
cd '$(1)/10bit' && cmake ../source \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
|
|
||||||
-DHIGH_BIT_DEPTH=ON \
|
-DHIGH_BIT_DEPTH=ON \
|
||||||
-DEXPORT_C_API=OFF \
|
-DEXPORT_C_API=OFF \
|
||||||
-DENABLE_SHARED=OFF \
|
-DENABLE_SHARED=OFF \
|
||||||
-DENABLE_ASSEMBLY=$$X265_ASM \
|
-DENABLE_ASSEMBLY=$(if $(findstring x86_64,$(TARGET)),ON,OFF) \
|
||||||
-DENABLE_CLI=OFF
|
-DENABLE_CLI=OFF \
|
||||||
$(MAKE) -C '$(1)/10bit' -j '$(JOBS)'
|
-DWINXP_SUPPORT=ON \
|
||||||
cp '$(1)/10bit/libx265.a' '$(1)/8bit/libx265_main10.a'
|
-DENABLE_DYNAMIC_HDR10=ON
|
||||||
|
$(MAKE) -C '$(BUILD_DIR)/10bit' -j '$(JOBS)'
|
||||||
|
cp '$(BUILD_DIR)/10bit/libx265.a' '$(BUILD_DIR)/libx265_main10.a'
|
||||||
|
|
||||||
# 8bit
|
# 8bit
|
||||||
test '$(TARGET)' = 'x86_64-w64-mingw32.static' && X265_ASM=ON || X265_ASM=OFF; \
|
cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)/source' \
|
||||||
cd '$(1)/8bit' && cmake ../source \
|
-DHIGH_BIT_DEPTH=OFF \
|
||||||
-DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
|
-DEXPORT_C_API=ON \
|
||||||
-DENABLE_SHARED=OFF \
|
-DENABLE_SHARED=$(CMAKE_SHARED_BOOL) \
|
||||||
-DENABLE_ASSEMBLY=$$X265_ASM \
|
-DENABLE_ASSEMBLY=$(if $(findstring x86_64,$(TARGET)),ON,OFF) \
|
||||||
-DEXTRA_LIB="x265_main10.a;x265_main12.a" \
|
-DENABLE_CLI=OFF \
|
||||||
-DEXTRA_LINK_FLAGS=-L. \
|
-DWINXP_SUPPORT=ON \
|
||||||
|
-DENABLE_DYNAMIC_HDR10=ON \
|
||||||
|
-DEXTRA_LIB='x265_main10.a;x265_main12.a' \
|
||||||
|
-DEXTRA_LINK_FLAGS=-L'$(BUILD_DIR)' \
|
||||||
-DLINKED_10BIT=ON \
|
-DLINKED_10BIT=ON \
|
||||||
-DLINKED_12BIT=ON
|
-DLINKED_12BIT=ON
|
||||||
|
|
||||||
$(MAKE) -C '$(1)/8bit' -j '$(JOBS)' install
|
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' install
|
||||||
$(INSTALL) '$(1)/8bit/libx265_main12.a' '$(PREFIX)/$(TARGET)/lib/libx265_main12.a'
|
$(if $(BUILD_SHARED),rm -f '$(PREFIX)/$(TARGET)/lib/libx265.a',\
|
||||||
$(INSTALL) '$(1)/8bit/libx265_main10.a' '$(PREFIX)/$(TARGET)/lib/libx265_main10.a'
|
$(INSTALL) '$(BUILD_DIR)/libx265_main12.a' '$(PREFIX)/$(TARGET)/lib/libx265_main12.a' && \
|
||||||
$(SED) -i 's|-lx265|-lx265 -lx265_main10 -lx265_main12|' '$(PREFIX)/$(TARGET)/lib/pkgconfig/x265.pc'
|
$(INSTALL) '$(BUILD_DIR)/libx265_main10.a' '$(PREFIX)/$(TARGET)/lib/libx265_main10.a' && \
|
||||||
|
$(SED) -i 's|-lx265|-lx265 -lx265_main10 -lx265_main12|' '$(PREFIX)/$(TARGET)/lib/pkgconfig/x265.pc')
|
||||||
|
|
||||||
|
'$(TARGET)-gcc' \
|
||||||
|
-W -Wall -Werror \
|
||||||
|
'$(TOP_DIR)/src/$(PKG)-test.c' \
|
||||||
|
-o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
|
||||||
|
`$(TARGET)-pkg-config --cflags --libs $(PKG)`
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(PKG)_BUILD_SHARED =
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue