[Ffmpeg-devel] [PATCH] THP PCM decoder (GSoC Qualification)
Michael Niedermayer
michaelni
Wed Apr 4 00:06:06 CEST 2007
Hi
On Tue, Apr 03, 2007 at 08:59:31PM +0200, Marco Gerards wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
>
> > Hi
> >
> > On Tue, Apr 03, 2007 at 03:21:56PM +0200, Marco Gerards wrote:
> > [...]
> >> In this new patch there are still two issues. For some reason the
> >> quality of the sound was not that good. It wasn't as bad as someone
> >> reported, for example he said that there were issues with mono sound.
> >> I can not reproduce this.
> >>
> >> The problem is in stereo sound. I have disabled stereo in this patch
> >> and the sound is just fine now. To be honest, I am not sure what the
> >> problem is. I have tried all kinds of things without much success.
> >> Perhaps it is better to commit this first. After that I can fix this
> >> with another patch.
> >
> > hmm did you properly interleave right and left channel samples? that is
> > does it work if you decode just the other channel?
> > could it be that the encoding is R+L,R-L ? instead of R,L
>
> I tried about anything. This is the first time I am working with
> audio, so I perhaps made a silly mistake.
>
> What I tried was interleaving the data send to the output buffer. The
> PCM data in the THP files is stored in packets. First x samples for
> the first channel are stored, after that x samples for the second
> channel.
>
> When I decode the other channel it seems to work as well. So I assume
> the problem is in how I fill the output buffer and how I tell ffmpeg
> the format (stereo, interleaved samples) of this data. How does one
> in general deal with stereo from a decoder?
stereo in ffmpeg is always
channel0-sample0, channel1-sample0, channel0-sample1, channel1-sample1, channel0-sample2, channel1-sample2, ...
>
> [...]
>
> >> Index: libavcodec/allcodecs.c
> >> ===================================================================
> >> --- libavcodec/allcodecs.c (revision 8605)
> >> +++ libavcodec/allcodecs.c (working copy)
> >> @@ -242,6 +242,7 @@
> >> REGISTER_ENCDEC (ADPCM_SBPRO_3, adpcm_sbpro_3);
> >> REGISTER_ENCDEC (ADPCM_SBPRO_4, adpcm_sbpro_4);
> >> REGISTER_ENCDEC (ADPCM_SWF, adpcm_swf);
> >> + REGISTER_ENCDEC (ADPCM_THP, adpcm_thp);
> >
> > ENCDEC ?
>
>
> Baptiste said "use CODEC and dummy return -1 to stay in conformance
> with others (see IMA_QT)". I assumed it also applied to allcodecs.c.
> Should I change this to REGISTER_DECODER?
yes and flame baptiste ;)
>
> >> REGISTER_ENCDEC (ADPCM_XA, adpcm_xa);
> >> REGISTER_ENCDEC (ADPCM_YAMAHA, adpcm_yamaha);
> >>
> >> Index: libavcodec/Makefile
> >> ===================================================================
> >> --- libavcodec/Makefile (revision 8605)
> >> +++ libavcodec/Makefile (working copy)
> >> @@ -246,6 +246,8 @@
> >> OBJS-$(CONFIG_ADPCM_SBPRO_4_ENCODER) += adpcm.o
> >> OBJS-$(CONFIG_ADPCM_SWF_DECODER) += adpcm.o
> >> OBJS-$(CONFIG_ADPCM_SWF_ENCODER) += adpcm.o
> >> +OBJS-$(CONFIG_ADPCM_THP_DECODER) += adpcm.o
> >> +OBJS-$(CONFIG_ADPCM_THP_ENCODER) += adpcm.o
> >> OBJS-$(CONFIG_ADPCM_XA_DECODER) += adpcm.o
> >
> > unless you write an ADPCM_THP encoder there shouldnt be
> > a CONFIG_ADPCM_THP_ENCODER ...
>
> Same as above. Should I remove this?
yes
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- 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/20070404/f7b8c19a/attachment.pgp>
More information about the ffmpeg-devel
mailing list