Re: [FFmpeg-devel] [PATCH] avcodec/libx265: use x265 Multi-library Interface to query the API
On 5/11/2015 5:57 AM, Gopu Govindaswamy wrote: > Thanks for review, Do i need to send a new patch or this patch itself can > move into ffmpeg repo? I fixed and pushed it. I was out of the country for a few days, hence the delay. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/libx265: use x265 Multi-library Interface to query the API
Hello Derek, Thanks for review, Do i need to send a new patch or this patch itself can move into ffmpeg repo? Regards Gopu On Sat, May 9, 2015 at 12:38 AM, Derek Buitenhuis < derek.buitenh...@gmail.com> wrote: > On 5/7/2015 10:17 AM, Gopu Govindaswamy wrote: > > Hello, > > > > this patch is ffmpeg can now use the x265 multi-library interface to > make a > > run-time selection between a number of libx265 libraries (perhaps 8bpp > and > > 16bpp). > > > > I have attached the patch with this mail, > > [...] > > > -x265_picture x265pic_out = { 0 }; > > +x265_picture x265pic_out = { { 0 } }; > > Unrelated change. > > > -ret = x265_encoder_encode(ctx->encoder, &nal, &nnal, > > +ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal, > >pic ? &x265pic : NULL, &x265pic_out); > > Line needs re-indent. > > Other than that, I think it can be applied. > > - Derek > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > -- Thanks & Regards Gopu G Multicoreware Inc ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/libx265: use x265 Multi-library Interface to query the API
On 5/7/2015 10:17 AM, Gopu Govindaswamy wrote: > Hello, > > this patch is ffmpeg can now use the x265 multi-library interface to make a > run-time selection between a number of libx265 libraries (perhaps 8bpp and > 16bpp). > > I have attached the patch with this mail, [...] > -x265_picture x265pic_out = { 0 }; > +x265_picture x265pic_out = { { 0 } }; Unrelated change. > -ret = x265_encoder_encode(ctx->encoder, &nal, &nnal, > +ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal, >pic ? &x265pic : NULL, &x265pic_out); Line needs re-indent. Other than that, I think it can be applied. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/libx265: use x265 Multi-library Interface to query the API
On 5/5/2015 9:54 AM, Gopu Govindaswamy wrote: >>From c882bbf42b0f13f98fb706139b7d3fbc53665319 Mon Sep 17 00:00:00 2001 > From: Gopu Govindaswamy > Date: Tue, 5 May 2015 12:24:44 +0530 > Subject: [PATCH] avcodec/libx265: use x265 Multi-library Interface to query > the API The patch is malformed. Please use git-email. > If Application might want to make a runtime selection between > a number of libx265 libraries (perhaps 8bpp and 16bpp), then we want > to use the multi-library interface, > > The Application must link to one build of libx265 (statically or > dynamically) and this linked version of libx265 will support one > bit-depth (8 or 10 bits). [...] > If the application must now request the API for the bitDepth you would > prefer the encoder to use (8 or 10). If the requested bitdepth is zero, > or if it matches the bitdepth of the system default libx265 (the > currently linked library), then this library will be used for encode. > If you request a different bit-depth, the linked libx265 will attempt > to dynamically bind a shared library with a name appropriate for the > requested bit-depth You should mention this is a new x265 API meant specifically for this. > This changes enables the ffmpeg to query an API for > the bitdepth of the input pixels, to make a runtime selection between > a number of libx265 libraries (perhaps 8bpp and 16bpp) Remove this bit. > --- > libavcodec/libx265.c | 33 ++--- > 1 file changed, 22 insertions(+), 11 deletions(-) You need to update the API requirements in the check in configure. > x265_encoder *encoder; > x265_param *params; > +const x265_api *api; Broken spacing. > > float crf; > char *preset; > @@ -67,10 +68,10 @@ static av_cold int libx265_encode_close(AVCodecContext > *avctx) > > av_frame_free(&avctx->coded_frame); > > -x265_param_free(ctx->params); > +ctx->api->param_free(ctx->params); > > if (ctx->encoder) > -x265_encoder_close(ctx->encoder); > +ctx->api->encoder_close(ctx->encoder); > > return 0; > } > @@ -79,6 +80,16 @@ static av_cold int libx265_encode_init(AVCodecContext > *avctx) > { > libx265Context *ctx = avctx->priv_data; > > +ctx->api = NULL; Not needed. Private data is always zero-initialized. > +ctx->api = > x265_api_get(av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1); > +if (!ctx->api) > +ctx->api = x265_api_get(0); > + > +if (!ctx->api) { > +av_log(avctx, AV_LOG_ERROR, "Could not get x265 API. \n"); Extra space at end of log message. > +return AVERROR(ENOSYS); I think we have AVERROR_EXTERNAL now. Rest is probably OK. - Derek ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel