[FFmpeg-cvslog] Implement av_samples_alloc() and av_samples_fill_arrays().

Justin Ruggles justin.ruggles
Thu Feb 3 20:22:42 CET 2011


On 02/03/2011 01:34 PM, Stefano Sabatini wrote:

> On date Wednesday 2011-02-02 03:26:32 +0100, Stefano Sabatini wrote:
>> ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Sat Jan 15 00:00:00 2011 +0100| [e98b8e2f2fae3e75f87d0d87098a8faee691a514] | committer: Michael Niedermayer
>>
>> Implement av_samples_alloc() and av_samples_fill_arrays().
>>
>> With minor changes by michael
>>
>> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
>>
>>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e98b8e2f2fae3e75f87d0d87098a8faee691a514
>> ---
>>
>>  libavcore/samplefmt.c |   47 +++++++++++++++++++++++++++++++++++++++++++++++
>>  libavcore/samplefmt.h |   39 +++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 86 insertions(+), 0 deletions(-)
>>
>> diff --git a/libavcore/samplefmt.c b/libavcore/samplefmt.c
>> index 532acd9..db6b93c 100644
>> --- a/libavcore/samplefmt.c
>> +++ b/libavcore/samplefmt.c
>> @@ -68,3 +68,50 @@ int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt)
>>      return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ?
>>          0 : sample_fmt_info[sample_fmt].bits;
>>  }
>> +
>> +int av_samples_fill_arrays(uint8_t *pointers[8], int linesizes[8],
>> +                           uint8_t *buf, int nb_channels, int nb_samples,
>> +                           enum AVSampleFormat sample_fmt, int planar, int align)
>> +{
>> +    int i, step_size = 0;
>> +    int sample_size = av_get_bits_per_sample_fmt(sample_fmt) >> 3;
> 
> Maybe more correct: (av_get_bits_per_sample_fmt(sample_fmt) + 7) >> 3;


It is always a multiple of 8.  I don't see any reason why we would ever
want it to not be.

-Justin




More information about the ffmpeg-cvslog mailing list