[PATCH] AACENC: fix SEGV in multi-channel encode WAS Re: AAC Encoding - Where we stand, what's left
On Wed, Jul 8, 2009 at 12:37 AM, Kostya<kostya.shishkov@gmail.com> wrote:
On Wed, Jul 08, 2009 at 12:05:50AM -0400, Alex Converse wrote:
On Tue, Jul 7, 2009 at 4:45 AM, Kostya<kostya.shishkov@gmail.com> wrote:
On Mon, Jul 06, 2009 at 09:14:00PM -0400, Alex Converse wrote:
I'd like to take a minute to discuss the status of the AAC encoder and where it is going.
In SoC svn: --Applies cleanly to SVN HEAD --The most egregious of the artifacting is gone (sections being replaced by silence or having the wrong volume, etc.) --Lacks TNS
--Lacks multichannel support
Ahem, I've added it long time ago.
$ ./ffmpeg -i ../../Canyon-5.1-48khz-448kbit.ac3 canyon5.1.m4a FFmpeg version git-04fe5e6, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --enable-gpl --disable-ffserver libavutil 50. 3. 0 / 50. 3. 0 libavcodec 52.32. 0 / 52.32. 0 libavformat 52.36. 0 / 52.36. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0. 7. 1 / 0. 7. 1 built on Jul 7 2009 23:49:58, gcc: 4.3.3 Input #0, ac3, from '../../Canyon-5.1-48khz-448kbit.ac3': Duration: 00:00:37.98, bitrate: 448 kb/s Stream #0.0: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s File 'canyon5.1.m4a' already exists. Overwrite ? [y/N] y Output #0, ipod, to 'canyon5.1.m4a': Stream #0.0: Audio: aac, 48000 Hz, 5.1, s16, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding Segmentation fault
Something is broken in preprocessing. If you change line 482 in aacenc.c like in this patch to disable IIR filtering, it will work:
Index: aacenc.c =================================================================== --- aacenc.c (revision 4653) +++ aacenc.c (working copy) @@ -479,7 +479,7 @@ if(s->last_frame) return 0; if(data){ - if(!s->psypp){ + if(1){ memcpy(s->samples + 1024 * avctx->channels, data, 1024 * avctx->channels * sizeof(s->samples[0])); }else{ start_ch = 0;
On Wed, Jul 08, 2009 at 01:41:41AM -0400, Alex Converse wrote: [...]
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 9bd80b7..51abfbe 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -487,7 +487,7 @@ static int aac_encode_frame(AVCodecContext *avctx, for(i = 0; i < chan_map[0]; i++){ tag = chan_map[i+1]; chans = tag == TYPE_CPE ? 2 : 1; - ff_psy_preprocess(s->psypp, (uint16_t*)data + start_ch, samples2 + start_ch, start_ch + i, chans); + ff_psy_preprocess(s->psypp, (uint16_t*)data + start_ch, samples2 + start_ch, start_ch, chans); start_ch += chans; } }
ok
On Wed, Jul 8, 2009 at 2:13 AM, Kostya<kostya.shishkov@gmail.com> wrote:
On Wed, Jul 08, 2009 at 01:41:41AM -0400, Alex Converse wrote: [...]
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 9bd80b7..51abfbe 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -487,7 +487,7 @@ static int aac_encode_frame(AVCodecContext *avctx, for(i = 0; i < chan_map[0]; i++){ tag = chan_map[i+1]; chans = tag == TYPE_CPE ? 2 : 1; - ff_psy_preprocess(s->psypp, (uint16_t*)data + start_ch, samples2 + start_ch, start_ch + i, chans); + ff_psy_preprocess(s->psypp, (uint16_t*)data + start_ch, samples2 + start_ch, start_ch, chans); start_ch += chans; } }
ok
Applied
participants (2)
-
Alex Converse -
Kostya