Lines Matching defs:avctx
38 static av_cold int encode_init(AVCodecContext *avctx)
40 DPXContext *s = avctx->priv_data;
41 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
49 switch (avctx->pix_fmt) {
69 if (avctx->bits_per_raw_sample)
70 s->bits_per_component = avctx->bits_per_raw_sample;
92 static void encode_rgb48_10bit(AVCodecContext *avctx, const AVFrame *pic,
95 DPXContext *s = avctx->priv_data;
99 for (y = 0; y < avctx->height; y++) {
100 for (x = 0; x < avctx->width; x++) {
118 static void encode_gbrp10(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst)
120 DPXContext *s = avctx->priv_data;
124 for (y = 0; y < avctx->height; y++) {
125 for (x = 0; x < avctx->width; x++) {
144 static void encode_gbrp12(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst)
146 DPXContext *s = avctx->priv_data;
151 pad = avctx->width*6;
153 for (y = 0; y < avctx->height; y++) {
154 for (x = 0; x < avctx->width; x++) {
175 static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
178 DPXContext *s = avctx->priv_data;
184 size = avctx->height * avctx->width * 4;
187 len = avctx->width*6;
190 size *= avctx->height;
193 len = avctx->width * s->num_components * s->bits_per_component >> 3;
196 size *= avctx->height;
198 if ((ret = ff_get_encode_buffer(avctx, pkt, size + HEADER_SIZE, 0)) < 0)
210 if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT))
217 write32(buf + 772, avctx->width);
218 write32(buf + 776, avctx->height);
228 write32(buf + 1628, avctx->sample_aspect_ratio.num);
229 write32(buf + 1632, avctx->sample_aspect_ratio.den);
238 size = (len + need_align) * avctx->height;
239 for (j=0; j<avctx->height; j++) {
248 avctx->pix_fmt,
249 avctx->width, avctx->height, 1);
256 encode_gbrp10(avctx, frame, buf + HEADER_SIZE);
258 encode_rgb48_10bit(avctx, frame, buf + HEADER_SIZE);
261 encode_gbrp12(avctx, frame, buf + HEADER_SIZE);
264 av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n", s->bits_per_component);