Lines Matching defs:avctx
28 static av_cold int avui_encode_init(AVCodecContext *avctx)
30 if (avctx->width != 720 || avctx->height != 486 && avctx->height != 576) {
31 av_log(avctx, AV_LOG_ERROR, "Only 720x486 and 720x576 are supported.\n");
34 if (!(avctx->extradata = av_mallocz(144 + AV_INPUT_BUFFER_PADDING_SIZE)))
36 avctx->extradata_size = 144;
37 memcpy(avctx->extradata, "\0\0\0\x18""APRGAPRG0001", 16);
38 if (avctx->field_order > AV_FIELD_PROGRESSIVE) {
39 avctx->extradata[19] = 2;
41 avctx->extradata[19] = 1;
43 memcpy(avctx->extradata + 24, "\0\0\0\x78""ARESARES0001""\0\0\0\x98", 20);
44 AV_WB32(avctx->extradata + 44, avctx->width);
45 AV_WB32(avctx->extradata + 48, avctx->height);
46 memcpy(avctx->extradata + 52, "\0\0\0\x1\0\0\0\x20\0\0\0\x2", 12);
52 static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
58 interlaced = avctx->field_order > AV_FIELD_PROGRESSIVE;
60 if (avctx->height == 486) {
65 size = 2 * avctx->width * (avctx->height + skip) + 8 * interlaced;
66 if ((ret = ff_get_encode_buffer(avctx, pkt, size, 0)) < 0)
70 memset(dst, 0, avctx->width * skip);
71 dst += avctx->width * skip;
76 if (interlaced && avctx->height == 486) {
81 memset(dst, 0, avctx->width * skip + 4 * i);
82 dst += avctx->width * skip + 4 * i;
83 for (j = 0; j < avctx->height; j += interlaced + 1) {
84 memcpy(dst, src, avctx->width * 2);
86 dst += avctx->width * 2;