[Ffmpeg-devel] THP decoder
Kislyakov Maxim
spidy
Sat Apr 7 14:19:54 CEST 2007
>> Hi,
Hi
Michael Niedermayer wrote:
>> Michael Niedermayer wrote:
>> >> New patch.
>> > where?
>>
>> I'm sorry, i was half-sleepy yesterday and must have forgotten to
>> attach it (it was 3 o'clock am). So it is here.
>>
>> Maxim
>> Index: libavformat/thp.c
>> ===================================================================
>> --- libavformat/thp.c (revision 0)
>> +++ libavformat/thp.c (revision 0)
> [...]
>> +#include "avformat.h"
>> +#include "allformats.h"
>> +
>> +typedef struct ThpDemuxerContext {
>> + int maxAudioSamples; /* maximal number of samples in
>> one frame */
>
> still not doxygen compatible
I hope fixed
> [...]
>> +static int thp_probe(AVProbeData *p)
>> +{
>> + if (p->buf_size < 4)
>> + return 0;
>> + if ((AV_RL32(p->buf))== MKTAG('T', 'H', 'P', '\0'))
>
> still a superfluous ()
removed
> [...]
>> +static inline short adpcm_thp_expand_nibble(ADPCMThpFrameHeader *fh,
>> int8_t nibble,
>> + uint8_t index, uint8_t
>> exponent, int st)
>> +{
>> + short temp = 0;
>> + int factor1, factor2;
>> + if (nibble & 0x08) {
>> + nibble = (nibble | 0xf0);
>> + }
>> + factor1 = (fh->channelPrev[st][0] * fh->table[st][2*index]);
>> + factor2 = (fh->channelPrev[st][1] * fh->table[st][2*index + 1]);
>
> this still contains superfluous ()
removed
> [...]
>> @@ -1111,6 +1130,46 @@
>> buf_size -= 128;
>> }
>> break;
>> + case CODEC_ID_ADPCM_THP:
>> + {
>> + GetBitContext gb;
>> + ADPCMThpFrameHeader frameHeader;
>> + src += 8;
>> + init_get_bits(&gb, src, buf_size*8);
>> + for (n=0; n<2; n++)
>> + for (i=0; i<16; i++)
>> + frameHeader.table[n][i] = get_sbits(&gb,16);
>> +
>> + for (n=0; n<2; n++)
>> + for (i=0; i<2; i++)
>> + frameHeader.channelPrev[n][i] = get_sbits(&gb,16);
>> +
>> + src += 72;
>> + m = (buf_size - 80) >> st;
>> + n = 7;
>> + uint8_t exponent = 0;
>
> this still wont work on gcc 2.95
fixed
This is the 7th try of submitting patch.
Maxim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thp-patchv7.diff
Type: application/octet-stream
Size: 11005 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070407/e12fdd41/attachment.obj>
More information about the ffmpeg-devel
mailing list