Lines Matching defs:avctx

59 static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p,
98 put_bits(p, 16, (avctx->width-1)/(8*hsample[0]) + 1);
140 int ff_mjpeg_add_icc_profile_size(AVCodecContext *avctx, const AVFrame *frame,
151 av_log(avctx, AV_LOG_ERROR, "Cannot store %"SIZE_SPECIFIER" byte ICC "
165 static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p,
172 if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
173 AVRational sar = avctx->sample_aspect_ratio;
176 if (!av_reduce(&sar.num, &sar.den, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 65535))
177 av_log(avctx, AV_LOG_WARNING,
179 avctx->sample_aspect_ratio.num,
180 avctx->sample_aspect_ratio.den);
228 if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
238 if (((avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
239 avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
240 avctx->pix_fmt == AV_PIX_FMT_YUV444P) && avctx->color_range != AVCOL_RANGE_JPEG)
241 || avctx->color_range == AVCOL_RANGE_MPEG) {
252 void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[4], int vsample[4])
254 if (avctx->codec_id == AV_CODEC_ID_LJPEG &&
255 ( avctx->pix_fmt == AV_PIX_FMT_BGR0
256 || avctx->pix_fmt == AV_PIX_FMT_BGRA
257 || avctx->pix_fmt == AV_PIX_FMT_BGR24)) {
262 } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P || avctx->pix_fmt == AV_PIX_FMT_YUVJ444P) {
267 av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift,
278 void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
287 int components = 3 + (avctx->pix_fmt == AV_PIX_FMT_BGRA);
292 ff_mjpeg_init_hvsample(avctx, hsample, vsample);
297 if (avctx->codec_id == AV_CODEC_ID_AMV)
300 jpeg_put_comments(avctx, pb, frame);
302 jpeg_table_header(avctx, pb, m, intra_scantable,
306 switch (avctx->codec_id) {
313 if (lossless && ( avctx->pix_fmt == AV_PIX_FMT_BGR0
314 || avctx->pix_fmt == AV_PIX_FMT_BGRA
315 || avctx->pix_fmt == AV_PIX_FMT_BGR24))
319 put_bits(pb, 16, avctx->height);
320 put_bits(pb, 16, avctx->width);
377 switch (avctx->codec_id) {
492 int ff_mjpeg_encode_check_pix_fmt(AVCodecContext *avctx)
494 if (avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL &&
495 avctx->color_range != AVCOL_RANGE_JPEG &&
496 (avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
497 avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
498 avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
499 avctx->color_range == AVCOL_RANGE_MPEG)) {
500 av_log(avctx, AV_LOG_ERROR,