summaryrefslogtreecommitdiff
path: root/media-libs/x265
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-12-21 13:58:21 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-12-21 13:58:21 +0000
commitd8e7aaf1b90b28ec354e7854abea07d53644e754 (patch)
treea3dfecdac470c25645b7bcacd4923343eec46afe /media-libs/x265
parenta473f013073f9c57e59e7d30f088eee89312dd0d (diff)
gentoo auto-resync : 21:12:2023 - 13:58:21
Diffstat (limited to 'media-libs/x265')
-rw-r--r--media-libs/x265/Manifest4
-rw-r--r--media-libs/x265/files/x265-9999-test-ns.patch286
-rw-r--r--media-libs/x265/x265-3.5-r3.ebuild217
-rw-r--r--media-libs/x265/x265-9999.ebuild22
4 files changed, 515 insertions, 14 deletions
diff --git a/media-libs/x265/Manifest b/media-libs/x265/Manifest
index f58805d350b8..713fe29b9a3e 100644
--- a/media-libs/x265/Manifest
+++ b/media-libs/x265/Manifest
@@ -5,7 +5,9 @@ AUX tests.patch 650 BLAKE2B 21759b11966e12df1a72a1ed00935ff781ad8b912e734de65cf0
AUX x265-3.3-ppc64.patch 590 BLAKE2B bbc6f18b8f192424450d2860e33ea6dbba14b46876f05cf9c499412d491127c877c342b1900bb9d06d66126aca2f383da1a4986ce69670ebc392fec0fe9b59a9 SHA512 bb4ace2c4bc899a0ccdd17fb78e63980354f41ff0f201812d47c5df16b23fea6fcdbde086e737d0efd5d8cb8fa571a131c03433bec31999c71ff51bccd754950
AUX x265-9999-arm.patch 2115 BLAKE2B 92f2225fd23030220531e6bfda7a3d4ce197090a7b1d996fe5995885fe332352e3628ca3fe307d2ae7af2d0342b183c5bbe4337201c51fb4092e273eae2f1308 SHA512 602725dc487397466c48d4d0aa09d8d63b3519fc72cd9538e732c2c82f6f3fa9c959f6f29ff3f810fec82dbdf609d9fd37fe05dd67496fc4c8bbda5f87c9f165
AUX x265-9999-ppc64.patch 385 BLAKE2B c75bd6e0e7c1ded2b4858f4cbacc337d6015a0387a0fa8dab87964f1995e8e39cdce3f69dc2bb0bb338f5df5fff2051ef5dbcd065e59bd4905282349850e92f6 SHA512 5601b0f29136d5b36f237841b4d4ed6ad0d7cdaed559b8b450352d9fb406b1e0c91ccde11b32d7e32b9ebf6622c85aa2ed44c63bf6ebe5a08550a1b24ebe0eb8
+AUX x265-9999-test-ns.patch 14971 BLAKE2B 8750a3a94eefd78dfe082c46634606a1abe4ae1b9cf89971e5532a1fc8d42e8b406ca71ab2dfd3e77bdc589e553e190c423a12b5c1007eae9fe12d86e7603ef7 SHA512 55baf712622acfb0d76eee3b283ba38905327eacb0ce52f202563e7e6c1c8593bcae84acc876c91f36ac22fcc06950ffa181515b58d199821c8d265f309594e7
DIST x265_3.5.tar.gz 1537044 BLAKE2B 4fe15b762eda08a4379f69df622bef603fed784a237381d5c95876412020c113d053af829fa1eb66468462a6edc0de32dc597b1a98a63e9aa0250a47f4e76d05 SHA512 230e683239c3e262096ba96246c6f67229a1625d163f86647a411733bb1cf349685858aee3017bce818bb6992448d0abaa9241615a5b620561ce47ecb164f997
EBUILD x265-3.5-r2.ebuild 6342 BLAKE2B 3a5bf8ebedc877d8d69c3021f925fb77559ea682a423438d734953e9960518d9d96672955bf56d7d11409ba734c38edd43f60f25b1f5b666f68de11591fe4370 SHA512 55e41cc836b62aab1c64da0e2b1d5ea35a204bcee5408b47fc732237af394daf419e965fb963c4cba4814b00f2d40ea9ce707aa14f5695b18f5f8dadb43272c6
-EBUILD x265-9999.ebuild 6346 BLAKE2B c75ada90a626922136e2463e871b1a67dc6d96caf17197e38dd07034e12a03723805d8b0810c5c53e51c2fcd2f1a8d10d7747324ab3dbf4a2b173d207c1e5957 SHA512 27fe484febc7489e33e6ce31f3e607db7e1dd7ab369f393e6773fd100eec03afd48ad1f87c3735232f4fb45fcdf35572389564bb7cdcf5c6e5673dfa11a4591d
+EBUILD x265-3.5-r3.ebuild 6127 BLAKE2B e73816bf0cc95edbb59e582a0abc64c87e66c4cc211c18ac8505632a3914e99328b526daaa4fadd2415bf02bd814d318fb1c415b756c2ec912b37ad2819a376c SHA512 25a13b2a63e832792d8b7033da5f639781a71bd86e2e89b2a32aa5b0654b3798295a98aa402eb504ec7e23568363d6c6f736ac9861b1cdac6d75f1b7edb4efb9
+EBUILD x265-9999.ebuild 6112 BLAKE2B 852aa11b7fa1edfea6a2036e9c1b5122095c394becec564c6f7d10bd15350178b3de8ed3204d370047036f0fb135b6fa47ddb6366f7d8aed65b7bcc90dc776a7 SHA512 e7c3aa595223570954c6b40032aab381ea997568cf9d8fad8139f5e1b87e348f24b650d6b47b0d73041cabb12b1358bee9eb8d2c8706acff6eb2954d8e8c94ed
MISC metadata.xml 626 BLAKE2B 59840316bac42695fd0c76baad143fcbdf810d80b48aa0260633b7dd70cd24a064ac0e3284772368bffd05415befd99fc4f224d2c2c7fc44e27ec56759f04b07 SHA512 97ba150042a2f4558c828af03bb489faa4385af6a2c72ed3f7489091e011a94e40330117a3f2edddea8fc73652396fb53e9190bdd00cb2b3d1c8b553ed2d0d7e
diff --git a/media-libs/x265/files/x265-9999-test-ns.patch b/media-libs/x265/files/x265-9999-test-ns.patch
new file mode 100644
index 000000000000..ed3de18ae83e
--- /dev/null
+++ b/media-libs/x265/files/x265-9999-test-ns.patch
@@ -0,0 +1,286 @@
+Namespace functions for multi-bitdepth builds so that libraries are self-contained.
+--- a/common/param.cpp
++++ b/common/param.cpp
+@@ -102,7 +102,7 @@ x265_param *x265_param_alloc()
+
+ void x265_param_free(x265_param* p)
+ {
+- x265_zone_free(p);
++ PARAM_NS::x265_zone_free(p);
+ #ifdef SVT_HEVC
+ x265_free(p->svtHevcParam);
+ #endif
+--- a/common/param.h
++++ b/common/param.h
+@@ -55,6 +55,18 @@ int x265_param_apply_profile(x265_param *, const char *profile);
+ int x265_param_parse(x265_param *p, const char *name, const char *value);
+ int x265_scenecut_aware_qp_param_parse(x265_param* p, const char* name, const char* value);
+ int x265_zone_param_parse(x265_param* p, const char* name, const char* value);
++void x265_free_analysis_data(x265_param *param, x265_analysis_data* analysis);
++void x265_alloc_analysis_data(x265_param *param, x265_analysis_data* analysis);
++void x265_picture_free(x265_picture *);
++x265_zone *x265_zone_alloc(int zoneCount, int isZoneFile);
++void x265_zone_free(x265_param *param);
++FILE* x265_csvlog_open(const x265_param *);
++void x265_csvlog_frame(const x265_param *, const x265_picture *);
++void x265_csvlog_encode(const x265_param*, const x265_stats *, int padx, int pady, int argc, char** argv);
++void x265_dither_image(x265_picture *, int picWidth, int picHeight, int16_t *errorBuf, int bitDepth);
++int x265_encoder_reconfig(x265_encoder *, x265_param *);
++x265_picture *x265_picture_alloc(void);
++void x265_picture_init(x265_param *param, x265_picture *pic);
+ #define PARAM_NS X265_NS
+ #endif
+ }
+--- a/encoder/api.cpp
++++ b/encoder/api.cpp
+@@ -106,9 +106,9 @@ x265_encoder *x265_encoder_open(x265_param *p)
+ if (p->rc.zoneCount || p->rc.zonefileCount)
+ {
+ int zoneCount = p->rc.zonefileCount ? p->rc.zonefileCount : p->rc.zoneCount;
+- param->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+- latestParam->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+- zoneParam->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
++ param->rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
++ latestParam->rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
++ zoneParam->rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+ }
+
+ x265_copy_params(param, p);
+@@ -214,7 +214,7 @@ x265_encoder *x265_encoder_open(x265_param *p)
+ /* Try to open CSV file handle */
+ if (encoder->m_param->csvfn)
+ {
+- encoder->m_param->csvfpt = x265_csvlog_open(encoder->m_param);
++ encoder->m_param->csvfpt = PARAM_NS::x265_csvlog_open(encoder->m_param);
+ if (!encoder->m_param->csvfpt)
+ {
+ x265_log(encoder->m_param, X265_LOG_ERROR, "Unable to open CSV log file <%s>, aborting\n", encoder->m_param->csvfn);
+@@ -319,7 +319,7 @@ int x265_encoder_reconfig(x265_encoder* enc, x265_param* param_in)
+ if (encoder->m_latestParam->rc.zoneCount || encoder->m_latestParam->rc.zonefileCount)
+ {
+ int zoneCount = encoder->m_latestParam->rc.zonefileCount ? encoder->m_latestParam->rc.zonefileCount : encoder->m_latestParam->rc.zoneCount;
+- save.rc.zones = x265_zone_alloc(zoneCount, !!encoder->m_latestParam->rc.zonefileCount);
++ save.rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!encoder->m_latestParam->rc.zonefileCount);
+ }
+ x265_copy_params(&save, encoder->m_latestParam);
+ int ret = encoder->reconfigureParam(encoder->m_latestParam, param_in);
+@@ -602,7 +602,7 @@ fail:
+ *pi_nal = 0;
+
+ if (numEncoded && encoder->m_param->csvLogLevel && encoder->m_outputCount >= encoder->m_latestParam->chunkStart)
+- x265_csvlog_frame(encoder->m_param, pic_out);
++ PARAM_NS::x265_csvlog_frame(encoder->m_param, pic_out);
+
+ if (numEncoded < 0)
+ encoder->m_aborted = true;
+@@ -643,7 +643,7 @@ void x265_vmaf_encoder_log(x265_encoder* enc, int argc, char **argv, x265_param
+ encoder->fetchStats(&stats, sizeof(stats));
+ int padx = encoder->m_sps.conformanceWindow.rightOffset;
+ int pady = encoder->m_sps.conformanceWindow.bottomOffset;
+- x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
++ PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
+ }
+ }
+ #endif
+@@ -657,7 +657,7 @@ void x265_encoder_log(x265_encoder* enc, int argc, char **argv)
+ encoder->fetchStats(&stats, sizeof(stats));
+ int padx = encoder->m_sps.conformanceWindow.rightOffset;
+ int pady = encoder->m_sps.conformanceWindow.bottomOffset;
+- x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
++ PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
+ }
+ }
+
+@@ -878,7 +878,7 @@ void x265_alloc_analysis_data(x265_param *param, x265_analysis_data* analysis)
+ return;
+
+ fail:
+- x265_free_analysis_data(param, analysis);
++ PARAM_NS::x265_free_analysis_data(param, analysis);
+ }
+
+ void x265_free_analysis_data(x265_param *param, x265_analysis_data* analysis)
+--- a/encoder/encoder.cpp
++++ b/encoder/encoder.cpp
+@@ -216,8 +216,8 @@ void Encoder::create()
+ {
+ m_dupBuffer[i] = (AdaptiveFrameDuplication*)x265_malloc(sizeof(AdaptiveFrameDuplication));
+ m_dupBuffer[i]->dupPic = NULL;
+- m_dupBuffer[i]->dupPic = x265_picture_alloc();
+- x265_picture_init(p, m_dupBuffer[i]->dupPic);
++ m_dupBuffer[i]->dupPic = PARAM_NS::x265_picture_alloc();
++ PARAM_NS::x265_picture_init(p, m_dupBuffer[i]->dupPic);
+ m_dupBuffer[i]->dupPlane = NULL;
+ m_dupBuffer[i]->dupPlane = X265_MALLOC(char, framesize);
+ m_dupBuffer[i]->dupPic->planes[0] = m_dupBuffer[i]->dupPlane;
+@@ -768,7 +768,7 @@ int Encoder::setAnalysisData(x265_analysis_data *analysis_data, int poc, uint32_
+ curFrame->m_analysisData = (*analysis_data);
+ curFrame->m_analysisData.numCUsInFrame = widthInCU * heightInCU;
+ curFrame->m_analysisData.numPartitions = m_param->num4x4Partitions;
+- x265_alloc_analysis_data(m_param, &curFrame->m_analysisData);
++ PARAM_NS::x265_alloc_analysis_data(m_param, &curFrame->m_analysisData);
+ if (m_param->maxCUSize == 16)
+ {
+ if (analysis_data->sliceType == X265_TYPE_IDR || analysis_data->sliceType == X265_TYPE_I)
+@@ -872,7 +872,7 @@ void Encoder::destroy()
+ for (uint32_t i = 0; i < DUP_BUFFER; i++)
+ {
+ X265_FREE(m_dupBuffer[i]->dupPlane);
+- x265_picture_free(m_dupBuffer[i]->dupPic);
++ PARAM_NS::x265_picture_free(m_dupBuffer[i]->dupPic);
+ X265_FREE(m_dupBuffer[i]);
+ }
+
+@@ -1478,7 +1478,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ if (m_exportedPic)
+ {
+ if (!m_param->bUseAnalysisFile && m_param->analysisSave)
+- x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
+
+ ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
+
+@@ -1892,7 +1892,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+
+ /* Free up inputPic->analysisData since it has already been used */
+ if ((m_param->analysisLoad && !m_param->analysisSave) || ((m_param->bAnalysisType == AVC_INFO) && slice->m_sliceType != I_SLICE))
+- x265_free_analysis_data(m_param, &outFrame->m_analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
+
+ if (pic_out)
+ {
+@@ -1971,7 +1971,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ writeAnalysisFile(&pic_out->analysisData, *outFrame->m_encData);
+ pic_out->analysisData.saveParam = pic_out->analysisData.saveParam;
+ if (m_param->bUseAnalysisFile)
+- x265_free_analysis_data(m_param, &pic_out->analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &pic_out->analysisData);
+ }
+ }
+ if (m_param->rc.bStatWrite && (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion))
+@@ -1986,7 +1986,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ writeAnalysisFileRefine(&outFrame->m_analysisData, *outFrame->m_encData);
+ }
+ if (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion)
+- x265_free_analysis_data(m_param, &outFrame->m_analysisData);
++ PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
+ if (m_param->internalCsp == X265_CSP_I400)
+ {
+ if (slice->m_sliceType == P_SLICE)
+@@ -2153,7 +2153,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ uint32_t heightInCU = (m_param->sourceHeight + m_param->maxCUSize - 1) >> m_param->maxLog2CUSize;
+ frameEnc->m_analysisData.numCUsInFrame = widthInCU * heightInCU;
+ frameEnc->m_analysisData.numPartitions = m_param->num4x4Partitions;
+- x265_alloc_analysis_data(m_param, &frameEnc->m_analysisData);
++ PARAM_NS::x265_alloc_analysis_data(m_param, &frameEnc->m_analysisData);
+ frameEnc->m_analysisData.poc = frameEnc->m_poc;
+ if (m_param->rc.bStatRead)
+ readAnalysisFile(&frameEnc->m_analysisData, frameEnc->m_poc, frameEnc->m_lowres.sliceType);
+@@ -2164,7 +2164,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ for (int i = 0; i < m_param->rc.zonefileCount; i++)
+ {
+ if (m_param->rc.zones[i].startFrame == frameEnc->m_poc)
+- x265_encoder_reconfig(this, m_param->rc.zones[i].zoneParam);
++ PARAM_NS::x265_encoder_reconfig(this, m_param->rc.zones[i].zoneParam);
+ }
+ }
+
+@@ -2307,7 +2307,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ analysis->numCUsInFrame = numCUsInFrame;
+ analysis->numCuInHeight = heightInCU;
+ analysis->numPartitions = m_param->num4x4Partitions;
+- x265_alloc_analysis_data(m_param, analysis);
++ PARAM_NS::x265_alloc_analysis_data(m_param, analysis);
+ }
+ if (m_param->bEnableTemporalSubLayers > 2)
+ {
+@@ -4434,7 +4434,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+ else if (fread(val, size, readSize, fileOffset) != readSize)\
+ {\
+ x265_log(NULL, X265_LOG_ERROR, "Error reading analysis data\n");\
+- x265_free_analysis_data(m_param, analysis);\
++ PARAM_NS::x265_free_analysis_data(m_param, analysis);\
+ m_aborted = true;\
+ return;\
+ }\
+@@ -4470,7 +4470,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+ if (poc != curPoc || feof(m_analysisFileIn))
+ {
+ x265_log(NULL, X265_LOG_WARNING, "Error reading analysis data: Cannot find POC %d\n", curPoc);
+- x265_free_analysis_data(m_param, analysis);
++ PARAM_NS::x265_free_analysis_data(m_param, analysis);
+ return;
+ }
+ }
+@@ -4504,7 +4504,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+ if (m_param->scaleFactor)
+ analysis->numPartitions *= factor;
+ /* Memory is allocated for inter and intra analysis data based on the slicetype */
+- x265_alloc_analysis_data(m_param, analysis);
++ PARAM_NS::x265_alloc_analysis_data(m_param, analysis);
+
+ if (m_param->ctuDistortionRefine == CTU_DISTORTION_INTERNAL)
+ {
+@@ -4757,7 +4757,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+ else if (fread(val, size, readSize, fileOffset) != readSize)\
+ {\
+ x265_log(NULL, X265_LOG_ERROR, "Error reading analysis data\n");\
+- x265_free_analysis_data(m_param, analysis);\
++ PARAM_NS::x265_free_analysis_data(m_param, analysis);\
+ m_aborted = true;\
+ return;\
+ }\
+@@ -4794,7 +4794,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+ if (poc != curPoc || feof(m_analysisFileIn))
+ {
+ x265_log(NULL, X265_LOG_WARNING, "Error reading analysis data: Cannot find POC %d\n", curPoc);
+- x265_free_analysis_data(m_param, analysis);
++ PARAM_NS::x265_free_analysis_data(m_param, analysis);
+ return;
+ }
+ }
+@@ -4825,7 +4825,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+ analysis->numCuInHeight = cuLoc.heightInCU;
+
+ /* Memory is allocated for inter and intra analysis data based on the slicetype */
+- x265_alloc_analysis_data(m_param, analysis);
++ PARAM_NS::x265_alloc_analysis_data(m_param, analysis);
+
+ if (m_param->ctuDistortionRefine == CTU_DISTORTION_INTERNAL)
+ {
+@@ -5440,7 +5440,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, int sli
+ if (fread(val, size, readSize, fileOffset) != readSize)\
+ {\
+ x265_log(NULL, X265_LOG_ERROR, "Error reading analysis 2 pass data\n"); \
+- x265_alloc_analysis_data(m_param, analysis); \
++ PARAM_NS::x265_alloc_analysis_data(m_param, analysis); \
+ m_aborted = true; \
+ return; \
+ }\
+@@ -5454,7 +5454,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, int sli
+ if (poc != curPoc || feof(m_analysisFileIn))
+ {
+ x265_log(NULL, X265_LOG_WARNING, "Error reading analysis 2 pass data: Cannot find POC %d\n", curPoc);
+- x265_free_analysis_data(m_param, analysis);
++ PARAM_NS::x265_free_analysis_data(m_param, analysis);
+ return;
+ }
+ /* Now arrived at the right frame, read the record */
+@@ -5561,7 +5561,7 @@ void Encoder::writeAnalysisFile(x265_analysis_data* analysis, FrameData &curEncD
+ if (fwrite(val, size, writeSize, fileOffset) < writeSize)\
+ {\
+ x265_log(NULL, X265_LOG_ERROR, "Error writing analysis data\n");\
+- x265_free_analysis_data(m_param, analysis);\
++ PARAM_NS::x265_free_analysis_data(m_param, analysis);\
+ m_aborted = true;\
+ return;\
+ }\
+@@ -5783,7 +5783,7 @@ void Encoder::writeAnalysisFileRefine(x265_analysis_data* analysis, FrameData &c
+ if (fwrite(val, size, writeSize, fileOffset) < writeSize)\
+ {\
+ x265_log(NULL, X265_LOG_ERROR, "Error writing analysis 2 pass data\n"); \
+- x265_free_analysis_data(m_param, analysis); \
++ PARAM_NS::x265_free_analysis_data(m_param, analysis); \
+ m_aborted = true; \
+ return; \
+ }\
diff --git a/media-libs/x265/x265-3.5-r3.ebuild b/media-libs/x265/x265-3.5-r3.ebuild
new file mode 100644
index 000000000000..f510894becf4
--- /dev/null
+++ b/media-libs/x265/x265-3.5-r3.ebuild
@@ -0,0 +1,217 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake multilib-minimal multibuild
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://bitbucket.org/multicoreware/x265_git/"
+ S=${WORKDIR}/${P}/source
+else
+ SRC_URI="https://bitbucket.org/multicoreware/x265_git/downloads/${PN}_${PV}.tar.gz"
+ KEYWORDS="amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
+fi
+
+DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
+HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265_git/"
+
+LICENSE="GPL-2"
+# subslot = libx265 soname
+SLOT="0/199"
+IUSE="+10bit +12bit cpu_flags_ppc_vsx2 numa test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}"
+ASM_DEPEND=">=dev-lang/nasm-2.13"
+BDEPEND="
+ abi_x86_32? ( ${ASM_DEPEND} )
+ abi_x86_64? ( ${ASM_DEPEND} )"
+
+PATCHES=(
+ "${FILESDIR}/arm-r1.patch"
+ "${FILESDIR}/neon.patch"
+ "${FILESDIR}/x265-3.3-ppc64.patch"
+ "${FILESDIR}/tests.patch"
+ "${FILESDIR}/test-ns.patch"
+)
+
+src_unpack() {
+ if [[ ${PV} = 9999* ]]; then
+ git-r3_src_unpack
+ else
+ unpack ${A}
+ export S="$(echo "${WORKDIR}/${PN}_"*"/source")"
+ fi
+}
+
+# By default, the library and the encoder is configured for only one output bit
+# depth. Meaning, one has to rebuild libx265 if (s)he wants to produce HEVC
+# files with a different bit depth, which is annoying. However, upstream
+# supports proper namespacing for 8bits, 10bits & 12bits HEVC and linking all
+# that together so that the resulting library can produce all three of them
+# instead of only one.
+# The API requires the bit depth parameter, so that libx265 can then chose which
+# variant of the encoder to use.
+# To achieve this, we have to build one (static) library for each non-main
+# variant, and link it into the main library.
+# Upstream documents using the 8bit variant as main library, hence we do not
+# allow disabling it: "main" *MUST* come last in the following list.
+
+x265_get_variants() {
+ local variants=""
+ use 12bit && variants+="main12 "
+ use 10bit && variants+="main10 "
+ variants+="main"
+ echo "${variants}"
+}
+
+x265_variant_src_configure() {
+ mkdir -p "${BUILD_DIR}" || die
+ pushd "${BUILD_DIR}" >/dev/null || die
+
+ einfo "Configuring variant: ${MULTIBUILD_VARIANT} for ABI: ${ABI}"
+
+ local mycmakeargs=( "${myabicmakeargs[@]}" )
+ case "${MULTIBUILD_VARIANT}" in
+ "main12")
+ mycmakeargs+=(
+ -DHIGH_BIT_DEPTH=ON
+ -DEXPORT_C_API=OFF
+ -DENABLE_SHARED=OFF
+ -DENABLE_CLI=OFF
+ -DMAIN12=ON
+ )
+ if [[ ${ABI} = x86 ]] ; then
+ mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
+ fi
+ if [[ ${ABI} = arm* ]] ; then
+ # 589674
+ mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
+ fi
+ # disable altivec for 12bit build #607802#c5
+ if [[ ${ABI} = ppc* ]] ; then
+ mycmakeargs+=(
+ -DENABLE_ALTIVEC=OFF
+ -DCPU_POWER8=$(usex cpu_flags_ppc_vsx2 ON OFF)
+ )
+ fi
+ ;;
+ "main10")
+ mycmakeargs+=(
+ -DHIGH_BIT_DEPTH=ON
+ -DEXPORT_C_API=OFF
+ -DENABLE_SHARED=OFF
+ -DENABLE_CLI=OFF
+ -DENABLE_HDR10_PLUS=ON
+ )
+ if [[ ${ABI} = x86 ]] ; then
+ mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
+ fi
+ if [[ ${ABI} = arm* ]] ; then
+ # 589674
+ mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
+ fi
+ # disable altivec for 10bit build #607802#c5
+ if [[ ${ABI} = ppc* ]] ; then
+ mycmakeargs+=(
+ -DENABLE_ALTIVEC=OFF
+ -DCPU_POWER8=$(usex cpu_flags_ppc_vsx2 ON OFF)
+ )
+ fi
+ ;;
+ "main")
+ if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ; then
+ local myvariants=( "${MULTIBUILD_VARIANTS[@]}" )
+ unset myvariants[${#MULTIBUILD_VARIANTS[@]}-1]
+ local liblist="" v=
+ for v in "${myvariants[@]}" ; do
+ ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die
+ liblist+="libx265_${v}.a;"
+ done
+ mycmakeargs+=(
+ -DEXTRA_LIB="${liblist}"
+ -DEXTRA_LINK_FLAGS=-L.
+ -DLINKED_10BIT=$(usex 10bit)
+ -DLINKED_12BIT=$(usex 12bit)
+ )
+ if [[ ${ABI} = ppc* ]] ; then
+ # upstream uses mix of altivec + power8 vectors
+ # it's impossible to enable altivec without CPU_POWER8
+ # and it does not work on ppc32
+ # so we toggle both variables together
+ mycmakeargs+=(
+ -DCPU_POWER8=$(usex cpu_flags_ppc_vsx2 ON OFF)
+ -DENABLE_ALTIVEC=$(usex cpu_flags_ppc_vsx2 ON OFF)
+ )
+ fi
+ fi
+ ;;
+ *)
+ die "Unknown variant: ${MULTIBUILD_VARIANT}";;
+ esac
+ cmake_src_configure
+ popd >/dev/null || die
+}
+
+multilib_src_configure() {
+ local myabicmakeargs=(
+ -DENABLE_TESTS=$(usex test ON OFF)
+ $(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
+ -DENABLE_PIC=ON
+ -DENABLE_LIBNUMA=$(usex numa ON OFF)
+ -DGIT_ARCHETYPE=1 #814116
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+ )
+
+ # Unfortunately, the asm for x86/x32/arm isn't PIC-safe.
+ if [[ ${ABI} = x86 ]] ; then
+ # Bug #528202, bug #913412
+ myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
+ elif [[ ${ABI} = x32 ]] ; then
+ # bug #510890
+ myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
+ elif [[ ${ABI} = arm ]] ; then
+ myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
+ fi
+
+ local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
+ multibuild_foreach_variant x265_variant_src_configure
+}
+
+multilib_src_compile() {
+ local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
+ multibuild_foreach_variant cmake_src_compile
+}
+
+x265_variant_src_test() {
+ if [ -x "${BUILD_DIR}/test/TestBench" ] ; then
+ "${BUILD_DIR}/test/TestBench" || die
+ else
+ einfo "Unit tests check only assembly."
+ einfo "You do not seem to have any for ABI=${ABI}, x265 variant=${MULTIBUILD_VARIANT}"
+ einfo "Skipping tests."
+ fi
+}
+
+multilib_src_test() {
+ local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
+ multibuild_foreach_variant x265_variant_src_test
+}
+
+multilib_src_install() {
+ # Install only "main" variant since the others are already linked into it.
+ local MULTIBUILD_VARIANTS=( "main" )
+ multibuild_foreach_variant cmake_src_install
+}
+
+multilib_src_install_all() {
+ dodoc -r "${S}/../doc/"*
+
+ # we don't install *.a files for all variants,
+ # so just delete these files instead of pretending
+ # real USE=static-libs support
+ find "${ED}" -name "*.a" -delete || die
+}
diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-9999.ebuild
index d7587145d46d..7503475200d5 100644
--- a/media-libs/x265/x265-9999.ebuild
+++ b/media-libs/x265/x265-9999.ebuild
@@ -11,7 +11,7 @@ if [[ ${PV} = 9999* ]]; then
S=${WORKDIR}/${P}/source
else
SRC_URI="https://bitbucket.org/multicoreware/x265_git/downloads/${PN}_${PV}.tar.gz"
- KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~x86"
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
fi
DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
@@ -19,8 +19,8 @@ HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265_git/"
LICENSE="GPL-2"
# subslot = libx265 soname
-SLOT="0/207"
-IUSE="+10bit +12bit cpu_flags_arm_neon cpu_flags_ppc_vsx2 numa pic test"
+SLOT="0/208"
+IUSE="+10bit +12bit cpu_flags_ppc_vsx2 numa test"
RESTRICT="!test? ( test )"
RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
@@ -32,10 +32,9 @@ BDEPEND="
PATCHES=(
"${FILESDIR}/${PN}-9999-arm.patch"
- #"${FILESDIR}/neon.patch"
- "${FILESDIR}/${PN}-9999-ppc64.patch"
+ "${FILESDIR}/neon.patch"
"${FILESDIR}/tests.patch"
- "${FILESDIR}/test-ns.patch"
+ "${FILESDIR}/${PN}-9999-test-ns.patch"
)
src_unpack() {
@@ -166,18 +165,15 @@ multilib_src_configure() {
-DLIB_INSTALL_DIR="$(get_libdir)"
)
+ # Unfortunately, the asm for x86/x32/arm isn't PIC-safe.
if [[ ${ABI} = x86 ]] ; then
- # Bug #528202
- if use pic ; then
- ewarn "PIC has been requested but x86 asm is not PIC-safe, disabling it."
- myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
- fi
+ # Bug #528202, bug #913412
+ myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
elif [[ ${ABI} = x32 ]] ; then
# bug #510890
myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
elif [[ ${ABI} = arm ]] ; then
- myabicmakeargs+=( -DENABLE_ASSEMBLY=$(usex pic OFF $(usex cpu_flags_arm_neon ON OFF)) )
- use cpu_flags_arm_neon && use pic && ewarn "PIC has been requested but arm neon asm is not PIC-safe, disabling it."
+ myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
fi
local MULTIBUILD_VARIANTS=( $(x265_get_variants) )