Commit bc657ac3 authored by Zdenek Kabelac's avatar Zdenek Kabelac

* using pixtype as enum - by Philip Gladstone

Originally committed as revision 389 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 4606ac8d
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment