[FFmpeg-devel] [RFC] AAC Encoder
Michael Niedermayer
michaelni
Fri Aug 15 11:40:39 CEST 2008
On Fri, Aug 15, 2008 at 10:11:03AM +0300, Kostya wrote:
> On Thu, Aug 14, 2008 at 11:42:44PM +0200, Michael Niedermayer wrote:
> > >
> > > enum AACPsyModelMode{
> > > PSY_MODE_CBR, ///< follow bitrate as closely as possible
> > > PSY_MODE_ABR, ///< try to achieve bitrate but actual bitrate may differ significantly
> > > PSY_MODE_QUALITY, ///< try to achieve set quality instead of bitrate
> > > };
> > >
> > > #define PSY_MODEL_MODE_MASK 0x0000000F ///< bit fields for storing mode (CBR, ABR, VBR)
> >
> > please use bitrate tolterance/bitrate/max/min bitrate/buffer size/...
> > from AVCodecContext for selecting the mode
>
> I will, but I will keep those for internal state.
>
> > > #define PSY_MODEL_NO_PULSE 0x00000010 ///< disable pulse searching
> > > #define PSY_MODEL_NO_SWITCH 0x00000020 ///< disable window switching
> > > #define PSY_MODEL_NO_ST_ATT 0x00000040 ///< disable stereo attenuation
> > > #define PSY_MODEL_NO_LOWPASS 0x00000080 ///< disable low-pass filtering
> >
> > How does the user pass these to the codec?
> > I suspect in AVCodecContext, if so above would be redundant and unneeded
> > as AVCodecContext is availabe to the psy model
>
> huh? I haven't seen flags for such thing in avcodec.h
it was a hyphotetical question
* If noone adds such flags to AVCodecContext the user can not pass them to the
psy model thus above would be useless
* If one does add such flags to AVCodecContext the above would be redundant
[...]
> > >
> > > #define PSY_MODEL_NO_PREPROC (PSY_MODEL_NO_ST_ATT | PSY_MODEL_NO_LOWPASS)
> > >
> > > #define PSY_MODEL_MODE(a) ((a) & PSY_MODEL_MODE_MASK)
> > >
> > > /**
> > > * context used by psychoacoustic model
> > > */
> > > typedef struct AACPsyContext {
> > > AVCodecContext *avctx; ///< encoder context
> > >
> > > int flags; ///< model flags
> >
> > > const uint8_t *bands1024; ///< scalefactor band sizes for long (1024 samples) frame
> > > int num_bands1024; ///< number of scalefactor bands for long frame
> > > const uint8_t *bands128; ///< scalefactor band sizes for short (128 samples) frame
> > > int num_bands128; ///< number of scalefactor bands for short frame
> >
> > This is a little AAC specific but then its called AACPsyContext
> > so iam not sure. Is the code supposed to be a generic psychoacoustic model
> > or AAC specific?
>
> AAC-specific. I thinks it's possible to make it more generic, but it will require
> some radical changes, especially for window switching code and scalefactors.
ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080815/4aa94c29/attachment.pgp>
More information about the ffmpeg-devel
mailing list