[Ffmpeg-devel] THP decoder
Michael Niedermayer
michaelni
Sat Apr 7 13:57:17 CEST 2007
Hi
On Sat, Apr 07, 2007 at 02:15:38PM +0400, Kislyakov Maxim wrote:
> Hi,
>
> 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
[...]
> +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 ()
[...]
> +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 ()
[...]
> @@ -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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070407/284e2613/attachment.pgp>
More information about the ffmpeg-devel
mailing list