[FFmpeg-devel] [RFC/PATCH 6/8] tidsp: add mp4v configuration

Felipe Contreras felipe.contreras
Tue Sep 7 11:44:12 CEST 2010


On Tue, Sep 7, 2010 at 5:45 AM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> On Sun, Sep 5, 2010 at 6:15 PM, Felipe Contreras
> <felipe.contreras at gmail.com> wrote:
>> +struct mp4vdec_args {
>> + ? ? ? uint32_t size;
>> + ? ? ? uint16_t num_streams;
>> +
>> + ? ? ? uint16_t in_id;
>> + ? ? ? uint16_t in_type;
>> + ? ? ? uint16_t in_count;
>> +
>> + ? ? ? uint16_t out_id;
>> + ? ? ? uint16_t out_type;
>> + ? ? ? uint16_t out_count;
>> +
>> + ? ? ? uint16_t reserved;
>> +
>> + ? ? ? uint32_t max_width;
>> + ? ? ? uint32_t max_height;
>> + ? ? ? uint32_t color_format;
>> + ? ? ? uint32_t max_framerate;
>> + ? ? ? uint32_t max_bitrate;
>> + ? ? ? uint32_t endianness;
>> + ? ? ? uint32_t profile;
>> + ? ? ? int32_t max_level;
>> + ? ? ? uint32_t mode;
>> + ? ? ? int32_t preroll;
>> + ? ? ? uint32_t display_width;
>> +};
>
> What are all these?

These are arguments needed to start the DSP algorithm.

> Why are they specifically-sized fields? Can you
> document some of them? Do they describe bitstream (in which case they
> should likely be read from AVCodecContext rather than be copied here,
> no?)? Do they describe the system (e.g. endianness, in which case you
> shouldn't make it a variable since it's highly unlikely that halfway
> the movie, the endianness of the running system will switch)? Do they
> describe the hardware (max_bitrate - is that static or configurable or
> dependent on hardware/driver version?)?

You can think of a DSP algorithm as a normal program, written in C
code even, except that it runs in a separate processor (C64x). You
communicate to it through the tidspbridge driver, and each algorithm
requires different arguments, but of course the fields have to have
specific sizes.

There are many arguments passed; at creation time, dynamically, and
in-stream. You can see more here[1].

>> +struct td_codec td_mp4v_codec = {
>> + ? ? ? .uuid = &(const struct dsp_uuid) { 0x7e4b8541, 0x47a1, 0x11d6, 0xb1, 0x56,
>> + ? ? ? ? ? ? ? { 0x00, 0xb0, 0xd0, 0x17, 0x67, 0x4b } },
>
>> + ? ? ? .filename = DSP_DIR "mp4vdec_sn.dll64P",
>
> What's the filename for? Init stuff for the codec?

As Vladimir pointed out; this is the file that contains the code to be
loaded at runtime on the DSP processor.

Just to clarify a bit; although the actual DSP can help in some
operations, like FFT, most of the processing is done in a separate
chip; a real hardware accelerator. Unfortunately TI designed the
hardware so that only the DSP processor can talk to the hardware
accelerator, so the GPP can only make use of the accelerator through
the DSP. TI is a DSP company after all =/

[1] http://github.com/felipec/gst-dsp/blob/master/gstdspvdec.c

-- 
Felipe Contreras



More information about the ffmpeg-devel mailing list