[FFmpeg-devel] [PATCH] dnxhd parser and raw de/muxer

Michael Niedermayer michaelni
Mon Sep 15 20:40:42 CEST 2008


On Mon, Sep 15, 2008 at 10:58:06AM -0700, Baptiste Coudurier wrote:
> Hi,
> 
> Michael Niedermayer wrote:
> > On Mon, Sep 08, 2008 at 02:54:14PM -0700, Baptiste Coudurier wrote:
> >> Hi,
> >>
> >> $subject, to use dnxhd raw essences.
> > [...]
> >> Index: libavformat/raw.c
> >> ===================================================================
> >> --- libavformat/raw.c	(revision 15275)
> >> +++ libavformat/raw.c	(working copy)
> >> @@ -487,6 +487,15 @@
> >>  }
> >>  #endif
> >>  
> >> +static int dnxhd_probe(AVProbeData *p)
> >> +{
> >> +    static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
> >> +    if (!memcmp(p->buf, header, 5))
> >> +        return AVPROBE_SCORE_MAX;
> >> +    else
> >> +        return 0;
> >> +}
> > 
> > Can more than that be used for a more reliable probe?
> > I mean yes its 5 bytes but they are all 0 except 3 bits, thus this might
> > be more common in real files than expected in random data.
> 
> Well nothing can be more unreliable than mp3 probe, even .deb are probed
> as mp3 ;)

true, but mp3 probe doesnt return AVPROBE_SCORE_MAX for debs, 
at least i hope it does not :)


> Besides, after these 5 bytes, I'd need to go far to fetch interesting
> data like cid, Im not sure.

well its not that important, we can always leave it until someone actually
finds some misdetection. I wasnt aware that these 5 bytes where the only
easy checkable thing ...


> 
> >  [...]
> > 
> > Iam not sure if this is correct, ff_combine_frame() upates state, but
> > thats just its 32bit state, it has no knowledge of the 64bit state.
> > This should lead to problems when DNXHD_HEADER_PREFIX is split accross
> > 2 input frames.
> > 
> 
> That's possible, I had a look at aac/ac3 parser and it uses the same
> mechanism so the problem might also be there, 

yes, that could be


> the alternatives I see is,
> add an uint64_t field to pc->state, upgrade pc->state to uint64_t but
> parsers might need modifications I guess, or duplicate ff_combine_frame.

I think adding a state64 field in addition to the existing 32bit one would
be a good solution. There is a speed penalty for 64bit operations on 32bit
CPUs

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

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080915/7e125709/attachment.pgp>



More information about the ffmpeg-devel mailing list