Re: [libav-devel] [PATCH] ac3dec: Increment channel pointers only once per channel
On Thu, 11 Jul 2013, Luca Barbato wrote: On 07/11/2013 03:36 PM, Martin Storsjö wrote: If the channel mapping map multiple output channels to one input channel, we should only increment the actual pointer once. Cc: libav-sta...@libav.org --- libavcodec/ac3dec.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index abfd380..01da328 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1393,10 +1393,10 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, if (err) for (ch = 0; ch < s->out_channels; ch++) memcpy(s->outptr[channel_map[ch]], output[ch], 1024); -for (ch = 0; ch < s->out_channels; ch++) { +for (ch = 0; ch < s->out_channels; ch++) output[ch] = s->outptr[channel_map[ch]]; -s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE; -} +for (ch = 0; ch < s->channels; ch++) +s->outptr[ch] += AC3_BLOCK_SIZE; } If our samples are fine with the change, looks great. Yes, this passes fate. // Martin___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] ac3dec: Increment channel pointers only once per channel
On 07/11/2013 03:36 PM, Martin Storsjö wrote: > If the channel mapping map multiple output channels to one > input channel, we should only increment the actual pointer once. > > Cc: libav-sta...@libav.org > --- > libavcodec/ac3dec.c |6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c > index abfd380..01da328 100644 > --- a/libavcodec/ac3dec.c > +++ b/libavcodec/ac3dec.c > @@ -1393,10 +1393,10 @@ static int ac3_decode_frame(AVCodecContext * avctx, > void *data, > if (err) > for (ch = 0; ch < s->out_channels; ch++) > memcpy(s->outptr[channel_map[ch]], output[ch], 1024); > -for (ch = 0; ch < s->out_channels; ch++) { > +for (ch = 0; ch < s->out_channels; ch++) > output[ch] = s->outptr[channel_map[ch]]; > -s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE; > -} > +for (ch = 0; ch < s->channels; ch++) > +s->outptr[ch] += AC3_BLOCK_SIZE; > } If our samples are fine with the change, looks great. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] ac3dec: Increment channel pointers only once per channel
If the channel mapping map multiple output channels to one input channel, we should only increment the actual pointer once. Cc: libav-sta...@libav.org --- libavcodec/ac3dec.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index abfd380..01da328 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1393,10 +1393,10 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, if (err) for (ch = 0; ch < s->out_channels; ch++) memcpy(s->outptr[channel_map[ch]], output[ch], 1024); -for (ch = 0; ch < s->out_channels; ch++) { +for (ch = 0; ch < s->out_channels; ch++) output[ch] = s->outptr[channel_map[ch]]; -s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE; -} +for (ch = 0; ch < s->channels; ch++) +s->outptr[ch] += AC3_BLOCK_SIZE; } /* keep last block for error concealment in next frame */ -- 1.7.10.4 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel