Lines Matching defs:avctx
37 static av_cold int bmp_encode_init(AVCodecContext *avctx){
38 switch (avctx->pix_fmt) {
40 avctx->bits_per_coded_sample = 32;
43 avctx->bits_per_coded_sample = 24;
48 avctx->bits_per_coded_sample = 16;
56 avctx->bits_per_coded_sample = 8;
59 avctx->bits_per_coded_sample = 1;
66 static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
74 int bit_count = avctx->bits_per_coded_sample;
77 switch (avctx->pix_fmt) {
94 avpriv_set_systematic_pal2(palette256, avctx->pix_fmt);
105 n_bytes_per_row = ((int64_t)avctx->width * (int64_t)bit_count + 7LL) >> 3LL;
107 n_bytes_image = avctx->height * (n_bytes_per_row + pad_bytes_per_row);
115 if ((ret = ff_get_encode_buffer(avctx, pkt, n_bytes, 0)) < 0)
125 bytestream_put_le32(&buf, avctx->width); // BITMAPINFOHEADER.biWidth
126 bytestream_put_le32(&buf, avctx->height); // BITMAPINFOHEADER.biHeight
138 ptr = p->data[0] + (avctx->height - 1) * p->linesize[0];
140 for(i = 0; i < avctx->height; i++) {
143 for(n = 0; n < avctx->width; n++)