[Ffmpeg-devel] DV and pix_fmt reporting
Dan Maas
dmaas
Sun Mar 5 12:24:07 CET 2006
Oops, I just noticed we are missing a check for height==576 as well!
This should do it:
static inline const DVprofile* dv_codec_profile(AVCodecContext* codec)
{
if (codec->width != 720) {
return NULL;
} else if (codec->height == 480) {
if(codec->pix_fmt == PIX_FMT_YUV422P) {
/* NTSC 4:2:2 50Mbps */
return &dv_profiles[3];
} else if (codec->pix_fmt == PIX_FMT_YUV411P) {
/* NTSC 4:1:1 25Mbps */
return &dv_profiles[0];
} else {
/* invalid pixel format */
return NULL;
}
} else if (codec->height == 576) {
if(codec->pix_fmt == PIX_FMT_YUV422P) {
/* PAL 4:2:2 50Mbps */
return &dv_profiles[4];
} else if (codec->pix_fmt == PIX_FMT_YUV420P) {
/* PAL 4:2:0 25Mbps */
return &dv_profiles[1];
} else {
/* invalid pixel format */
return NULL;
}
} else {
/* invalid height */
return NULL;
}
}
More information about the ffmpeg-devel
mailing list