[FFmpeg-devel] [PATCH] MLP/TrueHD Decoder - 2nd try
Ramiro Polla
ramiro
Tue Jul 1 03:09:10 CEST 2008
Michael Niedermayer wrote:
> On Sun, Jun 29, 2008 at 12:41:17PM +0100, Ramiro Polla wrote:
>> Hello,
>>
>> 01_mlp_parser_gb.diff makes a function in mlp_parser receive a
>> GetBitContext instead of uint8_t buffers. This helps out in the decoder to
>> simplify the code.
>
> ok, after fixing issue below
[...]
>> -int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, const uint8_t *buf,
>> - unsigned int buf_size)
>> +int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
>> {
>> - GetBitContext gb;
>> int ratebits;
>> uint16_t checksum;
>>
>> - if (buf_size < 28) {
>> + assert(get_bits_count(gb) == 0);
>> +
>> + if (gb->size_in_bits < 28 << 3) {
>> av_log(log, AV_LOG_ERROR, "Packet too short, unable to read major sync\n");
>> return -1;
>> }
>>
>> - checksum = mlp_checksum16(buf, 26);
>> - if (checksum != AV_RL16(buf+26)) {
>> + checksum = mlp_checksum16(gb->buffer, 26);
>
> You should document the "no stuff read yet" requirement in a doxy comment
> (or add get_bits_count()>>3 iam not sure which is better ...)
Is this what you meant? I just added this line to
ff_mlp_read_major_sync's doxy comment:
* gb must be a freshly initialized GetBitContext with no bits read.
Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01_mlp_parser_gb_2.diff
Type: text/x-diff
Size: 4379 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080701/3a5bea50/attachment.diff>
More information about the ffmpeg-devel
mailing list