[Ffmpeg-devel] Mpeg-4 playback: issues with CBR padding

Michael Niedermayer michaelni
Wed Nov 8 14:24:48 CET 2006


Hi

On Wed, Nov 08, 2006 at 12:04:12PM +0100, Mathieu Monnier wrote:
> Hi,
> 
> It's a late answer, but after rechecking the ISO/IEC standard, I may 
> disagree with that :
> >i dont think that stuffing macroblocks are allowed _after_ all macroblocks,
> >the mpeg4 syntax places the stuffing mb in the mb type decoding loop and
> >it seems like this loop must terminate with decoding a non stuffing mb
> >which cannot happen after all mbs, that is my interpretation of the spec 
> >...
> >  
> There are two cases :
>  - the decoding loop of the macroblocks is a gob loop, in which case 
> the statement is true ( since the pseudo code is : "for ( i=0; i < 
> nMacroblock; i++ ) macroblock();" )
>  - the decoding loop of the macroblocks is in a 
> combined_motion_shape_texture(), in which case the pseudo code is : "do 
> { macroblock(); } while ( !resync_marker && !start_code );". In that 
> case, padding after the last macroblock seems allowed, unless I 
> misinterpreted something else ?

combined_motion_shape_texture() {
   do{
       macroblock()
   } while (nextbits_bytealigned() != resync_marker && nextbits_bytealigned()
            != "000 0000 0000 0000 0000 0000")
}

and in macroblock() i think you end up at

do{
    if (vop_coding_type != "I" && !(sprite_enable == "s
          && sprite_transmit_mode == "piece"))
          not_coded
    if (!not_coded || vop_coding_type == "I"
          || (vop_coding_type == "S"
          && low_latency_sprite_enable
          && sprite_transmit_mode == "piece"))
          mcbpc
} while(!(not_coded || derived_mb_type != "stuffing"))

and the only way i see to get out of this loop is with a non stuffing
macroblock so there has to be a non stuffing mb at the end, or i 
missed something

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list