On 06/02/2011 06:29 AM, Stefano Sabatini wrote:

> On date Monday 2011-05-23 19:48:53 +0200, Stefano Sabatini encoded:
>> On date Monday 2011-05-23 16:51:25 +0200, Stefano Sabatini encoded:
> [...]
>> Elaborating more: this patches is basically changing the layout of the
>> samples buffer.
>>
>> My objective is getting a layout as similiar as possible with that of
>> the video buffer.
>>
>> So this was my idea:
>> pointers  -> contain pointers to each samples plane
>> linesizes -> the linesize of each plane
>>
>> This looks simpler and generally easier to manage.
>>
>> Currently we have:
>>  * data[c] points to the first sample of channel c.
>>  * data[c] + linesize[0] points to the second sample of channel c
>>
>> This has a slight advantage for accessing the samples for each channel
>> but it has the disadvantage that:
>> * misuse the term "linesize" (with a different semantics depending on
>>   planar/packed mode)
>> * creates an asymmetry between audio and video data layout
> 
> Updated patchset in attachment. This is the base of the audio-filters
> changes, and will possibly affect also how audio in AVFrame is dealt
> with.
> 
> I'm adding libav-devel to recipients in case they're interested in
> discussing (av_samples_* functions were never integrated in libav).


Both ways have their advantages. Either way there is both redundant and
missing information, but your way does seem like the simplest and most
obvious way to access planar vs interleaved samples using data &
linesize.  I would prefer this sort of layout for AVFrame.

Thanks,
Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to