[Ffmpeg-devel] [PATCH] correctly set profile/level for mpeg2 hd
Michael Niedermayer
michaelni
Thu Jan 25 12:58:41 CET 2007
Hi
On Thu, Jan 25, 2007 at 12:05:33PM +0100, Baptiste Coudurier wrote:
> Hi
>
> $subj.
>
> --
> Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
> SMARTJOG S.A. http://www.smartjog.com
> Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
> Phone: +33 1 49966312
> Index: libavcodec/mpeg12.c
> ===================================================================
> --- libavcodec/mpeg12.c (revision 7707)
> +++ libavcodec/mpeg12.c (working copy)
> @@ -234,11 +234,19 @@
> }
> }
>
> - if(avctx->profile == FF_PROFILE_UNKNOWN)
> + if(avctx->profile == FF_PROFILE_UNKNOWN) {
> + if (avctx->width > 720 || avctx->height > 576)
> + avctx->profile = 1; /* High Profile */
> + else
> avctx->profile = s->chroma_format == CHROMA_420 ? 4 : 0;
this is incorrect, such resolutions do not need high profile
> + }
>
> - if(avctx->level == FF_LEVEL_UNKNOWN)
> + if(avctx->level == FF_LEVEL_UNKNOWN) {
> + if (avctx->width > 720 || avctx->height > 576)
> + avctx->level = 4; /* High Level */
High 1440 profile seems sufficient here
anyway either set these values correctly or dont set them
[...]
> - put_bits(&s->pb, 1, s->chroma_format == CHROMA_422); //escx
> + put_bits(&s->pb, 1, s->avctx->profile == 0); //escx 1 for 4:2:2 profile */
my mpeg2 draft says non 0 is reserved, so this will need some
explanations
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070125/22340df7/attachment.pgp>
More information about the ffmpeg-devel
mailing list