[FFmpeg-trac] #2686(avcodec:open): Native AAC encoder collapses at high bitrates on some samples

FFmpeg trac at avcodec.org
Sun Jul 21 06:15:40 CEST 2013


#2686: Native AAC encoder collapses at high bitrates on some samples
-------------------------------------+-------------------------------------
             Reporter:  Kamedo2      |                    Owner:
                 Type:  defect       |                   Status:  open
             Priority:  normal       |                Component:  avcodec
              Version:  git-master   |               Resolution:
             Keywords:  aac          |               Blocked By:
  regression                         |  Reproduced by developer:  1
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Comment (by Kamedo2):

 I recommend psymodel.h line 24 to be:
 {{{
 #include "libavutil/libm.h"
 #include "avcodec.h"

 /** maximum possible number of bands */
 #define PSY_MAX_BANDS 128
 /** maximum number of channels */
 #define PSY_MAX_CHANS 24

 #define _AAC_CUTOFF(bit_rate,channels,sample_rate) (bit_rate ?
 FFMIN3(FFMIN3( \
     bit_rate/channels/2, \
     3000 + bit_rate/channels/4, \
     12000 + bit_rate/channels/16), \
     20000, \
     sample_rate / 2): (sample_rate / 2))
 #define AAC_CUTOFF(s) ( \
     (s->flags & CODEC_FLAG_QSCALE) \
     ? _AAC_CUTOFF(((int)(135000.0f*sqrtf(s->global_quality ?
 s->global_quality/120.0f : 1.0f))), 2, s->sample_rate) \
     : _AAC_CUTOFF(s->bit_rate, s->channels, s->sample_rate) \
 )
 }}}
 In this way, I can set cutoff to VBR modes as well.
 PSY_MAX_CHANS 24 is to accommodate NHK 22.2ch.

 I notice that in -q:a 0.2 and -q:a 0.4, the lower freq is in trouble. It
 sounds like a thunder far away.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2686#comment:70>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list