Lines Matching refs:ctx
56 LibJxlDecodeContext *ctx = avctx->priv_data;
58 ctx->events = JXL_DEC_BASIC_INFO | JXL_DEC_FULL_IMAGE | JXL_DEC_COLOR_ENCODING;
59 if (JxlDecoderSubscribeEvents(ctx->decoder, ctx->events) != JXL_DEC_SUCCESS) {
64 if (JxlDecoderSetParallelRunner(ctx->decoder, JxlThreadParallelRunner, ctx->runner) != JXL_DEC_SUCCESS) {
69 memset(&ctx->basic_info, 0, sizeof(JxlBasicInfo));
70 memset(&ctx->jxl_pixfmt, 0, sizeof(JxlPixelFormat));
77 LibJxlDecodeContext *ctx = avctx->priv_data;
81 ctx->decoder = JxlDecoderCreate(&manager);
82 if (!ctx->decoder) {
87 ctx->runner = JxlThreadParallelRunnerCreate(&manager, ff_libjxl_get_threadcount(avctx->thread_count));
88 if (!ctx->runner) {
186 LibJxlDecodeContext *ctx = avctx->priv_data;
191 jret = JxlDecoderGetICCProfileSize(ctx->decoder, &ctx->jxl_pixfmt, JXL_COLOR_PROFILE_TARGET_DATA, &icc_len);
193 av_buffer_unref(&ctx->iccp);
194 ctx->iccp = av_buffer_alloc(icc_len);
195 if (!ctx->iccp)
197 jret = JxlDecoderGetColorAsICCProfile(ctx->decoder, &ctx->jxl_pixfmt, JXL_COLOR_PROFILE_TARGET_DATA,
198 ctx->iccp->data, icc_len);
201 av_buffer_unref(&ctx->iccp);
227 LibJxlDecodeContext *ctx = avctx->priv_data;
234 jret = JxlDecoderGetColorAsEncodedProfile(ctx->decoder, NULL, JXL_COLOR_PROFILE_TARGET_ORIGINAL, &jxl_color);
237 jret = JxlDecoderSetPreferredColorProfile(ctx->decoder, &jxl_color);
239 jret = JxlDecoderGetColorAsEncodedProfile(ctx->decoder, &ctx->jxl_pixfmt, JXL_COLOR_PROFILE_TARGET_DATA, &jxl_color);
246 if (ctx->basic_info.uses_original_profile) {
262 if (ctx->jxl_pixfmt.num_channels >= 3)
267 if (!ctx->iccp) {
285 if (ctx->jxl_pixfmt.data_type == JXL_TYPE_FLOAT
286 || ctx->jxl_pixfmt.data_type == JXL_TYPE_FLOAT16) {
299 jret = JxlDecoderSetPreferredColorProfile(ctx->decoder, &jxl_color);
323 LibJxlDecodeContext *ctx = avctx->priv_data;
332 jret = JxlDecoderSetInput(ctx->decoder, buf, remaining);
340 jret = JxlDecoderProcessInput(ctx->decoder);
346 remaining = JxlDecoderReleaseInput(ctx->decoder);
362 if (JxlDecoderGetBasicInfo(ctx->decoder, &ctx->basic_info) != JXL_DEC_SUCCESS) {
370 avctx->pix_fmt = libjxl_get_pix_fmt(avctx, &ctx->basic_info, &ctx->jxl_pixfmt);
375 if ((ret = ff_set_dimensions(avctx, ctx->basic_info.xsize, ctx->basic_info.ysize)) < 0)
387 ctx->jxl_pixfmt.align = frame->linesize[0];
388 if (JxlDecoderSetImageOutBuffer(ctx->decoder, &ctx->jxl_pixfmt, frame->data[0], frame->buf[0]->size)
399 if (ctx->iccp) {
400 AVFrameSideData *sd = av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_ICC_PROFILE, ctx->iccp);
404 ctx->iccp = NULL;
421 JxlDecoderReset(ctx->decoder);
435 LibJxlDecodeContext *ctx = avctx->priv_data;
437 if (ctx->runner)
438 JxlThreadParallelRunnerDestroy(ctx->runner);
439 ctx->runner = NULL;
440 if (ctx->decoder)
441 JxlDecoderDestroy(ctx->decoder);
442 ctx->decoder = NULL;
443 av_buffer_unref(&ctx->iccp);