[FFmpeg-devel] [PATCH] dnxhd parser and raw de/muxer
Michael Niedermayer
michaelni
Sat Sep 20 03:58:19 CEST 2008
On Fri, Sep 19, 2008 at 04:52:59PM -0700, Baptiste Coudurier wrote:
> Hi Stuart,
>
> Stuart Cunningham wrote:
> > On Mon, 2008-09-15 at 20:40 +0200, Michael Niedermayer wrote:
> >> 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.
> > [...]
> >>> 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 ...
> >>
> > There's the 32bit end-of-frame marker 0x600DC0DE but that's probably not
> > helpful here, but might be useful in the dnxhd_find_frame_end() function
> > of libavcodec/dnxhd_parser.c (also part of the patch).
> >
>
> Indeed, it needs special case for the first frame however, let's try
> this way first and if any error happens, I'll cook something up.
>
> Parser updated.
>
> --
> Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
> Smartjog USA Inc. http://www.smartjog.com
> Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
[...]
> Index: libavcodec/parser.c
> ===================================================================
> --- libavcodec/parser.c (revision 15351)
> +++ libavcodec/parser.c (working copy)
> @@ -274,6 +274,7 @@
> /* store overread bytes */
> for(;next < 0; next++){
> pc->state = (pc->state<<8) | pc->buffer[pc->last_index + next];
> + pc->state64 = (pc->state64<<8) | pc->buffer[pc->last_index + next];
> pc->overread++;
> }
>
> Index: libavcodec/parser.h
> ===================================================================
> --- libavcodec/parser.h (revision 15351)
> +++ libavcodec/parser.h (working copy)
> @@ -34,6 +34,7 @@
> int frame_start_found;
> int overread; ///< the number of bytes which where irreversibly read from the next frame
> int overread_index; ///< the index into ParseContext.buffer of the overread bytes
> + uint64_t state64; ///< contains the last 8 bytes in MSB order
> } ParseContext;
>
> struct MpegEncContext;
ok, but seperate commit please
rest looks ok as well
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- 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/20080920/560a7973/attachment.pgp>
More information about the ffmpeg-devel
mailing list