Lines Matching defs:avctx

66 static av_cold int pixlet_init(AVCodecContext *avctx)
68 avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
69 avctx->color_range = AVCOL_RANGE_JPEG;
73 static void free_buffers(AVCodecContext *avctx)
75 PixletContext *ctx = avctx->priv_data;
82 static av_cold int pixlet_close(AVCodecContext *avctx)
84 PixletContext *ctx = avctx->priv_data;
85 free_buffers(avctx);
91 static int init_decoder(AVCodecContext *avctx)
93 PixletContext *ctx = avctx->priv_data;
126 static int read_low_coeffs(AVCodecContext *avctx, int16_t *dst, int size,
129 PixletContext *ctx = avctx->priv_data;
201 static int read_high_coeffs(AVCodecContext *avctx, const uint8_t *src, int16_t *dst,
205 PixletContext *ctx = avctx->priv_data;
316 static int read_highpass(AVCodecContext *avctx, const uint8_t *ptr,
319 PixletContext *ctx = avctx->priv_data;
335 av_log(avctx, AV_LOG_ERROR,
344 ret = read_high_coeffs(avctx, ptr + bytestream2_tell(&ctx->gb), dest, size,
348 av_log(avctx, AV_LOG_ERROR,
424 static void reconstruction(AVCodecContext *avctx, int16_t *dest,
428 PixletContext *ctx = avctx->priv_data;
467 static void build_luma_lut(AVCodecContext *avctx, int depth)
469 PixletContext *ctx = avctx->priv_data;
480 static void postprocess_luma(AVCodecContext *avctx, AVFrame *frame,
483 PixletContext *ctx = avctx->priv_data;
528 static int decode_plane(AVCodecContext *avctx, int plane,
531 PixletContext *ctx = avctx->priv_data;
558 ret = read_low_coeffs(avctx, dst + 1, ctx->band[plane][0].width - 1,
561 av_log(avctx, AV_LOG_ERROR,
566 ret = read_low_coeffs(avctx, dst + stride,
569 av_log(avctx, AV_LOG_ERROR,
575 ret = read_low_coeffs(avctx, dst + stride + 1,
579 av_log(avctx, AV_LOG_ERROR,
586 av_log(avctx, AV_LOG_ERROR, "no bytes left\n");
590 ret = read_highpass(avctx, avpkt->data, plane, frame);
597 reconstruction(avctx, (int16_t *)frame->data[plane], ctx->w >> shift,
604 static int pixlet_decode_frame(AVCodecContext *avctx, AVFrame *p,
607 PixletContext *ctx = avctx->priv_data;
615 av_log(avctx, AV_LOG_ERROR, "Invalid packet size %"PRIu32"\n", pktsize);
621 avpriv_request_sample(avctx, "Version %d", version);
643 avpriv_request_sample(avctx, "Depth %d", depth);
647 build_luma_lut(avctx, depth);
649 ret = ff_set_dimensions(avctx, w, h);
652 avctx->width = width;
653 avctx->height = height;
656 free_buffers(avctx);
660 ret = init_decoder(avctx);
662 free_buffers(avctx);
675 ret = ff_thread_get_buffer(avctx, p, 0);
680 ret = decode_plane(avctx, i, avpkt, p);
683 if (avctx->flags & AV_CODEC_FLAG_GRAY)
687 postprocess_luma(avctx, p, ctx->w, ctx->h, ctx->depth);