| 50 | } CRIContext; |
| 51 | |
| 52 | static 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 | |
| 80 | static void unpack_10bit(GetByteContext *gb, uint16_t *dst, int shift, |
| 81 | int w, int h, ptrdiff_t stride) |
nothing calls this directly
no test coverage detected