On Mon, Mar 9, 2015 at 3:31 PM, Claudio Freire <klaussfre...@gmail.com> wrote: > On Mon, Mar 9, 2015 at 1:38 PM, Michael Niedermayer <michae...@gmx.at> wrote: >> On Mon, Mar 09, 2015 at 01:31:26PM -0300, Claudio Freire wrote: >>> On Mon, Mar 9, 2015 at 1:26 PM, Michael Niedermayer <michae...@gmx.at> >>> wrote: >>> > doesnt help >>> > but >>> > this does: >>> > -fate-aac-s7350-encode: CMD = enc_dec_pcm adts wav s16le $(REF) -strict >>> > -2 -c:a aac -b:a 256k >>> > +fate-aac-s7350-encode: CMD = enc_dec_pcm adts wav s16le $(REF) -strict >>> > -2 -c:a aac -b:a 88k >>> > >>> > this seems to fix it, didnt ivestigate why ... >>> >>> 88k is the maximum allowed bitrate at 7350hz, but it shouldn't make >>> any difference given that lavc/aacenc.c:775 already clamps the bitrate >>> to that number. >> >> i think it clamps to 88200 while 88k sets 88000 >> i can reproduce the difference with -b:a 88200 > > Oh... I see. > > There's a specific implementation for mips, I had completely > overlooked it on all patchesets. > > I'll have to look into it more thoroughly, most earlier patches should > be applied to that implementation as well when applicable.
Ok, try the attached patch on top of the previous ones, see what it does. I cannot test myself yet (cannot build against mips, it will probably take me a long while before I can set up qemu for that), but the patch should bring both implementations in sync, at least enough for the test to pass without the -b:a 88k
diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c index ea0bf31..dfbbd04 100644 --- a/libavcodec/mips/aaccoder_mips.c +++ b/libavcodec/mips/aaccoder_mips.c @@ -2139,7 +2139,7 @@ static void search_for_quantizers_twoloop_mips(AVCodecContext *avctx, const float lambda) { int start = 0, i, w, w2, g; - int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels; + int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f); float dists[128] = { 0 }, uplims[128]; float maxvals[128]; int fflag, minscaler; @@ -2329,23 +2329,23 @@ static void search_for_ms_mips(AACEncContext *s, ChannelElement *cpe, float minthr = FFMIN(band0->threshold, band1->threshold); float maxthr = FFMAX(band0->threshold, band1->threshold); for (i = 0; i < sce0->ics.swb_sizes[g]; i+=4) { - M[i ] = (sce0->coeffs[start+w2*128+i ] - + sce1->coeffs[start+w2*128+i ]) * 0.5; - M[i+1] = (sce0->coeffs[start+w2*128+i+1] - + sce1->coeffs[start+w2*128+i+1]) * 0.5; - M[i+2] = (sce0->coeffs[start+w2*128+i+2] - + sce1->coeffs[start+w2*128+i+2]) * 0.5; - M[i+3] = (sce0->coeffs[start+w2*128+i+3] - + sce1->coeffs[start+w2*128+i+3]) * 0.5; + M[i ] = (sce0->pcoeffs[start+w2*128+i ] + + sce1->pcoeffs[start+w2*128+i ]) * 0.5; + M[i+1] = (sce0->pcoeffs[start+w2*128+i+1] + + sce1->pcoeffs[start+w2*128+i+1]) * 0.5; + M[i+2] = (sce0->pcoeffs[start+w2*128+i+2] + + sce1->pcoeffs[start+w2*128+i+2]) * 0.5; + M[i+3] = (sce0->pcoeffs[start+w2*128+i+3] + + sce1->pcoeffs[start+w2*128+i+3]) * 0.5; S[i ] = M[i ] - - sce1->coeffs[start+w2*128+i ]; + - sce1->pcoeffs[start+w2*128+i ]; S[i+1] = M[i+1] - - sce1->coeffs[start+w2*128+i+1]; + - sce1->pcoeffs[start+w2*128+i+1]; S[i+2] = M[i+2] - - sce1->coeffs[start+w2*128+i+2]; + - sce1->pcoeffs[start+w2*128+i+2]; S[i+3] = M[i+3] - - sce1->coeffs[start+w2*128+i+3]; + - sce1->pcoeffs[start+w2*128+i+3]; } abs_pow34_v(L34, sce0->coeffs+start+w2*128, sce0->ics.swb_sizes[g]); abs_pow34_v(R34, sce1->coeffs+start+w2*128, sce0->ics.swb_sizes[g]);
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel