Hi Johannes Kauffmann, Could you share the patches attached to this email?
Thanks, Yaswanth On Fri, Jun 9, 2023 at 5:30 PM <[email protected]> wrote: > Send x265-devel mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > https://mailman.videolan.org/listinfo/x265-devel > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of x265-devel digest..." > > > Today's Topics: > > 1. [PATCH 2/3] Fix Wundef for ENABLE_LIBVMAF (Johannes Kauffmann) > 2. [PATCH 3/3] Add defines needed by client apps to .pc file > (Johannes Kauffmann) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 9 Jun 2023 00:11:42 +0200 > From: Johannes Kauffmann <[email protected]> > To: [email protected] > Subject: [x265] [PATCH 2/3] Fix Wundef for ENABLE_LIBVMAF > Message-ID: > < > db6pr07mb317525092b6c7590902611caa6...@db6pr07mb3175.eurprd07.prod.outlook.com > > > > Content-Type: text/plain > > --- > source/abrEncApp.cpp | 4 ++-- > source/encoder/api.cpp | 18 +++++++++--------- > source/encoder/encoder.cpp | 2 +- > source/encoder/frameencoder.cpp | 4 ++-- > source/encoder/frameencoder.h | 2 +- > source/x265.h | 4 ++-- > source/x265cli.cpp | 4 ++-- > 7 files changed, 19 insertions(+), 19 deletions(-) > > diff --git a/source/abrEncApp.cpp b/source/abrEncApp.cpp > index 94644a1c0..4b4c2242c 100644 > --- a/source/abrEncApp.cpp > +++ b/source/abrEncApp.cpp > @@ -514,7 +514,7 @@ ret: > while (m_threadActive) > { > > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > x265_vmaf_data* vmafdata = m_cliopt.vmafData; > #endif > /* This allows muxers to modify bitstream format */ > @@ -816,7 +816,7 @@ ret: > > api->encoder_get_stats(m_encoder, &stats, sizeof(stats)); > if (m_param->csvfn && !b_ctrl_c) > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > api->vmaf_encoder_log(m_encoder, m_cliopt.argCnt, > m_cliopt.argString, m_cliopt.param, vmafdata); > #else > api->encoder_log(m_encoder, m_cliopt.argCnt, > m_cliopt.argString); > diff --git a/source/encoder/api.cpp b/source/encoder/api.cpp > index 18edb9a70..542b074a5 100644 > --- a/source/encoder/api.cpp > +++ b/source/encoder/api.cpp > @@ -32,7 +32,7 @@ > #include "bitcost.h" > #include "svt.h" > > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > #include "libvmaf/libvmaf.h" > #endif > > @@ -626,7 +626,7 @@ void x265_encoder_get_stats(x265_encoder *enc, > x265_stats *outputStats, uint32_t > encoder->fetchStats(outputStats, statsSizeBytes); > } > } > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > void x265_vmaf_encoder_log(x265_encoder* enc, int argc, char **argv, > x265_param *param, x265_vmaf_data *vmafdata) > { > if (enc) > @@ -1076,7 +1076,7 @@ static const x265_api libapi = > &x265_csvlog_encode, > &x265_dither_image, > &x265_set_analysis_data, > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > &x265_calculate_vmafscore, > &x265_calculate_vmaf_framelevelscore, > &x265_vmaf_encoder_log, > @@ -1381,7 +1381,7 @@ FILE* x265_csvlog_open(const x265_param* param) > /* detailed performance statistics */ > fprintf(csvfp, ", DecideWait (ms), Row0Wait (ms), > Wall time (ms), Ref Wait Wall (ms), Total CTU time (ms)," > "Stall Time (ms), Total frame time (ms), Avg WPP, > Row Blocks"); > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > fprintf(csvfp, ", VMAF Frame Score"); > #endif > } > @@ -1392,7 +1392,7 @@ FILE* x265_csvlog_open(const x265_param* param) > fputs(summaryCSVHeader, csvfp); > if (param->csvLogLevel >= 2 || param->maxCLL || > param->maxFALL) > fputs("MaxCLL, MaxFALL,", csvfp); > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > fputs(" Aggregate VMAF Score,", csvfp); > #endif > fputs(" Version\n", csvfp); > @@ -1508,7 +1508,7 @@ void x265_csvlog_frame(const x265_param* param, > const x265_picture* pic) > > frameStats->totalFrameTime); > > fprintf(param->csvfpt, " %.3lf, %d", frameStats->avgWPP, > frameStats->countRowBlocks); > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > fprintf(param->csvfpt, ", %lf", frameStats->vmafFrameScore); > #endif > } > @@ -1529,7 +1529,7 @@ void x265_csvlog_encode(const x265_param *p, const > x265_stats *stats, int padx, > fputs(summaryCSVHeader, p->csvfpt); > if (p->csvLogLevel >= 2 || p->maxCLL || p->maxFALL) > fputs("MaxCLL, MaxFALL,", p->csvfpt); > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > fputs(" Aggregate VMAF score,", p->csvfpt); > #endif > fputs(" Version\n",p->csvfpt); > @@ -1627,7 +1627,7 @@ void x265_csvlog_encode(const x265_param *p, const > x265_stats *stats, int padx, > fprintf(p->csvfpt, " -, -, -, -, -, -, -,"); > if (p->csvLogLevel >= 2 || p->maxCLL || p->maxFALL) > fprintf(p->csvfpt, " %-6u, %-6u,", stats->maxCLL, > stats->maxFALL); > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > fprintf(p->csvfpt, " %lf,", stats->aggregateVmafScore); > #endif > fprintf(p->csvfpt, " %s\n", api->version_str); > @@ -1722,7 +1722,7 @@ void x265_dither_image(x265_picture* picIn, int > picWidth, int picHeight, int16_t > } > } > > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > /* Read y values of single frame for 8-bit input */ > int read_image_byte(FILE *file, float *buf, int width, int height, int > stride) > { > diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp > index 977ae19e3..e3e205fd0 100644 > --- a/source/encoder/encoder.cpp > +++ b/source/encoder/encoder.cpp > @@ -3080,7 +3080,7 @@ void Encoder::finishFrameStats(Frame* curFrame, > FrameEncoder *curEncoder, x265_f > #define ELAPSED_MSEC(start, end) (((double)(end) - (start)) / 1000) > if (m_param->csvLogLevel >= 2) > { > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > frameStats->vmafFrameScore = curFrame->m_fencPic->m_vmafScore; > #endif > frameStats->decideWaitTime = ELAPSED_MSEC(0, > curEncoder->m_slicetypeWaitTime); > diff --git a/source/encoder/frameencoder.cpp > b/source/encoder/frameencoder.cpp > index 659b87c89..c11ede720 100644 > --- a/source/encoder/frameencoder.cpp > +++ b/source/encoder/frameencoder.cpp > @@ -959,7 +959,7 @@ void FrameEncoder::compressFrame() > m_frameFilter.processRow(i - m_filterRowDelay); > } > } > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > vmafFrameLevelScore(); > #endif > > @@ -2232,7 +2232,7 @@ void > FrameEncoder::readModel(FilmGrainCharacteristics* m_filmGrain, FILE* filmgr > } > } > } > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > void FrameEncoder::vmafFrameLevelScore() > { > PicYuv *fenc = m_frame->m_fencPic; > diff --git a/source/encoder/frameencoder.h b/source/encoder/frameencoder.h > index 9c5810883..21f2ffaf0 100644 > --- a/source/encoder/frameencoder.h > +++ b/source/encoder/frameencoder.h > @@ -277,7 +277,7 @@ protected: > void enqueueRowFilter(int row) { WaveFront::enqueueRow(row * 2 + 1); > } > void enableRowEncoder(int row) { WaveFront::enableRow(row * 2 + 0); } > void enableRowFilter(int row) { WaveFront::enableRow(row * 2 + 1); } > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > void vmafFrameLevelScore(); > #endif > void collectDynDataFrame(); > diff --git a/source/x265.h b/source/x265.h > index 901f33ded..d153d048e 100644 > --- a/source/x265.h > +++ b/source/x265.h > @@ -2522,7 +2522,7 @@ void x265_csvlog_encode(const x265_param*, const > x265_stats *, int padx, int pad > /* In-place downshift from a bit-depth greater than 8 to a bit-depth of > 8, using > * the residual bits to dither each row. */ > void x265_dither_image(x265_picture *, int picWidth, int picHeight, > int16_t *errorBuf, int bitDepth); > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > /* x265_calculate_vmafScore: > * returns VMAF score for the input video. > * This api must be called only after encoding was done. */ > @@ -2593,7 +2593,7 @@ typedef struct x265_api > void (*csvlog_encode)(const x265_param*, const x265_stats *, > int, int, int, char**); > void (*dither_image)(x265_picture*, int, int, int16_t*, int); > int (*set_analysis_data)(x265_encoder *encoder, > x265_analysis_data *analysis_data, int poc, uint32_t cuBytes); > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > double (*calculate_vmafscore)(x265_param *, x265_vmaf_data *); > double (*calculate_vmaf_framelevelscore)(x265_vmaf_framedata > *); > void (*vmaf_encoder_log)(x265_encoder*, int, char**, > x265_param *, x265_vmaf_data *); > diff --git a/source/x265cli.cpp b/source/x265cli.cpp > index eef101fe9..4e3e4a4e5 100755 > --- a/source/x265cli.cpp > +++ b/source/x265cli.cpp > @@ -637,7 +637,7 @@ namespace X265_NS { > x265_log(NULL, X265_LOG_ERROR, "param alloc failed\n"); > return true; > } > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > vmafData = (x265_vmaf_data*)x265_malloc(sizeof(x265_vmaf_data)); > if (!vmafData) > { > @@ -930,7 +930,7 @@ namespace X265_NS { > param->sourceWidth, param->sourceHeight, param->fpsNum, > param->fpsDenom, > x265_source_csp_names[param->internalCsp]); > } > -#if ENABLE_LIBVMAF > +#ifdef ENABLE_LIBVMAF > if (!reconfn) > { > x265_log(param, X265_LOG_ERROR, "recon file must be specified > to get VMAF score, try --help for help\n"); > -- > 2.34.1 > > > > ------------------------------ > > Message: 2 > Date: Fri, 9 Jun 2023 00:11:43 +0200 > From: Johannes Kauffmann <[email protected]> > To: [email protected] > Subject: [x265] [PATCH 3/3] Add defines needed by client apps to .pc > file > Message-ID: > < > db6pr07mb3175a8ad89183e730e949d72a6...@db6pr07mb3175.eurprd07.prod.outlook.com > > > > Content-Type: text/plain > > For now, the only defines also needed by client apps are HIGH_BIT_DEPTH > and ENABLE_LIBVMAF. > > Also, use HIGH_BIT_DEPTH define in public header, instead of X265_DEPTH. > --- > source/CMakeLists.txt | 15 +++++++++++---- > source/x265.h | 2 +- > source/x265.pc.in | 2 +- > 3 files changed, 13 insertions(+), 6 deletions(-) > > diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt > index e1c83bf97..cbbd813d2 100755 > --- a/source/CMakeLists.txt > +++ b/source/CMakeLists.txt > @@ -37,6 +37,10 @@ configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in" > > SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" > "${CMAKE_MODULE_PATH}") > > +# Added to the .pc file, and also passed to add_definitions() later. Use > this variable > +# instead of add_definitions() for flags needed by both x265 itself and > client applications. > +set(X265_PUBLIC_DEFINES "") > + > # System architecture detection > if (APPLE AND CMAKE_OSX_ARCHITECTURES) > string(TOLOWER "${CMAKE_OSX_ARCHITECTURES}" SYSPROC) > @@ -129,7 +133,7 @@ if(UNIX) > find_library(VMAF vmaf) > option(ENABLE_LIBVMAF "Enable VMAF" OFF) > if(ENABLE_LIBVMAF) > - add_definitions(-DENABLE_LIBVMAF) > + set(X265_PUBLIC_DEFINES "${X265_PUBLIC_DEFINES} -DENABLE_LIBVMAF") > endif() > endif(UNIX) > > @@ -405,14 +409,15 @@ if(X64) > option(HIGH_BIT_DEPTH "Store pixel samples as 16bit values > (Main10/Main12)" OFF) > endif(X64) > if(HIGH_BIT_DEPTH) > + set(X265_PUBLIC_DEFINES "${X265_PUBLIC_DEFINES} -DHIGH_BIT_DEPTH") > option(MAIN12 "Support Main12 instead of Main10" OFF) > if(MAIN12) > - add_definitions(-DHIGH_BIT_DEPTH=1 -DX265_DEPTH=12) > + add_definitions(-DX265_DEPTH=12) > else() > - add_definitions(-DHIGH_BIT_DEPTH=1 -DX265_DEPTH=10) > + add_definitions(-DX265_DEPTH=10) > endif() > else(HIGH_BIT_DEPTH) > - add_definitions(-DHIGH_BIT_DEPTH=0 -DX265_DEPTH=8) > + add_definitions(-DX265_DEPTH=8) > endif(HIGH_BIT_DEPTH) > > if (ENABLE_HDR10_PLUS) > @@ -722,6 +727,8 @@ if(ENABLE_SHARED) > endif() > endif() > > +add_definitions("${X265_PUBLIC_DEFINES}") > + > if(X265_LATEST_TAG) > # convert lists of link libraries into -lstdc++ -lm etc.. > foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS}) > diff --git a/source/x265.h b/source/x265.h > index d153d048e..be50639c3 100644 > --- a/source/x265.h > +++ b/source/x265.h > @@ -181,7 +181,7 @@ typedef struct x265_weight_param > int wtPresent; > }x265_weight_param; > > -#if X265_DEPTH < 10 > +#ifndef HIGH_BIT_DEPTH > typedef uint32_t sse_t; > #else > typedef uint64_t sse_t; > diff --git a/source/x265.pc.in b/source/x265.pc.in > index 0bf99e938..993d674a2 100644 > --- a/source/x265.pc.in > +++ b/source/x265.pc.in > @@ -8,4 +8,4 @@ Description: H.265/HEVC video encoder > Version: @X265_LATEST_TAG@ > Libs: -L${libdir} -lx265 > Libs.private: @PRIVATE_LIBS@ > -Cflags: -I${includedir} > +Cflags: -I${includedir} @X265_PUBLIC_DEFINES@ > -- > 2.34.1 > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > x265-devel mailing list > [email protected] > https://mailman.videolan.org/listinfo/x265-devel > > > ------------------------------ > > End of x265-devel Digest, Vol 120, Issue 3 > ****************************************** >
_______________________________________________ x265-devel mailing list [email protected] https://mailman.videolan.org/listinfo/x265-devel
