Lines Matching defs:avctx
37 static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
40 PHMEncContext *s = avctx->priv_data;
44 int size = av_image_get_buffer_size(avctx->pix_fmt,
45 avctx->width, avctx->height, 1);
47 if ((ret = ff_get_encode_buffer(avctx, pkt, size + 200, 0)) < 0)
54 h = avctx->height;
56 switch (avctx->pix_fmt) {
59 n = (avctx->width + 7) >> 3;
63 n = avctx->width;
67 n = avctx->width * 2;
71 n = avctx->width * 3;
75 n = avctx->width * 6;
78 if (avctx->width & 1 || avctx->height & 1) {
79 av_log(avctx, AV_LOG_ERROR, "pgmyuv needs even width and height\n");
83 n = avctx->width;
88 n = avctx->width * 2;
93 if (avctx->codec_id == AV_CODEC_ID_PFM) {
95 n = avctx->width * 4;
98 n = avctx->width * 2;
103 if (avctx->codec_id == AV_CODEC_ID_PFM) {
105 n = avctx->width * 4;
108 n = avctx->width * 2;
115 "P%c\n%d %d\n", c, avctx->width, h1);
117 if (avctx->pix_fmt == AV_PIX_FMT_GBRPF32LE ||
118 avctx->pix_fmt == AV_PIX_FMT_GRAYF32LE ||
119 avctx->pix_fmt == AV_PIX_FMT_GBRPF32BE ||
120 avctx->pix_fmt == AV_PIX_FMT_GRAYF32BE)
122 "%f\n", (avctx->pix_fmt == AV_PIX_FMT_GBRPF32BE ||
123 avctx->pix_fmt == AV_PIX_FMT_GRAYF32BE) ? 1.f: -1.f);
125 if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE &&
126 avctx->pix_fmt != AV_PIX_FMT_GBRPF32LE &&
127 avctx->pix_fmt != AV_PIX_FMT_GRAYF32LE &&
128 avctx->pix_fmt != AV_PIX_FMT_GBRPF32BE &&
129 avctx->pix_fmt != AV_PIX_FMT_GRAYF32BE) {
130 int maxdepth = (1 << av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth) - 1;
136 if ((avctx->pix_fmt == AV_PIX_FMT_GBRPF32LE ||
137 avctx->pix_fmt == AV_PIX_FMT_GBRPF32BE) && c == 'F') {
142 for (int i = 0; i < avctx->height; i++) {
143 for (int j = 0; j < avctx->width; j++) {
154 } else if ((avctx->pix_fmt == AV_PIX_FMT_GRAYF32LE ||
155 avctx->pix_fmt == AV_PIX_FMT_GRAYF32BE) && c == 'f') {
158 for (int i = 0; i < avctx->height; i++) {
159 for (int j = 0; j < avctx->width; j++) {
166 } else if (avctx->pix_fmt == AV_PIX_FMT_GBRPF32 && c == 'H') {
171 for (int i = 0; i < avctx->height; i++) {
172 for (int j = 0; j < avctx->width; j++) {
183 } else if (avctx->pix_fmt == AV_PIX_FMT_GRAYF32 && c == 'h') {
186 for (int i = 0; i < avctx->height; i++) {
187 for (int j = 0; j < avctx->width; j++) {
204 if (avctx->pix_fmt == AV_PIX_FMT_YUV420P || avctx->pix_fmt == AV_PIX_FMT_YUV420P16BE) {
301 static av_cold int phm_enc_init(AVCodecContext *avctx)
303 PHMEncContext *s = avctx->priv_data;