Lines Matching refs:avctx
37 static void sunrast_image_write_header(AVCodecContext *avctx)
39 SUNRASTContext *s = avctx->priv_data;
42 bytestream2_put_be32u(&s->p, avctx->width);
43 bytestream2_put_be32u(&s->p, avctx->height);
51 static void sunrast_image_write_image(AVCodecContext *avctx,
56 SUNRASTContext *s = avctx->priv_data;
78 len = (s->depth * avctx->width + 7) >> 3;
88 #define GET_VALUE y >= avctx->height ? 0 : x >= len ? ptr[len-1] : ptr[x]
92 while (y < avctx->height) {
102 while (value2 == value && run < 256 && y < avctx->height) {
126 for (y = 0; y < avctx->height; y++) {
135 static av_cold int sunrast_encode_init(AVCodecContext *avctx)
137 SUNRASTContext *s = avctx->priv_data;
139 switch (avctx->coder_type) {
147 av_log(avctx, AV_LOG_ERROR, "invalid coder_type\n");
154 switch (avctx->pix_fmt) {
170 s->length = avctx->height * (FFALIGN(avctx->width * s->depth, 16) >> 3);
177 static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
180 SUNRASTContext *s = avctx->priv_data;
183 if ((ret = ff_alloc_packet2(avctx, avpkt, s->size)) < 0)
187 sunrast_image_write_header(avctx);
188 sunrast_image_write_image(avctx, frame->data[0],
201 static av_cold int sunrast_encode_close(AVCodecContext *avctx)
203 av_frame_free(&avctx->coded_frame);