* using pixtype as enum - by Philip Gladstone

Originally committed as revision 389 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Zdenek Kabelac 23 years ago
parent 4606ac8dee
commit bc657ac31d
  1. 3
      libavcodec/avcodec.h
  2. 2
      libavcodec/imgconvert.c
  3. 2
      libavcodec/mpegvideo.c
  4. 4
      libavcodec/utils.c

@ -39,6 +39,7 @@ enum CodecType {
};
enum PixelFormat {
PIX_FMT_ANY,
PIX_FMT_YUV420P,
PIX_FMT_YUV422,
PIX_FMT_RGB24,
@ -98,7 +99,7 @@ typedef struct AVCodecContext {
#define FF_ASPECT_16_9_625 4
#define FF_ASPECT_16_9_525 5
int gop_size; /* 0 = intra only */
int pix_fmt; /* pixel format, see PIX_FMT_xxx */
enum PixelFormat pix_fmt; /* pixel format, see PIX_FMT_xxx */
/* if non NULL, 'draw_horiz_band' is called by the libavcodec
decoder to draw an horizontal band. It improve cache usage. Not

@ -361,6 +361,8 @@ int img_convert(AVPicture *dst, int dst_pix_fmt,
{
int i;
assert(pix_fmt != PIX_FMT_ANY && dst_pix_fmt != PIX_FMT_ANY);
if (dst_pix_fmt == pix_fmt) {
switch(pix_fmt) {
case PIX_FMT_YUV420P:

@ -286,6 +286,8 @@ int MPV_encode_init(AVCodecContext *avctx)
MpegEncContext *s = avctx->priv_data;
int i;
avctx->pix_fmt = PIX_FMT_YUV420P;
s->bit_rate = avctx->bit_rate;
s->bit_rate_tolerance = avctx->bit_rate_tolerance;
s->frame_rate = avctx->frame_rate;

@ -205,6 +205,7 @@ AVCodec *avcodec_find(enum CodecID id)
}
const char *pix_fmt_str[] = {
"??",
"yuv420p",
"yuv422",
"rgb24",
@ -259,6 +260,9 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
enc->width, enc->height,
(float)enc->frame_rate / FRAME_RATE_BASE);
}
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", q=%d-%d", enc->qmin, enc->qmax);
bitrate = enc->bit_rate;
break;
case CODEC_TYPE_AUDIO:

Loading…
Cancel
Save