mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-02 20:35:37 +02:00
* using pixtype as enum - by Philip Gladstone
Originally committed as revision 389 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
4606ac8dee
commit
bc657ac31d
libavcodec
@ -39,6 +39,7 @@ enum CodecType {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum PixelFormat {
|
enum PixelFormat {
|
||||||
|
PIX_FMT_ANY,
|
||||||
PIX_FMT_YUV420P,
|
PIX_FMT_YUV420P,
|
||||||
PIX_FMT_YUV422,
|
PIX_FMT_YUV422,
|
||||||
PIX_FMT_RGB24,
|
PIX_FMT_RGB24,
|
||||||
@ -98,7 +99,7 @@ typedef struct AVCodecContext {
|
|||||||
#define FF_ASPECT_16_9_625 4
|
#define FF_ASPECT_16_9_625 4
|
||||||
#define FF_ASPECT_16_9_525 5
|
#define FF_ASPECT_16_9_525 5
|
||||||
int gop_size; /* 0 = intra only */
|
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
|
/* if non NULL, 'draw_horiz_band' is called by the libavcodec
|
||||||
decoder to draw an horizontal band. It improve cache usage. Not
|
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;
|
int i;
|
||||||
|
|
||||||
|
assert(pix_fmt != PIX_FMT_ANY && dst_pix_fmt != PIX_FMT_ANY);
|
||||||
|
|
||||||
if (dst_pix_fmt == pix_fmt) {
|
if (dst_pix_fmt == pix_fmt) {
|
||||||
switch(pix_fmt) {
|
switch(pix_fmt) {
|
||||||
case PIX_FMT_YUV420P:
|
case PIX_FMT_YUV420P:
|
||||||
|
@ -286,6 +286,8 @@ int MPV_encode_init(AVCodecContext *avctx)
|
|||||||
MpegEncContext *s = avctx->priv_data;
|
MpegEncContext *s = avctx->priv_data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
avctx->pix_fmt = PIX_FMT_YUV420P;
|
||||||
|
|
||||||
s->bit_rate = avctx->bit_rate;
|
s->bit_rate = avctx->bit_rate;
|
||||||
s->bit_rate_tolerance = avctx->bit_rate_tolerance;
|
s->bit_rate_tolerance = avctx->bit_rate_tolerance;
|
||||||
s->frame_rate = avctx->frame_rate;
|
s->frame_rate = avctx->frame_rate;
|
||||||
|
@ -205,6 +205,7 @@ AVCodec *avcodec_find(enum CodecID id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *pix_fmt_str[] = {
|
const char *pix_fmt_str[] = {
|
||||||
|
"??",
|
||||||
"yuv420p",
|
"yuv420p",
|
||||||
"yuv422",
|
"yuv422",
|
||||||
"rgb24",
|
"rgb24",
|
||||||
@ -259,6 +260,9 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
|
|||||||
enc->width, enc->height,
|
enc->width, enc->height,
|
||||||
(float)enc->frame_rate / FRAME_RATE_BASE);
|
(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;
|
bitrate = enc->bit_rate;
|
||||||
break;
|
break;
|
||||||
case CODEC_TYPE_AUDIO:
|
case CODEC_TYPE_AUDIO:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user