MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / cri_decode_init

Function cri_decode_init

libavcodec/cri.c:52–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50} CRIContext;
51
52static av_cold int cri_decode_init(AVCodecContext *avctx)
53{
54 CRIContext *s = avctx->priv_data;
55 int ret;
56
57 s->jpgframe = av_frame_alloc();
58 if (!s->jpgframe)
59 return AVERROR(ENOMEM);
60
61 s->jpkt = av_packet_alloc();
62 if (!s->jpkt)
63 return AVERROR(ENOMEM);
64
65 EXTERN const FFCodec ff_mjpeg_decoder;
66 s->jpeg_avctx = avcodec_alloc_context3(&ff_mjpeg_decoder.p);
67 if (!s->jpeg_avctx)
68 return AVERROR(ENOMEM);
69 s->jpeg_avctx->flags = avctx->flags;
70 s->jpeg_avctx->flags2 = avctx->flags2;
71 s->jpeg_avctx->idct_algo = avctx->idct_algo;
72 s->jpeg_avctx->max_pixels = avctx->max_pixels;
73 ret = avcodec_open2(s->jpeg_avctx, NULL, NULL);
74 if (ret < 0)
75 return ret;
76
77 return 0;
78}
79
80static void unpack_10bit(GetByteContext *gb, uint16_t *dst, int shift,
81 int w, int h, ptrdiff_t stride)

Callers

nothing calls this directly

Calls 4

av_frame_allocFunction · 0.85
av_packet_allocFunction · 0.85
avcodec_alloc_context3Function · 0.85
avcodec_open2Function · 0.85

Tested by

no test coverage detected