[Ffmpeg-devel] [PATCH] correctly set profile/level for mpeg2 hd

Michael Niedermayer michaelni
Thu Jan 25 20:46:44 CET 2007


Hi

On Thu, Jan 25, 2007 at 06:07:37PM +0100, Baptiste Coudurier wrote:
> Baptiste Coudurier wrote:
> > Hi
> > 
> > Michael Niedermayer wrote:
> >>> [...]
> >>> 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
> > 
> > This is correct, they do not need it, except when 422 chroma,
> > and we could use 422P profile when height is 608.
> > 
> >>> +    }
> >>>  
> >>> -    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
> > 
> > What about 4:2:2 chroma format ? Only High profile and 4:2:2 support it
> > at such resolutions.
> > Those profile/level I set with the patch are correct,
> > they englobes all combinations with the smallest code.
> > 
> > If you prefer, I'll use the least requiring profile for all
> > chroma/resolution combinations.
> > 
> >> [...]
> >>> -                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
> >>
> > 
> > Quote from ISO 13818-2 2000:
> > "Table 8-4 describes profiles and levels when the escape bit equals 1.
> > For these profiles and levels there is no implied hierarchy from the
> > assignment of profile_and_level_indication and profiles and levels
> > are not necessarily subsets of
> > others."
> > 
> > 4:2:2 profile always use escape bit to one. Multi view profile uses it
> > too, but I don't know if encoder supports it.
> > 
> > 10000101 4:2:2 profile @ Main level
> > 10000010 4:2:2 profile @ High level
> > 
> 
> Here is another patch. Is that acceptable ?

i guess yes, mans any comments?, my knowledge of the profile and level numbers
isnt that good ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- 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/140e6280/attachment.pgp>



More information about the ffmpeg-devel mailing list