[FFmpeg-devel] [PATCH] CrystalHD decoder support v3

Philip Langdale philipl
Thu Feb 3 01:14:59 CET 2011

On Tue, 01 Feb 2011 10:01:10 -0700
Philip Langdale <philipl at overt.org> wrote:

> >
> > Do you think some code could be shared between this and and the mp4
> > to annex B bitstream filter?
> >
>  Ah ha! I think so, if I'm reading libavformat/sdp.c correctly. It
> looks like that is using it to rewrite extradata and nothing else; if
> so, that's
>  what I need and I can just use it as-is and forget about the
> broadcom code.

It can be made to work but it's kludgy in mplayer because of the initial
probe pass. Firstly, note that libcrystalhd is weird and has a built-in
bitstream filter but it doesn't handle the extradata - so you have the
odd requirement to transform the extra data but not the actual stream.

In mplayer, on the first pass, it rewrites the extradata, and then on
the second pass it decides that it's already in annex b format and
passes it to libcrystalhd as annex b. As a result, libcrystalhd will
skip its bitstream filter and then everything goes south.

I can work around that by copying the original extradata, then running
the filter, then holding on to the transformed extradata for myself
and put the original back. Then it'll still work on the second pass.

The obvious proper fix is to refactor the filter so that the extradata
transform can be done standalone without replacing the original


More information about the ffmpeg-devel mailing list