Lines Matching refs:avctx
41 AVCodecContext *avctx;
51 static av_cold int msrle_decode_init(AVCodecContext *avctx)
53 MsrleContext *s = avctx->priv_data;
56 s->avctx = avctx;
58 switch (avctx->bits_per_coded_sample) {
60 avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
64 avctx->pix_fmt = AV_PIX_FMT_PAL8;
67 avctx->pix_fmt = AV_PIX_FMT_BGR24;
70 av_log(avctx, AV_LOG_ERROR, "unsupported bits per sample\n");
78 if (avctx->extradata_size >= 4)
79 for (i = 0; i < FFMIN(avctx->extradata_size, AVPALETTE_SIZE)/4; i++)
80 s->pal[i] = 0xFFU<<24 | AV_RL32(avctx->extradata+4*i);
85 static int msrle_decode_frame(AVCodecContext *avctx,
91 MsrleContext *s = avctx->priv_data;
92 int istride = FFALIGN(avctx->width*avctx->bits_per_coded_sample, 32) / 8;
98 if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
101 if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) {
113 if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
114 int linesize = av_image_get_linesize(avctx->pix_fmt, avctx->width, 0);
116 uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
122 for (i = 0; i < avctx->height; i++) {
123 if (avctx->bits_per_coded_sample == 4) {
124 for (j = 0; j < avctx->width - 1; j += 2) {
128 if (avctx->width & 1)
138 ff_msrle_decode(avctx, (AVPicture*)s->frame, avctx->bits_per_coded_sample, &s->gb);
150 static av_cold int msrle_decode_end(AVCodecContext *avctx)
152 MsrleContext *s = avctx->priv_data;